How download a folder from pythonAnywhere in Matlab?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have to download a *.csv in a folder that a python code generate everyday in pythonAnywhere.
I just check to use webread but i don't know how put the username and password or how to aim to the folder/file I want.
Please help me.
0 Commenti
Risposte (1)
Hornett
il 3 Set 2024
I undertand that you are trying to download a folder/file from your “pythonAnywhere” server using MATLAB
To utilize a username and password in the `webread` function, you can pass the credentials by creating a `Credentials` object. Additionally, to specify the directory of the file, you can provide the file address as a parameter to the `webread` function.
Here is a sample code demonstrating the same:
% Example username and password
username = 'myUser';
password = 'myPassword';
% Manually set Authorization header field in weboptions
options = weboptions('HeaderFields',{'Authorization',...
['Basic ' matlab.net.base64encode([username ':' password])]});
% Make a request using these options
url = "https://yoururlhere"; % Replace the destination file or directory address here
webread(url, options)
You can also refer the below links for more details about webread function:
0 Commenti
Vedere anche
Categorie
Scopri di più su Call Python from MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!