| | |
"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: 149
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...
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt ansi anti approximation assignment avogadro backend basic beginner binary bluetooth calculator character code customdialog decimals dictionaries dictionary drive dynamic examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime program programming progressbar projects py2exe pygame pyqt python random recursion recursive refresh schedule scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial twoup ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib






