Re: sending bytes to parallel port

2006-07-28 Thread Timothy Smith
Diez B. Roggisch wrote: >> >>> fd = open('/dev/ppi0','w') >> >>> fcntl.ioctl(fd.fileno(),'PPISCTRL',1000) >> Traceback (most recent call last): >> File "", line 1, in ? >> TypeError: an integer is required >> >> i guess i'm failing to properly define the int i need for the 8byte >> value in

Re: sending bytes to parallel port

2006-07-28 Thread Diez B. Roggisch
> > >>> fd = open('/dev/ppi0','w') > >>> fcntl.ioctl(fd.fileno(),'PPISCTRL',1000) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: an integer is required > > i guess i'm failing to properly define the int i need for the 8byte > value ineed to send the port to set

Re: sending bytes to parallel port

2006-07-28 Thread Timothy Smith
Dennis Lee Bieber wrote: > On Sat, 29 Jul 2006 13:59:02 +1000, Timothy Smith > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> and yes i've done quite a bit of googling, i never expected it to be >> this difficult. i've done work with serial ports before. never parallel

Re: sending bytes to parallel port

2006-07-28 Thread Timothy Smith
Grant Edwards wrote: > On 2006-07-29, Grant Edwards <[EMAIL PROTECTED]> wrote: > > >> I'd particularly recommend taking a look at the pyparallel >> module found here: >> >> http://pyserial.sourceforge.net/ >> > > Oops, there isn't actually a link to pyparallel from that page > (I swear th

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

2006-07-28 Thread Tim Roberts
Vincent Delporte <[EMAIL PROTECTED]> wrote: > >BTW, what is the advantage of running a CherryPy/Django server instead >of the regular way of code in pages? Improved performance because the >Python interpreter is already up and running? Exactly. The Python interpreter can take a significant fracti

Re: sending bytes to parallel port

2006-07-28 Thread Timothy Smith
Grant Edwards wrote: > On 2006-07-28, Timothy Smith <[EMAIL PROTECTED]> wrote: > > >> i've been trying to send an 8 byte string to my parallel port >> under freebsd. the purpose is it to control a relay board. the >> board simply responds to the output byte coming from the port. >> eg. 0001

Re: HERE I BUILT A QUICK MATRIX TOOOK 5 MINS

2006-07-28 Thread alex23
switzerland qunatium computer wrote: > HERE I BUILT A QUICK MATRIX TOOOK 5 MINS Gene Ray called. He'd like his crazy back, please. -alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: sending bytes to parallel port

2006-07-28 Thread Grant Edwards
On 2006-07-29, Grant Edwards <[EMAIL PROTECTED]> wrote: > I'd particularly recommend taking a look at the pyparallel > module found here: > > http://pyserial.sourceforge.net/ Oops, there isn't actually a link to pyparallel from that page (I swear there used to be). Here's the pyparallel page:

Re: sending bytes to parallel port

2006-07-28 Thread Grant Edwards
On 2006-07-28, Timothy Smith <[EMAIL PROTECTED]> wrote: > i've been trying to send an 8 byte string to my parallel port > under freebsd. the purpose is it to control a relay board. the > board simply responds to the output byte coming from the port. > eg. 0001 will set pin 1 high and flick th

Re: Looking for a regular expression for this...

2006-07-28 Thread John Machin
[EMAIL PROTECTED] wrote: > OK, I tried this one. I am actually trying to parse dhcpd.conf file. > > def get_filename(self): > p = "^[ \t]*filename[ \t]+(\S+).*?host[ \t]+%s\s*$" % self.host > pat = re.compile(p, re.MULTILINE | re.DOTALL) > mo = pat.search(self.confdata) > if mo: >

Re: War chest for writing web apps in Python?

2006-07-28 Thread Nick Vatamaniuc
Aptitude, are you still using that? Just use Synaptic on Ubuntu. The problem as I wrote in my post before is that for some IDEs you don't just download an executable but because they are written for Linux first, on Windows you have to search and install a lot of helper libraries that often takes q

Re: SocketServer and timers

2006-07-28 Thread Simon Forman
[EMAIL PROTECTED] wrote: ... > > That alone does not work. If server.handle_request() blocks, > you don't get to the check(). You need some kind of timeout > in handle_request(). > > > -- > --Bryan Ach! You're right. I didn't consider that handle_request() might block.. -- http://mail.python.or

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread John Machin
Daniel Mark wrote: > Dear John: > > > Have a look in each of those folders (including the root!!) and see > > what you find there. [If I were forced to bet, I'd put my money on > > cygwin]. > > You are a genius!!! No, it was just a matter of noticing that the dog didn't bark :-) > > My machine w

Re: replacing single line of text

2006-07-28 Thread Simon Forman
[EMAIL PROTECTED] wrote: > I want to be able to replace a single line in a large text file > (several hundred MB). Using the cookbook's method (below) works but I > think the replace fxn chokes on such a large chunk of text. For now, I > simply want to replace the 1st line (CSV header) in the file

Re: replacing single line of text

2006-07-28 Thread Tim Chase
> I want to be able to replace a single line in a large text file > (several hundred MB). Using the cookbook's method (below) works but I > think the replace fxn chokes on such a large chunk of text. For now, I > simply want to replace the 1st line (CSV header) in the file but I'd > also like to kn

Re: Looking for a regular expression for this...

2006-07-28 Thread malahal
OK, I tried this one. I am actually trying to parse dhcpd.conf file. def get_filename(self): p = "^[ \t]*filename[ \t]+(\S+).*?host[ \t]+%s\s*$" % self.host pat = re.compile(p, re.MULTILINE | re.DOTALL) mo = pat.search(self.confdata) if mo: return mo.group(1) else:

simple dbus python problem ... please help

2006-07-28 Thread bob
Hi, I have this sample python script from the hal sources, but it doesn't work for me. This is despite other example python scripts I have to help me are working fine. The problem is that this script is the closet to what it is I actually want to learn to do. The error is: Traceback (most recent

Re: MySQLdb and dictcursor

2006-07-28 Thread blank
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > dictCursor > RETURNS the results as a dictionary; it doesn't affect how > parameters are passed in. thats how I was using it > > Normally results are a (list or tuple) where you have to know the > ord

how to solve TypeError: list objects are unhashable?

2006-07-28 Thread Jorge Vargas
Hello listI'm not a newbie on python but I'm not an expert either and just found out that code like this gives the above exception.    self.db={}    self.db["foo"]=[1,2]    self.db ["bar"]=[2,3]I now undestand why this is giving me a problem and I think i'm using the wrong approachfirst

sending bytes to parallel port

2006-07-28 Thread Timothy Smith
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from the port. eg. 0001 will set pin 1 high and flick the relay open. todate i've attempted this with mer

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread nikie
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 t

Re: Unicode question

2006-07-28 Thread Martin v. Löwis
Ben Edwards (lists) wrote: > Firstly sys.setdefaultencoding('iso−8859−1') does not work, I have to do > sys.setdefaultencoding = 'iso−8859−1' That "works", but has no effect. You bind the variable sys.setdefaultencoding to some value, but that value is never used for anything (do sys.getdefaultenc

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
Dear John: > Have a look in each of those folders (including the root!!) and see > what you find there. [If I were forced to bet, I'd put my money on > cygwin]. You are a genius!!! My machine was intalled python in cygwin:) I didn't expect that I could get so much helps from this forum. My hear

Re: mx.DateTime to datetime.datetime

2006-07-28 Thread John Machin
mp wrote: > Is there a constructor for an mx.DateTime object which takes a > datetime.datetime object? It seems like a pretty common thing to do but > I didn't see such a constructor in the mx.DateTime docs. > 1. It's very strange that you got the impression from the mx docs that the author was a

replacing single line of text

2006-07-28 Thread saad82
I want to be able to replace a single line in a large text file (several hundred MB). Using the cookbook's method (below) works but I think the replace fxn chokes on such a large chunk of text. For now, I simply want to replace the 1st line (CSV header) in the file but I'd also like to know a more

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:33:00 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >Well, syntax color coding, and block folding are supported by >PythonWin (comes with the ActiveState Windows install) and SciTE. > > The structural browser isn't as easy... Thanks for the input. -- http://mail.p

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:31:47 -0400, Dan Sommers <[EMAIL PROTECTED]> wrote: >You win that bet. (We actually tested on both platforms.) *Not* >testing on the deployment platform is *definitely* asking for trouble. I did intend to validate it on the deployment platform. It's just that I prefer to w

Re: War chest for writing web apps in Python?

2006-07-28 Thread Rob Sinclar
> > 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?) ? So

RE: Client/Server Question

2006-07-28 Thread bruce
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of faulkner i'm not familiar with python's os/system/exec functions, but i'm willing to bet that you're running into an issue with how the "system" function works. look for a function that allows you to spawn an

Re: Looking for a regular expression for this...

2006-07-28 Thread faulkner
idk, most regexes look surprisingly like undergrowth. malahal, why don't you parse s into a dict? read each couple of lines into a key-value pair. John Machin wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > My string is a multi line string that contains "filename > > \n" and "host \n" entr

mx.DateTime to datetime.datetime

2006-07-28 Thread mp
Is there a constructor for an mx.DateTime object which takes a datetime.datetime object? It seems like a pretty common thing to do but I didn't see such a constructor in the mx.DateTime docs. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Accessing USGS Web Service Using Python

2006-07-28 Thread Doug Caldwell
Hi! ** Accessing the USGS Web Service Using Python ** I am trying to access the US Geological Survey's gazetteer SOAP web service using Python to find the locations of all the places with the name 'Alexandria.' I tried to keep this simple by putting a soap message in a string and sending the

Re: Client/Server Question

2006-07-28 Thread faulkner
you might want to look at sshd. if you're on a windows box, you may need cygwin. if you're on linux, you either already have it, or it's in your package manager. [EMAIL PROTECTED] wrote: > My server.py looks like this > > -CODE---

Re: Threads vs Processes

2006-07-28 Thread [EMAIL PROTECTED]
mark wrote: > On Wed, 26 Jul 2006 10:54:48 -0700, Carl J. Van Arsdall wrote: > > Alright, based a on discussion on this mailing list, I've started to > > wonder, why use threads vs processes. > > The debate should not be about "threads vs processes", it should be > about "threads vs events". Event

Re: Client/Server Question

2006-07-28 Thread faulkner
i highly doubt it. http://www.google.com/search?domains=www.python.org&sitesearch=www.python.org&sourceid=google-search&q=os+system+deprecate&submit=search [EMAIL PROTECTED] wrote: > Is os.system() going to be deprecated in future ?.I read somewhere. > > Dennis Benzinger wrote: > > [EMAIL PRO

Re: Threads vs Processes

2006-07-28 Thread [EMAIL PROTECTED]
sturlamolden wrote: > Chance Ginger wrote: > > > Not quite that simple. In most modern OS's today there is something > > called COW - copy on write. What happens is when you fork a process > > it will make an identical copy. Whenever the forked process does > > write will it make a copy of the memo

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

2006-07-28 Thread John Machin
thebjorn wrote: > 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

Re: Threads vs Processes

2006-07-28 Thread bryanjugglercryptographer
sturlamolden wrote: > A noteable exception is a toy OS from a manufacturer in Redmond, > Washington. It does not do COW fork. It does not even fork. > > To make a server system scale well on Windows you need to use threads, > not processes. Here's one to think about: if you have a bunch of thread

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread John Machin
Terry Reedy wrote: > "Chaos" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> > 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): > >> >

Re: War chest for writing web apps in Python?

2006-07-28 Thread Dan Sommers
On Fri, 28 Jul 2006 13:03:25 +0200, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > Dan Sommers enlightened us with: >> We just did that at work (developed on the corporate-issued non-Unix >> computers and then deployed on a Linux box), and had no problems at >> all. In a former life, I was a long-ti

Re: Looking for a regular expression for this...

2006-07-28 Thread John Machin
[EMAIL PROTECTED] wrote: > Hi, > My string is a multi line string that contains "filename > \n" and "host \n" entries among other things. > > For example: s = """ filename X > host hostname1 > blah... > host hostname2 >

Re: Using iterators to write in the structure being iterated through?

2006-07-28 Thread Pierre Barbier de Reuille
Pierre Thibault wrote: > On Wed, 26 Jul 2006 18:54:39 +0200, Peter Otten wrote: > >> Pierre Thibault wrote: >> [...] > > Now, I want to do simple math operations on the data in C. Doing a loop > from 0 to 49 would loop twice through the actual data. In this > context, an iterator is perfect since

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread John Machin
Daniel Mark wrote: > > Also, I list some screen shot from my machine as follows: > > C:\Program Files\Python24>cd \ > > C:\>python Note: *no* error message !!! [or you edited the screen shot] Hypothesis: there is something called python.exe or python.bat or whatever somewhere in your path b

Re: Python and real-time OS timing/task communication?

2006-07-28 Thread seletz
Hi, Ray Schumacher wrote: > Has anyone used Python and a hard real-time OS/patch to schedule timed events? > We have started in on Debian and RTAI, and may be using LXRT. > (I've been reading > http://people.mech.kuleuven.be/~psoetens/lxrt/portingtolxrt.html) you should really also try http://ww

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread John Salerno
Daniel Mark wrote: > Hello John: > > I did try, however, it doesn't work on my machine. > > > Thank you > -Daniel > > > John Salerno wrote: >> Daniel Mark wrote: >> >>> Maybe there is not solution to this problem:)? >> Did you not try Sybren's suggestion? Remove the space between the >> semico

Re: Client/Server Question

2006-07-28 Thread diffuser78
Is os.system() going to be deprecated in future ?.I read somewhere. Dennis Benzinger wrote: > [EMAIL PROTECTED] wrote: > > My server.py looks like this > > > > -CODE-- > > #!/usr/bin/env python > > import socket > > im

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

2006-07-28 Thread Paul Boddie
Ben Sizer wrote: > > Even C++ comes with OpenGL in the standard library. Which standard library? [...] > Does PyQT play well with PyGame? And isn't it more of a windowing > environment? I'll have to let that question go, but I imagine the PyQt mailing list would be able to provide some kind of

Re: Client/Server Question

2006-07-28 Thread Dennis Benzinger
[EMAIL PROTECTED] wrote: > My server.py looks like this > > -CODE-- > #!/usr/bin/env python > import socket > import sys > import os > > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > host = '' > port = 2000 > >

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
Hello John: I did try, however, it doesn't work on my machine. Thank you -Daniel John Salerno wrote: > Daniel Mark wrote: > > > Maybe there is not solution to this problem:)? > > Did you not try Sybren's suggestion? Remove the space between the > semicolon and the path and it should work. It w

Re: Thread Question

2006-07-28 Thread Justin Azoff
Ritesh Raj Sarraf wrote: > I'd like to put my understanding over here and would be happy if people can > correct me at places. ok :-) > So here it goes: > Firstly the code initializes the number of threads. Then it moves on to > initializing requestQueue() and responseQueue(). > Then it moves on t

Looking for a regular expression for this...

2006-07-28 Thread malahal
Hi, My string is a multi line string that contains "filename \n" and "host \n" entries among other things. For example: s = """ filename X host hostname1 blah... host hostname2 blah... f

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Brian McFarland
Dumb question... but you're 100% positive your python install is in "C:\Program Files\Python24" and not just "C:\Python24" Right? Also, an alternative approach to being able to run python from the command line is to add it to the path variable in each instance of cmd.exe when it starts up. To

Re: Threads vs Processes

2006-07-28 Thread sturlamolden
Chance Ginger wrote: > Not quite that simple. In most modern OS's today there is something > called COW - copy on write. What happens is when you fork a process > it will make an identical copy. Whenever the forked process does > write will it make a copy of the memory. So it isn't quite as bad.

Re: Don't use __slots__! (was Re: dicts vs classes)

2006-07-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote: >>Guido sez: >> >> __slots__ is a terrible hack with nasty, hard-to-fathom side >> effects that should only be used by programmers at grandmaster and >> wizard levels. Unfortunately it has gained an enormous undeserved

Client/Server Question

2006-07-28 Thread diffuser78
My server.py looks like this -CODE-- #!/usr/bin/env python import socket import sys import os s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '' port = 2000 s.bind((host,port)) s.listen(1) conn, addr = s.acc

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

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:58:24 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Ben Sizer wrote: >(snip) >> Pretty much every Python web offering revolves around you having your >> own server with the luxury of running your own long-running processes >> on it. BTW, what is the advantage of ru

Re: build problems with Python 2.4.3 under Solaris 10

2006-07-28 Thread Victor Ng
Oops.. I meant: ./configure --prefix=/opt/python/2.4.3 --enable-shared When I include /opt/csw into the CPPFlags or LDFlags, libraries like lxml start to fail to compile. Still - if anyone can point me out to getting readline working - that'd be great. thanks, Hmm Linux is *easy* compar

Re: Nested function scope problem

2006-07-28 Thread Gerhard Fiedler
On 2006-07-28 14:32:59, Dennis Lee Bieber wrote: > On Fri, 28 Jul 2006 11:41:30 -0300, Gerhard Fiedler <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> wondered (this is slightly related) is whether it wouldn't be really good >> to make the difference between mutable and im

Re: list of lists of lists ....

2006-07-28 Thread bearophileHUGS
You can use this, fast, gives a tuple: from Tkinter import _flatten as flatten --- The xflatten/flatten version I sometimes use, maybe I can put something similar in the cookbook, but it can be improved a lot (and isrecursive is too much fragile): from pprint import isrecurs

build problems with Python 2.4.3 under Solaris 10

2006-07-28 Thread Victor Ng
How do I enable readline support for Python under Solaris 10?  I've got CSWreadline installed in /opt/csw from blastwave, but I'm not having any luck getting the readline.so module compiled.I'm using: CPPFLAGS="-I/opt/csw/include" LDFLAGS="-L/opt/csw/lib" ./configure --prefix=/opt/python/2.4.3 --en

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

2006-07-28 Thread Terry Reedy
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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? I think the doc. -- http://mail.python.org/mailman/listinfo/python-list

Re: list of lists of lists ....

2006-07-28 Thread Michal Kwiatkowski
faulkner wrote: > ok, so, recursion is just functional programming sugar for a loop. And a loop is a procedural programming sugar for tail recursion. 8-) Cheers, mk -- . o . >> http://joker.linuxstuff.pl << . . o It's easier to get forgiveness for being wrong o o o than forgivenes

