Re: cfgparse v01_00 released

2005-02-01 Thread dan . gass
> I like this, its really nice that it fits well with optparse. Thanks. > I read through the docs, mostly it seems very logical, the following > things stood out to me as not really fitting: > > http://cfgparse.sourceforge.net/cfgparse-round-trip-set.html > It doesn't seem logical that in order t

Re: How do you do arrays

2005-02-01 Thread Kartic
Tom, Before you use iMatrix[index], you have to tell python to use iMatrix as an array. You will do that using iMatrix = [] *outside* the loop. iMatrix = [] while index < majorlop1: # rest of the loop statements Since you are new, please take a look at the Python tutorial to get you started. htt

Re: How do you do arrays

2005-02-01 Thread Kartic
and it is called a "List" in Python parlance. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you do arrays

2005-02-01 Thread Sean Blakey
On Tue, 01 Feb 2005 10:52:45 -0800, Thomas Bunce <[EMAIL PROTECTED]> wrote: > I am new at Pyton and I am learning from book not classes > so please forgive my being slow > > The below does not work I get an Error of File > "Matrix[index] = k > NameError: name 'iMatrix' is not defined" > > while

Re: variable declaration

2005-02-01 Thread Nick Vargish
[EMAIL PROTECTED] (Aahz) writes: > It's kind of like having a guy who juggles chainsaws wearing body armor > arguing with a guy who juggles rubber chickens wearing a T-shirt about who's > in more danger." --Roy Smith, c.l.py, 2004.05.23 If it's Nethack, the guy in the T-shirt is in more danger

Re: How do you do arrays

2005-02-01 Thread wes weston
Thomas Bunce wrote: I am new at Pyton and I am learning from book not classes so please forgive my being slow The below does not work I get an Error of File "Matrix[index] = k NameError: name 'iMatrix' is not defined" while index < majorlop1: index = index + 1 k = random.choice(listvalues

Printing Filenames with non-Ascii-Characters

2005-02-01 Thread Marian Aldenhövel
Hi, I am very new to Python and have run into the following problem. If I do something like dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain non-ascii characters. 'ascii' codec can't encode characters in position 33-34: I have

(no subject)

2005-02-01 Thread Dan Smyth
Hey,   I'm trying to compile python 2.4 on an SGI machine.  The configure program shot back this error and told me to post it to the Python lists.  Anyone know what's going on?   configure: WARNING: stropts.h: present but cannot be compiledconfigure: WARNING: stropts.h: check for missing

Re: How do you do arrays

2005-02-01 Thread Kartic
Tom, It has to be iMatrix.append(k), not iMatrix[index] = k. Python will give an error - list assignment index out of range - for that. Just curious - what book are you following? -Kartic -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's idiom for function overloads

2005-02-01 Thread Frans Englich
On Tuesday 01 February 2005 05:02, Steven Bethard wrote: > Frans Englich wrote: > > But in Python, when one wants to be able to pass different data types > > into a single "entry point" for functionality, how is that best done? To > > in a function do an if statement with the type() function? > > I

Nokia Chooses Python

2005-02-01 Thread Tim Daneliuk
http://press.nokia.com/PR/200501/978226_5.html -- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing Filenames with non-Ascii-Characters

2005-02-01 Thread aurora
On Tue, 01 Feb 2005 20:28:11 +0100, Marian Aldenhövel <[EMAIL PROTECTED]> wrote: Hi, I am very new to Python and have run into the following problem. If I do something like dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain

Re: The next Xah-lee post contest

2005-02-01 Thread Peter Hansen
Luis M. Gonzalez wrote: Peter Hansen wrote: Arthur wrote: And the rules of the game, if he shows? Arthur, if Xah Lee shows up at Pycon, he most definitely will not be giving the best impression... Have you visited his website? I kind of like this guy... it's like he has a few bugs in his brain, but

Re: How do you do arrays

2005-02-01 Thread Thomas Bunce
Thanks all Tom -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you do arrays

2005-02-01 Thread beliavsky
If you want do numerical calculations with vectors and matrices, you should probably use the Numarray module. Python's built-in lists are not intended for heavy numerical computations. They are more flexible than the arrays in languages like C and Fortran in that they can store elements of differen

Re: Next step after pychecker

2005-02-01 Thread Francis Girard
Hi, I do not want to discourage Philippe Fremy but I think that this would be very very difficult to do without modifying Python itself. What FP languages rely upon to achieve type inference is a feature named "strong typing". A clear definition of strong typing is : "Every well-formed express

Re: Printing Filenames with non-Ascii-Characters

2005-02-01 Thread Serge Orlov
Marian Aldenhövel wrote: > Hi, > > I am very new to Python and have run into the following problem. If I do > something like > >dir = os.listdir(somepath) >for d in dir: > print d > > The program fails for filenames that contain non-ascii characters. > >'ascii' codec can't encode

Re: How do you do arrays

2005-02-01 Thread Thomas Bunce
Tryed it and this is what I got (I did go to the web sight) tom(h=500)$ /tmp/501/Cleanup\ At\ Startup/ptesting-128981347.87.py.command; exit Input the maximu number of tvalue: 114 Traceback (most recent call last): File "/Users/tom/Desktop/ptesting.py", line 20, in ? iMatrix[index] = k Index

Re: Python's idiom for function overloads

2005-02-01 Thread Jorgen Grahn
On Tue, 1 Feb 2005 04:17:10 +, Frans Englich <[EMAIL PROTECTED]> wrote: ... > But in Python, when one wants to be able to pass different data types into a > single "entry point" for functionality, how is that best done? To in a > function do an if statement with the type() function? Have a

Re: Awkwardness of C API for making tuples

2005-02-01 Thread John Machin
Dave Opstad wrote: > One of the functions in a C extension I'm writing needs to return a > tuple of integers, where the length of the tuple is only known at > runtime. I'm currently doing a loop calling PyInt_FromLong to make the > integers, What is the purpose of this first loop? In what variabl

Re: msvcp71.dll and Python 2.4 C++ extensions

2005-02-01 Thread Matthias Baas
On Tue, 01 Feb 2005 00:14:30 +0100, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> are there any guidelines about what to do if a Windows extension for >> Python 2.4 requires the C++ runtime (msvcp71.dll)? > >No; it should "just work fine". [...] I fully agree with that. :) And that was actuall

