http call.

2006-10-24 Thread Kirt
Hi! I have a php program (test.php) on a server. eg: http://abc.xyz.com/test.php I need my python scripts to make a http call to these program pass some data and get back a secret key from the php program.. Could anyone help me this, what will i need to make a http call to the php application?

Re: Tkinter question

2006-10-24 Thread Eric Brunel
On Tue, 24 Oct 2006 07:48:51 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > Sorin Schwimmer wrote: > Hi All, > > Is it possible to have a widget id while it is created? > Something like this: > > Button(root, text='...', command= lambda v=: fn(v)).grid() > > and then the function: > > d

can't open word document after string replacements

2006-10-24 Thread Antoine De Groote
Hi there, I have a word document containing pictures and text. This documents holds several 'ABCDEF' strings which serve as a placeholder for names. Now I want to replace these occurences with names in a list (members). I open both input and output file in binary mode and do the transformation

Re: Attempting to parse free-form ANSI text.

2006-10-24 Thread Frederic Rentsch
Steve Holden wrote: Frederic Rentsch wrote: Frederic Rentsch wrote: Frederic Rentsch wrote: Paul McGuire wrote: "Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote in message Sorry about the line wrap mess in the previous message.

Re: Sorting by item_in_another_list

2006-10-24 Thread Cameron Walsh
Delaney, Timothy (Tim) wrote: > Cameron Walsh wrote: > >> Hi, >> >> I have two lists, A and B, such that B is a subset of A. >> >> I wish to sort A such that the elements in B are at the beginning of >> A, and keep the existing order otherwise, i.e. stable sort. The >> order of elements in B will

Protecting against SQL injection

2006-10-24 Thread Tor Erik Soenvisen
Hi, How safe is the following code against SQL injection: # Get user privilege digest = sha.new(pw).hexdigest() # Protect against SQL injection by escaping quotes uname = uname.replace("'", "''") sql = 'SELECT privilege FROM staff WHERE ' + \

Re: Protecting against SQL injection

2006-10-24 Thread Paul Rubin
Tor Erik Soenvisen <[EMAIL PROTECTED]> writes: > # Protect against SQL injection by escaping quotes Don't ever do that, safe or not. Use query parameters instead. That's what they're for. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Ben Finney
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: [quoting problems fixed] > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > some days, I ask myself why I shouldn't just use GPL for > > everything I do, and ship it as source code only. > > because then you would deny your work to thousands of ungr

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Thomas Heller
Ben Finney schrieb: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > [quoting problems fixed] > >> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >> > some days, I ask myself why I shouldn't just use GPL for >> > everything I do, and ship it as source code only. >> >> because then you would de

Re: pretty basic instantiation question

2006-10-24 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Why do you need to know the number of instances. I know that Python > does not support Class Variable, Plain wrong. class Class(object): classvar = ["w", "t", "f"] print Class.classvar c = Class() c.classvar.append("???") print c.classvar -- bruno desthuilliers p

Re: pytho servlet engine

