multiple file deletes using ftp.delete

2007-01-19 Thread Drew
Hi all I'm fairly new to python so please forgive my lack of comprehension of the obvious. I'm writing a script to ftp files to a server. This script will run weekly. Part of the script first deletes the previous weeks files. The problem is I'm never sure of the exact number and full name of the f

Re: OT Annoying Habits

2007-01-19 Thread Ben Finney
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > > > .snoitnevnoc > > hsilgnE tpada )ylbissop revenehw( dluohs ew os dna ,naitraM ton ,puorgswen > > egaugnal hsilgnE na no er'ew ,segaugnal hcus era ereht fi neve tuB > > First I thought it was Welsh

Re: Code reformater?

2007-01-19 Thread Ben Finney
Vincent Delporte <[EMAIL PROTECTED]> writes: > When I copy/paste Python code from the web, every so often, the TABs > are wrong, which means that the code won't work and I have to > manually reformat the code. > > Is there a code reformater that can parse the code to make it right? Indentation is

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > Or perhaps I should say: > > .snoitnevnoc > hsilgnE tpada )ylbissop revenehw( dluohs ew os dna ,naitraM ton ,puorgswen > egaugnal hsilgnE na no er'ew ,segaugnal hcus era ereht fi neve tuB First I thought it was Welsh or Cornish or something. Then i

Re: confused on python rpc with apache, is it possible?

2007-01-19 Thread Ravi Teja
krishnakant Mane wrote: > On 19/01/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > > I'm unclear why you want the apache in there in the first place. Why don't > > you just create an e.g. twisted-based XMLRPC-server, and simply let that > > run? What is the apache intended for? > > > twisted

Re: Match 2 words in a line of file

2007-01-19 Thread Rickard Lindberg
Daniel Klein wrote: > 2) This can be resolved with > > templine = ' ' + line + ' ' > if ' ' + word1 + ' ' in templine and ' ' + word2 + ' ' in templine: But then you will still have a problem to match the word "foo" in a string like "bar (foo)". -- http://mail.python.org/mailman/listinfo/python

How to implement recording scripts of operating IE as loadrunner?

2007-01-19 Thread 尹祥龙
hello all. I intend to implement recording scripts of operating IE as the function of loadrunner. How can I implement in python. Any suggestions would be appreciated. XiangLong -- http://mail.python.org/mailman/listinfo/python-list

Code reformater?

2007-01-19 Thread Vincent Delporte
Hello When I copy/paste Python code from the web, every so often, the TABs are wrong, which means that the code won't work and I have to manually reformat the code. Is there a code reformater that can parse the code to make it right? Thanks. -- http://mail.python.org/mailman/listinfo/py

Re: Py 2.5 on Language Shootout

2007-01-19 Thread pgarrone
Isaac Gouy wrote: > [EMAIL PROTECTED] wrote: > > Alioth is a great site for selecting the language in which to implement > > primitives. Usually it's C. > > And for selecting a language for which you might need to implement > primitives in C :-) Well if you like C so much, just do it in C. ":-)"

Re: regexp qns

