Re: non-blocking PIPE read on Windows

2006-07-31 Thread Durumdara
Hi !If you don't want to use MS-specific things, you can use the normal pipes.See this code. If you want to use non-blocking version, you need to create a thread that handle the reads/writes. import os, sys, time, binascii, cPicklebpath,bname=os.path.split(sys.argv[0])def Log(Msg,IsMaster,First=Fal

Re: Small problem with print and comma

2006-07-31 Thread Diez B. Roggisch
Dustan wrote: > Dennis Lee Bieber wrote: >> > for i in range(0,len(param)): >> > print a[i], >> >> for it in param: >> print it, > > That's one way. However, if you need the position (this is for future > reference; you don't need the position number here): > > for i in range(len(param)+1):

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

2006-07-31 Thread Ben Sizer
Paul Boddie wrote: > Ben Sizer wrote: > > > > Even C++ comes with OpenGL in the standard library. > > Which standard library? Sorry, it was a long day, and I used entirely the wrong term here. By that, I meant "typically shipped with each compiler". I've never had to even install a development lib

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

2006-07-31 Thread Ben Sizer
Sybren Stuvel wrote: > Ben Sizer enlightened us with: > > 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. > > Still, ID Software and Epic both use SDL + OpenGL for their games.

Newbie help - test for data type

2006-07-31 Thread Jonathan Bowlas
Hi Listers, I have a requirement to test for a data type could someone tell me if this is possible in python? Basically I have a ZPT in Zope that users can select checkboxes in a form which pass arguments for a python function, however if there is only one checkbox selected it is passed as a stri

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

2006-07-31 Thread Ben Sizer
Terry Reedy wrote: > "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 recen

Re: XML parsing and writing

2006-07-31 Thread Stefan Behnel
c00i90wn wrote: > 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 goe

Re: Windows vs. Linux

2006-07-31 Thread 3KWA
I am not a programming expert but I use python everyday on Windows XP: * python standard distribution (CPython) * iPython * cygwin for the command line interaction, add a unix/linux flavour to the blend EuGeNe -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie help - test for data type

2006-07-31 Thread John Machin
Jonathan Bowlas wrote: > Hi Listers, > > I have a requirement to test for a data type could someone tell me if this > is possible in python? > > Basically I have a ZPT in Zope that users can select checkboxes in a form > which pass arguments for a python function, however if there is only one > che

Re: Newbie help - test for data type

2006-07-31 Thread Dennis Benzinger
Jonathan Bowlas wrote: > Hi Listers, > > I have a requirement to test for a data type could someone tell me if this > is possible in python? > > Basically I have a ZPT in Zope that users can select checkboxes in a form > which pass arguments for a python function, however if there is only one > c

Re: Has anyone used davlib by Greg Stein?

2006-07-31 Thread Joel Hedlund
> Has anyone worked with this? Is it any good? I'll take the palpable silence as a "no" then. :-) Thank's anyway! /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie help - test for data type

2006-07-31 Thread Jonathan Bowlas
Thanks for everyone’s help, much appreciated, I’ll check out the isinstance function.   Jon   -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Benzinger Sent: 31 July 2006 10:20 To: python-list@python.org Subject: Re: Newbie help - test fo

Re: Newbie help - test for data type

2006-07-31 Thread Rob Wolfe
> This is my function: > selecteddeptcodes = context.REQUEST.DEPTCODE > currentstatus = context.REQUEST.STATUS > > if currentstatus == 'pending': > for dptcd in selecteddeptcodes: >context.changetolive(DEPTCODE=dptcd) > if currentstatus == 'old': > for dptcd in selecteddeptcodes: >contex

Re: [OT]Newbie help - test for data type

2006-07-31 Thread Bruno Desthuilliers
Jonathan Bowlas wrote: > Hi Listers, > > I have a requirement to test for a data type could someone tell me if this > is possible in python? > > Basically I have a ZPT in Zope that users can select checkboxes in a form > which pass arguments for a python function, however if there is only one > c

Re: Newbie help - test for data type

2006-07-31 Thread Bruno Desthuilliers
John Machin wrote: > Jonathan Bowlas wrote: >> Hi Listers, >> >> I have a requirement to test for a data type could someone tell me if this >> is possible in python? >> >> Basically I have a ZPT in Zope that users can select checkboxes in a form >> which pass arguments for a python function, howeve