2006-10-24 Thread Bruno Desthuilliers
makerjoe wrote: > hi, all > i would like to know which is the best PSE "best" according to what metrics ? > i have to choose to use > servlets with mod_python in my HRYDROGEN project > (http://makerjoe.sytes.net/pycrud/query.psp) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[

Re: Protecting against SQL injection

2006-10-24 Thread Ben Finney
Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes: > Tor Erik Soenvisen <[EMAIL PROTECTED]> writes: > > # Protect against SQL injection by escaping quotes > > Don't ever do that, safe or not. Use query parameters instead. > That's what they're for. More specifically: They've been debugg

Re: http call.

2006-10-24 Thread Bruno Desthuilliers
Kirt wrote: > Hi! > > I have a php program (test.php) on a server. eg: > http://abc.xyz.com/test.php > > I need my python scripts to make a http call to these program pass some > data and get back a secret key from the php program.. > > Could anyone help me this, what will i need to make a http

Re: can't open word document after string replacements

2006-10-24 Thread Daniel Dittmar
Antoine De Groote wrote: > I have a word document containing pictures and text. This documents > holds several 'ABCDEF' strings which serve as a placeholder for names. > Now I want to replace these occurences with names in a list (members). I > open both input and output file in binary mode and

Re: can't open word document after string replacements

2006-10-24 Thread Bruno Desthuilliers
Antoine De Groote wrote: > Hi there, > > I have a word document containing pictures and text. This documents > holds several 'ABCDEF' strings which serve as a placeholder for names. > Now I want to replace these occurences with names in a list (members). Do you know that MS Word already provides

Re: can't open word document after string replacements

2006-10-24 Thread Jon Clements
Antoine De Groote wrote: > Hi there, > > I have a word document containing pictures and text. This documents > holds several 'ABCDEF' strings which serve as a placeholder for names. > Now I want to replace these occurences with names in a list (members). I > open both input and output file in bin

forcing a definition to be called on attribute change

2006-10-24 Thread Michael Malinowski
Hey All, Apologies if this is a stupidly obvious or simple question. If I have a class with a series of attributes, is there a way to run a function definition in the class whenever a specific attribute is changed? Something like the following class cSphere() : def __init__(sel

Re: Protecting against SQL injection

2006-10-24 Thread Fredrik Lundh
Ben Finney wrote: > More specifically: They've been debugged for just these kinds of > purposes in a well-designed database, the SQL parser never sees the parameter values, so *injection* attacks are simply not possible. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter question

2006-10-24 Thread Fredrik Lundh
Eric Brunel wrote: > But Hendrik's solution is better, since it avoids the use of lambda, which > is often difficult to understand. storing the button reference in a variable doesn't help if you want to use the same callback for multiple buttons, though... -- http://mail.python.org/mailman

Re: How to get each pixel value from a picture file!

2006-10-24 Thread Fredrik Lundh
Dennis Lee Bieber wrote: >> 2) i think putpixel((44, 55), (0, 0, 0)) and putpixel((44,55),0) is >> same. > > It shouldn't be... The former is three separate data values, the > latter is one. the "putpixel" API is polymorphic; you can use either tuples or integers for RGB pixels (the latter should

Re: Screen capture on Linux

2006-10-24 Thread Fredrik Lundh
Paolo Pantaleo wrote: > If needed, I was thinking to write a C module too. I never did it > before, but I am a not so bad C programmer... any suggestion? What > code can I read and eventually reuse? Would the xwd be useful? > > Anyway doesn't it exist a Python binding for let's say X APIs ? h

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Laurent Pointal
Thomas Heller a écrit : > Ben Finney schrieb: >> "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: >> >> [quoting problems fixed] >> >>> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: some days, I ask myself why I shouldn't just use GPL for everything I do, and ship it as source code only. >>

Re: Socket module bug on OpenVMS

2006-10-24 Thread Jean-François Piéronne
Irmen de Jong wrote: > Martin v. Löwis wrote: [snip] >> Perhaps you had some different work-around in mind? > > Nope, I was indeed thinking about splitting up the recv() into > smaller blocks internally. > Maybe a more elaborate check in Python's build system (to remove > the MSG_WAITALL on VMS) w

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-24 Thread Paul Boddie
Martin v. Löwis wrote: > Georg Brandl schrieb: > > Perhaps you can bring up a discussion on python-dev about your improvements > > and how they could be integrated into the standard library... > > Let me second this. The compiler package is largely unmaintained and > was known to be broken (and per

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Fredrik Lundh
Michael Malinowski wrote: > Apologies if this is a stupidly obvious or simple question. If I have a > class with a series of attributes, is there a way to run a function > definition in the class whenever a specific attribute is changed? you can implement a __setattr__ hook, or, in Python 2.2 and

Re: python GUIs comparison (want)

2006-10-24 Thread Paul Boddie
Cameron Walsh wrote: > > I googled "python gui compare" a while back and got > www.awaretek.com/toolkits.html as the first result. See also the python.org Wiki for more information: http://wiki.python.org/moin/UsefulModules http://wiki.python.org/moin/GuiProgramming (big list!) > Every variation

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Paul Boddie
Thomas Heller wrote: > > I wonder if it would be possible to setup a windows box which provides > a (web-)service that allows to build Python packages. Isn't this the kind of service your distribution vendor should be providing, especially if you've paid them good money? Oh wait! That would be Mic

RE: python thread state

2006-10-24 Thread Stefan Schukat
For this use case the PyGILState API was introduced. e.g. try PyGILState_STATE state = PyGILState_Ensure() run python code PyGILState_Release(state) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Bryan > Sent: Monday, October

Re: can't open word document after string replacements

2006-10-24 Thread Antoine De Groote
Thank you all for your comments. I ended up saving the word document in XML and then using (a slightly modified version of) my script of the OP. For those interested, there was also a problem with encodings. Regards, antoine -- http://mail.python.org/mailman/listinfo/python-list

Re: can't open word document after string replacements

2006-10-24 Thread Antoine De Groote
Bruno Desthuilliers wrote: > Antoine De Groote wrote: >> Hi there, >> >> I have a word document containing pictures and text. This documents >> holds several 'ABCDEF' strings which serve as a placeholder for names. >> Now I want to replace these occurences with names in a list (members). > > Do yo

Re: multythreading app memory consumption

2006-10-24 Thread Andrew MacIntyre
Bryan Olson wrote: > In Python 2.5, each thread will be allocated > > thread.stack_size() > > bytes of stack address space. Note that address space is > not physical memory, nor even virtual memory. On modern > operating systems, the memory gets allocated as needed, > and 150 threads is not

[OT] Re: can't open word document after string replacements

2006-10-24 Thread Bruno Desthuilliers
Antoine De Groote wrote: > Bruno Desthuilliers wrote: >> Antoine De Groote wrote: >>> Hi there, >>> >>> I have a word document containing pictures and text. This documents >>> holds several 'ABCDEF' strings which serve as a placeholder for names. >>> Now I want to replace these occurences with name

Re: sharing persisten cache between modules

2006-10-24 Thread Bart Ogryczak
Dennis Lee Bieber wrote: > f-i-* creates local names initially bound to the objects inside a > module, but any "assignment" to such a name later results in the name > being rebound to the new object -- disconnecting from the original. Great! That was it. Thank you! :-) -- http://mail.python.org

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Bruno Desthuilliers
Michael Malinowski wrote: > Hey All, > Apologies if this is a stupidly obvious or simple question. If I have a > class with a series of attributes, is there a way to run a function > definition in the class s/run a function definition in the class/call a method/ > whenever a specific attribute i

Re: sharing persisten cache between modules

2006-10-24 Thread Steve Holden
Dennis Lee Bieber wrote: > On 23 Oct 2006 09:45:33 -0700, "Bart Ogryczak" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >>The problem is, that then it is not shared. If I do it like that, each >>module has it´s own copy of the cache. Maybe I´m doing something >>wrong.

Re: numpy error

2006-10-24 Thread Juergen Kareta
> Or install the numpy-1.0rc2 binary which is now again available on > sourceforge. Hello Travis, thanks for your help. Going back to the 1.0rc2 release was successful. Ok, I had also to copy wxmsw26uh_vc.dll to my path and get around wx.PrindData.SetPrinterCommand, but that's because I run w

Re: http call.

2006-10-24 Thread Steve Holden
Kirt wrote: > Hi! > > I have a php program (test.php) on a server. eg: > http://abc.xyz.com/test.php > > I need my python scripts to make a http call to these program pass some > data and get back a secret key from the php program.. > > Could anyone help me this, what will i need to make a http

Re: can't open word document after string replacements

2006-10-24 Thread Steve Holden
Antoine De Groote wrote: > Bruno Desthuilliers wrote: > >>Antoine De Groote wrote: >> >>>Hi there, >>> >>>I have a word document containing pictures and text. This documents >>>holds several 'ABCDEF' strings which serve as a placeholder for names. >>>Now I want to replace these occurences with nam

Re: FTP over SSL

2006-10-24 Thread Stefan Schwarzer
On 2006-10-20 15:50, Tor Erik Soenvisen wrote: > Anyone know about existing code supporting FTP over SSL? > I guess pycurl http://pycurl.sourceforge.net/ could be used, but that > requires knowledge of libcurl, which I haven't. Possibly you could use M2Crypto [1]. It has a FTP_TLS class in module

Python Crytographic Toolkit, AES and OpenPGP

2006-10-24 Thread ml1n
Hello, Does anybody have an example of using Crypto.Cipher.AES to encrypt an OpenPGP literal data packet? I can't get MODE_PGP to work at all (gpg doesn't recognise the unencrypted packet), with MODE_CFB gpg correctly identifies the packet after decryption but it's body is incorrect (suggesting th

Re: Protecting against SQL injection

2006-10-24 Thread Steve Holden
Tor Erik Soenvisen wrote: > Hi, > > How safe is the following code against SQL injection: > > # Get user privilege > digest = sha.new(pw).hexdigest() > # Protect against SQL injection by escaping quotes > uname = uname.replace("'", "''") > sql = 'SELECT pri

Change on file

2006-10-24 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** Hello, I was thinking about use md5 check to se if a file had changes since last check. Am I correct? Is there any other light method? F -- http://mail.python.org/mailman/listinfo/python-list

Re: python GUIs comparison (want)

2006-10-24 Thread Peter Decker
On 23 Oct 2006 22:07:39 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Now i began to learn GUI programming. There are so many > choices of GUI in the python world, wxPython, pyGTK, PyQT, > Tkinter, .etc, it's difficult for a novice to decide, however. > Can you draw a comparison among them

Re: Change on file

2006-10-24 Thread Sybren Stuvel
Fulvio enlightened us with: > I was thinking about use md5 check to se if a file had changes since > last check. Am I correct? You can do that, but a check on the mtime (os.stat) would be a lot easier. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman

Re: Change on file

2006-10-24 Thread Marshall
You could use ctime to see it by the time. MD5 it's a most secure way to a file that CAN'T be modified. If you just want to see if the file has been modified (like to make a cache), use ctime. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Re: can't open word document after string replacements