Re: Where are list methods documented?

2005-02-01 Thread Nick Craig-Wood
Tim Peters <[EMAIL PROTECTED]> wrote: > You could have gotten to the same place in several ways. [snip] Since I'm a unix person, I would have typed pydoc -k sort But it doesn't come up with anything useful :-( $ pydoc -k sort MySQLdb.stringtimes - Use strings to handle date and time colu

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread Jorgen Grahn
On 31 Jan 2005 23:11:58 -0800, Sridhar <[EMAIL PROTECTED]> wrote: > Hi, > > I am doing my undergrade CS course. I am in the final year, and would > like to do my project involving Python. Our instructors require the > project to have novel ideas. Can the c.l.p people shed light on this > topic?

Re: How do you do arrays

2005-02-01 Thread wes weston
Thomas, If you were allowed to do what you're doing, the list first element would be getting skipped as "index" is always > 0. The thing is, you don't want the "index" var at all for adding to the list; just do jMatrix.append(k). You can iterate over the list with for x in jMatrix: print x

Re: variable declaration

2005-02-01 Thread Michael Tobis
> All in all, I fail to see what gains would be expected by making Python > into a single-assignment or single-binding language, even on a module by > module basis, to repay this kind of awkwardness. Just to be clear, if anyone was suggesting that, it wasn't me. It would be helpful on occasion in

Re: Next step after pychecker [StarKiller?]

2005-02-01 Thread Francis Girard
Hi, Do you have some more pointers to the StarKiller project ? According to the paper some implementation of this very interesting project exists. Thank you Francis Girard Le mardi 1 Février 2005 11:21, Sylvain Thenault a écrit : > On Tue, 01 Feb 2005 05:18:12 +0100, Philippe Fremy wrote: > >

[perl-python] string pattern matching

2005-02-01 Thread Xah Lee
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images files from gif # format to png format. Now you need to change the # html code to use the .png files. So, ess

Re: a sequence question

2005-02-01 Thread todddeluca
Chris Wright wrote: > Hi, > > 1) I want to iterate over a list "N at a time" > sort of like: > > # Two at a time... won't work, obviously > > >>> for a, b in [1,2,3,4]: > ... print a,b > ... > Traceback (most recent call last): >File "", line 1, in ? > TypeError: unpack non-sequence > >>>