2007-01-19 Thread Gabriel Genellina
<[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > hi > suppose i have a string like > > test1?test2t-test3*test4*test5$test6#test7*test8 > > how can i construct the regexp to get test3*test4*test5 and > test7*test8, ie, i want to match * and the words before and after? > thanks

Re: confused on python rpc with apache, is it possible?

2007-01-19 Thread krishnakant Mane
On 19/01/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > I'm unclear why you want the apache in there in the first place. Why don't > you just create an e.g. twisted-based XMLRPC-server, and simply let that > run? What is the apache intended for? twisted-based? what is that? what is that. I

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Paul Rubin
"Carroll, Barry" <[EMAIL PROTECTED]> writes: > When I was last a regular Usenet citizen the Internet was new, GUI > interfaces were experimental and the World Wide Web didn't exist yet. > Newsreader software was text-based. Top-posting was the common > practice, because it was the most convenient.

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Ross Ridge
Ross Ridge wrote: > So identifying PDF files is pretty easy. Steven D'Aprano wrote: > Sure. MIS-identifying PDF files is pretty easy. Identifying them is not. > Consider this example: Your contrived example doesn't show how a PDF file would be misidentified, it only shows how a file deliberately

Re: regexp qns

2007-01-19 Thread eight02645999
James Stroud wrote: > [EMAIL PROTECTED] wrote: > > hi > > suppose i have a string like > > > > test1?test2t-test3*test4*test5$test6#test7*test8 > > > > how can i construct the regexp to get test3*test4*test5 and > > test7*test8, ie, i want to match * and the words before and after? > > thanks > > >

Re: regexp qns

2007-01-19 Thread James Stroud
[EMAIL PROTECTED] wrote: > hi > suppose i have a string like > > test1?test2t-test3*test4*test5$test6#test7*test8 > > how can i construct the regexp to get test3*test4*test5 and > test7*test8, ie, i want to match * and the words before and after? > thanks > py> import re py> s = 'test1?test2t-

regexp qns

2007-01-19 Thread eight02645999
hi suppose i have a string like test1?test2t-test3*test4*test5$test6#test7*test8 how can i construct the regexp to get test3*test4*test5 and test7*test8, ie, i want to match * and the words before and after? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 12:48:14 -0800, Ross Ridge wrote: > tubby wrote: >> Now, If only I could something like that on PDF files :) > > PDF files should begin with "%PDF-" followed by a version number, eg. > "%PDF-1.4". The PDF Reference notes that Adobe Acrobat Reader is a bit > more flexiable abo

Re: Py 2.5 on Language Shootout

2007-01-19 Thread Isaac Gouy
[EMAIL PROTECTED] wrote: > Alioth is a great site for selecting the language in which to implement > primitives. Usually it's C. And for selecting a language for which you might need to implement primitives in C :-) > > Two of the alioth benchmarks, Partial-sums and Spectral-norm, could be > don

Re: **argv can't work

2007-01-19 Thread Jm lists
Thanks for all the kind helps! 2007/1/20, Parthan SR <[EMAIL PROTECTED]>: > > > On 1/20/07, Jm lists <[EMAIL PROTECTED]> wrote: > > hello members, > > > > See my script piece below: > > > > def testB(shift,**argv): > > print "first argument is %s" %shift > > print "all other arguments are:

Re: **argv can't work

2007-01-19 Thread Parthan SR
On 1/20/07, Jm lists <[EMAIL PROTECTED]> wrote: hello members, See my script piece below: def testB(shift,**argv): print "first argument is %s" %shift print "all other arguments are:",argv testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]') It can't work at all.please

Re: **argv can't work

2007-01-19 Thread Steven D'Aprano
On Sat, 20 Jan 2007 11:20:29 +0800, Jm lists wrote: > hello members, > > See my script piece below: > > def testB(shift,**argv): > print "first argument is %s" %shift > print "all other arguments are:",argv > > testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]') > > It c

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>OpenSSL version: "OpenSSL 0.9.7a Feb 19 2003" > > > Hmm, I've never actually used that old OpenSSL myself, just assumed from > the original author's notes that anything from 0.9.7 onward worked. > Guess not. I am thinking of changing the require

Re: **argv can't work

2007-01-19 Thread rzed
"Jm lists" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > hello members, > > See my script piece below: > > def testB(shift,**argv): > print "first argument is %s" %shift > print "all other arguments are:",argv > > testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED

**argv can't work

2007-01-19 Thread Jm lists
hello members, See my script piece below: def testB(shift,**argv): print "first argument is %s" %shift print "all other arguments are:",argv testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]') It can't work at all.please help tell me the reasons.thanks. -- http://mail.py

Weekly Python Patch/Bug Summary

2007-01-19 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 423 open ( +2) / 3539 closed ( +9) / 3962 total (+11) Bugs: 960 open ( -3) / 6446 closed (+20) / 7406 total (+17) RFE : 258 open ( +3) / 249 closed ( +3) / 507 total ( +6) New / Reopened Patches __ Add alias

KEEP YOUR MOUTH SHUT Re: Did The Chinese Violate Any Treaties?

2007-01-19 Thread thermate
In this evil regime of George W Bush, you better keep your mouth shut about international treaties. Many more finger will point at you if you even point one finger at others. www.st911.org www.nkusa.org www.counterpunch.org Rand Simberg wrote: > On not making messes in space? My dim understandin

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread gonzlobo
I should write a python script to read this. :) >.snoitnevnoc >hsilgnE tpada )ylbissop revenehw( dluohs ew os dna ,naitraM ton ,puorgswen >egaugnal hsilgnE na no er'ew ,segaugnal hcus era ereht fi neve tuB -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 12:20:26 -0800, Carroll, Barry wrote: > It took me about 3 seconds to realize that Mr. D'Aprano' Q&A session was > laid out bottom-to-top instead of top-to-bottom. After that, it made > perfect sense. Three seconds, compared to about thirty milliseconds if it were written in

Re: Py 2.5 on Language Shootout

2007-01-19 Thread pgarrone
Alioth is a great site for selecting the language in which to implement primitives. Usually it's C. Two of the alioth benchmarks, Partial-sums and Spectral-norm, could be done using Numarray, or would be done with Numarray if most of the program was in Python and there was a need to implement a si

Re: More M2Crypto issues

2007-01-19 Thread Heikki Toivonen
John Nagle wrote: > OpenSSL version: "OpenSSL 0.9.7a Feb 19 2003" Hmm, I've never actually used that old OpenSSL myself, just assumed from the original author's notes that anything from 0.9.7 onward worked. Guess not. I am thinking of changing the requirements to state which one works... I thi

Re: OT Annoying Habits

2007-01-19 Thread Ben Finney
Gabriel Genellina <[EMAIL PROTECTED]> writes: > At Friday 19/1/2007 18:43, Carroll, Barry wrote: > > >Secondly, can someone point me to the Standard Usenet Convention > >that mandates against top-posting. This is not sarcasm; I would > >really like to see it. > > There are some guidelines, like R

Re: float comparison confusion

2007-01-19 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Type "help", "copyright", "credits" or "license" for more information. > >>> cmp(20.10, 20.9) > -1 > > Why is cmp returning -1 instead of returning positive integer? >>> 20.10 < 20.9 True >>> 20.1 < 20.9 True >>> 20.10 == 20.1

nice one

2007-01-19 Thread Raed
Take a break and try this cool game, this test is apporved by Peugeot for car parking http://www.pixelswall.com/Download/peugeot/peugeot.html Anton www.pixelswall.com -- http://mail.python.org/mailman/listinfo/python-list

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Carroll, Barry
> -Original Message- > From: Aahz [mailto:[EMAIL PROTECTED] > Sent: Friday, January 19, 2007 3:29 PM > To: python-list@python.org > Subject: Re: OT Annoying Habits (Was: when format strings attack) > > In article <[EMAIL PROTECTED]>, > Carroll, Barry <[EMAIL PROTECTED]> wrote: > > > >Secon

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>Actually, at the moment I'm having an M2Crypto problem related >>to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an >>include file that needs __i386__ defined, which is something GCC >>does based on what platform you're on. SWIG uses

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 18:43, Carroll, Barry wrote: Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I would really like to see it. There are some guidelines, like RFC 1855 (not a real standard, or enforced in any way): ht

Re: How to comment code?

2007-01-19 Thread gonzlobo
If it's hard to write, it should be hard to read! :) On 1/19/07, Martin P. Hellwig <[EMAIL PROTECTED]> wrote: > Hi all, (snip) > However since I'm learning more of python I've struggled with > commenting, how should I've comment my code (snip) -- http://mail.python.org/mailman/listinfo/python-li

Re: OT Annoying Habits

2007-01-19 Thread Jorge Godoy
"Carroll, Barry" <[EMAIL PROTECTED]> writes: > Secondly, can someone point me to the Standard Usenet Convention that > mandates against top-posting. This is not sarcasm; I would really like You can read RFC 1855. Section 3.1.3 talks about newsgroups. Section 3.1.1 has general guidelines and

Re: float comparison confusion

2007-01-19 Thread skip
chrolson> Why is cmp returning -1 instead of returning positive integer? Last time I checked 20.1 was less than 20.9. Skip -- http://mail.python.org/mailman/listinfo/python-list

float comparison confusion

2007-01-19 Thread [EMAIL PROTECTED]
Type "help", "copyright", "credits" or "license" for more information. >>> cmp(20.10, 20.9) -1 Why is cmp returning -1 instead of returning positive integer? -- http://mail.python.org/mailman/listinfo/python-list

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Again, thank you for your help. With digging through the Asyncore.py source, I was able to find the poll2 function which is called when the function asyncore.loop(use_poll = True) is enabled. This function does not use a select call, but a poll call to do its looping. It works well for the probl

Help with creating processes

2007-01-19 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to create a simple gui wrapper for the handbrake dvd ripper with python 2.4 on a FreeBSD system. My problem is this. I want to scan the dvd to see all the titles and chapters. The handbrake command for this is: handbrake -i /dev/ac

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Carroll, Barry <[EMAIL PROTECTED]> wrote: > >Secondly, can someone point me to the Standard Usenet Convention that >mandates against top-posting. This is not sarcasm; I would really like >to see it. You see, I recently returned to Usenet after a LONG absence. >When

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Jerry Hill
On 1/19/07, Carroll, Barry <[EMAIL PROTECTED]> wrote: > Secondly, can someone point me to the Standard Usenet Convention that > mandates against top-posting. This is not sarcasm; I would really like > to see it. For what (very little) it's worth, see RFC 1855. -- Jerry -- http://mail.python.or

Re: How to comment code?

2007-01-19 Thread Pavel Panchekha
I think that doc strings are the most important way in which you should be commenting on your code. Once the code works, you can elimainate most inline comments, leaving only doc string for everything and a few comments on some particularly confusing parts. Other than that, comments usually only cl

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Robert Marshall
On Fri, 19 Jan 2007, Steven D'Aprano wrote: > On Fri, 19 Jan 2007 12:22:04 +1100, Ben Finney wrote: > >> tubby <[EMAIL PROTECTED]> writes: >> >>> Silly question, but here goes... what's a good way to determine >>> when a file is an Open Office document? I could look at the file >>> extension, bu

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Carroll, Barry" <[EMAIL PROTECTED]> writes: |> |> Secondly, can someone point me to the Standard Usenet Convention that |> mandates against top-posting. This is not sarcasm; I would really like |> to see it. You see, I recently returned to Usenet after a LONG ab

Re: How to comment code?

2007-01-19 Thread James Stroud
Martin P. Hellwig wrote: > Hi all, > > I've been toying with python for about two years now. Not every day, > just when I encounter something in my job (sysadmin) repetitively dull. > The amazing thing is that like any other language (natural or not) > learning it more gives you power to express

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Carroll, Barry
Hello again. First off, Aahz is absolutely right. It is my choice, just as it is his choice what to read and what to ignore. My reply was about the fuss, not the choice. Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Vinay (or anybody else), > > Well, now that logging is working, how do I stop it from working? > > I'm developing in PythonWin. When I run my test script, I get one > message. When I run it a second time, I get two, a third time gets me > three, and so on. > > I feel l

Py 2.5 on Language Shootout

2007-01-19 Thread bearophileHUGS
The The Computer Language Shootout has just published results for Python 2.5 and Psyco 1.5.2. Comparing the old (Python 2.4) Gentoo Pentium 4 results (now not visible anymore) with the new results, I have seen that all the tests with Python 2.5 are faster than the ones with Python 2.4 (some results

How to comment code?

2007-01-19 Thread Martin P. Hellwig
Hi all, I've been toying with python for about two years now. Not every day, just when I encounter something in my job (sysadmin) repetitively dull. The amazing thing is that like any other language (natural or not) learning it more gives you power to express your thoughts better and create som

Re: PyMeld for html templates?

2007-01-19 Thread Richie Hindle
[Sean] > I wonder if anyone has any thoughts on PyMeld as a template > system for churning out general websites? I'm doing that (but then I would be wouldn't I? 8-) http://www.mandant.net is an example - the content of each page comes from a file containing just the content, the layout and sidebar

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Carroll, Barry <[EMAIL PROTECTED]> wrote: > >Personally, I don't think top-posting is the most annoying newsgroup >habit. I think it's making a big fuss about minor inconveniences. =20 Thing is, nobody will ignore your posts for following standard Usenet convention

OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Carroll, Barry
Greetings: Personally, I don't think top-posting is the most annoying newsgroup habit. I think it's making a big fuss about minor inconveniences. One of the nicest things about being human is the amazing flexibility of our brains. For example, if a block of text isn't arranged in the order we

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Ross Ridge
tubby wrote: > Now, If only I could something like that on PDF files :) PDF files should begin with "%PDF-" followed by a version number, eg. "%PDF-1.4". The PDF Reference notes that Adobe Acrobat Reader is a bit more flexiable about what it will accept: 13. Acrobat viewers require only that

ANN: Python Molecular Viewer - 1.4.4

2007-01-19 Thread sargis
We are pleased to announce the release of version 1.4.4 of our software tools including: Python Molecular Viewer (PMV), AutoDockTools (ADT) and VISION a visual-programming environment. Installers for binary distributions are available for LINUX, Mac OS X and Windows at: http://mgltools.scripps.edu

war with china? a different approach?

2007-01-19 Thread thermate
Coz we have fools in the govt, the downfall of the US has only been accelerated !! The are morons who staged 9/11 controlled demolition to kill americans to start their idiotic war. Date: Sat, 21 Oct 2006 16:12:20 -0500 Subject: [nsmworld] war with china? a different approach? From: "J. Knowles" <

Re: Iterator length

2007-01-19 Thread bearophileHUGS
Steven D'Aprano: > since g is not an arbitrary iterator, one can easily do this: > print [(h,len(list(g))) for h,g in groupby(s)] > No need for a special function. If you look at my first post you can see that I have shown that solution too, but it creates a list that may be long, that may use a l

Re: spidering script

2007-01-19 Thread Bernard
4 easy steps to get the links: 1. Download BeautifulSoup and import it in your script file. 2. Use urllib2 to download the html of the url. 3. mash the html using BeautifulSoup 4. [code] for tag in BeautifulSoupisedHTML.findAll('a'): print tag [/code] David Waizer a écrit : > Hello.. > >

Re: when format strings attack

2007-01-19 Thread Jeremy Sanders
Steven D'Aprano wrote: > os.system('dir -l %s' % 'text.txt') > > > Now, there is a security risk: you might set command1 yourself, and > allow the user to set args. If command1 is an external application > with a security hole, and the user provides arguments that trigger that > bug, then natur

Re: Asyncore select statement problem

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 14:42, JamesHoward wrote: Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close() pr

Re: when format strings attack

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 10:43:53 -0800, John Zenger wrote: > Perhaps it is not as severe a security risk, but pure Python programs > can run into similar problems if they don't check user input for % > codes. Please don't top-post. A: Because it messes up the order that we read things. Q: Why? A: To

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 15:43, John Zenger wrote: Perhaps it is not as severe a security risk, but pure Python programs can run into similar problems if they don't check user input for % codes. Example: >>> k = raw_input("Try to trick me: ") Try to trick me: How about %s this? >>> j = "User %s jus

Re: More M2Crypto issues

2007-01-19 Thread Heikki Toivonen
John Nagle wrote: > Actually, at the moment I'm having an M2Crypto problem related > to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an > include file that needs __i386__ defined, which is something GCC > does based on what platform you're on. SWIG uses CPP, but > doesn't set the p

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 15:59, [EMAIL PROTECTED] wrote: One of the problems I was laboring under was that I did not know where to go to find the official documentation. Thanks for that link too! You already have it installed; look into your python install directory, under "doc" From inside the

Re: More M2Crypto issues

2007-01-19 Thread Heikki Toivonen
John Nagle wrote: > I've been running M2Crypto successfully using Python 2.4 on Windows 2000, > and now I'm trying to get it to work on Python 2.3.4 on Linux. > > Attempting to initialize a context results in > > Traceback (most recent call last): [...] > map()[long(self.ctx)] = self > Va

CHINESE TERRORISM 911 REPLAY Re: #Worldwide outcry follows China's sucessful test of a satellite killer

2007-01-19 Thread thermate
GO GET THE NEOCONS TO PUT SOME DEAD CHINESE STUDENTS IN A REMOTE PILOTED PLANES FLOWN INTO THE NEW WTC OWNED BY LARRY SILVERSTEIN WITH HEFTY INSURANCE BY SOME JAPANESE COMPANIES AND THEN DECLARE A WAR ON CHINESE TERROR . LAUGHING OUT LOUD 3027 Dead wrote: > http://www.guardian.co.uk/intern

Re: My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Vinay (or anybody else), Well, now that logging is working, how do I stop it from working? I'm developing in PythonWin. When I run my test script, I get one message. When I run it a second time, I get two, a third time gets me three, and so on. I feel like the Sorceror's Apprentice! Rob --

Re: when format strings attack

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 03:51:08 -0800, [EMAIL PROTECTED] wrote: > http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN > > I saw a warning from homeland security about this. I only comment on > the because I am trying to use os.system('command1 arg') and it doesn't > work What

Re: My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Beautiful! Thank you very much! One of the problems I was laboring under was that I did not know where to go to find the official documentation. Thanks for that link too! Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: when format strings attack

2007-01-19 Thread John Zenger
Perhaps it is not as severe a security risk, but pure Python programs can run into similar problems if they don't check user input for % codes. Example: >>> k = raw_input("Try to trick me: ") Try to trick me: How about %s this? >>> j = "User %s just entered: " + k >>> print j % "John" Traceback (

monitor the start and end of applications

2007-01-19 Thread awalter1
Hello, My purpose is to supervise (from a python program) the launch of some other programs (python or non python programs) as : "I click on the button X and the pg X is launched ..." I want also that my supervision be "wake up" when a pg has exited to check its status or something like that. I sup

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Gabriel Genellina wrote: > At Thursday 18/1/2007 04:41, John Nagle wrote: > On a previous version of M2Crypto that line said: map()[self.ctx] = > self, and that failed too ("unhashable object", I think). > I changed the class _ctxmap (the map() above returns an instance of it) > to use str(key)

Re: confused on python rpc with apache, is it possible?

2007-01-19 Thread Diez B. Roggisch
krishnakant Mane wrote: > hello all. > I will like to know if the following combination is possible. > I have looked around on google and did not find any thing productive > so bothering the list: sorry. > I am developing a distributed application which will have 3 layers > namely the thin client

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close() properly and the dispatchers are removed from async

Re: Why do I have to call del explicitly for com objects?

2007-01-19 Thread bg_ie
Gabriel Genellina skrev: > <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > > I'm creating objects in my python script belonging to a COM object > > which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll > > is the concerned process. The problem is that the o

confused on python rpc with apache, is it possible?

2007-01-19 Thread krishnakant Mane
hello all. I will like to know if the following combination is possible. I have looked around on google and did not find any thing productive so bothering the list: sorry. I am developing a distributed application which will have 3 layers namely the thin client written in wxpython, an application l

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
Gabriel Genellina wrote: > I'll try to explain better: the cgi *protocol* (I'm not talking about the > cgi *module*) requires a *new* python process to be created on *each* > request. Try to measure the time it takes to launch Python, that is, the > time from when you type `python ENTER` on your s

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
Tim Roberts wrote: > Cecil Westerhof <[EMAIL PROTECTED]> wrote: >> >>I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse >>I can not time the time used to import time, but os and sys do not take >>more as a millisecond. My script itself takes 3 or 4 milliseconds. But >>import

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
BJörn Lindqvist wrote: > On 1/18/07, Cecil Westerhof <[EMAIL PROTECTED]> wrote: >> I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse >> I can not time the time used to import time, but os and sys do not take >> more as a millisecond. My script itself takes 3 or 4 millisecon