2006-10-24 Thread Richie Hindle
[Antoine] > I have a word document containing pictures and text. This documents > holds several 'ABCDEF' strings which serve as a placeholder for names. > Now I want to replace these occurences with names in a list (members). [Bruno] > I don't know how it's named in english, but in french it's (w

Re: Change on file

2006-10-24 Thread Alan Franzoni
Il Tue, 24 Oct 2006 19:47:43 +0800, Fulvio ha scritto: > Hello, > > I was thinking about use md5 check to se if a file had changes since last > check. Am I correct? > Is there any other light method? It's OK, but if you have a lot of files to check and they're large, and changes frequent, it co

A py2exe like tool for Linux

2006-10-24 Thread Paolo Pantaleo
Hi, is thre something like py2exe for Linux? I don't need to build a standalone executable (most Linuxes have python instaled), but at least I need to provide all the needed libraries togheter with my source code, so users just need to download one file, and not several libraries. PAolo -- http:

Re: A py2exe like tool for Linux

2006-10-24 Thread Ben Finney
"Paolo Pantaleo" <[EMAIL PROTECTED]> writes: > Hi, > > is thre something like py2exe for Linux? I don't need to build a > standalone executable (most Linuxes have python instaled), but at > least I need to provide all the needed libraries togheter with my > source code, so users just need to downl

Tutorial on setuptools

2006-10-24 Thread Thomas W
I'm might just be dumb, but I cannot get the hang of usting setuptools based on the docs at http://peak.telecommunity.com/DevCenter/setuptools. Is there a simple example available showing how to pack a few modules, a few scripts, some resources files ( images ) and list a few dependencies ? I've s

Re: A py2exe like tool for Linux

