Advertisement
gauravssnl

launcher.py

Nov 27th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. # App launcher script by gauravssnl
  2. import os,glob,e32,appuifw
  3. lk=e32.Ao_lock()
  4. def q():lk.signal()
  5. appuifw.app.exit_key_handler=q
  6. timer=e32.Ao_timer()
  7. t= 0.5
  8. def main():
  9.     global exe
  10.     exe1=glob.glob("C:\\sys\\bin\\*.exe")
  11.     if os.path.exists("E:\\sys\\bin\\"):
  12.         exe2=glob.glob("E:\\sys\\bin\\*.exe")
  13.         exe=exe1+exe2
  14.         data=[u"%s"%f for f in exe]
  15.     else:
  16.         exe=exe1
  17.         data=[u"%s"%f for f in exe]
  18.        
  19.     global list
  20.     list=appuifw.Listbox(data,handle)
  21.     bd=appuifw.app.body=list
  22.     appuifw.app.title=u"App Launcher"
  23.     appuifw.app.menu=[(u"About",about),(u"Exit",q)]
  24.    
  25. def handle():
  26.     global list,exe
  27.     cur=list.current()
  28.     try:
  29.         appuifw.app.title=u"Launching app..."
  30.         e32.ao_sleep( 0.5)
  31.         e32.start_exe(exe[cur], "Gaurav")
  32.         main()
  33.     except:
  34.         appuifw.note(u"Sorry that app can't be started")
  35. def about():
  36.     appuifw.note(u"Developer:gauravssnl")      
  37. main()
  38. lk.wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement