Downloading a tar gz file with urllib






















Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search. URL was hosted at aws and contained file name as well.

Upon accessing the url it gives a. I needed to download this file in the directory of my choice untar and unzip it to reach the json file inside it and finally parse the json file. While searching on internet I found sporadic information spread all over the place. In this Question I try to consolidate it in one place. To save the extracted file in directory of choice with same name as downloaded file. Notice the usage of tempfile library is slightly different which worked for me.

I had to use shutil library with urllib where requests didn't work with shutil library copyfileobj method due to difference response object that we get using urllib and requests. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. How to Extract or Unzip tar. Extracting tar. Introduction A tar. Was this article helpful? Dejan Tucakov. He is dedicated to simplifying complex notions and providing meaningful insight into data center and cloud technology.

Next you should read. SysAdmin Web Servers. A list of all the important Linux commands in one place. Find the command you need, whenever you need it or Zip files are ubiquitously used on all operating system, including Linux. This simple guide explains how to Security SysAdmin. Save my name, email, and website in this browser for the next time I comment. Notify me of followup comments via e-mail.

You can also subscribe without commenting. This site uses Akismet to reduce spam. Learn how your comment data is processed. Read Also : 18 Tar Command Examples in Linux In this article, we will show you how to download tar archives using two well known command line downloaders — wget or cURL and extract them with one single command.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? Related Posts. Got something to say? Join the discussion. Cancel reply Have a question or suggestion? Comment Name Email Website Save my name, email, and website in this browser for the next time I comment.



0コメント

  • 1000 / 1000