2006-10-24 Thread Bruno Desthuilliers
Paolo Pantaleo wrote: > Hi, > > is thre something like py2exe for Linux? I don't need to build a > standalone executable (most Linuxes have python instaled), but at > least I need to provide all the needed libraries togheter with my > source code, so users just need to download one file, and not s

Re: multythreading app memory consumption

2006-10-24 Thread Roman Petrichev
Thank you guys for your replies. I've just realized that there was no memory leak and it was just my mistake to think so. I've almost disappointed with my favorite programming language before addressing the problem. Actually the app consume as much memory as it should and I've just miscalculated

Re: Tutorial on setuptools

2006-10-24 Thread Ben Finney
"Thomas W" <[EMAIL PROTECTED]> writes: > I'm might just be dumb, but I cannot get the hang of usting > setuptools based on the docs at > http://peak.telecommunity.com/DevCenter/setuptools. Yes, the documentation there is long on verbiage and short on realistic examples. It is also hard to navigat

Re: HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-24 Thread metaperl
Suren wrote: > It seems error prone as well as bad design to scatter this logic in > each content page. Is there a template logic like Sitemesh or Tiles > concept that can decorate a desired page just before show time? > Suren, you are looking for push-style templating. I list a number of alter

Re: A py2exe like tool for Linux

2006-10-24 Thread Sybren Stuvel
Paolo Pantaleo enlightened us with: > is thre something like py2exe for Linux? I don't need to build a > standalone executable (most Linuxes have python instaled), but at > least I need to provide all the needed libraries togheter with my > source code, so users just need to download one file, and

Re: Getting a lot of SPAM from this list

2006-10-24 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > Larry> Does anyone have a suggestion as to a way that I can get less of > Larry> this spam? I'm running spamassassin > > Get a better spam filter? > > Skip Any suggestions for Firefox? Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: Protecting against SQL injection

2006-10-24 Thread Aahz
In article <[EMAIL PROTECTED]>, Tor Erik Soenvisen <[EMAIL PROTECTED]> wrote: > >How safe is the following code against SQL injection: > ># Get user privilege >digest = sha.new(pw).hexdigest() ># Protect against SQL injection by escaping quotes >uname = uname.replac

Re: Getting a lot of SPAM from this list