Re: How do you do arrays

2005-02-01 Thread beliavsky
wes weston wrote: > Thomas, > If you were allowed to do what you're doing, the > list first element would be getting skipped as "index" > is always > 0. The thing is, you don't want the "index" > var at all for adding to the list; just do jMatrix.append(k). > You can iterate over the list w

Re: variable declaration

2005-02-01 Thread Christian Dieterich
On Dé Máirt, Feabh 1, 2005, at 12:19 America/Chicago, Alex Martelli wrote: Michael Tobis <[EMAIL PROTECTED]> wrote: ... I don't know that it's ever necessary to rebind, but it is, in fact, common, and perhaps too easy. In numeric Python, avoiding rebinding turns out to be a nontrivial skill. W

Re: variable declaration

2005-02-01 Thread Thomas Bartkus
"Michael Tobis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Since I'm very much a believer in Python as a beginner's language, that > doesn't satisfy me. "Declarations are impractical" would satisfy me, > but so far I'm not completely convinced of that. > As has been pointed out

Re: How do you do arrays

2005-02-01 Thread Kartic
Tom - I answered your question even before you posted it! You have to use iMatrix.append(k) and NOT iMatrix[index] = k. Also, what do you expect out of: while index < majorlop1: print '- %s %s' % ( iMatrix[index], sep) This loop will never get executed because your previous loop finishes due to

Re: Printing Filenames with non-Ascii-Characters

2005-02-01 Thread vincent wehren
Marian Aldenhövel wrote: Hi, I am very new to Python and have run into the following problem. If I do something like dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain non-ascii characters. 'ascii' codec can't encode characters in

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread Lucas Raab
Paul Robson wrote: On Tue, 01 Feb 2005 12:11:47 +, Kartic wrote: Sridhar said the following on 2/1/2005 2:11 AM: Hi, I am doing my undergrade CS course. I am in the final year, and would like to do my project involving Python. Our instructors require the project to have novel ideas. Can the

Re: pythonic equivalent of Mathematica's FixedPoint function

2005-02-01 Thread Russell Blau
"jelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > doh... > > https://sourceforge.net/projects/fixedpoint > > pardon me > I don't think that Tim's FixedPoint class is doing the same thing as Mathematica's FixedPoint function (or even anything remotely similar). Well, except for

Re: Where are list methods documented?

2005-02-01 Thread Timothy Fitz
[Tim Peters] > The methods on mutable sequence types are documented in the Library > manual's section on mutable sequence types: > >http://docs.python.org/lib/typesseq-mutable.html > And like -many- python programmers, when he thinks "List" he doesn't immediately think "Mutable Sequence Type.

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread phil_nospam_schmidt
How about a tool that can compute the intersection/union/disjunction of boolean expressions, and return the result as a boolean expression? This is something I've had on my plate for awhile, but haven't been able to get around to doing. As a simple example, assume we have the following expressions

how about writing some gui to a known console application

2005-02-01 Thread alexrait1
Do something useful... (at least for me) For instance I need a gtk frontend for pgp. So here you can have an opportunity to learn both pyGTK and pgp. A lot of python code... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread alexrait1
How about writing some gtk fronted to pgp.. That might be both useful (at least for me) and teach you about pgp and pyGTK, that is writing gui with python. -- http://mail.python.org/mailman/listinfo/python-list

