RE: Writting to file from file and printing using python

2006-07-28 Thread atanas Cosmas Nkelame
Hi,I have a task to write a program that will do the following.1. Run from the command line2. Get data from a text file (say data.txt) in the following format 111: peter edward [EMAIL PROTECTED] 112: John sykes[EMAIL PROTECTED] 113: edward mutaga [EMAIL PROTECTED]3. Write that data in a

War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
Hello I'm thinking of using Python to build the prototype for a business web appplication. The development and test machine is XP, while ultimate deployment will be on a shared Unix web host. What would you recommend I get, besides the Python engine itself? Good IDE (Kodomo?) ? Some kind of GUI

Re: War chest for writing web apps in Python?

2006-07-28 Thread faulkner
cygwin http://www.cygwin.com/ try a few IDEs out to see which fits you best. IDLE ships with python, and isn't significantly objectively worse than any other python IDE, afaik. GUI designers aren't necessary because there's usually so little boilerplate code in any python toolkit, but, again,

Re: a print bug?

2006-07-28 Thread Summercoolness
Steve Holden wrote: You obviously haven't yet passed your floating-point number proficiency test yet. Please restrict yourself to integers until you understand the difficulties that inaccuracies in floating-point can create ;-) hm, actually, i understand the limitation of floating point. but

Re: Zipping Files to user defined Directory

2006-07-28 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], OriginalBrownster wrote: I'm very new to python, and I have been using the TurboGears Framework to use python to power my application. […] my problems is that when I want to download that file from the server I want to zip the files selected. but how does a user

Re: Nested function scope problem

2006-07-28 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : On 2006-07-27 17:10:55, Bruno Desthuilliers wrote: Isn't being on the LHS the only way to write to a non-mutable object? You *don't* write to a non-mutable object. You rebind the name to another object (mutable or not, that's not the problem). Ok, sloppy

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Steve Jobless
Bruno Desthuilliers wrote: Steve Jobless wrote: Sybren Stuvel wrote: Steve Jobless enlightened us with: The first case can be just a typo, like: x.valeu = 5 I make typos all the time. Without a spell checker, this message would be unreadable :). Then learn to read what you

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread Simon Forman
Chaos wrote: Simon Forman wrote: Chaos wrote: As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes

Re: How to force a thread to stop

2006-07-28 Thread H J van Rooyen
Dennis Lee Bieber [EMAIL PROTECTED] Wrote: | On Thu, 27 Jul 2006 08:48:37 -0400, Jean-Paul Calderone | [EMAIL PROTECTED] declaimed the following in comp.lang.python: | | | If a thread never performs any I/O operations, signal handlers will still | get invokes on the arrival of a signal. | |

Re: Threads vs Processes

2006-07-28 Thread H J van Rooyen
Dennis Lee Bieber [EMAIL PROTECTED] Wrote: | On Thu, 27 Jul 2006 09:17:56 -0700, Carl J. Van Arsdall | [EMAIL PROTECTED] declaimed the following in comp.lang.python: | | Ah, alright, I think I understand, so threading works well for sharing | python objects. Would a scenario for this be

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Bruno Desthuilliers wrote: I'd rather let a machine to do that. Wasn't computer created for tasks like this? (No, not really. But...) There's obviously a trade-off between 'security' and flexibility. As I said, I do make lots of typo too, but OTOH the edit/test cycle in Python is usually

Re: non-blocking PIPE read on Windows

2006-07-28 Thread Simon Forman
placid wrote: Hi all, I have been looking into non-blocking read (readline) operations on PIPES on windows XP and there seems to be no way of doing this. Ive read that you could use a Thread to read from the pipe, but if you still use readline() wouldnt the Thread block too? Yes it will,

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread H J van Rooyen
Paul McGuire [EMAIL PROTECTED] wrote: | Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64, and | 11 with 8, and do bit-shifting instead of multiplying: | | def darkness(img,x,y): | return (RedVal(img,x,y) 5) + (GreenVal(img,x,y) 6) + | (BlueVal(img,x,y) 3) | | | --