2006-10-24 Thread skip
>> Get a better spam filter? Colin> Any suggestions for Firefox? You can try SpamBayes (http://www.spambayes.org/). It has both POP3 and IMAP filters that sit between your mail client and mail server. You control and train them via a local web interface. Skip -- http://mail.python.or

Re: Network Simulator in Python

2006-10-24 Thread Daniel
Any help ? Daniel wrote: > Hi, > > I was wondering if anybody can give me pointers on an existing network > simulator in Python somthing like ns2 which would model all the real > world internet dynamics including TCP stacks, congestion, flow control > etc. > > Every help is appreciated, > > Tha

return same type of object

2006-10-24 Thread David Isaac
Instances of MyClass have a method that returns another instance. Ignoring the details of why I might wish to do this, I could return MyClass() or return self.__class__() I like that latter better. Should I? Should I do something else altogether? Thanks, Alan Isaac -- http://mail.python.org/

FTP over TLS

2006-10-24 Thread Yogesh Chawla - PD
Hello All, The state of wisc. wrote a script to do FTP over TLS using pycurl. I can post this here, but first need to yank a bunch of password info out and get some security clearance. If someone is interested and wants to email me offline, please do so at this address. Cheers, Yogesh -- http:/

The format of filename

2006-10-24 Thread Neil Cerutti
Where can I find documentation of what Python accepts as the filename argument to the builtin function file? As an example, I'm aware (through osmosis?) that I can use '/' as a directory separator in filenames on both Unix and Dos. But where is this documented? -- Neil Cerutti -- http://mail.py

Re: return same type of object

2006-10-24 Thread Bruno Desthuilliers
David Isaac wrote: > Instances of MyClass have a method that > returns another instance. This is usually known as a 'factory method'. > Ignoring the details > of why I might wish to do this, I could > return MyClass() > or > return self.__class__() > > I like that latter better. Should I? You

Re: The format of filename

2006-10-24 Thread Leif K-Brooks
Neil Cerutti wrote: > Where can I find documentation of what Python accepts as the > filename argument to the builtin function file? Python will accept whatever the OS accepts. > As an example, I'm aware (through osmosis?) that I can use '/' as > a directory separator in filenames on both Unix an

Visibility against an unknown background

2006-10-24 Thread Odalrick
I need to draw visible lines on pictures with wxPython. That means I can't simply use, for instance, a black line since it wont be visible on a black or dark picture. Painting applications like the GIMP accomplish this by altering the colour of the line based on the colour of the pixel it covers,

Re: The format of filename

2006-10-24 Thread Fredrik Lundh
Neil Cerutti wrote: > Where can I find documentation of what Python accepts as the > filename argument to the builtin function file? > > As an example, I'm aware (through osmosis?) that I can use '/' as > a directory separator in filenames on both Unix and Dos. But > where is this documented? in

Re: A py2exe like tool for Linux

2006-10-24 Thread Fredrik Lundh
Paolo Pantaleo wrote: > is thre something like py2exe for Linux? I don't need to build a > standalone executable (most Linuxes have python instaled), but at > least I need to provide all the needed libraries togheter with my > source code, so users just need to download one file, and not several >

Re: The format of filename

2006-10-24 Thread Neil Cerutti
On 2006-10-24, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> As an example, I'm aware (through osmosis?) that I can use '/' >> as a directory separator in filenames on both Unix and Dos. >> But where is this documented? > > It's documented in the OS's documentation. It can be qu

Re: The format of filename

2006-10-24 Thread Neil Cerutti
On 2006-10-24, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: > >> Where can I find documentation of what Python accepts as the >> filename argument to the builtin function file? >> >> As an example, I'm aware (through osmosis?) that I can use '/' as >> a directory separator in fil

Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-24 Thread Fredrik Lundh
Tim Roberts wrote: > Further, as I understand it, Python 2.4 extensions can be built with the > free "express edition" compiler from Microsoft. or MinGW. -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-24 Thread Leif K-Brooks
Neil Cerutti wrote: > Is translation of '/' to '\\' a feature of Windows or Python? It's a feature of Windows, but it isn't a translation. Both slashes are valid path separators on Windows; backslashes are just the canonical form. -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-24 Thread Neil Cerutti
On 2006-10-24, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Is translation of '/' to '\\' a feature of Windows or Python? Well, *that* was easy to discover on my own. ;-) Thanks for the pointers. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-24 Thread Fredrik Lundh
Neil Cerutti wrote: > Is translation of '/' to '\\' a feature of Windows or Python? Windows. Random MSDN link: http://msdn2.microsoft.com/en-us/library/77859s1t.aspx Win32 operating systems support both the backslash (\) and the forward slash (/). /.../ (However, the Windows ope

Re: The format of filename

2006-10-24 Thread Tim Chase
>> As an example, I'm aware (through osmosis?) that I can use '/' as >> a directory separator in filenames on both Unix and Dos. But >> where is this documented? > > in the documentation for your operating system. Python doesn't do > anything with the filenames. Windows seems to be (occasionall

Re: Visibility against an unknown background

2006-10-24 Thread Paul McGuire
"Odalrick" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I need to draw visible lines on pictures with wxPython. That means I > can't simply use, for instance, a black line since it wont be visible > on a black or dark picture. > > Painting applications like the GIMP accomplish this

Re: The format of filename

2006-10-24 Thread Neil Cerutti
On 2006-10-24, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2006-10-24, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> Is translation of '/' to '\\' a feature of Windows or Python? > > Well, *that* was easy to discover on my own. ;-) > > Thanks for the pointers. Some experimentation shows that Python

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Rob Williscroft
Bruno Desthuilliers wrote in news:[EMAIL PROTECTED] in comp.lang.python: >> class cSphere() : > > OT : prefixing classes names with 'c' is totally unpythonic. My understanding of "pythonic" is that its about how you use the language not what style you code in. Here's a variation of the usual