Re: Nested function scope problem

2006-07-28 Thread Gerhard Fiedler
On 2006-07-28 15:20:52, Antoon Pardon wrote: >> Typically, "variable" implies a data storage location that can take on >> different values. Emphasis on "location" -- the name is fixed to a >> memory location whose contents can be varied. > > That is not true. It may be the case in a number of lan

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

2006-07-28 Thread Terry Reedy
"Ben Sizer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > PyGame was barely maintained for a year, and is based on SDL which was > also barely maintained for a year, and which hasn't kept up with > hardware advances at all. I believe there is a recent release of SDL, but which wh

Re: list of lists of lists ....

2006-07-28 Thread faulkner
doh. ok, so, recursion is just functional programming sugar for a loop. def get_As(L): checking = [elem for elem in L if isinstance(elem, list)]# the equivalent of elem in recursion all_As = [elem for elem in L if isinstance(elem, A)] while checking: new_checking = [] # al

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread John Salerno
Daniel Mark wrote: > Maybe there is not solution to this problem:)? Did you not try Sybren's suggestion? Remove the space between the semicolon and the path and it should work. It worked (and didn't work) for me when I tested it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
Hello Ray: Python is on my Path list as follows: C:\Program Files\Python24>echo %path% C:\Program Files\texmf\miktex\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\cygwin\usr\local\bin;c:\cygwin\bin;C:\P rogram Files\Java\jdk1.5.0_06\bin;C:\Program Files\gp400win32\gnuplot\bi n;C:\Program Files\Python24;C

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
Hello Dennis: > A second suggestion would be: don't install Python in "Program > Files", but put it at the top level of the partition (ie; C:\Python24\) > I guess your comment is right. However, I would like to install Python under directory "C:\Program Files\Python24" Also, I list some scr