Re: using names before they're defined

2006-07-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hiya, you might be interested in this alternative config parsing program: http://www.voidspace.org.uk/python/configobj.html Yes, I know it. But I don't like it. Either a simple ini file do the trick, or I need a full blown app-specific DSL - which can be as simple as a

Re: SocketServer and timers

2006-07-28 Thread Simon Forman
alf wrote: Hi, I have one thread app using SocketServer and use server_forever() as a main loop. All works fine, but now I need certain timer checking let's say every 1 second something and stopping the main loop. So questions are: -how to stop serve_forever -how to implement

Re: locked file

2006-07-28 Thread Simon Forman
Kirt wrote: By locked files i mean Outlook PST file while Outlook has it open Simon Forman wrote: Kirt wrote: i have a code that backsup file from src to dest. Now if some of the files are locked , i need to skip those files.. I was trying to use fctl module but it can be used only

Re: How to force a thread to stop

2006-07-28 Thread Paul Rubin
H J van Rooyen [EMAIL PROTECTED] writes: So on a processor that does not have protected instructions - if an idiot writes something to the following effect : *instructions to disable interrupts* followed by : *instructions that go into an infinite loop AND that make no OS calls* the

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread Simon Forman
Simon Forman wrote: Chaos wrote: Simon Forman wrote: Chaos wrote: As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX,

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Steve Jobless wrote: Bruno Desthuilliers wrote: Steve Jobless wrote: But what about adding a method to the class? Am I supposed to ask Is anyone using name xxx? assert 'xxx' not in dir(SomeClassOrObject) The class may be used by developers I don't even know

Py2exe for packaging installers?