Re: Default location while open an Excel file

2006-10-24 Thread J. Clifford Dyer
Try this: >>> import os >>> os.getcwd() 'C:\\Python24' I ran it from the interpreter. Dunno what it does from a script in an arbitrary location. YMMV. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Visibility against an unknown background

2006-10-24 Thread Grant Edwards
On 2006-10-24, Odalrick <[EMAIL PROTECTED]> wrote: > I need to draw visible lines on pictures with wxPython. That means I > can't simply use, for instance, a black line since it wont be visible > on a black or dark picture. > > Painting applications like the GIMP accomplish this by altering the >

Re: Sorting by item_in_another_list

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 04:35, Cameron Walsh wrote: > c = set(B) > a.sort(key=c.__contains__, reverse=True) > > Tim Delaney Depressingly simple. I like it. ...and fast! -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus

Re: Visibility against an unknown background

2006-10-24 Thread Grant Edwards
On 2006-10-24, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-10-24, Odalrick <[EMAIL PROTECTED]> wrote: > >> I need to draw visible lines on pictures with wxPython. That means I >> can't simply use, for instance, a black line since it wont be visible >> on a black or dark picture. >> >> Painti

Re: Visibility against an unknown background

2006-10-24 Thread Sergei Organov
"Odalrick" <[EMAIL PROTECTED]> writes: > I need to draw visible lines on pictures with wxPython. That means I > can't simply use, for instance, a black line since it wont be visible > on a black or dark picture. > > Painting applications like the GIMP accomplish this by altering the > colour of th

Re: python GUIs comparison (want)

2006-10-24 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > Now i began to learn GUI programming. There are so many > choices of GUI in the python world, wxPython, pyGTK, PyQT, > Tkinter, .etc, it's difficult for a novice to decide, however. > Can you draw a comparison among them on easy coding, pythonish design, > beautiful and g

Re: Sorting by item_in_another_list

2006-10-24 Thread Carsten Haese
On Tue, 2006-10-24 at 11:31, Gabriel Genellina wrote: > At Tuesday 24/10/2006 04:35, Cameron Walsh wrote: > > > > c = set(B) > > > a.sort(key=c.__contains__, reverse=True) > > > > > > Tim Delaney > > > >Depressingly simple. I like it. > > ...and fast! ...and not guaranteed to be correct: http:

Re: Sorting by item_in_another_list

2006-10-24 Thread Carsten Haese
On Tue, 2006-10-24 at 11:41, Carsten Haese wrote: > On Tue, 2006-10-24 at 11:31, Gabriel Genellina wrote: > > At Tuesday 24/10/2006 04:35, Cameron Walsh wrote: > > > > > > c = set(B) > > > > a.sort(key=c.__contains__, reverse=True) > > > > > > > > Tim Delaney > > > > > >Depressingly simple. I lik

Re: The format of filename

2006-10-24 Thread Fredrik Lundh
Tim Chase wrote: > Windows seems to be (occasionally) doing the translation as /F > mentions: as leif pointed out, there's no translation. > C:\temp> REM try the same filename convention from dos prompt > C:\temp> type subdir/test.txt > The syntax of the command is incorrect. > C:\temp> REM try

Re: return same type of object

2006-10-24 Thread Steve Holden
David Isaac wrote: > Instances of MyClass have a method that > returns another instance. Ignoring the details > of why I might wish to do this, I could > return MyClass() > or > return self.__class__() > > I like that latter better. Should I? > Should I do something else altogether? > The latt

Re: Sorting by item_in_another_list

2006-10-24 Thread Peter Otten
Carsten Haese wrote: > On Tue, 2006-10-24 at 11:31, Gabriel Genellina wrote: >> At Tuesday 24/10/2006 04:35, Cameron Walsh wrote: >> >> > > c = set(B) >> > > a.sort(key=c.__contains__, reverse=True) >> > > >> > > Tim Delaney >> > >> >Depressingly simple. I like it. >> >> ...and fast! > > ...an

