python启动vscode
#!/bin/env python#coding=utf-8import osimport sysimport subprocessimport commandsdef checkUserIsROOTCommandline():if os.geteuid() != 0:print "This program must be run as root. Ab...
·
#!/bin/env python
#coding=utf-8
import os
import sys
import subprocess
import commands
def checkUserIsROOTCommandline():
if os.geteuid() != 0:
print "This program must be run as root. Aborting."
return False
sys.exit(1)
else:
return True
def startVSCodeIDE():
rc,out = commands.getstatusoutput("code --user-data-dir=/home/config/Code/")
#print ("VSCode Starting:\033[0;31m%s\033[0m" % out)
#print ("VSCode Starting:\033[1;32m%s\033[0m" % "out")
def main():
if True==checkUserIsROOTCommandline():
# print checkUserIsROOTCommandline()
startVSCodeIDE()
if __name__ == '__main__':
main()
更多推荐
已为社区贡献1条内容
所有评论(0)