| | |
"Closing" a script...
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Ok, all I want ot know is how to close a script on command, lie type 3 to exit, what modules do i need to import and what is the command, I have everything else sorted out...
EDIT: The close command will go in a if statement, which is in a function.
EDIT2: Never mind, problem solved, go ahead and close or delete this topic admins...
EDIT: The close command will go in a if statement, which is in a function.
EDIT2: Never mind, problem solved, go ahead and close or delete this topic admins...
Last edited by danizzil14; Feb 11th, 2007 at 7:11 pm.
Blender is by far the best free 3D computer Graphics program and it is expandable with python! GoTo www.blender3d.org
Just in case others are interested, to exit a program use ...
or easier ...
Python Syntax (Toggle Plain Text)
import sys sys.exit()
Python Syntax (Toggle Plain Text)
raise SystemExit
May 'the Google' be with you!
•
•
•
•
Just in case others are interested, to exit a program use ...
or easier ...Python Syntax (Toggle Plain Text)
import sys sys.exit()
Python Syntax (Toggle Plain Text)
raise SystemExit
I come to <Daniweb> and search and... here some vital information is. (as usual
)vegaseat: can you elaborate on why using SystemExit is "easier"
just so I can understand it better. I just used it-- worked just fine.

Thanks a lot,
Matty
•
•
Join Date: Apr 2006
Posts: 150
Reputation:
Solved Threads: 40
sys.exit() implements SystemExit, see
http://docs.python.org/lib/module-sys.html
http://docs.python.org/lib/module-sys.html
![]() |
Similar Threads
- google "keyword" question (Search Engine Optimization)
- "error has occured in script on this page" (Windows NT / 2000 / XP)
Other Threads in the Python Forum
- Previous Thread: Tkinter Button "Disable" ?
- Next Thread: Problems with my game...
Views: 1376 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Python
approximation array beginner book builtin change cipher clear client code color converter countpasswordentry cturtle curved def dictionary drive dynamic examples excel file float format ftp function gui homework import inches input java library line lines linux list lists loop microcontroller mouse mysqldb mysqlquery newb number numbers output parsing path plugin port prime program programming projects py2exe pygame pymailer pyqt python random recursion recursive redirect remote script scrolledtext search singleton socket sqlite ssh string strings strip subprocess sum syntax table terminal text textarea thread threading time tkinter tlapse tuple tutorial twoup ubuntu unicode urllib urllib2 variable vigenere wikipedia windows wxpython xlwt