Re: The format of filename

2006-10-24 Thread Steve Holden
Tim Chase wrote: >>>As an example, I'm aware (through osmosis?) that I can use '/' as >>>a directory separator in filenames on both Unix and Dos. But >>>where is this documented? >> >>in the documentation for your operating system. Python doesn't do >>anything with the filenames. > > > Windows

Re: Visibility against an unknown background

2006-10-24 Thread Fredrik Lundh
Sergei Organov wrote: > There is a better way to do it. Check if the toolkit has line drawing > mode that XORs the line color with the background, then draw using this > mode and white color of the line. which means that the selection looks like crap most of the time, and doesn't work at all on

[ANN] argparse 0.2 - Command-line parsing library

2006-10-24 Thread Steven Bethard
Announcing argparse 0.2 --- argparse home: http://argparse.python-hosting.com/ argparse single module download: http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw argparse bundled downloads at PyPI: http://www.python.org/pypi/argparse/ About this releas

Re: python GUIs comparison (want)

2006-10-24 Thread Christophe
Kevin Walzer a écrit : > [EMAIL PROTECTED] wrote: >> Now i began to learn GUI programming. There are so many >> choices of GUI in the python world, wxPython, pyGTK, PyQT, >> Tkinter, .etc, it's difficult for a novice to decide, however. >> Can you draw a comparison among them on easy coding, python

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "sturlamolden" <[EMAIL PROTECTED]> wrote: ... > It seems that Python does take a length argument, but not an offset > argument (unlike the Windows' CreateFileMapping/MapViewOfFile and UNIX' > mmap), so you always map from the beginning of the file. Of course if > yo

Re: python GUIs comparison (want)

2006-10-24 Thread Kevin Walzer
Christophe wrote: > Since when is "based on C++ toolkit" a con? > If you don't know C++ (as is the case with me), then it's difficult to do a C++-to-Python translation in looking at code examples. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listi

Re: can't open word document after string replacements

2006-10-24 Thread Frederic Rentsch
Antoine De Groote wrote: > Hi there, > > I have a word document containing pictures and text. This documents > holds several 'ABCDEF' strings which serve as a placeholder for names. > Now I want to replace these occurences with names in a list (members). I > open both input and output file in bi

RE: Talks at PyCon that Teach How to Be Better Programmers

2006-10-24 Thread Robert Brewer
Jeff Rush wrote: > ...we need more talks that actually teach you how > to be better programmers...What the Heck Does > "Pythonic Programming Style" Mean Anyway? I'm finishing an outline for a talk which will overlap this one a bit, but under the topic "What makes a great API?" that will be directe

Re: Sorting by item_in_another_list

2006-10-24 Thread bearophileHUGS
Carsten Haese: > However, it's not clear > whether this specifies language behavior that all implementations must > adhere to, or whether it simply documents an implementation detail of > CPython. I think it's CPython-specific, but maybe here people expert in Jython and IronPython can tell if thei

Re: python GUIs comparison (want)

2006-10-24 Thread Christophe
Kevin Walzer a écrit : > Christophe wrote: > >> Since when is "based on C++ toolkit" a con? >> > > If you don't know C++ (as is the case with me), then it's difficult to > do a C++-to-Python translation in looking at code examples. As if a toolkit based on C would be much easier. In fact, I wou

Re: Handling emails

2006-10-24 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Tuesday 24 October 2006 01:12, Dennis Lee Bieber wrote: > Message-id: > <[EMAIL PROTECTED]> > > as the ID is generally created when the message is submitted to the > delivery system Well, that's what

Re: Handling emails

2006-10-24 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Tuesday 24 October 2006 03:07, Gerard Flanagan wrote: > The 'PopClient' class here might help you: Thank you, both for the replies. Gerard, Surely I'll peep on that code ;-) to gather a wider perspecti

  1   2   3   >