Mindstorms NXT Bluetooth API modules (with XInput support)

2008-07-26 Thread Jason R. Coombs
I'm pleased to announce jaraco.nxt 1.0, the first public release of a library for communicating with the Lego Mindstorms NXT devices. A minimal web site has been set up at: http://www.jaraco.com/projects/jaraco.nxt The modules have been uploaded to PyPI and should be installable using:

Re: 2d graphics - what module to use?

2008-07-26 Thread Carl Banks
On Jul 25, 4:10 am, King [EMAIL PROTECTED] wrote: Use python's default GUI tkinter's drawing functions or you can use wxPython GUI kit or you can use pyopengl. If you are only interested to draw sin waves or math functions that you should give try to matlab atwww.mathworks.com If you're only

u just click u get some dollars

2008-07-26 Thread abcd
http://www.parttimejobsu.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.dom's weirdness?

2008-07-26 Thread Fredrik Lundh
Lie wrote: Why this generates AttributeError, then not? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. import xml xml.dom Traceback (most recent call last): File stdin, line 1, in

Insert character at a fixed position of lines

2008-07-26 Thread Francesco Pietra
How to insert letter A on each line (of a very long list of lines) at position 22, i.e., one space after LEU, leaving all other characters at the same position as in the original example: ATOM 1 N LEU 1 146.615 40.494 103.776 1.00 73.04 1SG 2 In all linesATOM is

Re: Attack a sacred Python Cow

2008-07-26 Thread Torsten Bronger
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 the 'self' version. And

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

2008-07-26 Thread Richard Levasseur
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 have different interface. simplejson uses load/loads/dump/ dumps, whereas

Re: Attack a sacred Python Cow

2008-07-26 Thread Carl Banks
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 if x==0, or if s instead

Re: Insert character at a fixed position of lines

2008-07-26 Thread Peter Otten
Francesco Pietra wrote: How to insert letter A on each line (of a very long list of lines) at position 22, i.e., one space after LEU, leaving all other characters at the same position as in the original example: ATOM 1 N LEU 1 146.615 40.494 103.776 1.00 73.04 1SG

Re: Attack a sacred Python Cow

2008-07-26 Thread Carl Banks
On Jul 24, 1:41 am, Jordan [EMAIL PROTECTED] wrote: Except when it comes to Classes. I added some classes to code that had previously just been functions, and you know what I did - or rather, forgot to do? Put in the 'self'. In front of some of the variable accesses, but more noticably, at the

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

2008-07-26 Thread Robert Kern
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\traits\ui\tests\shell_editor_test.py -

Just click and Enjoy the latest Shreya and Asin

2008-07-26 Thread Enjoy
Just click and Enjoy the latest Shreya and Asin SEXY photes also your favorite Heroines... http://lovegroup341.blogspot.com/ # ENJOY each moments -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Martin v. Löwis
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 start a .NET .exe program, the operating system needs to decide whether to create a

Re: Questions on 64 bit versions of Python

2008-07-26 Thread Martin v. Löwis
(Any recommendations on a flavor of 64 bit of Linux for the Intel architecture would be appreciated) My recommendation is to use Debian or Ubuntu, as that's my personal preference. As MAL said, any recent distribution that supports AMD64 should be fine (assuming you are not interested in

Re: Attack a sacred Python Cow

2008-07-26 Thread Bruno Desthuilliers
Carl Banks a écrit : 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 if

Re: Insert character at a fixed position of lines

2008-07-26 Thread Lie
On Jul 26, 2:41 pm, Francesco Pietra [EMAIL PROTECTED] wrote: How to insert letter A on each line (of a very long list of lines) at position 22, i.e., one space after LEU, leaving all other characters at the same position as in the original example: ATOM      1  N   LEU     1     146.615  

Re: Attack a sacred Python Cow

2008-07-26 Thread Bruno Desthuilliers
Matthew Fitzgibbons a écrit : (snip) As for !=, it seems like there is a technical reason for the behavior. Remember, there is no default __ne__ method, so the behavior you want would have to live in the interpreter. If __ne__ isn't defined, it would have to try to call __eq__ and negate the

EZ Recipe Menu Costing

2008-07-26 Thread raja
Customized Excel Workbook to Cost All Your Recipes Menu Items http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Weinhaus Weiler

2008-07-26 Thread raja
Historical half-timbered house with excellent cuisine in Oberwesel http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Gain 700% More Muscle

2008-07-26 Thread raja
How To Gain Freaky Muscle Mass. As Seen On CNN. http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

How I Lost My Belly Fat

2008-07-26 Thread raja
I fought with excess belly fat for years until I found this 1 trick. http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Parmigiano Reggiano DOP

2008-07-26 Thread raja
Eccelsa Qualità di Montagna per Rivenditori, Ristoranti e Privati. http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

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

