Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Adapted and simplified from Franck Albinet's exercises available here. Also presented by NSRC at APRICOT 2018.

...

Import the basic operating system module (os): import os., then try a few commands:

Code Block
languagepy
titleBasic File System Operations
linenumberstrue
import os
# to find you current working directory:
os.getcwd() ## most probably the /flashfolder
# to list folders and files in your current working directory:
os.listdir()
# to create a new folder/directory named "log":
os.mkdir('log')

...