Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 11:22 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Russ P. wrote: > > On Jul 26, 2:25 pm, Terry Reedy > >> There is a lot of code you have not seen. Really. In informal code I > >> use 's' and 'o' for 'self' and 'other'. I don't usually post such > >> because it is not considered poli

Re: Insert string into string

2008-07-26 Thread Peter Otten
Mensanator wrote: > I don't know why you're using stdin if you're reading from a file. >From Francesco's initial post in his previous thread I inferred that he had a script like f = open("xxx.pdb") for line in f: # process line print line and was calling it python script.py >outfile M

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Russ P. wrote: On Jul 26, 2:25 pm, Terry Reedy There is a lot of code you have not seen. Really. In informal code I use 's' and 'o' for 'self' and 'other'. I don't usually post such because it is not considered polite. So you have seen a biased sample of the universe. You take the name d

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 11:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Colin J. Williams wrote: > > Russ P. wrote: > >> class MyClass: > > >> def func( , xxx, yyy): > > >> .xxx = xxx > > >> local = .yyy > > The use of '.' has been suggested before and rejected. Where and why? -- http://

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Torsten Bronger wrote: No more than Python 3.0 breaks. This proposal would break 3.0 code without sufficient reason. -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Colin J. Williams wrote: Russ P. wrote: class MyClass: def func( , xxx, yyy): .xxx = xxx local = .yyy The use of '.' has been suggested before and rejected. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Path issues

2008-07-26 Thread Gary Josack
Brett Ritter wrote: On Jul 26, 2:57 pm, Gary Josack <[EMAIL PROTECTED]> wrote: sys.path is a list that will tell you where python is looking. You can append to this in your scripts to have python look in a specific directory for your own modules. I can, but that is almost certainly not

Re: Insert character at a fixed position of lines

2008-07-26 Thread castironpi
On Jul 26, 10:02 pm, alex23 <[EMAIL PROTECTED]> wrote: > Ugh, and in pointing our your inaccurate code I posted my own: > > > >>> f = open('dummy.txt','w') > > >>> f.write(line = 'this doesn't work') > > >   File "", line 1 > >     f.write(line = 'this doesn't work') > >                            

Re: xml.dom's weirdness?

2008-07-26 Thread Lie
On Jul 26, 6:03 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > > If you have any idea what black magic is happening in my computer > > right now, I'd appreciate it. > > command completion?  (no ubuntu within reach right now, so I cannot > check how they've set it up). > > try starting

Re: interpreter vs. compiled

2008-07-26 Thread castironpi
On Jul 24, 11:04 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > >Compiling a program is different than running it.  A JIT compiler is a > >kind of compiler and it makes a compilation step.  I am saying that > >Python is not a compiler and in order to implemen

Re: persistent deque (continued)

2008-07-26 Thread castironpi
On Jul 21, 5:20 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Jul 21, 12:08 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > Some time ago, I was asking about the feasibility of a persistent > > deque, a double-ended queue. > > > It runs into the typical space allocation problems.   > > Try

Re: How to close all python-opened file identifiers?

2008-07-26 Thread Michele Simionato
On Jul 26, 2:19 am, BAnderton <[EMAIL PROTECTED]> wrote:  Although I > can't find unmatched "open" and "fid.close()" statements, I'd like to > implement a check for open file identifiers before launching the > editor. So you need a debug tool to track down the opened files. How about that: # assu

Re: Attack a sacred Python Cow

