Re: [Tutor] pass argument into running program *outside* of program

2008-08-21 Thread Alan Gauld
"James" <[EMAIL PROTECTED]> wrote I have a program that I am writing that will be shared amongst multiple users. This program sits in the background as a daemon and 'does' things (consider it a black box). I want users to be able to SSH into the Linux box that is running the code and then do s

Re: [Tutor] Problems with Gauge Bar.

2008-08-21 Thread Alan Gauld
"Olrik Lenstra" <[EMAIL PROTECTED]> wrote def onScan(self, event): self.myfile = open('foo.txt') self.count = 0 self.setTimer(0.01, self.processLine) Ah, I got this mixed up. I thought this was a function built into python. So I would need to define setTimer in the MyC

Re: [Tutor] pass argument into running program *outside* of program

2008-08-21 Thread Kent Johnson
On Thu, Aug 21, 2008 at 4:34 PM, James <[EMAIL PROTECTED]> wrote: > I have a program that I am writing that will be shared amongst > multiple users. This program sits in the background as a daemon and > 'does' things (consider it a black box). I want users to be able to > SSH into the Linux box th

[Tutor] pass argument into running program *outside* of program

2008-08-21 Thread James
All, I have a program that I am writing that will be shared amongst multiple users. This program sits in the background as a daemon and 'does' things (consider it a black box). I want users to be able to SSH into the Linux box that is running the code and then do something like this: $ program.py

Re: [Tutor] Tutor Digest, Vol 54, Issue 72

2008-08-21 Thread Dotan Cohen
2008/8/21 Lie Ryan <[EMAIL PROTECTED]>: > Python is strictly typed (unlike some languages like Javascript), you > cannot compare a string with a number although the string only contains > numbers. sys.argv[...] is a list of strings so preNumber[0] is a string, > while 0 is an integer. Thanks. --

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Dotan Cohen
2008/8/21 Jerry Hill <[EMAIL PROTECTED]>: > On Thu, Aug 21, 2008 at 12:01 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: >> 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: >>> Chapters 2 and 3 of the library reference are highly recommended. >>> http://docs.python.org/lib/lib.html >> >> Let's start from th

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Dotan Cohen
2008/8/21 Alan Gauld <[EMAIL PROTECTED]>: > "Dotan Cohen" <[EMAIL PROTECTED]> wrote > >> Let's start from there. I need the startswith() function, but I do not >> know it's name. I search for "strings" and find this: >> 4. String Services >> * 4.1 string -- Common string operations >> o 4

Re: [Tutor] Problems with Gauge Bar.

2008-08-21 Thread Olrik Lenstra
> > >def onScan(self, event): >> self.myfile = open('foo.txt') >> self.count = 0 >> self.setTimer(0.01, self.processLine) >> >> def processLine(self): >> line = self.myfile.readline() >> if line: >> processLine(line) >> > > This function needs to be def

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Hansen, Mike
> On Thu, Aug 21, 2008 at 12:01 PM, Dotan Cohen > <[EMAIL PROTECTED]> wrote: > > 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: > >> Chapters 2 and 3 of the library reference are highly recommended. > >> http://docs.python.org/lib/lib.html > > > > Let's start from there. I need the startswith() funct

Re: [Tutor] Regular expression to match \f in groff input?

2008-08-21 Thread Alan Gauld
"Bill Campbell" <[EMAIL PROTECTED]> wrote to get regular expressions to match the font change sequences in *roff input (e.g. \fB for bold, \fP to revert to previous font). The re library maps r'\f' to the single form-feed character (as it does other common single-character sequences like r'\n'

Re: [Tutor] Problems with Gauge Bar.

2008-08-21 Thread Alan Gauld
"Olrik Lenstra" <[EMAIL PROTECTED]> wrote I tried something (Posted below) but it doesn't work. Closer but class MyFrame(wx.Frame): def __init__(self, parent, id, title): ... panel = wx.Panel(self, -1) wx.Gauge(panel, -1, 50, (50, 30), (200, 20)) You need to store

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Jerry Hill
On Thu, Aug 21, 2008 at 12:01 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: >> Chapters 2 and 3 of the library reference are highly recommended. >> http://docs.python.org/lib/lib.html > > Let's start from there. I need the startswith() function, but I do n

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Alan Gauld
"Dotan Cohen" <[EMAIL PROTECTED]> wrote Let's start from there. I need the startswith() function, but I do not know it's name. I search for "strings" and find this: 4. String Services * 4.1 string -- Common string operations o 4.1.3 String functions Personally I rarely start with

Re: [Tutor] programming tic tac toe

2008-08-21 Thread bob gailer
Ark wrote: Hi. I programmed a simple tic tac toe game in python. I already finished it, but I'm not pleased with the way I used to identify a line. I used a list (with lists inside) to represent the board. And to identify a winning line I used many if's, like this one: def line(board): i

Re: [Tutor] Regular expression to match \f in groff input?

2008-08-21 Thread Danny Yoo
On Thu, Aug 21, 2008 at 1:40 PM, Bill Campbell <[EMAIL PROTECTED]> wrote: > I've been beating my head against the wall try to figure out how > to get regular expressions to match the font change sequences in > *roff input (e.g. \fB for bold, \fP to revert to previous font). > The re library maps r'

[Tutor] Regular expression to match \f in groff input?

2008-08-21 Thread Bill Campbell
I've been beating my head against the wall try to figure out how to get regular expressions to match the font change sequences in *roff input (e.g. \fB for bold, \fP to revert to previous font). The re library maps r'\f' to the single form-feed character (as it does other common single-character se

Re: [Tutor] Tutor Digest, Vol 54, Issue 72

2008-08-21 Thread Lie Ryan
On Wed, 2008-08-20 at 23:06 +0200, [EMAIL PROTECTED] wrote: > > Message: 6 > Date: Wed, 20 Aug 2008 23:50:55 +0300 > From: "Dotan Cohen" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Reformatting phone number > To: python-tutor. > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain;

Re: [Tutor] programming tic tac toe

2008-08-21 Thread Lie Ryan
> Message: 1 > Date: Thu, 21 Aug 2008 06:53:50 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] programming tic tac toe > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > >

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Dotan Cohen
2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: > On Thu, Aug 21, 2008 at 12:01 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: >> 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: >>> Chapters 2 and 3 of the library reference are highly recommended. >>> http://docs.python.org/lib/lib.html >> >> Let's start from