Re: Nested function scope problem

2006-07-28 Thread Antoon Pardon
On 2006-07-28, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > Hmmm, I've not followed the PEPs -- has any thought been given to > unifying class/instance and dictionary notation so that > > a['b'] > and > a.b If that is what you want, you could use the following

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread Terry Reedy
"Chaos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> > 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

XML parsing and writing

2006-07-28 Thread c00i90wn
Hey, I'm having a problem with the xml.dom.minidom package, I want to generate a simple xml for storing configuration variables, for that purpose I've written the following code, but before pasting it I'll tell you what my problem is. On first write of the xml everything goes as it should but on su

Re: list of lists of lists ....

2006-07-28 Thread faulkner
recursion. def get_As(L): res = [] for elem in L: if isinstance(elem, A): res.append(elem) elif isinstance(elem, list): res += get_As(elem) return res i also have a Tree class in my rc: http://home.comcast.net/~faulkner612/programming/python/pyth

Re: Nested function scope problem

2006-07-28 Thread Antoon Pardon
On 2006-07-28, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 27 Jul 2006 18:09:37 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> It is irrelevant because the word "variable" is used in a lot of >> different languages. A lot of them with behaviour

Re: list of lists of lists ....

2006-07-28 Thread yomgui
I forgot the most important, I am looking for a non recursive method. thanks yomgui yomgui wrote: > > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to

