-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset.py
More file actions
34 lines (26 loc) · 759 Bytes
/
Copy pathreset.py
File metadata and controls
34 lines (26 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
DistDir = "I:\\Python"
def CheckDirIsExist(dir,expectations):
d = os.listdir(dir)
for dirName in d :
if dirName == expectations:
return True
return False
def mkOneDir(dir):
if(os.makedirs(dir) == None):
return dir
def checkDir():
curDir = os.getcwd()
print(curDir)
print(os.chdir(curDir))
print("I:\\Python\\zwftest exist??: ",CheckDirIsExist(DistDir,"zwftest"))
if(os.path.exists(DistDir+"\\zwftest") == False):
print(mkOneDir(DistDir+"\\zwftest"))
#os.system("calc.exe")
print(os.path.abspath("."))
print(os.listdir("."))
def main():
print("starting main()")
checkDir()
if __name__ == "__main__":
main()