[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Is there any reason to call sys.exit() to close a pygame program?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Is there any reason to call sys.exit() to close a pygame program?
- From: Sam Bull <sam.hacking@xxxxxxxx>
- Date: Sun, 13 Aug 2017 09:29:38 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 13 Aug 2017 04:36:31 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=fOpE+LCobDTeM6ZcQzLJEhDvUT63SwiEBQ1n2pRSx Z4=; b=CJ1WQMBzZGjK5RRjrm6jyy7do2um9hoNAjPD08GUcSjdKbjxXhuKyyVzU zNtHlJ9+sNVXwk1jcXekxiMM5h9kmQB4sX+0DT3fDqroorKvXAYM1H7fLzcEXCnE jdFoePVE1pHwYGP2HazCKa8kPcHnwrFaBGJs4+Yyg0WUqXkEdF0LcblX/JRl4mg/ sGE8rsaN9X6XiTW0pJZ+4nfBVsIgJUvnL+EI09j6MTn9rFwTcPgt8Lu0eELd89QZ UCYqlzWztD9/BD3iRR/OnFdrs59cnAW6BZuKwA/3/fXjM9udo6OaF/Bohf/sZW9D A7O9GN31cAqq+q1OOHxHjBssY4yPw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=fOpE+LCobDTeM6ZcQz LJEhDvUT63SwiEBQ1n2pRSxZ4=; b=ZPKSTExefHGm5EmV1rC8Qb43tTF3oXKF1R kIV9VusOZ0B/wqhtFldfRrXQ5TJBLOUras4tQr4jxWmMdMU25VztEeT2QeC8lrfu gJKP+7sM+BDr7q1ffDlo/JtMKVj3BfP1uAN7s1SQ+/yrTv4C2jhnxxeGQ4bpfOt+ 3GsUNwk5R3b63ujh+dU2B79OkxEqgzZWo3lJmXaqiu9tOD/tGQb2H/QXIuFcgCmv pO97dFlMfK+V5rX9UN4+tH8QSzt6Vj+Rtaf9CFotSXUXxvyAHf3ysJTXk8+Klbzu ALzfUq+kucvM38EZdhIlyG1CMj9U2o3a8VoVeZzHds3xtNk/QCqQ==
- In-reply-to: <1840683151.626097.1502562207698@mail.yahoo.com>
- References: <1840683151.626097.1502562207698.ref@mail.yahoo.com> <1840683151.626097.1502562207698@mail.yahoo.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
On sab, 2017-08-12 at 18:23 +0000, skorpio wrote:
> I usually quit pygame by breaking out of the main loop and calling
> pygame.quit() followed by sys.exit(), but I can't remember anymore
> where I learned to use sys.exit and why it should be used.
If you need to use an exit function, then I've found using the built-in
exit() function gives an error if you use pyinstaller to create a
frozen binary. That's the only reason I try to use sys.exit(). I've not
had any problems just allowing the execution to reach the end of the
file and completing naturally though.
Attachment:
signature.asc
Description: This is a digitally signed message part