473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

NumTut view of greece

Hi

not sure if this would be the right place to ask this question!
using the shell prompt
:~$ python
Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import Numeric
from NumTut import *
view(greece)

shows a photo of the street in a tk window.

but if I have this file
**************** tut.py ****************
#!/usr/bin/env python
import Numeric
from NumTut import *
view(greece)
print "done"
************************************************** **************
and then type
$ ./tut.py
done
$
and not tk view of greece.

thanks
May 7 '06 #1
1 1560
Gary Wessle wrote:
Hi

not sure if this would be the right place to ask this question!
using the shell prompt
:~$ python
Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import Numeric
from NumTut import *
view(greece)
shows a photo of the street in a tk window.

but if I have this file
**************** tut.py ****************
#!/usr/bin/env python
import Numeric
from NumTut import *
view(greece)
print "done"
************************************************* ***************
and then type
$ ./tut.py
done
$
and not tk view of greece.

That's because, as soon as the program quits, the view window is removed.

In your interactive example, the view command opens the window, and then
immediately starts waiting for you to type the next command. Python is
still running and so the view window stays up.

In the non-interactive case, as soon as the view command executes,
Python immediately goes to the next line, does the print, then exits.
The view command, which was busily preparing to show your picture is
shut down when python exits before it had enough time to open the
window. (It was trying -- it just didn't have enough time.)

If you don't want the program to quit that quickly, you need to put in
something to keep it from running off the bottom and exiting. I'd
suggest something like this after the view line:

raw_input("Type ENTER when done viewing: ")

Gary Herron

thanks


May 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: r.e.s. | last post by:
No matter which site I download it from, NumTut.tgz appears to be corrupted. Anyone else having this problem? Thanks. -- r.e.s.
0
by: Kevin MacKenzie | last post by:
I am trying to download and install the NumTut package for Python 2.3 on MAC OS X. When installing Numeric using the MACPython IDE package manager does not install NumTut along with it. I am...
0
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.