Re: Newbie help - test for data type

2006-07-31 Thread Bruno Desthuilliers
Dennis Benzinger wrote: > Jonathan Bowlas wrote: >> Hi Listers, >> >> I have a requirement to test for a data type could someone tell me if >> this >> is possible in python? >> >> Basically I have a ZPT in Zope that users can select checkboxes in a form >> which pass arguments for a python function

Re: Newbie help - test for data type

2006-07-31 Thread Bruno Desthuilliers
Rob Wolfe wrote: >> This is my function: >> selecteddeptcodes = context.REQUEST.DEPTCODE >> currentstatus = context.REQUEST.STATUS >> >> if currentstatus == 'pending': >> for dptcd in selecteddeptcodes: >>context.changetolive(DEPTCODE=dptcd) >> if currentstatus == 'old': >> for dptcd in selec

Re:Newbie help - test for data type

2006-07-31 Thread Jonathan Bowlas
Thanks Bruno, I’ll use this.   Much appreciated.   Jon   -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Desthuilliers Sent: 31 July 2006 10:37 To: python-list@python.org Subject: Re: [OT]Newbie help - test for data type   Jonathan Bow

Re: how to stop python

2006-07-31 Thread victor
or if u want explicit exit of program then use: import sys sys.exit(1) or raise SystemExit, 'message' Dan wrote: > bruce bedouglas at earthlink.net posted: > > > perl has the concept of "die". does python have anything > > similar. how can a python app be stopped? > > I see this sort of state

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread nikie
Chaos wrote: > nikie 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 > > > >

Re: class variables

2006-07-31 Thread Bruno Desthuilliers
Colin J. Williams wrote: > Andre Meyer wrote: >> Hi all >> >> I am trying to understand the magic of Python's class variables and >> tried the following code (see below). >> >> Just out of curiosity, I tried to define a property that provides >> access to a seemingly instancae variable which is in

how to safely extract dict values

2006-07-31 Thread David Zaret
i have a dict with a particular key - the values for this key will be None, one valid scalar, or a list: {mykey, None} {mykey, "foo"} {mykey, ["bar", "baz"]} let's ignore the None case - in the case of the one or many values, i want to suck the values into a list. here'

Re: Nested function scope problem

2006-07-31 Thread Bruno Desthuilliers
Antoon Pardon wrote: > On 2006-07-29, Gerhard Fiedler <[EMAIL PROTECTED]> wrote: >> On 2006-07-29 13:47:37, Antoon Pardon wrote: >> >>> I think the important thing to remember is that the assignment in Python >>> is a alias maker and not a copy maker. In languages like C, Fortran, >>> pascal, the a

Re: how to safely extract dict values

2006-07-31 Thread Paul Rubin
David Zaret <[EMAIL PROTECTED]> writes: > my way is ugly. what's a better way? Untested: for key in mydict: if isinstance(mydict[key], list): vals.extend(mydict[key]) else: vals.append(mydict[key]) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to safely extract dict values

2006-07-31 Thread Bruno Desthuilliers
Paul Rubin wrote: > David Zaret <[EMAIL PROTECTED]> writes: >> my way is ugly. what's a better way? > > Untested: > > for key in mydict: >if isinstance(mydict[key], list): > vals.extend(mydict[key]) >else: > vals.append(mydict[key]) Too much useless looku

Re: how to safely extract dict values

2006-07-31 Thread Amit Khemka
On 7/31/06, David Zaret <[EMAIL PROTECTED]> wrote: > i have a dict with a particular key - the values for this key will be > None, one valid scalar, or a list: > > {mykey, None} > {mykey, "foo"} > {mykey, ["bar", "baz"]} > > let's ignore the None case - in the case of the on

Re: how to safely extract dict values

2006-07-31 Thread Bruno Desthuilliers
David Zaret wrote: > i have a dict with a particular key - the values for this key will be > None, one valid scalar, or a list: > > {mykey, None} > {mykey, "foo"} > {mykey, ["bar", "baz"]} > > let's ignore the None case - in the case of the one or many values, i > want to suck the val

Re: how to safely extract dict values

2006-07-31 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Too much useless lookup IMHO... Actually, you, me, and Amit all mis-read David's original exapmle. What he really wanted was (let's see if I get it right this time): if mykey in mydict: v = mydict[mykey] if not isinstance(v, list):

Re: how to safely extract dict values