list of lists of lists ....

2006-07-28 Thread yomgui
Hi, I have a list of data (type A) my list can includes element of type A or a lists, these list can includes element of type A or a lists, and so on ... is there a simple way to obtain a single list of all the elemets of type A ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python

Re: Automate Mozilla Firefox

2006-07-28 Thread John J. Lee
"david brochu jr" <[EMAIL PROTECTED]> writes: > want to take a text file (which has a list of urls) and have my script go > through them 1 by one using Firefox. Try Selenium. http://www.openqa.org/selenium/ John -- http://mail.python.org/mailman/listinfo/python-list

Re: Urllib.encode() - How does it Treat a List?

2006-07-28 Thread John J. Lee
"Gregory Piñero" <[EMAIL PROTECTED]> writes: > Hi Wise Python Folk, > > Here's my code: > >>> p={'type':'bar','title':'Gregs Chart 1','values':[1,2,3],'labels':[1,2,3]} > >>> urllib.urlencode(p) > 'values=%5B1%2C+2%2C+3%5D&labels=%5B1%2C+2%2C+3%5D&type=bar&title=Gregs+Chart+1' > > Now I just can

Re: python and dbus - beginner seeking some help

2006-07-28 Thread bob
On Fri, 28 Jul 2006 19:03:00 +0100, bob wrote: > Hello, > > First of all, does anyone know whether dbus will allow be to do 3 things: > > 1. query whether or not there is a dvd drive. > 2. query whether or not there is a blank disc in it. > 3. query what it's capacity is. > > If I'm barking