2008-07-26 Thread gcmartijn
H! First I have some random string below. bla = script type=text/javascript // ![CDATA[ var bla = new Blaobject(argh 1a, argh 2a, 24, 24, 345) function la( tec ) { etc etc }

Traditional cuisine

2008-07-26 Thread raja
with italian regional recipes with italian master chefs http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Superfruit strategy

2008-07-26 Thread raja
Six Elements of Superfruit Success Buy new book of expert insights! http://food-drinks.page.tl/ -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.dom's weirdness?

2008-07-26 Thread Lie
On Jul 26, 2:29 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Lie wrote: Why this generates AttributeError, then not? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. import xml

Re: Attack a sacred Python Cow

2008-07-26 Thread Nikolaus Rath
Terry Reedy [EMAIL PROTECTED] writes: Nikolaus Rath wrote: Terry Reedy [EMAIL PROTECTED] writes: Torsten Bronger wrote: Hallöchen! And why does this make the implicit insertion of self difficult? I could easily write a preprocessor which does it after all. class C(): def f(): a =

Re: Insert character at a fixed position of lines

2008-07-26 Thread Francesco Pietra
I am still at the stone age, using scripts (e.g., to insert a string after a string) of the type f = open(xxx.pdb, r) for line in f: print line if H16Z POPC in line: print TER f.close() That is, I have to learn about modules. In your scripts I am lost about the filename for the pdb

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

2008-07-26 Thread Lie
On Jul 26, 5:03 pm, [EMAIL PROTECTED] wrote: H! First I have some random string below. bla =          script type=text/javascript                 // ![CDATA[                 var bla = new Blaobject(argh 1a, argh 2a, 24, 24, 345)                 function la( tec )                 {    

Re: xml.dom's weirdness?

2008-07-26 Thread Fredrik Lundh
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 python with the -v option, so you can see exactly when the import

Re: Insert character at a fixed position of lines

2008-07-26 Thread Lie
On Jul 26, 5:42 pm, Francesco Pietra [EMAIL PROTECTED] wrote: I am still at the stone age, using scripts (e.g., to insert a string after a string) of the type f = open(xxx.pdb, r) for line in f:    print line    if H16Z POPC in line:        print TER f.close() That is, I have to learn

Re: scanf in python

2008-07-26 Thread AMD
Thanks Fredrik, very nice examples. André AMD wrote: For reading delimited fields in Python, you can use .split string method. Yes, that is what I use right now, but I still have to do the conversion to integers, floats, dates as several separate steps. What is nice about the scanf

Re: Insert character at a fixed position of lines

2008-07-26 Thread Fredrik Lundh
Francesco Pietra wrote: How to insert letter A on each line (of a very long list of lines) at position 22, i.e., one space after LEU, leaving all other characters at the same position as in the original example: ATOM 1 N LEU 1 146.615 40.494 103.776 1.00 73.04 1SG 2

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

2008-07-26 Thread gcmartijn
In short, the regular expression you used doesn't seem to be an effort to solve the problem. In other words, you haven't read the regular expression docs:http://docs.python.org/lib/module-re.html. In other words, it's useless to talk with you until then. Its a combination - I don't

Re: Attack a sacred Python Cow

2008-07-26 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : (snip) There are quite a few cases in Python where there are both a specific magic method *and* a default behaviour based on another magic method if the specific one is not implemented. Just out of my mind: s/out of my mind/Off the top of my head/ Pardon my

Re: Attack a sacred Python Cow

2008-07-26 Thread Steven D'Aprano
On Sat, 26 Jul 2008 11:08:12 +0200, Nikolaus Rath wrote: Terry Reedy [EMAIL PROTECTED] writes: ... Because you must prefix self attributes with 'self.'. If you do not use any attributes of the instance of the class you are making the function an instance method of, then it is not really an

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

2008-07-26 Thread Fredrik Lundh
[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.sourceforge.net/ also, don't forget the following guideline: Some people,

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

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. The problem

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.sourceforge.net/

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: 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: 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

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: 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, being a

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 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 itself? Yes.

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. The in

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 that other

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 compact 's.sum =

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 now free to write the

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 fact

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 start a

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: 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

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 21 | 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 forgot the

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

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' --

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 =

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

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 well,

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). snip  If solid discussion is your goal, I suggest that you

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

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

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

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 of every

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

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

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

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 was an

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

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 AFAICT

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 this

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

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 develop a

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. A

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 people

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 tests

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: 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, but for

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 ...

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: 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 have

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 exactly

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 if

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

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 the

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 argument list? As I said,

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 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 showstopper

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 = s.a + s.b + s.c'

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 at the

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 the

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 don't see much freedom

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 demos

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 --

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 workie.   I want an

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 two

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: 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 21 | 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:]')

  1   2   >