Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-13, Ben Finney wrote: > Python borrows from C in that consecutive literal strings are > concatenated in the bytecode:: > > stderr.write( > "WARNING:" > " Pants on fire\n") Hmm. So I just indent stuff inside the ()s or whatever? I can work with that. -s -- Copyri

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano writes: > On Wed, 13 Oct 2010 17:28:42 +0200, Pascal J. Bourguignon wrote: > But what exactly *is* this number? Is it 0.25, 1.57 or 90? >>> >>> That's the wrong question. It's like asking, what exactly "is" the >>> number twenty-one -- is it "one and twenty", or 21, or 0x15,

Re: My first Python program

2010-10-13 Thread Jonas H.
On 10/13/2010 11:26 PM, Seebs wrote: stderr.write( "WARNING:" " Pants on fire\n") Hmm. So I just indent stuff inside the ()s or whatever? I can work with that. I think common is stderr.write("WARNING: ", "Pants on fire") or stderr.write(

what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Roger Davis
Hi, I am new to this group, please forgive me if this is a repeat question. I am a new Python programmer but experienced in C/Unix. I am converting a shell script to Python which essentially loops infinitely, each pass through the loop running commands like set output = `cat this | grep that

RE: Hyperlink to a file using python

2010-10-13 Thread Pratik Khemka
This file is present on my hardrive..This file is present in the same folder in which the python code file is present...so http: wont work.. > To: python-list@python.org > From: em...@fenx.com > Subject: Re: Hyperlink to a file using python > Date: Wed, 13 Oct 2010 14:19:36 -0700 > > On 10/13

Re: Hyperlink to a file using python

2010-10-13 Thread Chris Rebert
>> To: python-list@python.org >> From: em...@fenx.com >> Subject: Re: Hyperlink to a file using python >> Date: Wed, 13 Oct 2010 14:19:36 -0700 >> >> On 10/13/2010 1:57 PM Pratik Khemka said... >> > >> > I want to create a hyperlink in my excel sheet using python such that >> > when you click on th

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Gregory Ewing
Ned Deily wrote: You'll also need to specify the appropriate SDK using Apple's gcc -sysroot option. Are you sure? I'm not asking for ppc + i386, I'm asking for i386 + x86_64. I can get either of these individually without switching SDKs. -- Greg -- http://mail.python.org/mailman/listinfo/pyth

Re: My first Python program

2010-10-13 Thread Christian Heimes
Am 14.10.2010 00:00, schrieb Jonas H.: > If you haven't got braces around an expression and you want it to be > multi-line, you need a '\' at the end of each line, just like C macros: > > msg = "WARNING: " \ >"Pants on fire" or msg = ("WARNING: " "Pants on fire") Christ

Re: Scheme as a virtual machine?

2010-10-13 Thread Pascal J. Bourguignon
namekuseijin writes: > On 11 out, 08:49, Oleg Parashchenko wrote: >> Hello, >> >> I'd like to try the idea that Scheme can be considered as a new >> portable assembler. We could code something in Scheme and then compile >> it to PHP or Python or Java or whatever. >> >> Any suggestions and point

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Mike Kent
You might want to check out the Python 2.7 'pipes' standard library module: http://docs.python.org/library/pipes.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Difficulty in easy_install

2010-10-13 Thread Diez B. Roggisch
John Nagle writes: > On 10/11/2010 1:45 AM, sankalp srivastava wrote: >> >> I am having difficulty in easy_installing >> I use a proxy server and strange errors , like it can't fetch the >> package is showing up . >> the package is pyspeech ...please help me :( >> >> I don't know if the proxy s

Re: how to add patch

2010-10-13 Thread Diez B. Roggisch
jimgardener writes: > hi > I have some demo python code hosted on a public host that uses > subversion..and I want to modify one of the files using a patch file > handed to me by another person..How do I do this?Generally I checkout > the code and make the change and then commit again..I have ne

Searching in str backwards

2010-10-13 Thread Pratik Khemka
I want to search for a symbol in a string backwards.. For eg: line = "my/cat/dog/baby" line.find('/') # but from the back... The reason I want to do this is because I want to print the last part of the string after the '/' . And I do not know how long the string might be or how many '/' i

Re: Help with sets

2010-10-13 Thread Lawrence D'Oliveiro
In message <57a322df-8e42-4da5-af96-0c21c5733...@b14g2000pro.googlegroups.com>, Steve Howell wrote: > Lawrence, I was actually talking about symmetry, not orthogonality. So what’s the difference? -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching in str backwards

2010-10-13 Thread Emile van Sebille
On 10/13/2010 4:28 PM Pratik Khemka said... line = "my/cat/dog/baby" Introspection is your friend >>> line = "my/cat/dog/baby" >>> dir(line) ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem_ _', '__getnewar

Re: Searching in str backwards

2010-10-13 Thread Chris Kaynor
Look up the string's rfind method. Chris On Wed, Oct 13, 2010 at 4:28 PM, Pratik Khemka wrote: > I want to search for a symbol in a string backwards.. > For eg: > > *line = "my/cat/dog/baby"* > ** > *line.find('/')* *# but from the back...* > > The reason I want to do this is because I want t

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Ned Deily
In article <8hmpchfsh...@mid.individual.net>, Gregory Ewing wrote: > Ned Deily wrote: > > You'll also need to specify the appropriate SDK using Apple's gcc > > -sysroot option. > Are you sure? I'm not asking for ppc + i386, I'm > asking for i386 + x86_64. I can get either of these > individuall

Re: Scheme as a virtual machine?

2010-10-13 Thread Ertugrul Söylemez
namekuseijin wrote: > Take haskell and its so friggin' huge and complex that its got its > very own scary monolithic gcc. When you think of it, Scheme is the > one true high-level language with many quality perfomant backends -- > CL has a few scary compilers for native code, but not one to java

Re: My first Python program

2010-10-13 Thread Ben Finney
Seebs writes: > On 2010-10-13, Ben Finney wrote: > > Python borrows from C in that consecutive literal strings are > > concatenated in the bytecode:: > > > > stderr.write( > > "WARNING:" > > " Pants on fire\n") > > Hmm. So I just indent stuff inside the ()s or whatever? I can

Re: My first Python program

2010-10-13 Thread Ben Finney
"Jonas H." writes: > On 10/13/2010 11:26 PM, Seebs wrote: > >> stderr.write( > >> "WARNING:" > >> " Pants on fire\n") > > > > Hmm. So I just indent stuff inside the ()s or whatever? I can work with > > that. > > I think common is > > stderr.write("WARNING: ", >

Re: My first Python program

2010-10-13 Thread Ben Finney
Christian Heimes writes: > msg = ("WARNING: " >"Pants on fire") Ick. When the name changes to something with a different length, you'll need to change every continuation line. A name change is easily predicted and quite likely to happen often in one's code, so why invite more work when it

Re: Using csv.DictReader with \r\n in the middle of fields

2010-10-13 Thread Tim Chase
On 10/13/10 11:33, Dennis Lee Bieber wrote: While I've not tested it, my understanding of the documentation indicates that the reader /can/ handle multi-line fields IF QUOTED... (you may still have to strip the terminator out of the description data after it has been loaded). Tha

Re: Help with sets

2010-10-13 Thread Steve Howell
On Oct 13, 4:27 pm, Lawrence D'Oliveiro wrote: > In message > <57a322df-8e42-4da5-af96-0c21c5733...@b14g2000pro.googlegroups.com>, Steve > > Howell wrote: > > Lawrence, I was actually talking about symmetry, not orthogonality. > > So what’s the difference? I don't think there's a big difference b

Re: Scheme as a virtual machine?

2010-10-13 Thread namekuseijin
On 13 out, 21:01, Ertugrul Söylemez wrote: > What exactly is "friggin' huge" and "complex" about Haskell, and what's > this stuff about a "very own monolithic gcc"?  Haskell isn't a lot more > complex than Scheme.  In fact, Python is much more complex.  Reduced to > bare metal (i.e. leaving out sy

Re: Scheme as a virtual machine?

2010-10-13 Thread namekuseijin
On 13 out, 19:41, p...@informatimago.com (Pascal J. Bourguignon) wrote: > namekuseijin writes: > > On 11 out, 08:49, Oleg  Parashchenko wrote: > >> Hello, > > >> I'd like to try the idea that Scheme can be considered as a new > >> portable assembler. We could code something in Scheme and then com

Re: Help with sets

2010-10-13 Thread Lawrence D'Oliveiro
In message , Steve Howell wrote: > I guess a lot depends on how you define "symmetry." Is your > definition of "symmetry" equivalent to your definition of > "orthogonality"? No idea. It’s just that the example being discussed in this thread seemed to come under the old term “orthogonality”, so

Re: Help needed - To get path of a directory

2010-10-13 Thread Kingsley Turner
On 13/10/10 15:26, Bishwarup Banerjee wrote: I want to get the absolute path of the Directory I pass explicitly. Like functionName("\abcd"). I should pass the name of the directory and the function should search for it in the Hard drives and return me the full path of location on the drive. I

Re: Help with sets

2010-10-13 Thread Steve Howell
On Oct 13, 7:25 pm, Lawrence D'Oliveiro wrote: > In message > , Steve > > Howell wrote: > > I guess a lot depends on how you define "symmetry."  Is your > > definition of "symmetry" equivalent to your definition of > > "orthogonality"? > > No idea. It’s just that the example being discussed in thi

Re: Scheme as a virtual machine?

2010-10-13 Thread Ertugrul Söylemez
namekuseijin wrote: > On 13 out, 21:01, Ertugrul Söylemez wrote: > > What exactly is "friggin' huge" and "complex" about Haskell, and > > what's this stuff about a "very own monolithic gcc"?  Haskell isn't > > a lot more complex than Scheme.  In fact, Python is much more > > complex.  Reduced to

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote: > Steven D'Aprano writes: > >> On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: >> >>> On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: >> The formula

Re: how to add patch

2010-10-13 Thread Lawrence D'Oliveiro
In message , Diez B. Roggisch wrote: > My first attempt would be > > cd my_project > patch -p0 < the.patch > > But it might not work, depending on how the patch was created. If the OP can post some initial part of the patch (probably the first dozen lines should be ample), we can get a bet

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread Lawrence D'Oliveiro
In message , Steve Howell wrote: > Bulk-load strategies usually solve one or more of these problems: > > network latency That’s not an issue. This is a bulk operation, after all. > index maintenance during the upload There are usually options to temporarily turn this off. > parsing of the

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread Lawrence D'Oliveiro
In message <4cb5e659$0$1650$742ec...@news.sonic.net>, John Nagle wrote: > Also note that there are some issues with doing a huge volume of > updates in one MySQL InnoDB transaction. The system has to keep the > data needed to undo the updates, and there's a limit on the amount of > pending t

Re: Help needed - To get path of a directory

2010-10-13 Thread Lawrence D'Oliveiro
In message , Kingsley Turner wrote: > I don't know how to enumerate all your windows device letters. There are only 26 of them, so you can try them all, right? -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steve Howell
On Oct 13, 12:31 pm, Steven D'Aprano wrote: 0.2141693770623265 > > Perhaps this will help illustrate what I'm talking about... the > mathematician Mitchell Feigenbaum discovered in 1975 that, for a large > class of chaotic systems, the ratio of each bifurcation interval to the > next approached a

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-13 Thread Lawrence D'Oliveiro
In message , Ethan Furman wrote: > Lawrence D'Oliveiro wrote: > >> In message , Ethan >> Furman wrote: >> >>>Lawrence D'Oliveiro wrote: >>> In message , Ethan Furman wrote: >>>MS treats those first three bytes as a flag -- if they equal the BOM, MS >>>treats it as UTF-8, if they equ

Re: how to add patch

2010-10-13 Thread Steve Howell
On Oct 13, 12:36 pm, jimgardener wrote: > hi > I have some demo python  code hosted on a public host that uses > subversion..and I want to modify one of the files using a patch file > handed to me by another person..How do I do this?Generally I checkout > the code and make the change and then comm

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Paul Rubin
Steve Howell writes: > And yet nobody can recite this equally interesting ratio to thousands > of digits: > > 0.2141693770623265... That is 1/F1 where F1 is the first Feigenbaum constant a/k/a delta. The mathworld article is pretty good: http://mathworld.wolfram.com/FeigenbaumConstant.html I

Whining about "struct"

2010-10-13 Thread Tim Roberts
I have a bad memory. I admit it. Because of that, the Python "help" system is invaluable to me. Up through Python 2.5, I could get a quick reference to the format specifiers for the struct module via import struct; help(struct) I used that a LOT. But in Python 2.6, the struct module moved fr

Re: Whining about "struct"

2010-10-13 Thread Terry Reedy
On 10/14/2010 12:30 AM, Tim Roberts wrote: I have a bad memory. I admit it. Because of that, the Python "help" system is invaluable to me. Up through Python 2.5, I could get a quick reference to the format specifiers for the struct module via import struct; help(struct) I used that a LOT.

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Seebs
On 2010-10-13, Roger Davis wrote: > Hi, I am new to this group, please forgive me if this is a repeat > question. I am a new Python programmer but experienced in C/Unix. I am > converting a shell script to Python which essentially loops > infinitely, each pass through the loop running commands lik

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Nobody
On Wed, 13 Oct 2010 14:58:57 -0700, Roger Davis wrote: > My understanding is that this functionality is best coded via > subprocess.Popen(). I need to read output from these spawned children > via a pipe from their stdout, hence something like > > p= subprocess.Popen(args, stdout=subprocess.

Re: Whining about "struct"

2010-10-13 Thread Ned Deily
In article , Tim Roberts wrote: > I have a bad memory. I admit it. Because of that, the Python "help" > system is invaluable to me. Up through Python 2.5, I could get a quick > reference to the format specifiers for the struct module via > import struct; help(struct) > > I used that a LOT.

Python, Windows, and file sockets

2010-10-13 Thread culix
Hey list, I have a question about unix-style file sockets and/or named pipes with python. I have a linux server program that uses a file socket to listen for connections. It has been ported to Windows with cygwin (I'm running WinXP SP3). On linux I have a python script that acts as a client - it c

Question regarding python migration

2010-10-13 Thread Pramod Thirthachar Sridhar
Hi, We have a Python based test framework which is being used in various projects. Our current environment is Python (ver 2.5.1) wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) pywin32-210.win32-py2.5 vcredist_x86.exe pyserial-2.2 Our Framework is being currently used in Windows XP.

Question regarding python migration

2010-10-13 Thread Pramod Thirthachar Sridhar
Hi, We have a Python based test framework which is being used in various projects. Our current environment is Python (ver 2.5.1) wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) pywin32-210.win32-py2.5 vcredist_x86.exe pyserial-2.2 Our Framework is being currently used in Windows XP.

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Chris Torek
In article Roger Davis wrote: >My understanding is that this functionality is best coded via >subprocess.Popen(). "Best" is always a big question mark. :-) >I need to read output from these spawned children >via a pipe from their stdout, hence something like > > p= subprocess.Popen(args, s

Question regarding python2.5 migration from windows xp to windows 7

2010-10-13 Thread python_tsp
Hi, We have a Python based test framework which is being used in various projects. Our current environment is Python (ver 2.5.1) wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) pywin32-210.win32-py2.5 vcredist_x86.exe pyserial-2.2 Our Framework is being currently used in Windows XP. The issue is

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-13 Thread Steven D'Aprano
On Thu, 14 Oct 2010 16:41:13 +1300, Lawrence D'Oliveiro wrote: > In message , Ethan > Furman wrote: > >> Lawrence D'Oliveiro wrote: >> >>> In message , >>> Ethan Furman wrote: >>> Lawrence D'Oliveiro wrote: >In message , >Ethan Furman wrote: > MS treats those first three

<    1   2