Re: Newbie..Needs Help

2006-07-28 Thread Nick Vatamaniuc
What do you mean? The html table is right there (at least in Firefox it is...). I'll paste it in too. Just need to isolate with some simple regexes and extract the text... Nick V. --- #

python and dbus - beginner seeking some help

2006-07-28 Thread bob
I've found some information at: http://www.freedesktop.org/wiki/Software/dbus However, if anyone knows of simpler or perhaps just easier to follow articles online or knows that I'm barking up the wrong tree, your help will still be appriciated. Meanwhile I'm off to RTFM to see if I can make sen

python and dbus - beginner seeking some help

2006-07-28 Thread bob
Hello, First of all, does anyone know whether dbus will allow be to do 3 things: 1. query whether or not there is a dvd drive. 2. query whether or not there is a blank disc in it. 3. query what it's capacity is. If I'm barking up the wrong tree, what should I be considering instead ? If I am

Python for Palm OS?

2006-07-28 Thread jeremy smith
anyone know of a python for palm application pippy is not downloading right __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
Simon Forman on Thursday 27 Jul 2006 22:47 wrote: > def run(request, response, func=dummy_func): > ''' > Get items from the request Queue, process them > with func(), put the results along with the > Thread's name into the response Queue. > > Stop running once an item is None. > ''' > name = curr

