Re: [Tutor] Questions about the new turtle module in Python 2.6b2

2008-08-09 Thread Gregor Lingl
Dick Moores schrieb: At 03:12 AM 8/9/2008, Dick Moores wrote: 4. For my random_rectangles.py program I've started to try out the new turtle. (See the current state of random_rectanglesV16_web.py at < http://py77.python.pastebin.com/d3e842821>.)

Re: [Tutor] IP address parse

2008-08-09 Thread Josh Rosen
On Aug 9, 2008, at 10:46 PM, Josh Rosen wrote: There are a few different problems in your code. First off, regular expressions must be passed to re.compile() as strings. patt = re.compile(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\. (\[0-9]{1,3}) should read patt = re.compile(r"(\[0-9

[Tutor] using generators to mock raw_input for doctest

2008-08-09 Thread broek
Hi all, I'm building a tool that will be run in a shell and depends heavily on raw_input. I'm also using doctest (mostly via doctest.testfile) to create unit tests for it. After thinking a while about how to use doctest for invocations of raw_input, I came up with the general sort of idea shown

Re: [Tutor] IP address parse

2008-08-09 Thread Timothy Grant
On Sat, Aug 9, 2008 at 9:57 PM, Que Prime <[EMAIL PROTECTED]> wrote: > I'm trying to parse a log file for all ip addresses but can't get my RE to > work. Thanks in advance for pointing me in the right direction > > > #IP address parse > > ## > import re > > infile = ope

[Tutor] IP address parse

2008-08-09 Thread Que Prime
I'm trying to parse a log file for all ip addresses but can't get my RE to work. Thanks in advance for pointing me in the right direction #IP address parse ## import re infile = open("host0_declare.txt","r") outfile = open("out.txt","w") patt = re.compile(\[0-9]{1,

[Tutor] Problems with Gauge Bar.

2008-08-09 Thread Olrik Lenstra
Hello mail list ;) I've been developing a program for a while now (I am still a beginner though) and I want to add a progress bar (gauge bar) to my program. I am having quite some trouble actually implementing it though. I attached the file TSO.pyw which is my current project. I want to keep it wi

[Tutor] importing path question

2008-08-09 Thread dave selby
Hi all, I have a main directory 'kmotion2' where python scripts live. They access a library of scripts in 'kmotion2/core' as 'kmotion2/core' has a __init__.py file. However I now need to create a new directory 'utilities' inside 'kmotion2' that also needs to access scripts in 'core' kmotion2 dir

Re: [Tutor] something is fundamentally wrong...

2008-08-09 Thread Martin Walsh
Joshua Nikkel wrote: > IDLE 1.2.2 No Subprocess s = 'supercalifragilisticexpialidocious' len(s) > Traceback (most recent call last): > File "", line 1, in > len(s) > TypeError: 'str' object is not callable My guess would be that you've reassigned the name 'len' to s

[Tutor] Unable to catch exception

2008-08-09 Thread James
All, I'm having a rather strange problem that I'm hoping someone can shed some light on. I'm trying to catch a BadStatusLine exception raised by the httplib library. Below is the traceback that Python gives me when something goes wrong with one of my programs: - Traceback (most recent ca

[Tutor] something is fundamentally wrong...

2008-08-09 Thread Joshua Nikkel
I've pasted the following from my python shell. Please note that the first two lines of code are taken directly from the standard tutorial files under section 3.1.2. Will someone please tell me why something as basic and straightforward as this will not work? Everything else seems to work just f

Re: [Tutor] Questions about the new turtle module in Python 2.6b2

2008-08-09 Thread Dick Moores
At 03:12 AM 8/9/2008, Dick Moores wrote: 4. For my random_rectangles.py program I've started to try out the new turtle. (See the current state of random_rectanglesV16_web.py at < http://py77.python.pastebin.com/d3e842821>.) The only downside I've found is that the new turtle is much faster that

Re: [Tutor] issue with the Backslash on IDLE 1.2.2

2008-08-09 Thread bob gailer
Please always reply to tutor@python.org as well as me. All of us can help and learn. Marc Rambert wrote: Marc Rambert wrote: hi, I would like to make some regular expression, unfortunately I can't because the backslash doesn't work Please explain "doesn't work". I interpret that as "I

[Tutor] Questions about the new turtle module in Python 2.6b2

2008-08-09 Thread Dick Moores
Gregor, 1. I want the window to open with the right edge 0 pixels from the right edge of my screen. However, setup(width=.75, height=.915, startx=-0, starty=0) doesn't work. I have to do the nearest thing, setup(width=.75, height=.91