win命令啟動程式python指令碼__python

來源:互聯網
上載者:User

最近win10的導覽列表徵圖越來越多了,機器上安裝的程式也有點多,難得今天有點時間,就寫了一個python啟動程式的小指令碼:

# -*- coding: utf-8 -*-import sysimport osif __name__=="__main__":   if len(sys.argv) < 2:      print 'which exe do you want start?'      os.system('pause')   else:      msg=sys.argv[1]      if msg == "ie" or msg == "chrome":         os.system("C:\PROGRA~2\Google\Chrome\Application\chrome.exe")      elif msg == "zkc":         os.chdir("D:\\work\\ZooInspector\\build")         os.system("java -jar zookeeper-dev-ZooInspector.jar")      elif msg == "memcache":         os.chdir("D:\work\memcache\memcached-win32-1.4.4-14")         os.system("memcached.exe –d –p 11211")      elif msg == "idea":         os.system(r'"C:\PROGRA~2\JetBrains\IntelliJ IDEA 2016.1.1\\bin\idea.exe"')
命名為s.py,然後放在某個路徑下,在環境變數的path中添加此路徑,之後就可以快速鍵win+r,開啟運行命令視窗,然後運行s.py ie就是開啟chrome,s.py idea就是運行idea等,這樣,案頭上的啟動表徵圖終於可以清除了,看上去乾淨了很多。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.