Python first acquaintance module

import sys 
#print(sys.path) #Print environment variables
print(sys.argv) #The relative path of the script!
print(sys.argv[2]) accepts parameters and needs to run


import os under dos #Interact with the operating system

cmd_res = os.system("dir") #Execute the command without saving the result
cmd_res = os.popen("dir" ).read() #Output the print of dir
print("---->",cmd_res)
os.mkdir("new_dir") #Create a new folder#import login #Call

the login library written by myself

Output of sys.path:

['C:\\Users\\Administrator\\PycharmProjects\\S14\\Day2'
'C:\\Users\\Administrator\\PycharmProjects\\S14'
'C:\\Program Files\\Python36\\python36. zip'
'C:\\Program Files\\Python36\\DLLs'
'C:\\Program Files\\Python36\\lib'
'C:\\Program Files\\Python36'
'C:\\Program Files\\ Python36\\lib\\site-packages'] #Third-party modules or self-developed modules, then the upper-level directory is the system default module

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324840334&siteId=291194637