Re: how about writing some gui to a known console application

2005-02-01 Thread Grant Edwards
On 2005-02-01, alexrait1 <[EMAIL PROTECTED]> wrote: > Do something useful... (at least for me) > For instance I need a gtk frontend for pgp. > So here you can have an opportunity to learn both pyGTK and pgp. A lot > of python code... :) Um, to whom are you addressing your commands? -- Grant Edw

web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread Newbie
I am doing some robotics projects but my main area of interest is trying out several algorithms for the processing of the stream of data coming from the video. I am wondering what type of camera I should invest in. Either I could buy a web cam and hope I can find a driver I could either modify or

Re: Using HTTPSConnection and verifying server's CRT

2005-02-01 Thread Ng Pheng Siong
According to Marc Poulhiès <[EMAIL PROTECTED]>: > Btw, thanks for your answer (this will save me from using Perl!) You're welcome. > ## what are the diff between these two?? > #ctx.load_verify_info(cafile="/tmp/ca.crt") > ctx.load_verify_locations(cafile="/tmp/ca.crt") None. One is an alias for

Re: Crude statistics on the standard library

2005-02-01 Thread IncessantRanting
F. Petitjean wrote: [snip] > Conclusion : > sre_compile and sre_parse should be coded with a __all__ attribute Problem with this is that it would change the API for the two modules. And the main reason for the dependencies is that sre_constants is import-star'ed; same with sre_constants. But ye

RE: Next step after pychecker

2005-02-01 Thread Delaney, Timothy C (Timothy)
huy wrote: > do not yet have good coverage. TDD is a quite hard to practice as a > beginner. It's even harder to bolt onto an existing codebase :( Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you do arrays

2005-02-01 Thread Thomas Bunce
Learning Python O'Reilly book and Python In A Nut Shell and about 2 inchs printed of Web information Tom In article <[EMAIL PROTECTED]>, "Kartic" <[EMAIL PROTECTED]> wrote: > Tom, > > It has to be iMatrix.append(k), not iMatrix[index] = k. Python will > give an error - list assignment in

Re: Redirecting stdout/err under win32 platform

