0
Can someone help me with how to import os
I'm doing gcse computing python
2 ответов
+ 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!')
0
thanks