473,549 Members | 3,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1570
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
2209
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
1177
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 simply trying to locate and download the appropriate archive/installer for NumTut, built for MacPython 2.3. Any help is greatly appreciated. kjm
0
2003
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) *************************************************************************** Symposium “Image Processing and Data Visualization” 2nd South-East European Conference on Computational Mechanics (SEECCM 2009) Island...
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.