2005-02-01 Thread David Douard
Alan, I did search Google for this problem (not enough, thou). In fact, I found some kind of solution (by myself, not that much on Google), but it is not really satisfactory. I have used win32 pipes to do so (win32api.CreatePipe). I can redirect stdout/stderr to it from my python code (even redir

Re: Next step after pychecker

2005-02-01 Thread John Roth
"Sylvain Thenault" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Tue, 01 Feb 2005 05:18:12 +0100, Philippe Fremy wrote: Did you take a look at the starkiller [1] and pypy projects [2] ? Has anything happened to Starkiller since PyCon 2004? The latest mention I can find on Google i

Re: How do you do arrays

2005-02-01 Thread Thomas Bunce
It was when I saw a use of complex numbers as a usable statement I became interested in Python Tom In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > If you want do numerical calculations with vectors and matrices, you > should probably use the Numarray module. Python's built-i

Re: How do you do arrays

2005-02-01 Thread Dan Perl
A solution that I haven't seen mentioned by other postings in the thread is to implement the array as a dictionary: iMatrix = {} for index in range(majorlop1): k = random.choice(listvalues) + 1 iMatrix[index] = k Mind you, a dictionary does not behave *exactly* like an array. For insta

MySQLdb - Tuples

2005-02-01 Thread Lajos Kuljo
Hallo, ich bin voll neu im Python-Programming, deshalb ist mein Problem wahrscheinlich trivial: Wenn ich die Script #33 #! /usr/bin/env python import MySQLdb db=MySQLdb.connect(host='localhost', db='photum_0_6_2', user='root', passwd='thkhgfgd') c=db.curso

Atlas and NumPy Problems

2005-02-01 Thread Justin Lemkul
Hello all, I am hoping someone out there will be able to help me. I am trying to install a program that utilizes NumPy. In installing NumPy, I realized that I was lacking Atlas. I ran into the following problems installing Atlas and NumPy, as I realized that NumPy could be installed using th

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread The Artist Formerly Known as Kap'n Salty
Newbie wrote: I am doing some robotics projects but my main area of interest is trying out several algorithms for the processing of the stream of data coming from the video. I am wondering what type of camera I should invest in. Either I could buy a web cam and hope I can find a driver I could eith

ftplib help - delete from server after download results in 0-byte file

2005-02-01 Thread Peter A.Schott
Got a strange scenario going on here in that I could have sworn this worked yesterday. I am issuing binary retrieval calls to an FTP server, writing to a file, close the file, then removing the file from the remote site. When I do this, I end up with 0 byte files. I was hoping to avoid parsing a

Re: MySQLdb - Tuples

2005-02-01 Thread Dennis Benzinger
Lajos Kuljo wrote: > Hallo, > ich bin voll neu im Python-Programming, deshalb ist mein Problem > wahrscheinlich trivial: > > Wenn ich die Script > #33 > #! /usr/bin/env python > import MySQLdb > db=MySQLdb.connect(host='localhost', db='photum_0_6_2', user='

Re: how about writing some gui to a known console application

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 21:57:45 +, Grant Edwards wrote: > On 2005-02-01, alexrait1 <[EMAIL PROTECTED]> wrote: > >> Do something useful... (at least for me) For instance I need a gtk >> frontend for pgp. So here you can have an opportunity to learn both >> pyGTK and pgp. A lot of python code... :

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread Matt D
Newbie wrote: I am doing some robotics projects but my main area of interest is trying out several algorithms for the processing of the stream of data coming from the video. Same for me! From what I can tell, a cheap webcam will "just work" with a recent version of windows - i.e. plug it in usin

Re: [perl-python] string pattern matching

2005-02-01 Thread Daniel Fackrell
Perhaps a message to the effect of "These messages are specifically disowned by the groups to which they are posted, have historically been riddled with blatant errors, and are assumed to continue in the same quality." should be posted as a follow-up to each of these messages by XL in order to avoi

Re: Next step after pychecker

2005-02-01 Thread Philippe Fremy
I do not want to discourage Philippe Fremy but I think that this would be very very difficult to do without modifying Python itself. That's the conclusion I reached to too after lurking on the ocaml list. What FP languages rely upon to achieve type inference is a feature named "strong typing".

Re: how about writing some gui to a known console application

2005-02-01 Thread alexrait1
I tried to delete this message, but I guess it was too late... or it didn't work for me... sorry anyway. -- http://mail.python.org/mailman/listinfo/python-list

Re: Awkwardness of C API for making tuples

2005-02-01 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, "John Machin" <[EMAIL PROTECTED]> wrote: > What is the purpose of this first loop? Error handling. If I can't successfully create all the PyInts then I can dispose the ones I've made and not bother making the tuple at all. > > In what variable-length storage are

permutations, patterns, and probability

2005-02-01 Thread kpp9c
Greetings, I am working on a program to produce patterns. What would like is for it to exhaustively produce all possible permutations of a sequence of items but for each permutation produce variations, and also a sort of stutter based on probability / weighted randomess. Let us say we have tiles

Re: [perl-python] string pattern matching

2005-02-01 Thread Dan Perl
Perhaps someone will write a program to automatically follow up on every [perl-python] posting? The follow-up could just contain a statement like the one Daniel mentions. Obviously the program would be written in python. ;-) Any suggestions on how to implement such a program? How would it de

Re: [perl-python] string pattern matching

2005-02-01 Thread Stephen Thorne
On Tue, 1 Feb 2005 18:59:18 -0500, Dan Perl <[EMAIL PROTECTED]> wrote: > Perhaps someone will write a program to automatically follow up on every > [perl-python] posting? The follow-up could just contain a statement like > the one Daniel mentions. Obviously the program would be written in python.

Re: [perl-python] string pattern matching

