alexgand / springer_free_books

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine
GNU General Public License v3.0
1.64k stars 366 forks source link

Syntax error #38

Closed sundrb closed 4 years ago

sundrb commented 4 years ago

image

How do I overcome this error?

I have changed my download folder image

No other changes done.

chaosAD commented 4 years ago

No, it won't work. Try the following:

# insert here the folder you want the books to be downloaded:
folder = r'C:\sundarb\downloads'

if not os.path.exists(folder):
    os.makedirs(folder)

The letter r before the string is important. Otherwise you get the same error you showed. You can't use C:\Users\... because of access permission reason. Take note of the os.makedirs() function. The os.mkdir() only works for creating a single level of directory.

alexgand commented 4 years ago

Please try again, the code was modified and is now much better.