[Tutor] Undo/Redo in wxpython?

2007-09-07 Thread Trey Keown
What is the proper way to undo/redo changes in a text box? I read somewhere that the default undo depth is 1. How could I change this to, say, about 35? Here's a snippet of my code- #!/usr/bin/python import wx import os ... ... ... class MainWin(wx.Frame): def __init__(self, parent, id, title

Re: [Tutor] rewriting script

2007-09-07 Thread Steve Willoughby
Christopher Spears wrote: > I have written a script that reads and displays text > files: > > #!/usr/bin/env python > > 'readTextFile.py -- read and display text file' > > import os > > # get filename > while True: > fname = raw_input('Enter file name: ') > print > if os.path.exists

[Tutor] replacing while loop

2007-09-07 Thread Christopher Spears
I've been reading 'Core Python Programming (2nd Edition)'. I have been given the following script: #!/usr/bin/env python 'makeTextFile.py -- create text file' import os # get filename while True: fname = raw_input('Enter file name: ') if os.path.exists(fname): print"*** ERROR:

[Tutor] Python scripting

2007-09-07 Thread Ryan
I am on a linux machine and I was wondering about python scripting. Mainly to get it up and running but also what can I do with it etc. Any help would be appreciated, Thnx ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/t

[Tutor] rewriting script

2007-09-07 Thread Christopher Spears
I have written a script that reads and displays text files: #!/usr/bin/env python 'readTextFile.py -- read and display text file' import os # get filename while True: fname = raw_input('Enter file name: ') print if os.path.exists(fname): fobj = open(fname, 'r') for e

[Tutor] WxPython Splashscreen?

2007-09-07 Thread Trey Keown
Hey all, Does anyone know how to make a wxPython splashscreen? It would be great if you could show a (working) example, as I have googled this topic, yet have not found any working examples. Thanks. ___ Tutor maillist - Tutor@python.org http://mail.pyt

Re: [Tutor] Problem with while loop

2007-09-07 Thread Ricardo Aráoz
matte wrote: > Hi guys > > Please excuse me but I've been out of Python for a while since my laptop > was stolen... > > I'm battling with a very basic while loop > > -- 8< -- > #!/usr/bin/python > > from random import randint > > counter = 0 > > howmany = r

Re: [Tutor] Fun with Cookies

2007-09-07 Thread Kent Johnson
Alex Ezell wrote: > Kent, > Thanks so much. I will give that a try. Your name is all over these > kinds of questions on the web. I guess you fought through it a while > back? I figured it out for part of the Python Challenge :-) http://www.pythonchallenge.com/ Don't know how it got all over the w

Re: [Tutor] Fun with Cookies

2007-09-07 Thread Alex Ezell
Kent, Thanks so much. I will give that a try. Your name is all over these kinds of questions on the web. I guess you fought through it a while back? Here's where I show off my Python newb status. What's the best way to specify those attributes? If I only include the 4 you mention (name, value, dom

Re: [Tutor] Fun with Cookies

2007-09-07 Thread Kent Johnson
Alex Ezell wrote: > Hi all, > I am trying to create a cookie and send it a long with a request. > > I searched the archives and found this code from Kent Johnson: > > import cookielib, urllib2 > > cj = cookielib.CookieJar() > cookie = cookielib.Cookie(...your cookie data here...) > cj.set_cookie

[Tutor] Fun with Cookies

2007-09-07 Thread Alex Ezell
Hi all, I am trying to create a cookie and send it a long with a request. I searched the archives and found this code from Kent Johnson: import cookielib, urllib2 cj = cookielib.CookieJar() cookie = cookielib.Cookie(...your cookie data here...) cj.set_cookie(cookie) opener = urllib2.build_opene

Re: [Tutor] (no subject)

2007-09-07 Thread Alan Gauld
"Lawrence Barrott" <[EMAIL PROTECTED]> wrote > using the built in function "open" how do you specify non local > files such as the C: drive without copying the program there Just provide the full path to the file. f = open(r"C:\TEMP\somefile.txt") Note the use of raw to avoid problems with the

[Tutor] (no subject)

2007-09-07 Thread Lawrence Barrott
using the built in function "open" how do you specify non local files such as the C: drive without copying the program there thanks___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Jason Timms is out of the office.

2007-09-07 Thread Jason . Timms
I will be out of the office starting 09/07/2007 and will not return until 09/09/2007. I will respond to your message when I return. ** Privileged and/or confidential information may be contained in this message. If you are not the addres

Re: [Tutor] Python / CGI

2007-09-07 Thread Fiyawerx
Wow, thanks for all the info guys, more than i was expecting :). After looking around at various options, I did download the python gdata module for google's calendar. What I'm thinking is, since my fiance has two schools, she can just log into her google account and create a calendar for each scho

[Tutor] Multi-threading help

2007-09-07 Thread Tino Dai
Hi there, I'm working on a multi-threaded utility to monitor network connections between three machines The configuration of the three machines are: a web machine that feeds back to two machines for processing. Sometimes when the web connection is closed, the corresponding processes on the t

Re: [Tutor] Problem with while loop

2007-09-07 Thread Michael Connors
You could use string formatting to output all pin numbers as 4 character strings. http://docs.python.org/lib/typesseq-strings.html On 07/09/2007, matte <[EMAIL PROTECTED]> wrote: > > Perfect... > > Thanks very much for your help... > > On 9/7/07, Michael Connors <[EMAIL PROTECTED]> wrote: > > > >

Re: [Tutor] Problem with while loop

2007-09-07 Thread matte
Perfect... Thanks very much for your help... On 9/7/07, Michael Connors <[EMAIL PROTECTED]> wrote: > > I think it will work if you cast your input to an int: > howmany = int(raw_input( "How many: " )) Now I just need to figure out how to only get 4 digit pin numbers :) -m _

Re: [Tutor] Problem with while loop

2007-09-07 Thread Michael Connors
I think it will work if you cast your input to an int: howmany = int(raw_input( "How many: " )) On 07/09/2007, matte <[EMAIL PROTECTED]> wrote: > > Hi guys > > Please excuse me but I've been out of Python for a while since my laptop > was stolen... > > I'm battling with a very basic while loop

[Tutor] Problem with while loop

2007-09-07 Thread matte
Hi guys Please excuse me but I've been out of Python for a while since my laptop was stolen... I'm battling with a very basic while loop -- 8< -- #!/usr/bin/python from random import randint counter = 0 howmany = raw_input( "How many: " ) while counter < h

Re: [Tutor] Python / CGI

2007-09-07 Thread Steve Willoughby
John wrote: > Steve, > > If you're interested in just banging out a Python app, though, my > experience > was writing a calendaring tool for a group of my friends who get > together > [...] > This sounds very cool, is it something you could post? Okay. It's not the greatest

Re: [Tutor] dynamic attribute assignment

2007-09-07 Thread Alan Gauld
"John" <[EMAIL PROTECTED]> wrote vars.var3 > ['a','b','c'] > > This is great, I had no idea! However, is there then a way to > reassign or > update the values? For instance, can you say: > vars.var1='some new text' Why not try it at the >>> prompt? Thats the great thing about python, i

Re: [Tutor] manually sorting variables

2007-09-07 Thread Alan Gauld
"Christopher Spears" <[EMAIL PROTECTED]> wrote > Have the user enter three numeric values and store > them in three different variables. Without using > lists or sorting algorithms, manually sort these three > numbers from smallest to largest. Hmm, the restriction of not using a sorting algori