2005-02-01 Thread Erik Max Francis
Dan Perl wrote: Perhaps someone will write a program to automatically follow up on every [perl-python] posting? The follow-up could just contain a statement like the one Daniel mentions. Obviously the program would be written in python. ;-) I'm not really sure that such a disclaimer is explici

Save the Canvas!

2005-02-01 Thread Sean McIlroy
I'd like to be able to save a Tkinter Canvas in a format other than postscript (preferably gif). Is there a tool out there for accomplishing that? Any help will be much appreciated. Peace, STM -- http://mail.python.org/mailman/listinfo/python-list

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread JGCASEY
The Artist Formerly Known as Kap'n Salty wrote: > Newbie wrote: > > I am doing some robotics projects but my main area of interest is > > trying out several algorithms for the processing of the stream of data > > coming from the video. > > > > I am wondering what type of camera I should invest in.

Re: Awkwardness of C API for making tuples

2005-02-01 Thread John Machin
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > "John Machin" <[EMAIL PROTECTED]> wrote: > > > What is the purpose of this first loop? > > Error handling. If I can't successfully create all the PyInts then I can > dispose the ones I've made and not bother making the tuple at all. > > > > I

Re: How do you do arrays

2005-02-01 Thread Thomas Bunce
Thanks Tom In article <[EMAIL PROTECTED]>, "Dan Perl" <[EMAIL PROTECTED]> wrote: > A solution that I haven't seen mentioned by other postings in the thread is > to implement the array as a dictionary: > > iMatrix = {} > for index in range(majorlop1): > k = random.choice(listvalues) + 1 >

Re: permutations, patterns, and probability

2005-02-01 Thread Steven Bethard
kpp9c wrote: Greetings, I am working on a program to produce patterns. What would like is for it to exhaustively produce all possible permutations of a sequence of items but for each permutation produce variations, and also a sort of stutter based on probability / weighted randomess. Let us say we

Re: MySQLdb - Tuples

2005-02-01 Thread Lajos Kuljo
Dennis Benzinger wrote: Lajos Kuljo wrote: Hallo, ich bin voll neu im Python-Programming, deshalb ist mein Problem wahrscheinlich trivial: Wenn ich die Script #33 #! /usr/bin/env python import MySQLdb db=MySQLdb.connect(host='localhost', db='photum_0_6_2',

Re: Atlas and NumPy Problems

2005-02-01 Thread Robert Kern
Justin Lemkul wrote: Hello all, I am hoping someone out there will be able to help me. I am trying to install a program that utilizes NumPy. In installing NumPy, I realized that I was lacking Atlas. I ran into the following problems installing Atlas and NumPy, as I realized that NumPy could b

Re: The next Xah-lee post contest

2005-02-01 Thread alex23
Luis M. Gonzalez wrote: > I kind of like this guy... it's like he has a few bugs in his brain, > but other parts are surprisingly interesting. Which bits especially impress you, the rampant misogyny or the unwarranted intellectual arrogance? -- http://mail.python.org/mailman/listinfo/python-lis

Re: how do i create such a thing?

2005-02-01 Thread Lowell Kirsh
I'm not sure I get it. What's the purpose of using a delegate rather than having the object itself supply the return value? Alex Martelli wrote: Lowell Kirsh <[EMAIL PROTECTED]> wrote: What might these exceptions be? It's HIGHLY advisable to have your __getattr__ methods raise AttributeError fo

Newbie Question

2005-02-01 Thread Joel Eusebio
Hi Everybody, I'm pretty new to Python and would like to ask a few questions. I have this setup on a Fedora Core 3 box. Python 2.3.4 wxPython-common-gtk-ansi-2.5.3.1-fc2_py2.3 mod_python-3.1.3-5 Apache/2.0.52 I have a test.py which looks like this: from mod_python import apache def handler(req)

Re: variable declaration

2005-02-01 Thread Steve Holden
Thomas Bartkus wrote: "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thomas Bartkus wrote: "Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] How common is it for a local variable to be bound in more than one place within a function? How common?

