Python executes commands in the specified directory

novice to python,
enter the specified directory to execute a command

see a solution. What I understand is that the semicolon is preceded by entering the folder, followed by the execution of the command, but executed in windows

import os
  os.system("cd D:/ANDROID/test1/HBuilder-Integrate-AS;./gradle assembleRelease")






import os
os.system("cd ~/cstudy;./sdkTest")

problem solving:
1.1l boss"s solution is the best. Fully applicable
2. You can also use os.system ("cd:./xxxx/xxx & & gradle assembleRelease"). The disadvantage is that there is a problem across the drive


Please use subprocess.check_call, instead, such as

subprocess.check_call('gradle assembleRelease', shell=True, cwd='D:/ANDROID/test1/HBuilder-Integrate-AS')
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30bf9-40d7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30bf9-40d7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?