0

Can someone help me with how to import os

I'm doing gcse computing python

19th Nov 2016, 12:50 PM
abdi
2 Antworten
+ 2
import os Or if you need smth exact from os : from os import mkdir, getcwd This has to work. I checked it in playground import os print(os.getcwd()) Output is: ..\Playground\ By the way there is a universal way to check if a module has been imported on the fly: import sys if 'os' not in sys.modules: print ('os module has not been imported correctly!')
19th Nov 2016, 1:22 PM
donkeyhot
donkeyhot - avatar
0
thanks
19th Nov 2016, 4:23 PM
abdi