So, I\'m learning Python and would like to create a simple script to download a file from the internet and then write it to a file. However, I am using IDLE and have no idea
You can check that using os.getcwd()
:
In [1]: import os
In [2]: os.getcwd()
Out[2]: '/home/monty'
In [7]: os.chdir("codechef") #change current working directory
In [8]: os.getcwd()
Out[8]: '/home/monty/codechef'
os.chdir()
:
In [4]: os.chdir?
Type: builtin_function_or_method
String Form:
Docstring:
chdir(path)
os.getcwd()
:
Change the current working directory to the specified path.
In [5]: os.getcwd?
Type: builtin_function_or_method
String Form:
Docstring:
getcwd() -> path
Return a string representing the current working directory.