2008-07-26 Thread s0suk3
On Jul 26, 6:47 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] wrote: > > On Jul 24, 5:01 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > > central.gen.new_zealand> wrote: > > >> In message > >> <[EMAIL PROTECTED

Re: Stripping parts of a path

2008-07-26 Thread Tim Roberts
Tim Cook <[EMAIL PROTECTED]> wrote: > >I just ran into an issue with the rstrip method when using it on path >strings. > >When executing a function I have a need to strip off a portion of the >current working directory and add on a path to a log file. Initially >this worked great but then I added

Re: How to close all python-opened file identifiers?

2008-07-26 Thread Tim Roberts
BAnderton <[EMAIL PROTECTED]> wrote: > >Question: Is there a way in Python to determine what all file >identifiers have been opened by Python, and to close them all? No. You are expected to be able to track this yourself. Python doesn't open any files that you didn't request. >Extra info on t

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >For Win64-Itanium users: python-2.5.2.ia64.msi >For Win64-AMD64 users: python-2.5.2.amd64.msi > >1. It looks like the 64 bit versions of Python for Windows are CPU >vendor specific, eg. it doesn't look like there's a single, universal >executable for Windows 64 bit platf

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 7:23 pm, "Marcus.CM" > 1. python should hardcode the keyword "self". So whenever this keyword > is used, it would automatically implied that it is > referring to a class scope variable. This would be similar to how the > "this" keyword is used in C++. > > 2. Omit self from the parameter

Re: Attack a sacred Python Cow

2008-07-26 Thread Benjamin Kaplan
On Sat, Jul 26, 2008 at 10:23 PM, Marcus.CM <[EMAIL PROTECTED]>wrote: > Well after reading some of these posts on "sacred python cow" on the "self" > , i would generally feel that most programmers > who started with C++/Java would find it odd. And its true, i agree > completely there should not be

Re: Insert character at a fixed position of lines

2008-07-26 Thread alex23
Ugh, and in pointing our your inaccurate code I posted my own: > >>> f = open('dummy.txt','w') > >>> f.write(line = 'this doesn't work') > > File "", line 1 > f.write(line = 'this doesn't work') >^ > SyntaxError: invalid syntax That should be: >>> f.write(li

Re: Insert character at a fixed position of lines

2008-07-26 Thread alex23
On Jul 27, 9:26 am, Lie Ryan <[EMAIL PROTECTED]> wrote: > Btw, if you do f.write('line = line[:22] + "A" + line[23:]'), you'd > output exactly that, and not inserting the 23rd character, you'd want to > do this instead: f.write(line = line[:22] + "A" + line[23:]) Please check your examples before

Re: pixel colour on screen

2008-07-26 Thread Tim Roberts
chris <[EMAIL PROTECTED]> wrote: >On Jun 30, 4:37 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> >> >Could anyone help me, I'm a python noob and need some help. im trying >> >to find some code that will, given ascreenco-ordinate, will give me >> >thecolourof thatpixelin

Re: Attack a sacred Python Cow

2008-07-26 Thread Marcus.CM
Well after reading some of these posts on "sacred python cow" on the "self" , i would generally feel that most programmers who started with C++/Java would find it odd. And its true, i agree completely there should not be a need to put "self" into every single member function. If you were writing

Re: Insert string into string

2008-07-26 Thread Mensanator
On Jul 26, 6:32 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jul 26, 4:40�pm, "Francesco Pietra" <[EMAIL PROTECTED]> wrote: > > > > > > > I am posting ex novo as it became confusing to me. I take the > > opportunity to ask advice for a second problem. > > > FIRST PROBLEM > > For file xxx.pdb, ins

bundling python with application

2008-07-26 Thread Randall Smith
I'd like to bundle Python with my app, which will be targeted at Linux, Windows and Mac. Discussions I've found about this tend to lead to py2exe, freeze, etc, but I'd like to do something rather simple and am seeking advice. What I'd like to do is just copy the standard libraries and execut

Re: binding names doesn't affect the bound objects

2008-07-26 Thread Ben Finney
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > Hmm. Are you saying that the following doesn't work? > > $ python > >>> f = open("test", "w") > >>> import sys > >>> sys.stdout = f > >>> print "test message" > >>> sys.exit(0) > $ cat test > test message > > > In other words, you can't change th

Re: Insert string into string

2008-07-26 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Francesco Pietra" <[EMAIL PROTECTED]> wrote: > I am posting ex novo as it became confusing to me. I take the > opportunity to ask advice for a second problem. > > FIRST PROBLEM > For file xxx.pdb, insert letter "A" into each line that starts with > "ATOM". "A" sh

Re: wx.Timer not working

2008-07-26 Thread Mike Driscoll
On Jul 26, 5:22 pm, [EMAIL PROTECTED] wrote: > On Jul 26, 3:13 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On Jul 26, 2:33 pm, [EMAIL PROTECTED] wrote: > > > > Windows XP SP3 > > > Python 2.5 > > > wx.version() = '2.8.1.1 (msw-unicode)' > > > -- > > > I have written the following *si

Re: Pwnie awards

2008-07-26 Thread Paul Boddie
On 27 Jul, 02:03, [EMAIL PROTECTED] (Aahz) wrote: > Boy, am I glad we're not listed: > > http://pwnie-awards.org/2008/awards.html An amusing mention, though: 2008-03-03: Core sends proof-of-concept code written in Python. 2008-03-05: Vendor asks for compiler tools required to use the PoC code

Re: Pwnie awards

2008-07-26 Thread Casey McGinty
One more award from award winner Tim Neshman ... http://www.thenewsh.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 2:25 pm, Terry Reedy > There is a lot of code you have not seen. Really. In informal code I > use 's' and 'o' for 'self' and 'other'. I don't usually post such > because it is not considered polite. So you have seen a biased sample > of the universe. You take the name down to a sing

Pwnie awards

2008-07-26 Thread Aahz
Boy, am I glad we're not listed: http://pwnie-awards.org/2008/awards.html -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ Adopt A Process -- stop killing all your children! -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > "Support OO but it doesn't have to"? That sounds like saying that in > some Python implementations you'll be able to use OO, but that you > just might bump into a Python distribution ... Change "distribution" to "program" and you're on th

Re: Attack a sacred Python Cow

2008-07-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On Jul 24, 5:01 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: > >> In message >> <[EMAIL PROTECTED]>, >> Jordan wrote: >> >> > Except when it comes to Classes. I added some classes to code that had >> > previ

Re: Function editing with Vim throws IndentError

2008-07-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Thomas Troeger wrote: > Finally, I'd like to throw in this one from the Linux kernel sources, > from `Documentation/CodingStyle: > > > > Chapter 1: Indentation > > Tabs are 8 characters, and

Re: Function editing with Vim throws IndentError

2008-07-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Matimus wrote: > On Jul 24, 9:32 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: > >> In message >> <[EMAIL PROTECTED]>, >> Matimus wrote: >> >> > On Jul 24, 2:54 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] >> > central.gen.new_zealand> w

Re: scanf in python

2008-07-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, AMD wrote: >> In message <[EMAIL PROTECTED]>, AMD wrote: >> >>> Actually it is quite common, it is used for processing of files not for >>> reading parameters. You can use it whenever you need to read a simple >>> csv file or fixed format file which contains many l

Re: Insert string into string

2008-07-26 Thread Mensanator
On Jul 26, 4:40�pm, "Francesco Pietra" <[EMAIL PROTECTED]> wrote: > I am posting ex novo as it became confusing to me. I take the > opportunity to ask advice for a second problem. > > FIRST PROBLEM > For file xxx.pdb, insert letter "A" into each line that starts with > "ATOM". "A" should be inserte

Re: Insert character at a fixed position of lines

2008-07-26 Thread Lie Ryan
On Sat, 2008-07-26 at 17:47 +0200, Francesco Pietra wrote: > Sorry to come again for the same problem. On commanding: > > $ python script.py 2>&1 | tee fileout.pdb > > nothing occurred (fileout.pdb was zero byte). The script reads: > > f = open("xxx.pdb", "w") > f.write('line = line[:22] + "A" +

Re: urllib and login with passwords

2008-07-26 Thread Jive Dadson
Thanks, Rob! Some of that is beyond my maturity level, but I'll try to figure it out. If anyone has specific info on about how YouTube does it, I would appreciate the info. -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-26 Thread Carl Banks
On Jul 26, 5:07 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Whether or not one should write 'if x' or 'if x != 0' [typo corrected] > depends on whether one means the general 'if x is any non-null object > for which bool(x) == True' or the specific 'if x is anything other than > numeric zero'.  The

Re: wx.Timer not working

2008-07-26 Thread 5lvqbwl02
On Jul 26, 3:13 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Jul 26, 2:33 pm, [EMAIL PROTECTED] wrote: > > > > > Windows XP SP3 > > Python 2.5 > > wx.version() = '2.8.1.1 (msw-unicode)' > > -- > > I have written the following *simplest* implementation of wx.timer I > > can think of.  No wo

Re: os.walk question

2008-07-26 Thread Terry Reedy
Eric Wertman wrote: I do this, mabye a no-no? It is a roundabout way to do multiple assignment: import os for root,dirs,files in os.walk(dir) : break root,dirs,files = os.walk(dir).next #2.x root,dirs,files = next(os.walk(dir))#3.x -- http://mail.python.org/mailman/listinfo/python-lis

Re: wx.Timer not working

2008-07-26 Thread Mike Driscoll
On Jul 26, 2:33 pm, [EMAIL PROTECTED] wrote: > Windows XP SP3 > Python 2.5 > wx.version() = '2.8.1.1 (msw-unicode)' > -- > I have written the following *simplest* implementation of wx.timer I > can think of.  No workie.   I want an exception, a print statement, or > something. > > The wxpython

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! Terry Reedy writes: > Torsten Bronger wrote: > >> D'Arcy J.M. Cain writes: >> >>> On Sat, 26 Jul 2008 09:45:21 +0200 >>> Torsten Bronger <[EMAIL PROTECTED]> wrote: >>> Of course, "self" would have to become a reserved word. You could say that this may break some code, but I

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Paul Boddie wrote: On 26 Jul, 06:06, Terry Reedy <[EMAIL PROTECTED]> wrote: Paul Boddie wrote: "The problem is that the explicit requirement to have self at the start of every method is something that should be shipped off to the implicit category." Here, I presume that the author meant "at

Insert string into string

2008-07-26 Thread Francesco Pietra
I am posting ex novo as it became confusing to me. I take the opportunity to ask advice for a second problem. FIRST PROBLEM For file xxx.pdb, insert letter "A" into each line that starts with "ATOM". "A" should be inserted at position 22, i.e., one space after "LEU", leaving all other characters a

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! Terry Reedy writes: > Torsten Bronger wrote: > >> Terry Reedy writes: >> >>> [...] >>> >>> Or the proposal would have to be that 'self' is mandatory for >>> all programmers in all languages. I think *that* would be >>> pernicious. People are now free to write the more compact 's.sum >

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Torsten Bronger wrote: Hallöchen! D'Arcy J.M. Cain writes: On Sat, 26 Jul 2008 09:45:21 +0200 Torsten Bronger <[EMAIL PROTECTED]> wrote: Of course, "self" would have to become a reserved word. You could say that this may break some code, but I don't see much freedom Isn't this a showstop

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Nikolaus Rath wrote: I think you misunderstood him. I did, but addressed the below in another post. > What he wants is to write > class foo: def bar(arg): self.whatever = arg + 1 instead of class foo: def bar(self, arg) self.whatever = arg + 1 so 'self' should *

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
> > So why not allow something like this?: > > > class MyClass: > > > def func( , xxx, yyy): > > > .xxx = xxx > > > local = .yyy > > > The "self" argument is replaced with nothing, but a comma is used as a > > placeholder. > > (+1) but why retain the leading comma in > the argu

Re: pixel colour on screen

2008-07-26 Thread chris
On Jun 30, 4:37 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > >Could anyone help me, I'm a python noob and need some help. im trying > >to find some code that will, given ascreenco-ordinate, will give me > >thecolourof thatpixelin RGB. i have found a lot about getting th

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Torsten Bronger wrote: Hallöchen! Terry Reedy writes: [...] Or the proposal would have to be that 'self' is mandatory for all programmers in all languages. I think *that* would be pernicious. People are now free to write the more compact 's.sum = s.a + s.b + s.c' if they want instead of th

Re: Attack a sacred Python Cow

2008-07-26 Thread Terry Reedy
Carl Banks wrote: On Jul 24, 4:11 am, Jordan <[EMAIL PROTECTED]> wrote: Of course not. I just think Explicit is better than Implicit is taken seriously by a large segment the Python community as a guiding principle, Yeah, try telling that to the people who advise writing "if x" instead of "

Re: Attack a sacred Python Cow

2008-07-26 Thread Colin J. Williams
Russ P. wrote: If, as I wrote, you permit the omission of "self" in method signatures defined within class definitions, then you could still insist on instance attribute qualification using "self" - exactly as one would when writing Java according to certain style guidelines. I'm not sure exact

Re: SimpleJson is slow .... is there any C Compiled version ?

2008-07-26 Thread Dan Stromberg
On Sat, 26 Jul 2008 00:49:20 -0700, Richard Levasseur wrote: > On Jul 25, 5:52 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: >> Also, simplejson and python-cjson might not be entirely compatible: >> there's one character that one escapes and the other doesn't, or >> something. -- > > They also hav

Re: tcp socket problem

2008-07-26 Thread Dan Stromberg
On Fri, 25 Jul 2008 16:09:13 -0700, jm.carp wrote: > I'm writing a tcp client that grabs data from a server at 32hz. But the > connection drops exactly one minute after it's opened. I can get data > from the server fine for the first 60s, and then the connection goes > dead. What's going on? What

Re: An Attempt to download and install traits - to a Windows XP

2008-07-26 Thread Colin J. Williams
Robert, Many thanks, this has put me on track. Colin W. Robert Kern wrote: On Jul 25, 5:37 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: Using >easy_install -v -fhttp://code.enthought.com/enstaller/eggs/sourceenthought.traits The result is: ... many lines ... copyingenthought\trai

Re: wx.Timer not working

2008-07-26 Thread Vlastimil Brom
2008/7/26 <[EMAIL PROTECTED]> > Windows XP SP3 > Python 2.5 > wx.version() = '2.8.1.1 (msw-unicode)' > -- > I have written the following *simplest* implementation of wx.timer I > can think of. No workie. I want an exception, a print statement, or > something. > > The wxpython demos all work

Re: os.walk question

2008-07-26 Thread Eric Wertman
I do this, mabye a no-no? import os for root,dirs,files in os.walk(dir) : break -- http://mail.python.org/mailman/listinfo/python-list

Re: Execution speed question

2008-07-26 Thread Eric Wertman
> The number of nodes is very large: millions for sure, maybe tens > of millions. If considering (2), take note of my BOLD text above, which > means I can't remove nodes as I iterate through them in the main loop. Since your use of 'node' is pretty vague and I don't have a good sense of what test

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
> If, as I wrote, you permit the omission of "self" in method signatures > defined within class definitions, then you could still insist on > instance attribute qualification using "self" - exactly as one would > when writing Java according to certain style guidelines. I'm not sure exactly what p

Re: urllib and login with passwords

2008-07-26 Thread Rob Williscroft
Jive Dadson wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Hey folks! > > There are various web pages that I would like to read using urllib, but > they require login with passwords. Can anyone tell me how to find out > how to do that, both in general and specifically for YouTube.com.

Re: Simple Path issues

2008-07-26 Thread Brett Ritter
On Jul 26, 2:57 pm, Gary Josack <[EMAIL PROTECTED]> wrote: > sys.path is a list that will tell you where python is looking. You can > append to this in your scripts to have python look in a specific > directory for your own modules. I can, but that is almost certainly not the standard way to devel

wx.Timer not working

2008-07-26 Thread 5lvqbwl02
Windows XP SP3 Python 2.5 wx.version() = '2.8.1.1 (msw-unicode)' -- I have written the following *simplest* implementation of wx.timer I can think of. No workie. I want an exception, a print statement, or something. The wxpython demos all work, but for some reason this isn't. The demos are

Re: Stripping parts of a path

2008-07-26 Thread Dan Stromberg
On Sat, 26 Jul 2008 08:59:15 -0300, Tim Cook wrote: > Hi All, > > I just ran into an issue with the rstrip method when using it on path > strings. > > When executing a function I have a need to strip off a portion of the > current working directory and add on a path to a log file. Initially > t

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Rob Williscroft
Martin v. Löwis wrote in news:[EMAIL PROTECTED] in comp.lang.python: >> I just tested, I built a default C# forms app using the "AnyCPU" >> option and it ran as a 64 bit app (no *32 in Task Manager), this is >> on XP64. >> >> I have though installed the AMD64 version of the 2.0 framework and

Re: Simple Path issues

2008-07-26 Thread Gary Josack
Brett Ritter wrote: New to Python, and I have some questions on how to best set up a basic development environment, particular relating to path issues. Note: I am not root on my development box (which is some flavor of BSD) Where should I develop my own modules so as to refer to them in the sta

Re: Confounded by Python objects

2008-07-26 Thread Robert Latest
satoru wrote: > As to "sample", it never get assigned to and when you say "append" the > class variable is changed in place. > hope my explaination helps. Sure does, thanks a lot. Here's an interesting side note: After fixing my "Channel" thingy the whole project behaved as expected. But there w

Simple Path issues

2008-07-26 Thread Brett Ritter
New to Python, and I have some questions on how to best set up a basic development environment, particular relating to path issues. Note: I am not root on my development box (which is some flavor of BSD) Where should I develop my own modules so as to refer to them in the standard way. I.E. I wan

Re: Gracefull application exit.

2008-07-26 Thread M.-A. Lemburg
On 2008-07-26 20:30, M.-A. Lemburg wrote: On 2008-07-24 18:06, Robert Rawlins wrote: Chaps, I'm looking to implement an exit/termination process for an application which can be triggered by A) a keyboard interrupt or B) termination of the application as a Daemon using a signal. I hav

Re: Gracefull application exit.

2008-07-26 Thread M.-A. Lemburg
On 2008-07-24 18:06, Robert Rawlins wrote: Chaps, I'm looking to implement an exit/termination process for an application which can be triggered by A) a keyboard interrupt or B) termination of the application as a Daemon using a signal. I have a whole bunch of tasks I want to perform as

Re: Attack a sacred Python Cow

2008-07-26 Thread Paul Boddie
On 26 Jul, 06:06, Terry Reedy <[EMAIL PROTECTED]> wrote: > Paul Boddie wrote: > > "The problem is that the explicit requirement to have self at the > > start of every method is something that should be shipped off to the > > implicit category." Here, I presume that the author meant "at the start o

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Paul Boddie
On 25 Jul, 12:35, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > > But then Intel Itanium is being phased out anyway Citation needed! ;-) Paul -- http://mail.python.org/mailman/listinfo/python-list

urllib and login with passwords

2008-07-26 Thread Jive Dadson
Hey folks! There are various web pages that I would like to read using urllib, but they require login with passwords. Can anyone tell me how to find out how to do that, both in general and specifically for YouTube.com. Thankee. -- http://mail.python.org/mailman/listinfo/python-list

how to upload files to "google code" filesection ?

2008-07-26 Thread Stef Mientki
hello, In a program I want to download (updated) files from google code (not the svn section). I could find a python script to upload files, but not for downloading. Anyone has a hint or a solution ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-26 Thread Michele Simionato
On Jul 26, 5:28 pm, [EMAIL PROTECTED] (Aahz) wrote: > IMO, you made a big mistake in combining your point with two other meaty > issues (whether method definitions should include self and whether != > should use __eq__() as a fallback). >  If solid discussion > is your goal, I suggest that you wai

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Martin v. Löwis
>> The Microsoft .NET commercial framework uses the PE architecture of the > > Whats the "Commercial framework" ? I've only come accross 3, the > standard 32 bit one and 2 64 bit variants. That's the name of the Microsoft .NET product available for Windows. There are other implementations as we

Re: Easier way to get the "here" path?

2008-07-26 Thread Andrew
Andrew wrote: bukzor wrote: I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: ... If you just need the current path (where it is executed) why not use os.getcwd() which returns

Re: Easier way to get the "here" path?

2008-07-26 Thread MRAB
On Jul 25, 10:08 pm, bukzor <[EMAIL PROTECTED]> wrote: > I have to go into these convulsions to get the directory that the > script is in whenever I need to use relative paths. I was wondering if > you guys have a better way: > > from os.path import dirname, realpath, abspath > here = dirname(realp

Re: Easier way to get the "here" path?

2008-07-26 Thread Andrew
bukzor wrote: from os.path import abspath, realpath realpath(path.__file__.rstrip("c")) '/home/bgolemon/python/symlinks/path.py' realpath(abspath(path.__file__.rstrip("c"))) '/home/bgolemon/python/symlinks/symlinks/path.py' -- http://mail.python.org/mailman/listinfo/python

Re: Easier way to get the "here" path?

2008-07-26 Thread Andrew
bukzor wrote: I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: ... If you just need the current path (where it is executed) why not use os.getcwd() which returns a string of th

Re: Insert character at a fixed position of lines

2008-07-26 Thread Francesco Pietra
Sorry to come again for the same problem. On commanding: $ python script.py 2>&1 | tee fileout.pdb nothing occurred (fileout.pdb was zero byte). The script reads: f = open("xxx.pdb", "w") f.write('line = line[:22] + "A" + line[23:]') f.close() File xxx.pdb is opened by the command: when I forgo

Re: print doesn't respect file inheritance?

2008-07-26 Thread Lie
On Jul 26, 8:50 am, bukzor <[EMAIL PROTECTED]> wrote: > I was trying to change the behaviour of print (tee all output to a > temp file) by inheriting from file and overwriting sys.stdout, but it > looks like print uses C-level stuff  to do its writes which bypasses > the python object/inhertiance s

Find Sofas

2008-07-26 Thread lindi
Huge Selections at Great Prices The Convenience of OneCart! http://good-furniture-care.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Rob Williscroft
Martin v. Löwis wrote in news:[EMAIL PROTECTED] in comp.lang.python: >> The end result of that is on a 32-bit machine IronPython runs in a >> 32-bit process and on a 64-bit machine it runs in a 64-bit process. > > > That's probably not exactly true (although I haven't checked). > > When you st

Re: Attack a sacred Python Cow

2008-07-26 Thread Aahz
In article <[EMAIL PROTECTED]>, Jordan <[EMAIL PROTECTED]> wrote: > >The point I was trying to make originally was that applying any mantra >dogmatically, including Explicit is better than implicit, can lead to >bad results. Perhaps having Practicality beats purity is enough of a >reminder of that

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! Kay Schluehr writes: > On 26 Jul., 09:45, Torsten Bronger <[EMAIL PROTECTED]> > wrote: >> >> Terry Reedy writes: >> >>> [...] >>> >>> Or the proposal would have to be that 'self' is mandatory for >>> all programmers in all languages. I think *that* would be >>> pernicious. People are

Re: Attack a sacred Python Cow

2008-07-26 Thread Kay Schluehr
On 26 Jul., 09:45, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Terry Reedy writes: > > [...] > > > Or the proposal would have to be that 'self' is mandatory for all > > programmers in all languages. I think *that* would be > > pernicious. People are now free to write the more compa

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! D'Arcy J.M. Cain writes: > On Sat, 26 Jul 2008 16:25:18 +0200 > Torsten Bronger <[EMAIL PROTECTED]> wrote: > >>> Isn't this a showstopper all by itself? >> >> Yes. But I've seen no code that uses some other word. Emacs' >> syntax highlighting even treats it as reserved. So I think

Re: Attack a sacred Python Cow

2008-07-26 Thread D'Arcy J.M. Cain
On Sat, 26 Jul 2008 16:25:18 +0200 Torsten Bronger <[EMAIL PROTECTED]> wrote: > > Isn't this a showstopper all by itself? > > Yes. But I've seen no code that uses some other word. Emacs' > syntax highlighting even treats it as reserved. So I think that > other counter-arguments are stronger. >

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! D'Arcy J.M. Cain writes: > On Sat, 26 Jul 2008 09:45:21 +0200 > Torsten Bronger <[EMAIL PROTECTED]> wrote: > >> Of course, "self" would have to become a reserved word. You >> could say that this may break some code, but I don't see much >> freedom > > Isn't this a showstopper all by i

clearing all warning module caches in a session

2008-07-26 Thread jason-sage
Hi all, I just started using the warnings module in Python 2.5.2. When I trigger a warning using the default warning options, an entry is created in a module-level cache so that the warning is ignored in the future. However, I don't see an easy way to clear or invalidate these module-level

Re: Attack a sacred Python Cow

2008-07-26 Thread D'Arcy J.M. Cain
On Sat, 26 Jul 2008 09:45:21 +0200 Torsten Bronger <[EMAIL PROTECTED]> wrote: > Of course, "self" would have to become a reserved word. You could > say that this may break some code, but I don't see much freedom Isn't this a showstopper all by itself? > removed from the language. After all, bei

Re: binding names doesn't affect the bound objects (was: print doesn't respect file inheritance?)

2008-07-26 Thread D'Arcy J.M. Cain
On Sat, 26 Jul 2008 14:07:52 +1000 Ben Finney <[EMAIL PROTECTED]> wrote: > > sys.stdout = n > > Re-binds the name 'sys.stdout' to the object already referenced by the > name 'n'. No objects are changed by this; only bindings of names to > objects. I do agree that the object formerly known as

Re: Stripping parts of a path

2008-07-26 Thread Larry Bates
Tim Cook wrote: Hi All, I just ran into an issue with the rstrip method when using it on path strings. When executing a function I have a need to strip off a portion of the current working directory and add on a path to a log file. Initially this worked great but then I added a branch in SVN w

Re: Stripping parts of a path

2008-07-26 Thread Karen Tracey
On Sat, Jul 26, 2008 at 7:59 AM, Tim Cook <[EMAIL PROTECTED]>wrote: > Hi All, > > I just ran into an issue with the rstrip method when using it on path > strings. > > When executing a function I have a need to strip off a portion of the > current working directory and add on a path to a log file.

Re: 2d graphics - what module to use?

2008-07-26 Thread sturlamolden
On Jul 26, 6:47 am, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > If you're using wx, there is also wx.lib.plot, which I found to be > _much_ faster than matplotlib in my application, especially when resizing. Yes. Matplotlib creates beautiful graphics, but are terribly slow on large data sets

Re: re.findall(a patern,'function(dsf sdf sdf)')

2008-07-26 Thread gcmartijn
On 26 jul, 14:25, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > - For me its hard to learn the re , I will try to search again at > > google for examples and do some copy past things. > > this might be useful when figuring out how RE:s work: > >      http://kodos.sourcefor

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
Hallöchen! Steven D'Aprano writes: > On Sat, 26 Jul 2008 11:08:12 +0200, Nikolaus Rath wrote: > >> [...] >> >> so 'self' should *automatically* only be inserted in the function >> declaration, and *manually* be typed for attributes. > > > That idea might have worked many years ago, but not now.

Stripping parts of a path

2008-07-26 Thread Tim Cook
Hi All, I just ran into an issue with the rstrip method when using it on path strings. When executing a function I have a need to strip off a portion of the current working directory and add on a path to a log file. Initially this worked great but then I added a branch in SVN which caused the pa

  1   2   >