Re: nsis and command-line argument

2007-01-19 Thread manouchk
manouchk wrote: > Hi, > > is there a standart way to prepare a single exe with nsis that pass the > command line to an exe created by py2exe on windows? > > py2exe allows to prepare an exe that get the command-line but needs > some lib file so that it is not so elegant to ditribute. I tried a > si

Re: Match 2 words in a line of file

2007-01-19 Thread Daniel Klein
On 18 Jan 2007 18:54:59 -0800, "Rickard Lindberg" <[EMAIL PROTECTED]> wrote: >I see two potential problems with the non regex solutions. > >1) Consider a line: "foo (bar)". When you split it you will only get >two strings, as split by default only splits the string on white space >characters. Thus

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
"Nick Maclaren" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > "Gabriel Genellina" <[EMAIL PROTECTED]> writes: > |> > |> Pure Python programs are not affected, but a review of the C > implementation > |> should be made to see if any (variant of

Re: PQueue and Python 2.5

2007-01-19 Thread Gabriel Genellina
"Berteun Damman" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Recently I was looking for a Priority Queue module, and I've found > Pqueue by Andrew Snare [1]. That appears to be rather ancient, from 1999. Is it a pure Python implementation or has some C code too? Python g

Re: Why do I have to call del explicitly for com objects?

2007-01-19 Thread Gabriel Genellina
<[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > I'm creating objects in my python script belonging to a COM object > which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll > is the concerned process. The problem is that the objects destructor > within the com ob

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Greetings! > > I want to write messages into the Windows event log. I found > sevicemanager, but the source is always "Python Service", and I'd like > to be a bit more descriptive. Poking around on the Internet revealed > the existence of the logging module. It seems

Re: when format strings attack

2007-01-19 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Gabriel Genellina" <[EMAIL PROTECTED]> writes: |> <[EMAIL PROTECTED]> escribió en el mensaje |> news:[EMAIL PROTECTED] |> |> > http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN |> > |> > I saw a warning from homeland security about this. I

Re: Iterator length

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 05:04:01 -0800, bearophileHUGS wrote: > Steven D'Aprano: >> > s = "aaabaabb" >> > from itertools import groupby >> > print [(h,leniter(g)) for h,g in groupby(s)] >> >> s isn't an iterator. It's a sequence, a string, and an iterable, but not >> an iterator. > > If you l

[ann] Appscript Installer 1.5 released

2007-01-19 Thread has
Announcing the release of Appscript Installer 1.5, containing all the latest appscript-related modules, documentation and tools: http://appscript.sourceforge.net/download.html Appscript enhances the Python scripting language (http://www.python.org) with robust, easy-to-use OS X application script

My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Greetings! I want to write messages into the Windows event log. I found sevicemanager, but the source is always "Python Service", and I'd like to be a bit more descriptive. Poking around on the Internet revealed the existence of the logging module. It seems to have easily understood methods wit

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
<[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN > > I saw a warning from homeland security about this. I only comment on > the because I am trying to use os.system('command1 arg') and it doesn't > work b

Re: PyMeld for html templates?

2007-01-19 Thread metaperl
Sean Schertell wrote: > > Of course I'm going to try them all but I wonder if anyone has any > thoughts on PyMeld as a template system for churning out general > websites? > meld3 evolved from pymeld. I use meld3 - http://plope.com/software/meld3/ this whole style of templating is known as push

Re: Why this script can work?

2007-01-19 Thread Gabriel Genellina
"Jm lists" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > I'm not habitual for this usage of 'else',other languages seem don't > support this syntax. > i.g,writting the codes below by Perl would get an error: > > [[[censored example]]] If all languages had the same features,

Re: Wierd M2Crypto bug - phony "peer did not return certificate" error

2007-01-19 Thread Jean-Paul Calderone
On Fri, 12 Jan 2007 05:54:42 GMT, John Nagle <[EMAIL PROTECTED]> wrote: >Heikki Toivonen wrote: >> [EMAIL PROTECTED] wrote: >> >>> That's a problem for me. I need short timeouts; I'm accessing sites >>>that might or might not have SSL support, and I need to quickly time >>>out when there's no SSL

Re: How can I create a linked list in Python?

2007-01-19 Thread Hendrik van Rooyen
"Jorgen Grahn" <[EMAIL PROTECTED]> wrote: > > FWIW, I oppose the idea (paraphrased from further up the thread) that linked > lists and other data structures are obsolete and dying concepts, obsoleted > by Python and other modern languages. > > 99% of the time. a Python list is the right tool for

Re: Would a Dutch speaker please check this wiki page please?

2007-01-19 Thread Hendrik van Rooyen
"Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > Stef Mientki wrote: > > [EMAIL PROTECTED] wrote: > >> Got a note about a new page on the Python Wiki: > >> > >>> "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: > >> > >> http://wiki.python.org/moin/Selcuk_Altun > >> > >> I suspect it's

PQueue and Python 2.5

2007-01-19 Thread Berteun Damman
Hello, Recently I was looking for a Priority Queue module, and I've found Pqueue by Andrew Snare [1]. When I use it with Python 2.4 everything works okay, at least on the two system I've tested it on (Debian based AMD 64) and OS PPC. However, when I use it with Python 2.5 - again on the same mach

Re: Login Form

2007-01-19 Thread [EMAIL PROTECTED]
Ghirai wrote: > Hello python-list, > > I need to make a login form, if possible without cookies. > Can anyone point me in the right direction? Or are there any > examples? > > Thanks. > > -- > Best regards, > Ghirai. You'd do pretty good using the 'cgi' module, which is documented at http://www.py

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread Roland Puntaier
Hi, >From a python module you could use subprocess and start the exe. Normally one must leave it to the OS to load a binary module, because there are certain things done during loading. Nevertheless the location of the entry point is coded in the binary file format (e.g. PE for windows or ELF

  1   2   >