Re: [Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Kent Johnson
On Thu, Aug 21, 2008 at 12:01 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: >> Chapters 2 and 3 of the library reference are highly recommended. >> http://docs.python.org/lib/lib.html > > Let's start from there. I need the startswith() function, but I do n

Re: [Tutor] Problems with Gauge Bar.

2008-08-21 Thread Olrik Lenstra
Follow-up on this question. I tried something (Posted below) but it doesn't work. Here it is. < import wx import os, sys class MyFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(300, 250),

[Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Dotan Cohen
2008/8/21 W W <[EMAIL PROTECTED]>: > On Thu, Aug 21, 2008 at 5:13 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: >> >> 2008/8/21 OmerT <[EMAIL PROTECTED]>: >> > mostly, I google "docs.python" and the term or class I'm looking for. >> > Mind, this mainly works for modules or classes which came with the

[Tutor] Python Docs (Was: Reformatting phone number)

2008-08-21 Thread Dotan Cohen
2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: > Chapters 2 and 3 of the library reference are highly recommended. > http://docs.python.org/lib/lib.html Let's start from there. I need the startswith() function, but I do not know it's name. I search for "strings" and find this: 4. String Services

Re: [Tutor] Reformatting phone number

2008-08-21 Thread W W
On Thu, Aug 21, 2008 at 5:13 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > 2008/8/21 OmerT <[EMAIL PROTECTED] <[EMAIL PROTECTED]>>: > > mostly, I google "docs.python" and the term or class I'm looking for. > > Mind, this mainly works for modules or classes which came with the > interpreter. > > > >

Re: [Tutor] Reformatting phone number

2008-08-21 Thread Dotan Cohen
2008/8/21 OmerT <[EMAIL PROTECTED]>: > mostly, I google "docs.python" and the term or class I'm looking for. > Mind, this mainly works for modules or classes which came with the > interpreter. > Exactly- that only works for term, classes, and functions that you already know the name of. The php d

Re: [Tutor] Reformatting phone number

2008-08-21 Thread Kent Johnson
On Thu, Aug 21, 2008 at 2:08 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > Is there a list of functions, organized by categories, for Python? > Take for example these pages from te php documentation: > http://il.php.net/manual/en/book.strings.php > http://il.php.net/manual/en/book.array.php > http:

Re: [Tutor] Merging table-like files with overlapping values in one column

2008-08-21 Thread Kent Johnson
On Thu, Aug 21, 2008 at 5:56 AM, Kat <[EMAIL PROTECTED]> wrote: > I have several input files where in each file, every line has a > space-separated pair values. The files are essentially tables with two > columns. There are no duplicates in the first column values within each file, > but they o

[Tutor] Merging table-like files with overlapping values in one column

2008-08-21 Thread Kat
Hi all, I'm new to Python and trying to come up with an elegant way of tackling the following problem. Sorry for the lengthy description: I have several input files where in each file, every line has a space-separated pair values. The files are essentially tables with two columns. There are no

Re: [Tutor] programming tic tac toe

2008-08-21 Thread Emile van Sebille
Ark wrote: Hi. I programmed a simple tic tac toe game in python. I already finished it, but I'm not pleased with the way I used to identify a line. I used a list (with lists inside) to represent the board. And to identify a winning line I used many if's, like this one: def line(board): i

Re: [Tutor] Reformatting phone number

2008-08-21 Thread OmerT
mostly, I google "docs.python" and the term or class I'm looking for. Mind, this mainly works for modules or classes which came with the interpreter. G'luck. On Thu, Aug 21, 2008 at 9:08 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > 2008/8/21 Kent Johnson <[EMAIL PROTECTED]>: >> Another way to wri