2006-07-28 Thread K.S.Wong
Hi all, I am trying to find out what tools (platform-independent if possible) that I can use to package a goup (few) of installers to become an exe application. I have heard of Py2exe but have not use it before. Could it be used to wrap different installers (for example Python and Leo,

Re: a print bug?

2006-07-28 Thread Roel Schroeven
[EMAIL PROTECTED] schreef: Steve Holden wrote: You obviously haven't yet passed your floating-point number proficiency test yet. Please restrict yourself to integers until you understand the difficulties that inaccuracies in floating-point can create ;-) hm, actually, i understand the

WSAStartup failed: error code 10107

2006-07-28 Thread ralphdepping
Trying to get moinmoin wiki working on Windows 2000 using IIS and python. I get the following error when trying to view the start page after insalling moinmoin and python - key error seems to be at the end related to socket.py (ImportError: WSAStartup failed: error code 10107). 10107 is A system

Re: Py2exe for packaging installers?

2006-07-28 Thread Tim N. van der Leeuw
K.S.Wong wrote: Hi all, I am trying to find out what tools (platform-independent if possible) that I can use to package a goup (few) of installers to become an exe application. I have heard of Py2exe but have not use it before. Could it be used to wrap different installers (for example

Re: Connecting to internet under proxy

2006-07-28 Thread Schronos
I don't know where is the problem, but I tried the same that you put and it failed. I tested it under cygwin, a cmd, linux with 2.2, 2.3 and 2.4 python version. I think taht the problem is my corporate proxy. In this sentences we use always a http proxy, but perhaps is not the suitable kind of

Re: a print bug?

2006-07-28 Thread Duncan Booth
wrote: Duncan Booth wrote: But you wouldn't complain about this would you? print %10.4f % 1.23445 1.2345 print %10.3f % 1.23445 1.234 A value which is slightly than 1.2345 prints to 4 decimal places as 1.2345 and to 3 decimal places as 1.234. That's all that happens with

Re: How to find difference in years between two dates?

2006-07-28 Thread Bruno Desthuilliers
thebjorn wrote: Bruno Desthuilliers wrote: Which conversion ? How do you get the data ? as a datetime object ? as a (y,m,d) tuple ? as a y-m-d string ? Else ? All input routines, whether they're from a web-form, database, command line, or anywhere else, only produce objects from the

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Ben Sizer
Roman Susi wrote: Ben Sizer wrote: The problem is that Python is the 2nd best language for everything. ;) Is it a bad thing? I don't know. I suppose that depends on how you define 'bad'! For me, it is often inconvenient, because I'd prefer to use Python but generally find that I have to

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread Paul McGuire
H J van Rooyen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paul McGuire [EMAIL PROTECTED] wrote: | Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64, and | 11 with 8, and do bit-shifting instead of multiplying: | | def darkness(img,x,y): | return

Re: Py2exe for packaging installers?

2006-07-28 Thread Mr BigSmoke
However, it's not platform independant -- it'll be for windows only. Yeah, u'll have to use py2exe similars for mac (should be py2app, if i remember right). py2exe is a Python distutils extension which converts python scripts into executable windows programs cheers Fabio --

Re: War chest for writing web apps in Python?

2006-07-28 Thread Mr BigSmoke
For IDEs i recommend Wing IDE (its really good but comercial.. :( ), pydev for eclipse and also SPE. For GUI designer... it depends of wich kind of app u'll develop. For web apps try cherrypy.. it's wonderfull and simple... U can also try zope and plone (the they are less simple) cheers

Re: Writting to file from file and printing using python

2006-07-28 Thread Simon Brunning
On 7/28/06, atanas Cosmas Nkelame [EMAIL PROTECTED] wrote: Hi, I have a task to write a program that will do the following. 1. Run from the command line Check out the optparse module for this. http://docs.python.org/lib/module-optparse.html 2. Get data from a text file (say data.txt) in

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: Trying to get moinmoin wiki working on Windows 2000 using IIS and python. I get the following error when trying to view the start page after insalling moinmoin and python - key error seems to be at the end related to socket.py (ImportError: WSAStartup failed: error

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Ray wrote: Actually Bruno, don't you think that the notion of flexibility in Python comes at the expense of security is simply due to the fact that the syntax of screw up is exactly the same as the syntax of I mean it this way and I do want it? Perhaps if we use a different syntax when we

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Ben Sizer wrote: Ray wrote: Actually Bruno, don't you think that the notion of flexibility in Python comes at the expense of security is simply due to the fact that the syntax of screw up is exactly the same as the syntax of I mean it this way and I do want it? Perhaps if we use a

Re: How to force a thread to stop

2006-07-28 Thread Paul Boddie
Paul Rubin wrote: Paul Boddie [EMAIL PROTECTED] writes: Whether this solves the questioner's problems remains to be seen, but issues of handling SSH-based communications streams do seem to be addressed. Actually I don't understand the need for SSH. This is traffic over a LAN, right? Is

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Paul Boddie
Ben Sizer wrote: In my case, multimedia and game support is patchy, There are lots of multimedia and game frameworks for Python. Which ones have you tried and why are they insufficient? and web development support is still oriented towards the Java/enterprise user - if CGI doesn't suffice,

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Timo
Steve Jobless kirjoitti: Let's say the class is defined as: class MyClass: def __init__(self): pass def func(self): return 123 But from the outside of the class my interpreter let me do: x = MyClass() x.instance_var_not_defined_in_the_class = 456 or even:

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Steve Jobless wrote: Unfortunately, I don't see a way to separate interface from implementation in Python. So, it may not make much difference whether you subclass it or hack it from the outside. Documentation. (And name-mangling, underscore prepending, all the stuff the others said.) Whenever

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread Ben Sizer
Chaos wrote: As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes 450-1000 milliseconds I want speeds less than 10

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Bruno Desthuilliers
Steve Jobless wrote: Bruno Desthuilliers wrote: Steve Jobless wrote: Sybren Stuvel wrote: Steve Jobless enlightened us with: The first case can be just a typo, like: x.valeu = 5 I make typos all the time. Without a spell checker, this message would be unreadable :). Then learn to

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread c d saunter
Chaos ([EMAIL PROTECTED]) wrote: : He is the code #Actions here : myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 * : image.GetGreen(thisX, thisY)) + (0.11 * image.GetBlue(thisX, thisY)) : if myCol darkestCol: :darkestCol = myCol :possX = thisX :possY = thisY You really don't

Re: How to find difference in years between two dates?

2006-07-28 Thread thebjorn
John Machin wrote: Jan 31 to Feb 27: 27d (ex) 28d (in) Jan 31 to Feb 28: 28d (ex) 1m 1d (in) Jan 31 to Mar 01: 1m 1d (ex) 1m 2d (in) So 1 day short of 1m 1d is not 1m 0 d??? Exactly. Just as a person born on 1999-3-1 isn't a year old on 2000-2-29. Perfectly regular, consistent and reasonable.

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Bruno Desthuilliers
Ray wrote: Bruno Desthuilliers wrote: I'd rather let a machine to do that. Wasn't computer created for tasks like this? (No, not really. But...) There's obviously a trade-off between 'security' and flexibility. As I said, I do make lots of typo too, but OTOH the edit/test cycle in Python is

Re: micro authoritative dns server

2006-07-28 Thread xan2
Jack wrote: No, it's very low level :) Please post back if you find a good solution (or have built something that you want to open source :) The same if you find or create it Xan. Well, thanks, but I think it's so few for beginning. ,-( Is it not any high-level DNS class? E!!!

Re: War chest for writing web apps in Python?

2006-07-28 Thread Dan Sommers
On Fri, 28 Jul 2006 10:22:55 +0200, Sybren Stuvel [EMAIL PROTECTED] wrote: Vincent Delporte enlightened us with: The development and test machine is XP, while ultimate deployment will be on a shared Unix web host. That's just begging for huge problems. No insult intended, but it's

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Timo wrote: Steve Jobless kirjoitti: Let's say the class is defined as: class MyClass: def __init__(self): pass def func(self): return 123 But from the outside of the class my interpreter let me do: x = MyClass()

Comma is not always OK in the argument list?!

2006-07-28 Thread Roman Susi
Hi! it is interesting that I found this syntax error: a = {} str('sdfd', **a,) File stdin, line 1 str('sdfd', **a,) ^ SyntaxError: invalid syntax I just wonder is it intentional or by-product (bug or feature)? (The behaviour makes sense, of course... I tend to leave

Re: War chest for writing web apps in Python?

2006-07-28 Thread Kjell Magne Fauske
Django(http://www.djangoproject.com/) is a nice Python based framework for writing web applications. It comes bundled with a simple web server that is usefull for local developing. A desciption on how to install Django on windows can be found at http://effbot.org/zone/django.htm#installing -

Re: WSAStartup failed: error code 10107

2006-07-28 Thread ralphdepping
Thanks for the suggestion Rob. All I can find are 2 copies of winsock.dll: c:/WINNT/system32/winsock.dll c:/WINNT/system32/dllcache/winsock.dll They're both the same version 3.10.0.13 I assume it's ok to have a copy in the dllcach directory and that's not a source of the problem? Does python

Re: War chest for writing web apps in Python?

2006-07-28 Thread Nick Vatamaniuc
Vincent, If you plant to deploy on Unix/Linux, why develop on Windows? I would suggest to make a partition on your Windows machine and install some popular Linux distribution (I use Ubuntu but there are others too.) The biggest benefit will come from the fact that you will have access to a large

Python Projects Continuous Integration

2006-07-28 Thread Dave Potts
Hi, I'm just starting a development project in Python having spent time in the Java world. I was wondering what tool advice you could give me about setting up a continuous integration environment for the python code: get the latest source, run all the tests, package up, produce the docs, tag the

Re: Comma is not always OK in the argument list?!

2006-07-28 Thread Nick Vatamaniuc
Roman, According to the Python call syntax definition (http://docs.python.org/ref/calls.html) commas should be allowed, so it seems like a minor bug. Here are the lines in question: -http://docs.python.org/ref/calls.html--- call ::= primary ( [argument_list [,]] )

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: Thanks for the suggestion Rob. All I can find are 2 copies of winsock.dll: c:/WINNT/system32/winsock.dll c:/WINNT/system32/dllcache/winsock.dll They're both the same version 3.10.0.13 I assume it's ok to have a copy in the dllcach directory and that's not a

Re: Threads vs Processes

2006-07-28 Thread Tobias Brox
[mark] http://twistedmatrix.com/projects/core/documentation/howto/async.html . At my work, we started writing a web app using the twisted framework, but it was somehow too twisted for the developers, so actually they chose to do threading rather than using twisted's async methods. -- Tobias

Re: Zipping Files to user defined Directory

2006-07-28 Thread OriginalBrownster
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], OriginalBrownster wrote: I'm very new to python, and I have been using the TurboGears Framework to use python to power my application. [...] my problems is that when I want to download that file from the server I want to zip

Re: Zipping Files to user defined Directory

2006-07-28 Thread OriginalBrownster
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], OriginalBrownster wrote: I'm very new to python, and I have been using the TurboGears Framework to use python to power my application. [...] my problems is that when I want to download that file from the server I want to zip

Suppressing banner on interactive startup?

2006-07-28 Thread Tim Chase
A couple of hopefully short (interrelated) questions: 1) is there a way to suppress the banner when starting Python interactively? Something like a --quiet that would just drop you straight to a prompt? I like to use Python as a nuclear-powered calculator, and am working on a couple little

problem with regex

2006-07-28 Thread abcd
I have a regex: '[A-Za-z]:\\([^/:\*\?\|])*' when I do, re.compile('[A-Za-z]:\\([^/:\*\?\|])*') ...I get sre_constants.error: unbalanced parenthesis do i need to escape something else? i see that i have matching parenthesis. thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Suppressing banner on interactive startup?

2006-07-28 Thread Simon Brunning
On 7/27/06, Tim Chase [EMAIL PROTECTED] wrote: 2) is there a way to change the two prompts from and ... to other options? Namely, again with the TTS option, something that is more TTS friendly than hearing greater-than greater-than greater-than. The dot dot dot isn't nearly as bad. Change

Re: Threads vs Processes

2006-07-28 Thread mark
On Thu, 27 Jul 2006 20:53:54 -0700, Nick Vatamaniuc wrote: Debugging all those threads should be a project in an of itself. Ahh, debugging - I forgot to bring that one up in my argument! Thanks Nick ;) Certainly I agree of course that there are many applications which suit a threaded design. I

Re: problem with regex

2006-07-28 Thread Barry
On 28 Jul 2006 05:45:05 -0700, abcd [EMAIL PROTECTED] wrote: I have a regex: '[A-Za-z]:\\([^/:\*\?\|])*' when I do, re.compile('[A-Za-z]:\\([^/:\*\?\|])*') ...I get sre_constants.error: unbalanced parenthesis do i need to escape something else? i see that i have matching parenthesis.

Re: Suppressing banner on interactive startup?

2006-07-28 Thread Tim Chase
Change sys.ps1 and sys.ps2: http://tinyurl.com/lgqth. Thanks! I knew I had seen a solution to this involving something like ps1 and ps2, but the things I kept finding referred to the bash/sh PS1 and PS2 prompt level variables. All it took was learning that they *really were* ps1 and

Re: problem with regex

2006-07-28 Thread Rob Wolfe
abcd wrote: I have a regex: '[A-Za-z]:\\([^/:\*\?\|])*' when I do, re.compile('[A-Za-z]:\\([^/:\*\?\|])*') ...I get sre_constants.error: unbalanced parenthesis do i need to escape something else? i see that i have matching parenthesis. You should use raw string:

Re: problem with regex

2006-07-28 Thread Tim Chase
when I do, re.compile('[A-Za-z]:\\([^/:\*\?\|])*') ...I get sre_constants.error: unbalanced parenthesis Because you're not using raw strings, the escapables become escaped, making your regexp something like [A-Za-z]:\([^/:\*\?\|])* (because it knows what \\ is, but likely doesn't

Re: problem with regex

2006-07-28 Thread abcd
well thanks for the quick replies, but now my regex doesn't work. [code] import re p = re.compile(r'[A-Za-z]:\\([^/:\*?\|])*') x = p.match(c:\test) [/code] x is None any ideas why? i escape the back-slash, the asterisk *, and the PIPE | b/c they are regex special characters. --

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread H J van Rooyen
Paul McGuire [EMAIL PROTECTED] wrote: | H J van Rooyen [EMAIL PROTECTED] wrote in message | news:[EMAIL PROTECTED] | Paul McGuire [EMAIL PROTECTED] wrote: | | | Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64, | and | | 11 with 8, and do bit-shifting instead of

Re: How to force a thread to stop

2006-07-28 Thread H J van Rooyen
Paul Rubin http://[EMAIL PROTECTED] Wrote: | H J van Rooyen [EMAIL PROTECTED] writes: | So on a processor that does not have protected instructions - if an | idiot writes something to the following effect : | | *instructions to disable interrupts* | | followed by : | | *instructions that

Re: problem with regex

2006-07-28 Thread Tim Chase
p = re.compile(r'[A-Za-z]:\\([^/:\*?\|])*') x = p.match(c:\test) any ideas why? i escape the back-slash, the asterisk *, and the PIPE | b/c they are regex special characters. Same problem, only now in the other string: s = c:\test print s c: est Your \t is interpreted as

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Ben Sizer
Paul Boddie wrote: Ben Sizer wrote: In my case, multimedia and game support is patchy, There are lots of multimedia and game frameworks for Python. Which ones have you tried and why are they insufficient? PyGame was barely maintained for a year, and is based on SDL which was also barely

Re: problem with regex

2006-07-28 Thread abcd
sorry i forgot to escape the question mark... [code] import re p = re.compile(r'[A-Za-z]:\\([^/:\*?\|])*') even when I escape that it still doesnt work as expected. p = re.compile(r'[A-Za-z]:\\([^/:\*\?\|])*') p.match('c:\test') still returns None. --

Possible error in 'dive into Python' book, help!

2006-07-28 Thread Ben Edwards
I have been going through Dive into Python which up to now has been excellent. I am now working through Chapter 9, XML Processing. I am 9 pages in (p182) in the 'Parsing XML section. The following code is supposed to return the whole XML document (I have put ti at the end of this email): from

Re: Comma is not always OK in the argument list?!

2006-07-28 Thread olsongt
Nick Vatamaniuc wrote: Roman, According to the Python call syntax definition (http://docs.python.org/ref/calls.html) commas should be allowed, so it seems like a minor bug. Here are the lines in question: -http://docs.python.org/ref/calls.html--- call ::= primary (

Newbie..Needs Help

2006-07-28 Thread Graham Feeley
Hi this is a plea for some help. I am enjoying a script that was written for me and its purpose is to collect data from a web site and puts it into a access database table. It works fine, however it is a sports info table but now I need to collect the results of those races. I simply can't keep

Re: problem with regex

2006-07-28 Thread abcd
Sybren Stuvel wrote: Yes, because after the c: you expect a backslash, and not a tab character. Read the manual again about raw strings and character escaping, it'll do you good. doh. i shall do that. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to force a thread to stop

2006-07-28 Thread Paul Rubin
Paul Boddie [EMAIL PROTECTED] writes: Anyway, the py.execnet thing is presumably designed to work over the Internet and over local networks, with the benefit of SSH being that it applies well to both domains. Whether it's a better solution for the questioner's problem than established

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Bruno Desthuilliers wrote: Ray wrote: Bruno Desthuilliers wrote: Actually Bruno, don't you think that the notion of flexibility in Python comes at the expense of security is simply due to the fact that the syntax of screw up is exactly the same as the syntax of I mean it this way and I

Possible error in 'dive into Python' book, help!

2006-07-28 Thread Ben Edwards (lists)
I have been going through Dive into Python which up to now has been excellent. I am now working through Chapter 9, XML Processing. I am 9 pages in (p182) in the 'Parsing XML section. The following code is supposed to return the whole XML document (I have put ti at the end of this email): from

Re: problem with regex

2006-07-28 Thread abcd
not sure why this passes: regex = r'[A-Za-z]:\\([^/:\*\?\|])*' p = re.compile(regex) p.match('c:\\test') _sre.SRE_Match object at 0x009D77E0 p.match('c:\\test?:/') _sre.SRE_Match object at 0x009D7720 the last example shouldnt give a match --

SWIG, Python and C structures

2006-07-28 Thread RocketIII
Hi, I have structures like the following: typedef struct _SX { int i; char str[10]; } SX; typedef struct _SXA { int num_elements; SX sa[10]; } SXA; void myfunc1( SX *sx_p ); void myfunc2( SXA *sxa_p ); The swig interface file simply includes the .h-file with the '%include'

Re: Newbie..Needs Help

2006-07-28 Thread Nick Vatamaniuc
Your description is too general. The way to 'collect the results' depends largely in what format the results are. If they are in an html table you will have to parse the html data if they are in a simple plaintext you might use a different method, and if the site renders the numbers to images and

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 08:06:10 +0200, Vincent Delporte [EMAIL PROTECTED] wrote: (snip) Thanks everyone for the input! For the IDE: Ideally, I'd like something modern that uses language wordlists (to show syntax, variables, etc. in different colors), a window that lists all the procedures so I can

Re: problem with regex

2006-07-28 Thread Tim Chase
regex = r'[A-Za-z]:\\([^/:\*\?\|])*' p = re.compile(regex) p.match('c:\\test') _sre.SRE_Match object at 0x009D77E0 p.match('c:\\test?:/') _sre.SRE_Match object at 0x009D7720 the last example shouldnt give a match Ah, but it should, because it *does* match. m = p.match('c:\\test?:/')

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Ray wrote: Yeah, I know... but the thing is that it's easy to do it. Say in C++, you can rebind the method of a class to another function if you want to, you can muck around with the vtable and stuff, but you've gotta do something different than, say, a normal assignment. But remember, at no

Re: New release of Diet Python (Beta 0.2)

2006-07-28 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible error in 'dive into Python' book, help!

2006-07-28 Thread Tim Chase
!DOCTYPE grammar PUBLIC '-//diveintopython.org//DTD Kant Generator Pro v1.0//EN' 'kgp.dtd' I tried to reproduce your problem with the sample file you gave, but it gasped, wheezed and died with a traceback about entities. Likely for not also having this kgp.dtd file (and any other

Re: how best to check a value? (if/else or try/except?)

2006-07-28 Thread John Salerno
John McMonagle wrote: Have a look at using a wx.Validator in your wx.TextCtrl. Ah, good thinking! I wasn't even considering another option like that, which probably makes more sense anyway! -- http://mail.python.org/mailman/listinfo/python-list

Re: how best to check a value? (if/else or try/except?)

2006-07-28 Thread John Salerno
Nick Vatamaniuc wrote: John, The way I do it is, is I ask myself 'is there a more common (basic) base between the code paths or do they both have about a 50/50 chance on average?' or 'will one code path be taken during an error and the other one during the normal processing?'. If there is

Re: How to force a thread to stop

2006-07-28 Thread Paul Rubin
H J van Rooyen [EMAIL PROTECTED] writes: *grin* - Yes of course - if the WDT was enabled - its something that I have not seen on PC's yet... They are available for PC's, as plug-in cards, at least for the ISA bus in the old days, and almost certainly for the PCI bus today. --

Re: HERE I BUILT A QUICK MATRIX TOOOK 5 MINS

2006-07-28 Thread Grant Edwards
On 2006-07-28, Paul McGuire [EMAIL PROTECTED] wrote: ...USING A INFINITE MAGENTIC FIELD!!! I have a vision of a sweeping magenta fabric rippling through the cosmos. Perhaps a mauvic, cyanic, or even aubergenic field would be more stylish. depends on what shoes you choose to go with it. --

Re: problem with regex

2006-07-28 Thread Rob Wolfe
abcd wrote: not sure why this passes: regex = r'[A-Za-z]:\\([^/:\*\?\|])*' p = re.compile(regex) p.match('c:\\test') _sre.SRE_Match object at 0x009D77E0 p.match('c:\\test?:/') _sre.SRE_Match object at 0x009D7720 the last example shouldnt give a match If you want to learn RE I

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Ben Sizer wrote: Ray wrote: But remember, at no point did they think to make that stuff deliberately hard so that it would give you safety. It's hard because the implementation is relatively complex. The flipside of that is writing function objects in C++, which are an ugly hack to get

Re: Comma is not always OK in the argument list?!

2006-07-28 Thread Nick Vatamaniuc
True, that is why it behaves the way it does, but which way is the correct way? i.e. does the code need updating or the documentation? -Nick V. [EMAIL PROTECTED] wrote: Nick Vatamaniuc wrote: Roman, According to the Python call syntax definition (http://docs.python.org/ref/calls.html)

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Ray
Ben Sizer wrote: Roman Susi wrote: Ben Sizer wrote: The problem is that Python is the 2nd best language for everything. ;) Is it a bad thing? I don't know. I suppose that depends on how you define 'bad'! For me, it is often inconvenient, because I'd prefer to use Python but

Re: Python Projects Continuous Integration

2006-07-28 Thread Harry George
Dave Potts [EMAIL PROTECTED] writes: Hi, I'm just starting a development project in Python having spent time in the Java world. I was wondering what tool advice you could give me about setting up a continuous integration environment for the python code: get the latest source, run all the

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Ray
Ben Sizer wrote: a minimal layer over the C interface anyway. DirectX support only appeared this year unless you used IronPython, and it doesn't seem very popular. IronPython is not released yet, I do hope it will become popular though. It's in RC1 now and should be released soon. I'm really

metaclass : parse all class once before doing anything else ?

2006-07-28 Thread Laurent Rahuel
Hi, I have a much to smart problem for my brain. Here is the deal : I got a metaclass named Foo Then I got two others classes: class Bar(Foo): pass class Baz(Foo): pass I know how to add some attrs, methods to Bar and Baz when the module is loaded but I need to do something

Re: Nested function scope problem

2006-07-28 Thread Gerhard Fiedler
On 2006-07-28 04:07:20, Bruno Desthuilliers wrote: Gerhard Fiedler a écrit : Isn't being on the LHS (of an assignment) the only way to (re)bind a variable? pedantic s/variable/name/ /pedantic Ok, I missed this one :) Are there situations where binding happens without an explicit

Re: SocketServer and timers

2006-07-28 Thread bryanjugglercryptographer
Simon Forman wrote: alf wrote: Hi, I have one thread app using SocketServer and use server_forever() as a main loop. All works fine, but now I need certain timer checking let's say every 1 second something and stopping the main loop. So questions are: -how to stop serve_forever

Re: Changing a value for each folder while traversing a file system

2006-07-28 Thread PipedreamerGrey
Perfect. That's exactly what I wanted. Thanks. For those reading this later on, the following script will crawl through a directory, select all the text files, dump them into seperate numbered html files in the parent directory (in which the python script is executed). In this example, the

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Paul Boddie
Ben Sizer wrote: Paul Boddie wrote: Ben Sizer wrote: In my case, multimedia and game support is patchy, There are lots of multimedia and game frameworks for Python. Which ones have you tried and why are they insufficient? PyGame was barely maintained for a year, and is based on

  1   2   3   >