[Tutor] Checking if value exist in a '2D array'

2005-06-16 Thread Olli Rajala
Hi again, I have a '2D array', I mean a list inside a list ([[][],[][],...]) and would need to check if the value exists in it. Of course I could do a for loop, but that just seem to be a little overkill, so is there any other way to do it? I have to check the first cell of every insider list. He

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Kent Johnson
Alan G wrote: >>I haven't found the correct way to do this so far. > > > There is no correct way. Every console is different so you have > to adapt. > That having been said Fred Lundh has written a console module > that tries to hide the diffeent trminal types in a common set > of commands -

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Alan G
> Don Parris wrote: > > Thanks! I thought there had to be a way to call the OS' clear screen > > command, but was going about it the wrong way. I was trying to use > > sys.clear instead of os.system. Would it be difficult to test the OS, > > store the result in a variable, and call the comand ba

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Alan G
> I haven't found the correct way to do this so far. There is no correct way. Every console is different so you have to adapt. That having been said Fred Lundh has written a console module that tries to hide the diffeent trminal types in a common set of commands - you can download it from his

Re: [Tutor] can't see emacs timer in action

2005-06-16 Thread Alan G
> buffer/output pane before running my program, so I always do > this to start my program: > ... > ...6 steps listed > ... > This is one cycle of running. > Is that normal ??? I doubt it, I've never user python mode in emacs but I have used SQL and C++ modes and usually you just call C-c C-c fro

Re: [Tutor] Controlling Where My Program Ends

2005-06-16 Thread Alan G
> >>Never mind. I found it - sys.exit() You can do the same thing by raise SystemExit This avoids the need to import sys... Alan G. > >> > >>Sorry to have wasted the bandwidth/time. > >>-- > > > > > > This was in reference to a post about exiting from a program. I couldn't > > figure out

Re: [Tutor] Process problem

2005-06-16 Thread Alberto Troiano
Hey You weren't pedantic at all I needed the explanation 'cause I don't like to make things I don't understand so now I will add the code to mine Thanks Alberto http://graphics.hotmail.com/emvamp.gif"; width=12> Gaucho >From: "Michael P. Reilly" <[EMAIL PROTECTED]> >Reply-To: "Michael P.

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Don Parris
On Thu, 16 Jun 2005 12:24:32 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > > Mind you, there may be other areas where I need an OS-specific command. > > I'm beginning to get an idea of the challenges of portability though. ;) > > Python actually gets a lot of this right, you may find it's ea

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Michael P. Reilly
On 6/16/05, Don Parris <[EMAIL PROTECTED]> wrote: Thanks!  I thought there had to be a way to call the OS' clear screencommand, but was going about it the wrong way.  I was trying to usesys.clear instead of os.system.  Would it be difficult to test the OS, store the result in a variable, and call t

Re: [Tutor] A newbie question about running python scripts

2005-06-16 Thread typetext
. Here's what happened. I had forgotten to specify the following, and therefore was not inside the proper directory. What worked was cd c:\documents and settings\my documents\ then enter, then python helloworld.py. Success! Onward and upward. I was missing the "my documents" part, and therefore was

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Kent Johnson
Don Parris wrote: > Thanks! I thought there had to be a way to call the OS' clear screen > command, but was going about it the wrong way. I was trying to use > sys.clear instead of os.system. Would it be difficult to test the OS, > store the result in a variable, and call the comand based on the

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Don Parris
On Thu, 16 Jun 2005 11:16:37 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > With the console-based menu system I'm building, I'd like to clear the > > screen for each menu call - something like: > > > > def main_menu(): > > clear #start with a fresh console screen, menu

Re: [Tutor] A newbie question about running python scripts (Out of the Office June 16)

2005-06-16 Thread Catherine Kostyn
I will be out of the office on June 16, to return on June 17. I will reply to your message at that time. Catherine Kostyn Transportation Planner Indianapolis MPO 200 E. Washington St., Ste. 1821 Indianapolis, IN 46204 (317)327-5142 ___ Tutor maillist -

Re: [Tutor] A newbie question about running python scripts

2005-06-16 Thread ZIYAD A. M. AL-BATLY
On Thu, 2005-06-16 at 08:08 -0700, typetext wrote: > I get exactly the same error message as below. What could be going on > here? To check that I am not misspelling the name, I also wrote a > script that says print "helloworld" and saved it as hello.py. The same > message comes up then, as well. A

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Kent Johnson
Don Parris wrote: > With the console-based menu system I'm building, I'd like to clear the > screen for each menu call - something like: > > def main_menu(): > clear #start with a fresh console screen, menu at top > print menuitems There is no nice portable way to do this. On Windows runn

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Liam Clarke
One way is to - print * 25 but that's probably not the best. You could check out Pythoncard for a simple GUI builder - pythoncard.sourceforge.net - but it's a leap into the OO stuff.On 6/17/05, Don Parris < [EMAIL PROTECTED]> wrote:With the console-based menu system I'm building, I'd like to c

Re: [Tutor] A newbie question about running python scripts

2005-06-16 Thread ZIYAD A. M. AL-BATLY
On Thu, 2005-06-16 at 07:23 -0700, typetext wrote: > Thank you for responding. Here is what happens when I type python > helloworld.py without any quotation marks into the command line:1. > The prompt line reads > 1.C:\Documents and Settings\Micky > 2. I type "python" > 3. the python prompt comes

[Tutor] Clearing the Console Screen

2005-06-16 Thread Don Parris
With the console-based menu system I'm building, I'd like to clear the screen for each menu call - something like: def main_menu(): clear #start with a fresh console screen, menu at top print menuitems This way, the users won't have to get too confused by all the previous screens. I hav

Re: [Tutor] Process problem

2005-06-16 Thread Michael P. Reilly
On 6/16/05, Alberto Troiano <[EMAIL PROTECTED]> wrote: Hey allNevermind, it worked with the & trick.I just posted because the first 2 times didn't do anything but there was anerror in the crontab so... Alberto, If you are going to use put the processes in the background with the ampersand ('&'), t

Re: [Tutor] Process problem

2005-06-16 Thread Alberto Troiano
Hey all Nevermind, it worked with the & trick. I just posted because the first 2 times didn't do anything but there was an error in the crontab so... Thanks to all who helped Best regards Alberto >Thanks for the reply > >That was one of the problems >Now the other problem is that when the scr

Re: [Tutor] Process problem

2005-06-16 Thread Alberto Troiano
Thanks for the reply That was one of the problems Now the other problem is that when the script finishes all processes (runing in the background or not) finishes with him. levantamuertos.py is supoosed to be a process manager for cotascamon.py I need levantamuertos.py run, start the cotascamons

Re: [Tutor] Process problem

2005-06-16 Thread Michael Lange
On Wed, 15 Jun 2005 22:04:48 + "Alberto Troiano" <[EMAIL PROTECTED]> wrote: Hi Alberto, > Hey > > Let me make you understand > > I need that levantamuertos.py run cotascamon.py (every script with it > differents arguments that are passed) and then die letting the cotascamon.py > scripts r