Re: Nested function scope problem

2006-07-28 Thread Antoon Pardon
On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Antoon Pardon a écrit : >> On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> >>>Antoon Pardon wrote: >>> On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >>> >>>(snip) >>> >>>It can only take y

Tkinter questions

2006-07-28 Thread Kevin Walzer
What is the recommended/preferred widget in Tkinter in the following areas: 1. Multi-column list display. I'm aware of bindings for Tktable, tablelist, and mclistbox, as well as Python-megawidgets that handle this. 2. Tree widgets. I'm aware of Gene Cash's tree widget, the IDLE tree widget, as w

Re: Python Projects Continuous Integration

2006-07-28 Thread Fabio Zadrozny
On 28 Jul 2006 04:55:39 -0700, Dave Potts <[EMAIL PROTECTED]> wrote: Hi,I'm just starting a development project in Python having spent time inthe Java world.  I was wondering what tool advice you could give meabout setting up a continuous integration environment for the python code: get the latest

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
And people, Is there any documentation on Python Threads or Threads in general. It'd be of great help to really understand. Ritesh Ritesh Raj Sarraf on Thursday 27 Jul 2006 16:37 wrote: > Is this the correct way of threading applications ? > This is the first time I'd be doing threading. So was

Re: Python Projects Continuous Integration

