Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console oridle versions.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="MRAB, post: 5159626"] I think I see your problem: you've unpacked everything into a single folder instead of a folder hierarchy. (It also looks like you have Explorer configured to hide the file extensions. That's generally _not_ recommended.) Try this: #! python3.4 # -*- coding: utf-8 -*- from os.path import splitext import gzip import tarfile # The path of the downloaded file. tar_gz_path = r'C:\beautifulsoup4-4.3.2.tar.gz' # Unpack the .tar.gz file to a .tar file. tar_path, ext = splitext(tar_gz_path) with gzip.open(tar_gz_path, 'rb') as from_file: with open(tar_path, 'wb') as to_file: chunk = from_file.read() to_file.write(chunk) # Unpack the .tar file to a folder. folder, ext = splitext(tar_path) tar = tarfile.open(tar_path) tar.extractall(folder) tar.close() [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console oridle versions.
Top