Re: Newbie Question

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 17:47:39 -0800, Joel Eusebio wrote: > Whenever I access test.py from my browser it says "The page cannot be > found" , I have the file on /var/www/html, what did I miss? > > Thanks in advance, > Joel In general, you will need to post the relevant entries from your Apache erro

curl and popen2

2005-02-01 Thread lists04
Hi, I have a problem with a curl request and running it under popen2. If I run this request from the command line: curl -i http://www.yahoo.com/test --stderr errfile (also tried redirecting stdderr to a file 2>, nothing) the file errfile is empty indicating no error with the request. However, wh

Re: how do i create such a thing?

2005-02-01 Thread Steve Holden
Lowell Kirsh wrote: I'm not sure I get it. What's the purpose of using a delegate rather than having the object itself supply the return value? Alex Martelli wrote: Lowell Kirsh <[EMAIL PROTECTED]> wrote: What might these exceptions be? It's HIGHLY advisable to have your __getattr__ methods rai

Re: Where are list methods documented?

2005-02-01 Thread Nick Coghlan
Tim Peters wrote: 2. Built-In Objects 2.1 Built-in Functions 2.2 Non-essential Built-in Functions 2.3 Built-in Types 2.3.1 Truth Value Testing 2.3.2 Boolean Operations 2.3.3 Comparisons 2.3.4 Numeric Types 2.3.5 Iterator Types 2.3

Re: [perl-python] string pattern matching

2005-02-01 Thread Chris Smith
> Stephen Thorne <[EMAIL PROTECTED]> writes: > On Tue, 1 Feb 2005 18:59:18 -0500, Dan Perl <[EMAIL PROTECTED]> wrote: >> Perhaps someone will write a program to automatically follow up >> on every [perl-python] posting? The follow-up could just >> contain a statement like the

Re: [perl-python] string pattern matching

2005-02-01 Thread Stephen Thorne
On Tue, 01 Feb 2005 21:19:34 -0500, Chris Smith <[EMAIL PROTECTED]> wrote: > Falls into the 'cure worse than the disease' category. > It's really just a prompt to explore the corners of Gnus, and > determine how to give X.L. the thorough ignoring he deserves. *headdesk* I'm using gmail, and I can

Re: [perl-python] string pattern matching

2005-02-01 Thread Daniel Fackrell
- Henry Wadsworth Longfellow "Erik Max Francis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: > > > Perhaps someone will write a program to automatically follow up on every > > [perl-python] posting? The follow-up could just contain a statement like > > the one Dani

Python checkin driver version on windows

2005-02-01 Thread Chris Jameyson
Is there a way to check driver version information on windows through Python? I'd like to pull driver version, digital sig from the same place that 'device manager' gets it's information. I tried using file system object, but seems like GetFileVersion() from version.dll only extracts versions

Re: test_socket.py failure