2006-07-31 Thread Bruno Desthuilliers
Amit Khemka wrote: > On 7/31/06, David Zaret <[EMAIL PROTECTED]> wrote: >> i have a dict with a particular key - the values for this key will be >> None, one valid scalar, or a list: >> >> {mykey, None} >> {mykey, "foo"} >> {mykey, ["bar", "baz"]} >> >> let's ignore the None

Re: Windows vs. Linux

2006-07-31 Thread jean-michel bain-cornu
Hi, [EMAIL PROTECTED] a écrit : > Is Windows > an okay enviornment in which to program under Python, or do you > recommend that I run a dual-boot of Linux or maybe a VMWare install to > program under Python? I'm used to practice windows & linux and it makes sense to use python on both because the

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

2006-07-31 Thread benben
You are heading the wrong way... There are a number of ways to implement this but the easiest I can think of is to use RTTI. To get around with counting sub-objects you can rely on virtual inheritance, which only happens at the top of the inheritance tree. Here is a simple demo: #include #in

Re: how to safely extract dict values

2006-07-31 Thread David Zaret
thanks for the many responses. i have zero control over the dict. in practice, i'm using turbogears which is "automatically" populating the result dict with zero-to-many choices from a generated list of HTML checkboxes. the user can select none, one, or many, and submit. cherrypy packs the *

Re: how to safely extract dict values

2006-07-31 Thread Bruno Desthuilliers
Paul Rubin wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> Too much useless lookup IMHO... > > Actually, you, me, and Amit all mis-read David's original exapmle. Actually, I plea not guilty - cf my answer to the OP !-) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::

Re: how to safely extract dict values

2006-07-31 Thread Bruno Desthuilliers
David Zaret wrote: > thanks for the many responses. > > i have zero control over the dict. in practice, i'm using turbogears > which is "automatically" populating the result dict with zero-to-many > choices from a generated list of HTML checkboxes. the user can select > none, one, or many, and s

Re: Windows vs. Linux

2006-07-31 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > Is Windows > an okay enviornment in which to program under Python, or do you > recommend that I run a dual-boot of Linux or maybe a VMWare install to > program under Python? Python is one of the best languages I've found for platform-independence - significantly better

Re: how to safely extract dict values

