Is it possible to download a text file, from pastebin or google-drive or another similar location, and read it into an array, using python? Ideally, I would prefer to not use any external libraries. If possible, using built in functions pls.
Asked
Active
Viewed 190 times
-1
-
Duplicate of: [Basic http file downloading and saving to disk in python?](https://stackoverflow.com/questions/19602931/basic-http-file-downloading-and-saving-to-disk-in-python) – Abdul Aziz Barkat Jun 15 '23 at 04:05
1 Answers
-1
As a matter of fact, you can do that without installing any python module using the built-in subprocess
module. But you need to install another entity to help you do that which is the curl
program.
All this subprocess
module does is to call curl
from the terminal and send the returned value to your script. To try this solution, you need to install curl
first using the following command on Ubuntu:
sudo apt install curl
Now, you can run the following command to download your text file; I've used this sample file:
>>> import subprocess
>>> url = "http://25.io/toau/audio/sample.txt"
>>> out = subprocess.check_output(["curl", url])
>>> # out is the content of the sample file
>>> out.decode("utf-8")
I would love to try or hear the sample audio your app can produce. I do not want to purchase, because I've purchased so many apps that say they do something and do not deliver.
Can you please add audio samples with text you've converted? I'd love to see the end results.
This is to answer your question, but I really don't ecourage it. You can check this SO thread to know why.
Also, every Cloud-service like GoogleDrive or DropBox has its own API to help you authorize and download all your files.

Anwarvic
- 12,156
- 4
- 49
- 69