<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'How do you stop the program from just closing once its done.' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'How do you stop the program from just closing once its done.' posted on the 'Python' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 19:27:59 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 19:27:59 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/267433/how-do-you-stop-the-program-from-just-closing-once-its-done/</link>
      <description>Hello, I just started learning how to program about an hour ago and I when I make a program it just closes once its done when I run it. How can I get it to pause or something when its done?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/267433/how-do-you-stop-the-program-from-just-closing-once-its-done/</guid>
      <pubDate>Wed, 21 Jul 2004 16:58:50 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/267541/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267541</link>
      <description>: Hello, I just started learning how to program about an hour ago and I when I make a program it just closes once its done when I run it. How can I get it to pause or something when its done?&lt;br /&gt;
&lt;br /&gt;
If you're talking about running a python script in MSWindows where the console window closes once the script is finished, then you can do something like:&lt;br /&gt;
&lt;br /&gt;
import os&lt;br /&gt;
os.system("pause")&lt;br /&gt;
&lt;br /&gt;
If you mean something else then you'll have to be more specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;em&gt;&lt;span style="color: Blue;"&gt;&lt;span style="color: Red;"&gt;i&lt;/span&gt;nfidel&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
$ select * from users where clue &amp;gt; 0
no rows returned
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/267541/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267541</guid>
      <pubDate>Thu, 22 Jul 2004 11:43:17 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/267592/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267592</link>
      <description>: : Hello, I just started learning how to program about an hour ago and I when I make a program it just closes once its done when I run it. How can I get it to pause or something when its done?&lt;br /&gt;
: &lt;br /&gt;
: If you're talking about running a python script in MSWindows where the console window closes once the script is finished, then you can do something like:&lt;br /&gt;
: &lt;br /&gt;
: import os&lt;br /&gt;
: os.system("pause")&lt;br /&gt;
: &lt;br /&gt;
: If you mean something else then you'll have to be more specific.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;span style="font-size: large;"&gt;&lt;em&gt;&lt;span style="color: Blue;"&gt;&lt;span style="color: Red;"&gt;i&lt;/span&gt;nfidel&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: $ select * from users where clue &amp;gt; 0
: no rows returned
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
Thanks that did the trick. Do you mind explaining how that works?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/267592/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267592</guid>
      <pubDate>Thu, 22 Jul 2004 18:02:34 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/267687/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267687</link>
      <description>&lt;strong&gt;&lt;span style="color: Red;"&gt;This message was edited by Moderator at 2004-7-23 10:36:7&lt;/span&gt;&lt;/strong&gt;&lt;hr /&gt;&lt;br /&gt;
: : import os&lt;br /&gt;
: : os.system("pause")&lt;br /&gt;
: : &lt;br /&gt;
: Thanks that did the trick. Do you mind explaining how that works?&lt;br /&gt;
&lt;br /&gt;
The os module is a way for python to interact with the operating system.  The system function passes a command line to the operating system.  On MSWindows, the "pause" command waits for the user to press enter (i.e. in batch files).  Try passing any DOS command to os.system to see what happens.&lt;br /&gt;
&lt;br /&gt;
I forgot about a pure python way of doing the same thing:&lt;br /&gt;
&lt;br /&gt;
raw_input('Press ENTER to continue...\n')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;em&gt;&lt;span style="color: Blue;"&gt;&lt;span style="color: Red;"&gt;i&lt;/span&gt;nfidel&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
$ select * from users where clue &amp;gt; 0
no rows returned
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/267687/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#267687</guid>
      <pubDate>Fri, 23 Jul 2004 10:29:48 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/343741/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343741</link>
      <description>: : Hello, I just started learning how to program about an hour ago and I when I make a program it just closes once its done when I run it. How can I get it to pause or something when its done?&lt;br /&gt;
: &lt;br /&gt;
: If you're talking about running a python script in MSWindows where the console window closes once the script is finished, then you can do something like:&lt;br /&gt;
: &lt;br /&gt;
: import os&lt;br /&gt;
: os.system("pause")&lt;br /&gt;
: &lt;br /&gt;
: If you mean something else then you'll have to be more specific.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;span style="font-size: large;"&gt;&lt;em&gt;&lt;span style="color: Blue;"&gt;&lt;span style="color: Red;"&gt;i&lt;/span&gt;nfidel&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: $ select * from users where clue &amp;gt; 0
: no rows returned
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/343741/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343741</guid>
      <pubDate>Thu, 24 Aug 2006 14:24:52 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/343772/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343772</link>
      <description>: I forgot about a pure python way of doing the same thing:&lt;br /&gt;
: &lt;br /&gt;
: raw_input('Press ENTER to continue...\n')&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Is this okay python programming, or just a simple way to get around? This is like using fgetc(stdin) in C/C++ to pause, which doesn't really make sense but is simply used for such. But of course, it doesn't make sense because its C/C++, but in python, I'd expect such stuff to not be considered bad programming...&lt;br /&gt;
&lt;br /&gt;
{2}rIng&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/343772/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343772</guid>
      <pubDate>Fri, 25 Aug 2006 03:09:04 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: How do you stop the program from just closing once its done.</title>
      <link>http://www.programmersheaven.com/mb/python/267433/343785/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343785</link>
      <description>: : I forgot about a pure python way of doing the same thing:&lt;br /&gt;
: : &lt;br /&gt;
: : raw_input('Press ENTER to continue...\n')&lt;br /&gt;
: : &lt;br /&gt;
: &lt;br /&gt;
: Is this okay python programming, or just a simple way to get around? This is like using fgetc(stdin) in C/C++ to pause, which doesn't really make sense but is simply used for such. But of course, it doesn't make sense because its C/C++, but in python, I'd expect such stuff to not be considered bad programming...&lt;br /&gt;
&lt;br /&gt;
As far as I know it's not considered bad form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;em&gt;&lt;span style="color: Blue;"&gt;&lt;span style="color: Red;"&gt;i&lt;/span&gt;nfidel&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
$ select * from users where clue &amp;gt; 0
no rows returned
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/267433/343785/re-how-do-you-stop-the-program-from-just-closing-once-its-done/#343785</guid>
      <pubDate>Fri, 25 Aug 2006 07:43:23 -0700</pubDate>
      <category>Python</category>
    </item>
  </channel>
</rss>