2005-02-01 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: At the interactive python prompt i did/got the following: bash-2.04$ ./python Python 2.4 (#1, Jan 29 2005, 10:31:35) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> sock

Re: a sequence question

2005-02-01 Thread Nick Coghlan
Steven Bethard wrote: I think you can write that second one so that it works for iterables without a __len__: py> def padded_partition(iterable, part_len, pad_val=None): ... itr = itertools.chain( ... iter(iterable), itertools.repeat(pad_val, part_len - 1)) ... return itertools.iz

Re: Where are list methods documented?

2005-02-01 Thread Skip Montanaro
Grant> where are the methods of basic types documented? The other day I suggested the most valuable doc page to bookmark is the global module index. Here's a demonstration. Start at: http://www.python.org/dev/doc/devel/modindex.html Click "__builtin__", which takes you to http:

Re: [perl-python] string pattern matching

2005-02-01 Thread Erik Max Francis
Daniel Fackrell wrote: It seems to me that application of one of these solutions reduces the effectiveness of the other. If enough persons killfile the threads, who warns the newbies? And so those who don't killfile the threads to ensure that somebody is still guarding against misleading informat

Re: Next step after pychecker

2005-02-01 Thread Skip Montanaro
Francis> "Every well-formed expression of the language can be assigned a Francis> type that can be deduced from the constituents of the Francis> expression alone." Bird and Wadler, Introduction to Functional Francis> Programming, 1988 Francis> This is certainly not the case fo

Re: Next step after pychecker

2005-02-01 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I don't know much about what pychecker does, but if it works with the > bytecode, shouldn't it be fine for jython and IronPython? I thought the > bytecode was part of the language spec, and what was CPython specific

RE: getting data from a port in use

2005-02-01 Thread Dana Marcusanu
--- Tony Meyer <[EMAIL PROTECTED]> wrote: > > I am trying to use Python to get the data received at a > > specific port (in use) on my computer. I already tried below > > code which seems to hang at the statement accepting > > connections. > > Seems to hang, or does hang? Using print statemen

RE: getting data from a port in use

2005-02-01 Thread Dana Marcusanu
Yes. It hangs at accept. I always end up doing end task because it never passes the "accept" statement. When I set the port I use netstat (netstat -bn) to get the ports that are in use. I use PythonWin 2.4. I am still puzzled about the fact that it runs fine for you. You are right about using the w

hotspot profiler experience and accuracy?

2005-02-01 Thread aurora
I have a parser I need to optimize. It has some disk IO and a lot of looping over characters. I used the hotspot profiler to gain insight on optimization options. The methods show up on on the top of this list seems fairly trivial and does not look like CPU hogger. Nevertheless I optimized i

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread Terry Reedy
"Sridhar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am doing my undergrade CS course. I am in the final year, and would > like to do my project involving Python. Our instructors require the > project to have novel ideas. Can the c.l.p people shed light on this > t

getting data from a port in use

2005-02-01 Thread Dana Marcusanu
Yes. I want to write a very small web sniffer that gets data from a specified port. I already looked at some of the existing ones on Internet, but they are not in Python (I am trying to learn Python!) and they have a lot more features that I want. Thanks for your suggestion. I will check out pcap l

RE: getting data from a port in use

2005-02-01 Thread Tony Meyer
>>> I am trying to use Python to get the data received at a >>> specific port (in use) on my computer. I already tried below >>> code which seems to hang at the statement accepting >>> connections. > > Yes. It hangs at accept. I always end up doing end task > because it never passes the "accept"

Re: Where are list methods documented?

2005-02-01 Thread Hans Nowak
Nick Craig-Wood wrote: Since I'm a unix person, I would have typed pydoc -k sort But it doesn't come up with anything useful :-( FYI, you can get this info using the not-very-intuitive pydoc __builtin__.list.sort e.g. (C:\Python23\Lib) $ pydoc __builtin__.list.sort Help on method_descriptor in

Re: getting data from a port in use

2005-02-01 Thread Grant Edwards
On 2005-02-02, Dana Marcusanu <[EMAIL PROTECTED]> wrote: > Yes. It hangs at accept. I always end up doing end task > because it never passes the "accept" statement. And you're sure that somebody tries to initiate a connection after your program has gotten to the accept() line? > When I set the

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread M.E.Farmer
JGCASEY wrote: > The Artist Formerly Known as Kap'n Salty wrote: > > Newbie wrote: > > > I am doing some robotics projects but my main area of interest is > > > trying out several algorithms for the processing of the stream of > data > > > coming from the video. > > > > > > I am wondering what type

Re: getting data from a port in use

2005-02-01 Thread Grant Edwards
On 2005-02-02, Dana Marcusanu <[EMAIL PROTECTED]> wrote: > Yes. I want to write a very small web sniffer that gets data > from a specified port. OK, know we know what you're actually trying to do. You should have told us that to start with rather than leading us down the wrong path with your lit

Re: Next step after pychecker

2005-02-01 Thread Steven Bethard
Terry Reedy wrote: > Nothing about bytecode is part of the language spec. And CPython > bytecode is version specific. If the CPython implementation changed > from a virtual stack machine to a virtual register machine, as was > once discussed, the stack-oriented byte code would be replaced by a >

<    1   2   3   >