2006-07-31 Thread Amit Khemka
oops ! my mistake :-D On 7/31/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Amit Khemka wrote: > > how about: > > > > vals = [] > > for val in mydict.values(): > > try: vals.extend(val) > > except: vals.append(val) > > >>> l = [] > >>> l.extend((1, 2)) > >>> l > [1, 2] > >>> l.extend('a

to automate an interactive shell

2006-07-31 Thread Murugesh
Hi all, I'm a newbie and would like to how python is efficient in automating an interative shell(I have a CLI executable which interatcs with the user). Any starters would be greatly appreciated. Thanks, Murugesh -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-07-31 Thread jean-michel bain-cornu
Andy Dingley a écrit : > I'd never recommend dual-boot for anything! Don't agree man, it's good for testing... -- http://mail.python.org/mailman/listinfo/python-list

Re: non-blocking PIPE read on Windows

2006-07-31 Thread Durumdara
Hi !A new version with binary data handling. 103 seconds with 1000 data exchange.import os, sys, time, binascii, cPicklebpath,bname=os.path.split(sys.argv[0])def Log(Msg,IsMaster,First=False):     fn=sys.argv[0]+'.'+['c','m'][int(IsMaster)]+'.log'    mode='aw'[int(First)]    f=open(fn,mode)    f.wr

Re: ANN: pywinauto 3.6 released

2006-07-31 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

Nuther problem with 'dive into Python'

2006-07-31 Thread Ben Edwards
Am going through Chapter 9 - HTTP Web Services in dive into Python. It uses the following: data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() The page no longer exists, can anyone recommend an alternative page to use? Ben -- http://mail.python.org/mailman/listinfo/python-l

Another problem with 'Dive Into Python'

2006-07-31 Thread Ben Edwards (lists)
Am going through Chapter 9 - HTTP Web Services in dive into Python. It uses the following: data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() The page no longer exists, can anyone recommend an alternative page to use? Ben -- http://mail.python.org/mailman/listinfo/python-l

gaierror: (8, 'hostname nor servname provided, or not known')

2006-07-31 Thread Laszlo Nagy
Hello, I asked this question about a week ago, but I did not provide a traceback. Here is the traceback: File "/usr/local/lib/python2.4/xmlrpclib.py", line 1096, in __call__ return self.__send(self.__name, args) File "/usr/local/lib/python2.4/xmlrpclib.py", line 1383, in __request

Re: Windows vs. Linux

2006-07-31 Thread metaperl
Andy Dingley wrote: > > Python is one of the best languages I've found for > platform-independence - significantly better than Perl. The reason I'm going with vmware is because I'm afraid that I will need to compile a C portiion of a Python module and that will not be a pretty picture under Wind

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> > Why are you avoiding naming the chip and its compiler? >> >> I must disagree on that one: There are many threads on this site where >> people just have fun talking algorithm. I'm not an algo. expert and I >> know there are many

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > > Philippe Martin wrote: > >> >> 3. How does the device manage to compute the 8-decimal-digit number >> >> that is your input?? >> >> What device manager ? think about it before being rude >> > > No device manager [noun] was mentioned. You may have inferred rudeness > w

Multiple Telnet sessions through one script

2006-07-31 Thread vmalhotra
Hi I am new in python scripting. I want to open a Multiple telnet session through once script. In other way i can tell i want to open two linux consoles through one script. I wrote one script, but the issue is I am not able to open multiple consoles. The Scripts which i wrote is as follows: impo

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

2006-07-31 Thread Gerhard Fiedler
On 2006-07-29 01:07:12, Tim Roberts wrote: > 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.

Re: Windows vs. Linux

2006-07-31 Thread William Witteman
On Mon, Jul 31, 2006 at 04:30:50AM -0700, Andy Dingley wrote: >[EMAIL PROTECTED] wrote: > >> Is Windows >> an okay enviornment in which to program under Python, or do you >> recommend that I run a dual-boot of Linux or maybe a VMWare install >> to >> program under Python? > >Python is one of the be

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: > >> >> Yes I had arm in mind (for some reason) while it is the Smc8831 >> (http://www.google.com/url?sa=U&start=1&q=http://www.epsondevice.com/www/PDFS/epdoc_ic.nsf/5388db40b5eee4f949256a9c001d589f/944b73008b0bad33492570a00015d6ba/%24FILE/S5U1C88000C_2

getting debug from urllib2

2006-07-31 Thread Ben Edwards
Have been experimenting with HTTP stuff in python 2.4 and am having a problem getting debug info. If I use utllib.utlopen I get debug but if I user utllib2 I do not. Below is the probram and the output I am getting. Any insight? Ben * Code * import urllib, urllib2, httplib url = 'http://www.mo

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

2006-07-31 Thread Ben Sizer
Gerhard Fiedler wrote: > On 2006-07-29 01:07:12, Tim Roberts wrote: > > > 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 a

Re: BCD List to HEX List

2006-07-31 Thread Paul Rubin
Philippe Martin <[EMAIL PROTECTED]> writes: > I actually need numbers much larger than 32 bits. What is the max size hex number you need? What is the application if you don't mind my asking? -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread Paul McGuire
"Chaos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Paul McGuire wrote: > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > "Chaos" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > > > > > > > > > myCol = (0.3 * image

Re: Windows vs. Linux

2006-07-31 Thread Duncan Booth
metaperl wrote: > The reason I'm going with vmware is because I'm afraid that I will need > to compile a C portiion of a Python module and that will not be a > pretty picture under Windows... true or false? > Provided you have the correct compilers installed it is no harder compiling C extensions

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread nikie
Paul McGuire wrote: > "Chaos" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Paul McGuire wrote: > > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > "Chaos" <[EMAIL PROTECTED]> wrote in message > > > > news:[EMAIL PROTECTED] > > > >

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> I actually need numbers much larger than 32 bits. > > What is the max size hex number you need? What is the application if > you don't mind my asking? Well I am under NDA so I cannot tell you what the application is - I need num

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread Fredrik Lundh
Chaos wrote: > I have tried PIL. Not only that, but the Image.eval function had no > success either. I did some tests and I found out that Image.eval only > called the function a certain number of times either 250, or 255. > Unless I can find a working example for this function, its impossible > t

Re: BCD List to HEX List

2006-07-31 Thread Paul Rubin
Philippe Martin <[EMAIL PROTECTED]> writes: > Well I am under NDA so I cannot tell you what the application is - I need > numbers (dec) with up to 24 digits. You actually need to represent numbers up to 10**24?? > As I said, I went the other way - more data on the line (from dev 1 to dev > 2) - b

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> Well I am under NDA so I cannot tell you what the application is - I need >> numbers (dec) with up to 24 digits. > > You actually need to represent numbers up to 10**24?? > >> As I said, I went the other way - more data on the li

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> Well I am under NDA so I cannot tell you what the application is - I need >> numbers (dec) with up to 24 digits. > > You actually need to represent numbers up to 10**24?? > >> As I said, I went the other way - more data on the li

Re: BCD List to HEX List

2006-07-31 Thread Paul Rubin
Philippe Martin <[EMAIL PROTECTED]> writes: > On device #1 no constraint for my purpose. On the smartcard, the tradeoff is > between using EEPROM (plenty + slow + small life expectancy) for temp > variables versus RAM (very little) ... but I do not think it is an issue > eather in my case. Speed is

poll() on OSX 10.3.9

2006-07-31 Thread Norman Khine
Hello, I need to use the 'select' module in python, but get an error on the: Python 2.5b2 (r25b2:50512, Jul 31 2006, 15:01:51) [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import select >>> dir(select) ['_

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> On device #1 no constraint for my purpose. On the smartcard, the tradeoff >> is between using EEPROM (plenty + slow + small life expectancy) for temp >> variables versus RAM (very little) ... but I do not think it is an issue >> ea

trouble understanding super()

2006-07-31 Thread John Salerno
Here's some code from Python in a Nutshell. The comments are lines from a previous example that the calls to super replace in the new example: class A(object): def met(self): print 'A.met' class B(A): def met(self): print 'B.met' # A.met(self) super(

Re: Multiple Telnet sessions through one script

2006-07-31 Thread Carl J. Van Arsdall
Well, although you spawn seperate telnet processes there is still only one thread of control in your pythons script. If you need to do two things simultaneously you'll need to setup a parallel control mechanism. For example you could use python threads, each thread spawns a separate telnet an

FTP (ftplib) output capture

2006-07-31 Thread ChaosKCW
Hi Has anyone caputerd the output from the std ftp lib? It seems a bit annoying that everything is printed to stdout. It means incorporating this into any real program is a problem. It would have been much better if they used the std logging module and hooked up a console logger for the feault ftp

Using Python for my web site

2006-07-31 Thread northband
Hi, I am interested in re-writing my website in Python vs PHP but have a few questions. Here are my specs, please advise as to which configuration would be best: 1.Dell Poweredge Server, w/IIS, currently Windows but considering FreeBSD 2. Site consists of result pages for auctions and items for sa

Re: BCD List to HEX List

2006-07-31 Thread bryanjugglercryptographer
Philippe Martin wrote: > Yes, I came here for the "algorithm" question, not the code result. To turn BCD x to binary integer y, set y to zero for each nibble n of x: y = (((y shifted left 2) + y) shifted left 1) + n Do you need instruction on extracting nibbles, and shifting and adding

Re: Mouse LED Control in Python

2006-07-31 Thread Chris Lambacher
There is not enough information in that post to be able to reimpliment what he did in any language. You will have to try and get in touch with the author. -Chris On Sun, Jul 30, 2006 at 01:26:40PM -0700, [EMAIL PROTECTED] wrote: > I found this link that describes the byte arrays to control the

Questions

2006-07-31 Thread Paré , Richard
Hi,   I find Python very interesting and useful as a developing matrix and other mathematical applications. I went through the tutorial to try to understand and work with various concepts. I have the following questions:   Where could I find more information on the "self" classes. Th

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

2006-07-31 Thread Sion Arrowsmith
In article <[EMAIL PROTECTED]>, Ben Edwards (lists) <[EMAIL PROTECTED]> wrote: >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

Re: Using Python for my web site

2006-07-31 Thread Norman Khine
northband wrote: > Hi, I am interested in re-writing my website in Python vs PHP but have > a few questions. Here are my specs, please advise as to which > configuration would be best: > > 1.Dell Poweredge Server, w/IIS, currently Windows but considering > FreeBSD > 2. Site consists of result pages

Re: getting debug from urllib2

2006-07-31 Thread Chris Lambacher
On Mon, Jul 31, 2006 at 02:43:36PM +0100, Ben Edwards wrote: > Have been experimenting with HTTP stuff in python 2.4 and am having a > problem getting debug info. If I use utllib.utlopen I get debug but if I > user utllib2 I do not. Below is the probram and the output I am > getting. > > Any insi

Re: trouble understanding super()

2006-07-31 Thread Simon Forman
John Salerno wrote: > Here's some code from Python in a Nutshell. The comments are lines from > a previous example that the calls to super replace in the new example: > > class A(object): > def met(self): > print 'A.met' > > class B(A): > def met(self): > print 'B.met' >

Re: Using Python for my web site

2006-07-31 Thread northband
Thanks I will look into it. -Adam Norman Khine wrote: > northband wrote: > > Hi, I am interested in re-writing my website in Python vs PHP but have > > a few questions. Here are my specs, please advise as to which > > configuration would be best: > > > > 1.Dell Poweredge Server, w/IIS, currentl

Re: FTP (ftplib) output capture

2006-07-31 Thread Simon Forman
ChaosKCW wrote: > Hi > > Has anyone caputerd the output from the std ftp lib? It seems a bit > annoying that everything is printed to stdout. It means incorporating > this into any real program is a problem. It would have been much better > if they used the std logging module and hooked up a consol

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

2006-07-31 Thread Vincent Delporte
On 31 Jul 2006 07:05:27 -0700, "Ben Sizer" <[EMAIL PROTECTED]> wrote: >Typically you run PHP as a module in your webserver, so there should be >no process startup overhead. mod_python provides the same sort of >functionality for Python, but is not as popular or widely installed as >the PHP Apache m

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
[EMAIL PROTECTED] wrote: > > Philippe Martin wrote: >> Yes, I came here for the "algorithm" question, not the code result. > > To turn BCD x to binary integer y, > > set y to zero > for each nibble n of x: > y = (((y shifted left 2) + y) shifted left 1) + n > > Do you need instruction

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

2006-07-31 Thread Terry Reedy
"Ben Sizer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >As for PyGame, it's > good that development there has picked up again but I'd love to see it > broaden its horizons beyond SDL. Maybe that is impractical, however. By wrapping SDL and interfacing to Numeric, Pete Shinners p

Re: Using Python for my web site

2006-07-31 Thread Bruno Desthuilliers
northband wrote: > Hi, I am interested in re-writing my website in Python vs PHP but have > a few questions. Here are my specs, please advise as to which > configuration would be best: > > 1.Dell Poweredge Server, w/IIS, currently Windows but considering > FreeBSD I may be a bit biased, but I wou

running an app as user "foo"

2006-07-31 Thread bruce
hi. within python, what's the best way to automatically spawn an app as a given user/group. i'm testing an app, and i'm going to need to assign the app to a given user/group, as well as assign it certain access rights/modes (rwx) i then want to copy the test app to a given dir, and then spawn a p

Abstract the storage of an app

2006-07-31 Thread Panos Laganakos
Hello, I'm trying to think of an OO way to abstract the storage of an application I am working on. The classes are (example): FamilyMember (base class) Family (container class) I've been thinking of using a FamilyDoc class to interface the Family container class to a storage location (particula

Re: how to make python socket server work with the app.MainLoop() in wxpython?

2006-07-31 Thread Vincent
I think you should use thread. I just write a similar program using thread. It works well You can try it, good luck! -- http://mail.python.org/mailman/listinfo/python-list

Problem with using unittest module

2006-07-31 Thread Olivier Langlois
Hi, I have the following statement in my test : self.assertRaises(CDKeyException, ValidationObject.Validate, 1001,'NonExistantKey') and the test fails as if assertRaises was not catching the thrown exception: == ERROR: test (DB

Re: trouble understanding super()

2006-07-31 Thread John Salerno
Simon Forman wrote: > In this case the object's (instance of D) mro will be (D, B, C, A, > object), so as super gets called in each class, it looks in that list > (tuple, whatever) for the class following it (actually the next class > following it that implements the method). > > Since no class a

Re: trouble understanding super()

2006-07-31 Thread Duncan Booth
John Salerno wrote: > But after super(D, self).met() is called, doesn't that then call both > super(B, self).met() and super(C, self).met()? If so, how does that > avoid calling A.met twice? Or is that not what's happening? If you have an instance of a B then super(B,self).met() will call A.met

Re: Using Python for my web site

2006-07-31 Thread northband
Thanks for the info. Reason why we are interested in PSP is because we think our developers would be able to quickly adapt to the migration, they are familiar with php and asp. I agree on the windows webserver, we are looking into using FreeBSD instead. What would postgre's advantage over MySQL

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

2006-07-31 Thread Bruno Desthuilliers
Vincent Delporte wrote: > On 31 Jul 2006 07:05:27 -0700, "Ben Sizer" <[EMAIL PROTECTED]> wrote: >> Typically you run PHP as a module in your webserver, so there should be >> no process startup overhead. mod_python provides the same sort of >> functionality for Python, but is not as popular or widel

Python Docs Fix

2006-07-31 Thread Terry Reedy
A month ago, someone posted, under Python Docs Bugs, a complaint about the difficulty of finding the library ref sub-subsection on string methods. "That's because it is section 2.3.6.1, and the table of contents only goes to 3 levels." I followed up the me-to's with an SF bug-report suggesting

Re: trouble understanding super()

2006-07-31 Thread John Salerno
Duncan Booth wrote: > John Salerno wrote: > >> But after super(D, self).met() is called, doesn't that then call both >> super(B, self).met() and super(C, self).met()? If so, how does that >> avoid calling A.met twice? Or is that not what's happening? > > If you have an instance of a B then supe

Re: Nested function scope problem

2006-07-31 Thread Antoon Pardon
On 2006-07-30, Gerhard Fiedler <[EMAIL PROTECTED]> wrote: > On 2006-07-30 12:45:50, Antoon Pardon wrote: > >>> [...] we'd have to use a common definition of "variable". This is a term >>> so widely used that I'm not sure there is a useful single definition of >>> it; do you know one? >> >> A name

Re: Using Python for my web site

2006-07-31 Thread Bruno Desthuilliers
northband wrote: > Thanks for the info. Reason why we are interested in PSP is because we > think our developers would be able to quickly adapt to the migration, > they are familiar with php and asp. Yes, I guessed it had do to with something like this. OTOH, the ServerPage model can quickly lead

Re: getting debug from urllib2

2006-07-31 Thread Peter Otten
Ben Edwards wrote: > Have been experimenting with HTTP stuff in python 2.4 and am having a > problem getting debug info. If I use utllib.utlopen I get debug but if I > user utllib2 I do not. Below is the probram and the output I am > getting. > > Any insight? Use the source :-) urllib2.build_

Re: pass parameters in SPYCE

2006-07-31 Thread Jonathan Ellis
kepioo wrote: > Hi all, > > I started to use the so good spyce server. I manage to do all the > basics, however, I still block on one problem : > > How can I pass parameters to a spy page : example > > I have an index page : > > link1 > link2 > link3 > link4 > > I want all theses html links to poin

Re: gaierror: (8, 'hostname nor servname provided, or not known')

2006-07-31 Thread faulkner
my boss has a similar problem with his home internet connection in general. he traced it back to his router, which was in the first couple generations of routers. how old are the routers you tested this on? aside from upgrading them, if they are the problem, i can suggest a workaround. the first ti

Megawidget Syntax (Tix)

2006-07-31 Thread Al in Dallas
I'm new to Python*. I am having trouble with the Tix NoteBook megawidget. When I use a simpler megawidget, such as a ButtonBox, I can add buttons by invoking .add ('button3', text='Retry') Unfortunately, with the Notebook, I need access to a subwidget, and all my attempts have led to error messag

Working with Widget after Instance loses the reference

2006-07-31 Thread Al in Dallas
I made the mistake of creating an instance of a widget and assigning it to a name I'd already used. Now, if I use root.children or root.slaves(), I can see the "lost" widget, but can I do anything else with the string of numbers that shows up when I use root.children? I'd like to destory the widget

Re: Problem with using unittest module

2006-07-31 Thread Peter Otten
Olivier Langlois wrote: > I have the following statement in my test : > > self.assertRaises(CDKeyException, ValidationObject.Validate, > 1001,'NonExistantKey') > > and the test fails as if assertRaises was not catching the thrown > exception: > >

Re: Nested function scope problem

2006-07-31 Thread Bruno Desthuilliers
Antoon Pardon wrote: (snip) > Sure it is usefull. It may be not 100% formally correct, but often > things that are not 100% formally correct can be better in bringing > an idea accross. hear hear... And yet you still fail to understand why I claimed Python didn't have variables ? Talk about stubb

  1   2   3   >