2006-07-28 Thread beliavsky
Harry George wrote: > "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 >

Re: How do you implement this Python idiom in C++

2006-07-28 Thread Pierre Barbier de Reuille
[EMAIL PROTECTED] wrote: > Rob Williscroft wrote: > >> If this is more than idle curiosity I strongly suggest you post >> a version of the python code you need to translate to C++. > > For the moment this is just healthy curiosity but i will still post the > code i would like to see translated: >

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
Duncan Booth on Thursday 27 Jul 2006 17:17 wrote: > What you want is to use a pool of threads so that you can configure how > many requests are issued at a time (you don't want to try to issue 100 > requests all in parallel). You can communicate with the threads through a > Queue. > Thanks to bot

Re: Newbie..Needs Help

2006-07-28 Thread Nick Vatamaniuc
Graham, I won't write the program for you since I have my own program to work on but here is an idea how to do it. 1) Need to have a function to download the page -- use the urllib module. Like this: import urllib page=urllib.urlopen(URL_GOES_HERE).read() 2) Go to the page with your browser and v

Re: help: output arrays into file as column

2006-07-28 Thread bei
Perfect! It works. Thanks Bruno. Bruno Desthuilliers wrote: > bei a écrit : > Please don't top-post > > > Hi,Simon, > > > > Thanks for your reply.It's very helpful :) > > But I am sorry for my given example.Actually, my data in the arrays are > > all float point datas.And I use integer in the exam

Re: Unicode question

2006-07-28 Thread Steve M
Ben Edwards (lists) wrote: > I am using python 2.4 on Ubuntu dapper, I am working through Dive into > Python. > > There are a couple of inconsictencies. > > Firstly sys.setdefaultencoding('iso-8859-1') does not work, I have to do > sys.setdefaultencoding = 'iso-8859-1' When you run a Python script

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

2006-07-28 Thread Ben Sizer
Paul Boddie wrote: > I can only profess familiarity with Pygame which still seems to do more > or less what it always did, although I haven't kept up with the > community, but I have recently released a simple game which seems to > work quite well. By "simple", I mean two-dimensional playing areas,

Re: New release of Diet Python (Beta 0.2)

2006-07-28 Thread The Eternal Squire
[EMAIL PROTECTED] wrote: > I'll be out of the office until approximately August 20th. If you have any > questions, please email [EMAIL PROTECTED] > > -- David Wahler What the heck is this??? The Eternal Squire -- http://mail.python.org/mailman/listinfo/python-list

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

2006-07-28 Thread Bruno Desthuilliers
Ben Sizer wrote: (snip) > Pretty much every Python web offering revolves around you having your > own server with the luxury of running your own long-running processes > on it. This is becoming less and less of a "luxury" - the cost of dedicated web servers is really dropping at eyesight. -- br

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread jay graves
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 th

Re: Unicode question

2006-07-28 Thread Max Erickson
"Ben Edwards (lists)" <[EMAIL PROTECTED]> wrote: > I am using python 2.4 on Ubuntu dapper, I am working through Dive > into Python. ... > Any insight? > Ben Did you follow all the instructions, or did you try to call sys.setdefaultencoding interactively? See: http://diveintopython.org/xml_pro

Re: Newbie..Needs Help

2006-07-28 Thread Graham Feeley
Thanks Nick for the reply Of course my first post was a general posting to see if someone would be able to help here is the website which holds the data I require http://www.aapracingandsports.com.au/racing/raceresultsonly.asp?storydate=27/07/2006&meetings=bdgo The fields required are as follows

Unicode question

2006-07-28 Thread Ben Edwards (lists)
I am using python 2.4 on Ubuntu dapper, I am working through Dive into Python. There are a couple of inconsictencies. Firstly sys.setdefaultencoding('iso−8859−1') does not work, I have to do sys.setdefaultencoding = 'iso−8859−1' secondly the following does not give a 'UnicodeError: ASCII encodin

  1   2   >