ANN: pyvm 2.0

2009-10-04 Thread Stelios Xanthakis
Hi. After a long period, the next version of pyvm is finally out! pyvm is a small hobby project that's based on a vm that is a cousin of Python and attempts to reimplement a full userspace system with the use of a monolithic toolchain with internal APIs. The result is a very compact codebase

Re: Threaded GUI slowing method execution?

2009-10-04 Thread Aaron Hoover
On Oct 2, 2009, at 1:18 PM, sturlamolden wrote: On 2 Okt, 21:30, Dave Angel da...@ieee.org wrote: There could very well be multiprocess support in wxPython. I'd check there first, before re-inventing the wheel. I don't think there is. But one can easily make a thread in the subprocess

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 3, 10:12 pm, horos11 horo...@gmail.com wrote: a __main__.Myclass instance at 0x95cd3ec b __main__.Myclass instance at 0x95cd5ac What's the problem? Like I said, the code was a sample of what I was trying to do, not the entire thing.. I just wanted to see if the metaphor was

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 3, 10:34 pm, horos11 horo...@gmail.com wrote: Anyways, I see what's going on here: With the line, for state in curstate.next_states():     if not state.to_string() in seen_states:         dq.append(state) Inadvertently using the name of a module as a variable seems to be causing

Re: creating class objects inside methods

2009-10-04 Thread horos11
Carl, Thanks for the info, but a couple of points: 1. it wasn't meant to be production code, simply a way to teach python. 2. this should either be a compile time or a runtime error. 'Actions at a distance' like this are deadly both to productivity and to correctness - not only is this

Re: Enormous Input and Output Test

2009-10-04 Thread n00m
And this code time limits (no matter with or without Psyco): import psyco psyco.full() import sys def foo(): ##sys.stdin = open('D:/1583.txt', 'rt') sys.stdin.readline() while 1: try: x, y = sys.stdin.readline().split() sys.stdout.write(str(int(x) *

defaults for function arguments bound only once(??)

2009-10-04 Thread horos11
All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the expected '[1,2]'. Now my question - exactly why is 'default_me()' only called

Re: defaults for function arguments bound only once(??)

2009-10-04 Thread Chris Rebert
On Sat, Oct 3, 2009 at 11:29 PM, horos11 horo...@gmail.com wrote: All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the

Re: creating class objects inside methods

2009-10-04 Thread horos11
It's not a bug.  In Python classes and global variables share the same namespace. Don't you think you should learn a bit more about how Python manages objects and namespaces before going around calling things bugs? Carl Banks No, I don't think so.. Say you went to another country, where

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 3, 11:14 pm, horos11 horo...@gmail.com wrote: Carl, Thanks for the info, but a couple of points:     1. it wasn't meant to be production code, simply a way to teach python. I understand, and if you think it's overkill for your pedagogical application then feel free not to follow the

from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Valery
Hi all is it a pure Ubuntu Karmic (beta) issue?.. $ python Python 2.6.3 (r263:75183, Oct 3 2009, 11:20:50) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. from logging import * Traceback (most recent call last): File stdin, line 1, in module

Re: creating class objects inside methods

2009-10-04 Thread Dave Angel
horos11 wrote: Carl, Thanks for the info, but a couple of points: 1. it wasn't meant to be production code, simply a way to teach python. 2. this should either be a compile time or a runtime error. 'Actions at a distance' like this are deadly both to productivity and to correctness -

Re: from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Valery
OK, I've filed a bug. Because Python2.5 works fine here. -- Valery -- http://mail.python.org/mailman/listinfo/python-list

Re: creating class objects inside methods

2009-10-04 Thread Hendrik van Rooyen
On Sunday, 4 October 2009 08:14:08 horos11 wrote: Saying that 'whoa, this coding error should be handled by naming convention' may be the only practical way of getting around this limitation, but it is a limitation nonetheless, and a pretty big one. You misunderstand the dynamic nature of

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 3, 11:45 pm, horos11 horo...@gmail.com wrote: It's not a bug.  In Python classes and global variables share the same namespace. Don't you think you should learn a bit more about how Python manages objects and namespaces before going around calling things bugs? Carl Banks No, I

Windows GCC Support (Mingw Mingw-w64)

2009-10-04 Thread xeno fears
I work with the Mingw-w64 Project, and am the project owner of WPG System64 (you can find out about both at http://www.cadforte.com), which contains Python.org Python 2.6.2. I haven't used Python 3.1.1 because I have seen errors with print occur in several places, but that is another topic (I am

Re: Enormous Input and Output Test

2009-10-04 Thread n00m
I've given up :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Enormous Input and Output Test

2009-10-04 Thread John Yeung
On Oct 4, 1:50 am, n00m n...@narod.ru wrote: It can be not so simple. There can be multiple input files, with *total* size ~30-50-80 MB. According to one of the global moderators, the 20s time limit is for each input file: https://www.spoj.pl/forum/viewtopic.php?f=6t=4667 John --

Re: Dictionary with Lists

2009-10-04 Thread Shaun
Okay that makes sense. I was assuming that list.append returned the new list. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Enormous Input and Output Test

2009-10-04 Thread n00m
PS Yes, they support psyco since long time ago (otherwise I'd get Compilitation Error verdict). I used Psyco there many many times. -- http://mail.python.org/mailman/listinfo/python-list

Re: Enormous Input and Output Test

2009-10-04 Thread n00m
This time limits too: = import psyco psyco.full() import sys def foo(): ##sys.stdin = open('D:/1583.txt', 'rt') a = sys.stdin.readlines() a = a[1:int(a[0]) + 1] for ai in a: x, y = ai.split()

Re: Enormous Input and Output Test

2009-10-04 Thread n00m
It can be not so simple. There can be multiple input files, with *total* size ~30-50-80 MB. -- http://mail.python.org/mailman/listinfo/python-list

Re: weak reference to bound method

2009-10-04 Thread ryles
On Oct 2, 4:54 am, Ole Streicher ole-usenet-s...@gmx.net wrote: Hi group, I am trying to use a weak reference to a bound method: class MyClass(object):     def myfunc(self):         pass o = MyClass() print o.myfunc   bound method MyClass.myfunc of __main__.MyClass object at 0xc675d0

Re: PIL : How to write array to image ???

2009-10-04 Thread Martin
On Oct 3, 11:56 pm, Peter Otten __pete...@web.de wrote: Martin wrote: Dear group I'm trying to use PIL to write an array (a NumPy array to be exact) to an image. Peace of cake, but it comes out looking strange. I use the below mini code, that I wrote for the purpose. The print of a

Re: Enormous Input and Output Test

2009-10-04 Thread John Yeung
On Oct 4, 4:20 am, n00m n...@narod.ru wrote: I've given up :-) Well, that numerix user (who already had the top Python solution) just submitted a ton of new ones to that problem, apparently trying to get a faster time. I don't think he can squeeze much more out of that stone, but unlike us,

Re: Dictionary with Lists

2009-10-04 Thread Mick Krippendorf
John Nagle schrieb: Shaun wrote: I'm trying to create a dictionary with lists as the value for each key. Try using a tuple, instead of a list, for each key. Tuples are immutable, so there's no issue about a key changing while being used in a dictionary. Only if Shaun wanted to use

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-04 Thread Martien Verbruggen
On Sun, 4 Oct 2009 01:17:18 + (UTC), Grant Edwards inva...@invalid.invalid wrote: On 2009-10-03, ryniek90 rynie...@gmail.com wrote: So, whether it is or has been planned the core Python implementation of *scanf()* ? One of the fist things I remember being taught as a C progrmmer

Re: Enormous Input and Output Test

2009-10-04 Thread Bearophile
Terry Reedy: Don't waste your time with problem sites that judge raw-clock time over (and before) accuracy, thereby greatly favoring low-level languages and hack tricks over clear high-level code. I usually don't like to solve the kind of problems shown by those sites because those problems

Re: creating class objects inside methods

2009-10-04 Thread Albert Hopkins
Just by a brief look at your code snippet there are a few things that I would point out, stylistically, that you may consider changing in your code as they are generally not considered pythonic: * As already mentioned the state class is best if given a name that is capitalized.

Re: Enormous Input and Output Test

2009-10-04 Thread Duncan Booth
n00m n...@narod.ru wrote: I've given up :-) Here's my attempt, which is about 30% faster than your original but I've no idea if it would be fast enough for you. import sys, time, os, itertools import gc gc.set_threshold() D = [] def foo(): ##sys.stdin = open('D:/1583.txt', 'rt')

Re: Enormous Input and Output Test

2009-10-04 Thread Jon Clements
On Oct 4, 12:08 pm, n00m n...@narod.ru wrote: Duncan Booth, alas... still TLE: 2800839 2009-10-04 13:03:59 Q Enormous Input and Output Test time limit exceeded - 88M PYTH Just to throw into the mix... What about buffering? Does anyone know what the effective stdin buffer is for

Re: creating class objects inside methods

2009-10-04 Thread Rhodri James
On Sun, 04 Oct 2009 07:14:08 +0100, horos11 horo...@gmail.com wrote: Carl, Thanks for the info, but a couple of points: 1. it wasn't meant to be production code, simply a way to teach python. Speaking as someone who does teach Python, Ew, no! If you start by teaching people bad habits,

Re: The Python: Rag October issue available

2009-10-04 Thread Bernie
On Sat, 03 Oct 2009 20:09:18 -0700, TerryP wrote: On Oct 3, 4:29 pm, Bernie edi...@pythonrag.org wrote: Hi, no -its just put on the website.  Unless there's a method you can suggest? Not to butt in, but off the top of my head, you could probably set up a mailing list and post the link to

Re: Enormous Input and Output Test

2009-10-04 Thread Duncan Booth
Jon Clements jon...@googlemail.com wrote: On Oct 4, 12:08 pm, n00m n...@narod.ru wrote: Duncan Booth, alas... still TLE: 2800839 2009-10-04 13:03:59 Q Enormous Input and Output Test time limit exceeded - 88M PYTH Just to throw into the mix... What about buffering? Does anyone

execfile in python3 breaks emacs mode

2009-10-04 Thread Rustom Mody
Removing execfile from python3 has broken the good-ol python-mode of emacs. Changing the line In python-mode.el in function py-execute-file changing the line (cmd (format execfile(r'%s') # PYTHON-MODE\n filename))) to (cmd (format exec(open(r'%s').read()) # PYTHON-MODE\n filename))) seems to

Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
I'm using python to access an email account via POP, then for each incoming message, save any attachments. This is the function which scans the message for attachments: def save_attachments (local_folder, msg_text): Scan the email message text and save the attachments (if any) in the

Client-server PDF creation with xtopdf, XML-RPC, ReportLab and Python

2009-10-04 Thread vasudevram
Hi group, I've released a software package named PDFXMLRPC. It consists of a server and a client. Using them, you can do client-server PDF creation from text, over the Internet or your intranet. It runs over XML-RPC and uses HTTP as the transport. It can work with any available port, including

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 07:27 -0700, dpapathanasiou wrote: When I try to write the filedata to a file system folder, though, I get an AttributeError in the stack trace. And where might we be able to see that stack trace? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: execfile in python3 breaks emacs mode

2009-10-04 Thread Rustom Mody
Just answering my own question A little googling tells me to use (cmd (format exec(compile(open('%s').read(), '%s', 'exec')) # PYTHON-MODE\n filename filename))) instead of (cmd (format exec(open(r'%s').read()) # PYTHON-MODE\n filename))) sheesh! On Sun, Oct 4, 2009 at 6:57 PM, Rustom Mody

Re: Python shared lib

2009-10-04 Thread Aahz
In article h9p9mp$2cv...@adenine.netfront.net, namekuseijin namekuseijin.nos...@gmail.com wrote: and then I realize that, for whatever reason, the super popular and trendy python DOESN'T FRIGGIN BUILD SHARED LIBS BY DEFAULT! I've got a dim memory that there's a reason for this -- you might try

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
And where might we be able to see that stack trace? This is it: Exception: ('AttributeError', 'no args', [' File /opt/server/smtp/ smtps.py, line 213, in handle\ne mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n', ' File / opt/server/smtp/email_replier.py, l ine 108, in

Re: from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Benjamin Kaplan
I can confirm this in Python 2.6.3 for Windows and Mac while it doesn't appear in Python 2.6.2 on Windows or the system Python 2.6.1 in Snow Leopard. Looks like it's a Python problem, not Ubuntu's. On Sun, Oct 4, 2009 at 3:31 AM, Valery khame...@gmail.com wrote: OK, I've filed a bug. Because

Re: organizing your scripts, with plenty of re-use

2009-10-04 Thread Stef Mientki
Steven D'Aprano wrote: On Sat, 03 Oct 2009 10:24:13 +0200, Stef Mientki wrote: I still don't use (because I don't fully understand them) packages, but by trial and error I found a reasonable good working solution, with the following specifications I find that fascinating. You haven't

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 08:16 -0700, dpapathanasiou wrote: And where might we be able to see that stack trace? This is it: Exception: ('AttributeError', 'no args', [' File /opt/server/smtp/ smtps.py, line 213, in handle\ne mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n', '

Re: from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Vinay Sajip
On Oct 4, 4:47 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: Looks like it's a Python problem, not Ubuntu's. That's correct, it's a Python problem. A fix has been checked in on the release26-maint branch (which means that it should be available in 2.6.4) and a unit test added to catch this

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread dpapathanasiou
Which is *really* difficult (for me) to read.  Any chance of providing a normal traceback? File /opt/server/smtp/smtps.py, line 213, in handle email_replier.post_reply(recipient_mbox, ''.join(data)) File /opt/server/smtp/email_replier.py, line 108, in post_reply

Re: defaults for function arguments bound only once(??)

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 2:29 AM, horos11 horo...@gmail.com wrote: All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the expected

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 5:29 AM, Martien Verbruggen martien.verbrug...@invalid.see.sig wrote: On Sun, 4 Oct 2009 01:17:18 + (UTC),        Grant Edwards inva...@invalid.invalid wrote: On 2009-10-03, ryniek90 rynie...@gmail.com wrote: So, whether it is or has been planned the core Python

Re: creating class objects inside methods

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 1:12 AM, horos11 horo...@gmail.com wrote: a __main__.Myclass instance at 0x95cd3ec b __main__.Myclass instance at 0x95cd5ac What's the problem? Like I said, the code was a sample of what I was trying to do, not the entire thing.. I just wanted to see if the

Re: The Python: Rag October issue available

2009-10-04 Thread Bernie
On Sun, 04 Oct 2009 07:37:35 -0500, Bernie wrote: On Sat, 03 Oct 2009 20:09:18 -0700, TerryP wrote: On Oct 3, 4:29 pm, Bernie edi...@pythonrag.org wrote: Hi, no -its just put on the website.  Unless there's a method you can suggest? Not to butt in, but off the top of my head, you could

Re: Windows GCC Support (Mingw Mingw-w64)

2009-10-04 Thread Martin v. Löwis
Is there any chance of getting some of the devs or anyone familiar enough with the source code to make this possibility become reality? Please take a look at http://bugs.python.org/issue4709 Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: creating class objects inside methods

2009-10-04 Thread horos11
Thanks for the info, but a couple of points:     1. it wasn't meant to be production code, simply a way to teach python. Speaking as someone who does teach Python, Ew, no!  If you start by teaching people bad habits, every educator who comes along afterwards will curse your name.  

Re: creating class objects inside methods

2009-10-04 Thread Benjamin Kaplan
On Sun, Oct 4, 2009 at 2:44 PM, horos11 horo...@gmail.com wrote: Thanks for the info, but a couple of points:     1. it wasn't meant to be production code, simply a way to teach python. Speaking as someone who does teach Python, Ew, no!  If you start by teaching people bad habits,

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 4, 11:56 am, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Sun, Oct 4, 2009 at 2:44 PM, horos11 horo...@gmail.com wrote: ( ps - an aside, but what was the rationale behind only displaying one error at a time on trying to run a script? I typically like to run a compilation

Re: creating class objects inside methods

2009-10-04 Thread Carl Banks
On Oct 4, 3:12 am, Albert Hopkins mar...@letterboxes.org wrote:       * You define a to_string() method. To have a string representation         of a class, one usually defines a __str__ method.  This gives         the advantage whereby print myobject or '%s' % myjobject just         work.

Re: creating class objects inside methods

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 2:44 PM, horos11 horo...@gmail.com wrote: Thanks for the info, but a couple of points:     1. it wasn't meant to be production code, simply a way to teach python. Speaking as someone who does teach Python, Ew, no!  If you start by teaching people bad habits,

Re: creating class objects inside methods

2009-10-04 Thread Rob Williscroft
Benjamin Kaplan wrote in news:mailman.838.1254682604.2807.python- l...@python.org in comp.lang.python: And how do you just check a script's syntax without running it anyways? ) Because these aren't compile-time errors. Python has no compilation phase- Sure it does, compilation happens

Re: organizing your scripts, with plenty of re-use

2009-10-04 Thread Robert Kern
On 2009-10-04 10:48 AM, Stef Mientki wrote: Steven D'Aprano wrote: On Sat, 03 Oct 2009 10:24:13 +0200, Stef Mientki wrote: I still don't use (because I don't fully understand them) packages, but by trial and error I found a reasonable good working solution, with the following specifications

Re: PIL : How to write array to image ???

2009-10-04 Thread Mart.
On Oct 4, 9:47 am, Martin mar...@hvidberg.net wrote: On Oct 3, 11:56 pm, Peter Otten __pete...@web.de wrote: Martin wrote: Dear group I'm trying to use PIL to write an array (a NumPy array to be exact) to an image. Peace of cake, but it comes out looking strange. I use the

Re: creating class objects inside methods

2009-10-04 Thread Stephen Hansen
Anyways, maybe I got off to a bad start, but I'm a bit leery of the language. In my estimation it's trying to be 'too clever by half', and this coming from a veteran bash/perl programmer. I mean, free form is one thing, but too much of a good thing can be harmful to your programming health.

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 09:17 -0700, dpapathanasiou wrote: Which is *really* difficult (for me) to read. Any chance of providing a normal traceback? File /opt/server/smtp/smtps.py, line 213, in handle email_replier.post_reply(recipient_mbox, ''.join(data)) File

Re: creating class objects inside methods

2009-10-04 Thread Terry Reedy
horos11 wrote: Anyways, maybe I got off to a bad start, Blaming programming errors on non-existent bugs in the interpreter is not a way to endear yourself. And perhaps Python truly is not your style. Maybe PyChecker or PyLint will help, I don't know. I do not use them, but others swear

Re: Client-server PDF creation with xtopdf, XML-RPC, ReportLab and Python

2009-10-04 Thread vasudevram
On Oct 4, 7:38 pm, vasudevram vasudev...@gmail.com wrote: Hi group, snip/ I'll update the README.txt file to correct that error soon.) Done. Corrected README.txt uploaded (as part of updated zip file). I forgot to mention, in the original post above, that both the client and the server

Skeletal animation

2009-10-04 Thread Manowar
I am new to pyton and have asked this question several times the answer is always not sure. Here is my question sekeltal animation ( bone animation) is it possible with python? What i want to develop is an aquarium in realtime, skeletal animation, all the movements will be from programming., no

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-04 Thread Martien Verbruggen
On Sun, 4 Oct 2009 13:18:22 -0400, Simon Forman sajmik...@gmail.com wrote: On Sun, Oct 4, 2009 at 5:29 AM, Martien Verbruggen martien.verbrug...@invalid.see.sig wrote: On Sun, 4 Oct 2009 01:17:18 + (UTC),        Grant Edwards inva...@invalid.invalid wrote: On 2009-10-03, ryniek90

Re: Skeletal animation

2009-10-04 Thread TerryP
On Oct 4, 10:05 pm, Manowar r_marcanto...@netzero.net wrote: I am new to pyton and have asked this question several times the answer is always not sure. Here is my question sekeltal animation ( bone animation) is it possible with python? What i want to develop is an aquarium in realtime,

Re: Python shared lib

2009-10-04 Thread Chris Colbert
thats because the standard way to build python packaged is to use distutils, and not make files. Blame Yafaray for not supplying a setup.py... ..M, Aahz a...@pythoncraft.com wrote: In article h9p9mp$2cv...@adenine.netfront.net, namekuseijin  namekuseijin.nos...@gmail.com wrote: and then I

Re: Skeletal animation

2009-10-04 Thread Manowar
On Oct 4, 6:38 pm, TerryP bigboss1...@gmail.com wrote: On Oct 4, 10:05 pm, Manowar r_marcanto...@netzero.net wrote: I am new to pyton and have asked this question several times the answer is always not sure. Here is my question sekeltal animation ( bone animation) is it possible with

Re: Skeletal animation

2009-10-04 Thread alex23
On Oct 5, 8:05 am, Manowar r_marcanto...@netzero.net wrote: I am new to pyton and have asked this question several times the answer is always not sure. Here is my question sekeltal animation ( bone animation) is it possible with python? What i want to develop is an aquarium in realtime,

Re: Skeletal animation

2009-10-04 Thread Carl Banks
On Oct 4, 5:16 pm, Manowar r_marcanto...@netzero.net wrote: On Oct 4, 6:38 pm, TerryP bigboss1...@gmail.com wrote: On Oct 4, 10:05 pm, Manowar r_marcanto...@netzero.net wrote: I am new to pyton and have asked this question several times the answer is always not sure. Here is my

Re: Skeletal animation

2009-10-04 Thread AK Eric
Building on what others have said and giving a +1 to Carl: I work daily in Maya doing character setup and rigging. As far as doing it straight in Python, again, like others, take a look at PyGame or Blender. I think the main question is: Do you want skeletal animation, or do you want skeletal

Re: Regular expression to structure HTML

2009-10-04 Thread Nobody
On Thu, 01 Oct 2009 22:10:55 -0700, 504cr...@gmail.com wrote: I'm kind of new to regular expressions The most important thing to learn about regular expressions is to learn what they can do, what they can't do, and what they can do in theory but can't do in practice (usually because of

Re: Need feedback on subprocess-using function

2009-10-04 Thread Nobody
On Sat, 03 Oct 2009 13:21:00 +, gb345 wrote: I'm relatively new to Python, and I'm trying to get the hang of using Python's subprocess module. As an exercise, I wrote the Tac class below, which can prints output to a file in reverse order, by piping it through the Unix tac utility. (The

Re: Q: sort's key and cmp parameters

2009-10-04 Thread Raymond Hettinger
[Paul Rubin] Example of list of trees (nested dicts). In practice you could get such a list from the simplejson module: list_of_trees = [{'value':1, 'left':{'value':3,'left':None,'right':None}, 'right':{'value':7,'left':{'value':5, ...}}},

Delete all list entries of length unknown

2009-10-04 Thread flebber
Hi Can someone clear up how I can remove all entries of a list when I am unsure how many entries there will be. I have been using sandbox to play essentially I am creating two lists a and b I then want to add a to b and remove all b entries. This will loop and b will receive new entries add it to

Re: Delete all list entries of length unknown

2009-10-04 Thread Chris Rebert
On Sun, Oct 4, 2009 at 8:09 PM, flebber flebber.c...@gmail.com wrote: Hi Can someone clear up how I can remove all entries of a list when I am unsure how many entries there will be. I have been using sandbox to play essentially I am creating two lists a and b I then want to add a to b and

Re: Delete all list entries of length unknown

2009-10-04 Thread r
On Oct 4, 10:09 pm, flebber flebber.c...@gmail.com wrote: Hi Can someone clear up how I can remove all entries of a list when I am unsure how many entries there will be. Sure...! a = range(10) a [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] del a[0] a [1, 2, 3, 4, 5, 6, 7, 8, 9] del a[-1] a [1, 2, 3,

Re: Skeletal animation

2009-10-04 Thread r
On Oct 4, 5:05 pm, Manowar r_marcanto...@netzero.net wrote: Here is my question sekeltal animation ( bone animation) is it possible with python? For God's sakes man![:-1]+'owar, use Blender!' -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete all list entries of length unknown

2009-10-04 Thread Mark Tolonen
Chris Rebert c...@rebertia.com wrote in message news:50697b2c0910042047i1cf2c1a3mc388bc74bab95...@mail.gmail.com... Tuples are immutable (i.e. they cannot be modified after creation) and are created using parentheses. Slight correction: tuples are created using commas. Parentheses are only

regex (?!..) problem

2009-10-04 Thread Wolfgang Rohdewald
Hi, I want to match a string only if a word (C1 in this example) appears at most once in it. This is what I tried: re.match(r'(.*?C1)((?!.*C1))','C1b1b1b1 b3b3b3b3 C1C2C3').groups() ('C1b1b1b1 b3b3b3b3 C1', '') re.match(r'(.*?C1)','C1b1b1b1 b3b3b3b3 C1C2C3').groups() ('C1',) but this should

Re: regex (?!..) problem

2009-10-04 Thread n00m
Why not check it simply by count()? s = '1234C156789' s.count('C1') 1 -- http://mail.python.org/mailman/listinfo/python-list

blog

2009-10-04 Thread cashpan...@live.com
hey friends just made a new blog will you comment it http://makeing-money.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

[issue6760] patch to subprocess docs to better explain Popen's 'args' argument

2009-10-04 Thread Chris Rebert
Chris Rebert pyb...@rebertia.com added the comment: Ok, changed to note directives instead of warnings. Anything else that keeps this from being applied? -- Added file: http://bugs.python.org/file15033/subprocess.rst.patch ___ Python tracker

[issue6760] patch to subprocess docs to better explain Popen's 'args' argument

2009-10-04 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: Removed file: http://bugs.python.org/file14817/subprocess.rst.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6760 ___

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Valery
New submission from Valery khame...@gmail.com: Hi all (I never filed a bug, so, I am not sure that all fields are OK) Anyway, here is the self explaining issue: $ python Python 2.6.3 (r263:75183, Oct 3 2009, 11:20:50) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Valery
Valery khame...@gmail.com added the comment: I have just installed python2.5 in addition. And there is no this issue with it. So, it rather speific to python2.6 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7052

[issue7053] wrong overload of slot wrapper

2009-10-04 Thread Mattelaer
New submission from Mattelaer olivier.mattel...@uclouvain.be: wrong redirection of slot wrapper: class.__iter__=list.__iter__ doesn't work. (the __iter__ still refer to the one define in class) The file in attachment shows an example of this problem -- components: None files: test.py

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Ryan Leslie
Ryan Leslie ryle...@gmail.com added the comment: Looks like a merge has gone bad. NullHandler has existed for a while on trunk but is not present in the 2.6.3 tag (__all__ was updated to include it, however): /python/tags/r263/Lib/logging/__init__.py -- nosy: +ryles

[issue7033] C/API - Document exceptions

2009-10-04 Thread lekma
lekma lekma...@gmail.com added the comment: Even though I don't fully agree with your comments here is a second attempt addressing them, against trunk. For the record, I think that the signature difference is enough to warrant a name that is a clear cut from PyErr_NewException. And in the

[issue7033] C/API - Document exceptions

2009-10-04 Thread lekma
lekma lekma...@gmail.com added the comment: Same as previous against py3k -- Added file: http://bugs.python.org/file15036/issue7033_py3k_2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7033

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Shrug. That doesn't really bother me. x**y%z and pow(x, y, z) aren't going to match anyway, as soon as x**y has to be rounded. What would bother me more is the idea of having, with precision 4: pow(3, 22, 12347) - nan pow(3, 23, 12347) -

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - vinay.sajip nosy: +vinay.sajip priority: - critical stage: - needs patch type: resource usage - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7052

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Gregor Lingl
Gregor Lingl gregorli...@users.sourceforge.net added the comment: The same True for captureWarnings? (It's also is only present in __all__) -- nosy: +gregorlingl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7052

[issue7054] Python25.chm seems to be broken

2009-10-04 Thread Mark Schlieker
New submission from Mark Schlieker sternenfaenge...@googlemail.com: CHM file for Python 2.5 documentation does not work when being used without Python installation. My OS is: Microsoft Windows XP (sp2) Steps on how to reproduce: prerequisite: 1) No python has been installed on machine (not

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Georg committed a fix but now we have: from logging import * Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'module' object has no attribute 'captureWarnings' -- nosy: +georg.brandl, pitrou

[issue5395] array.fromfile not checking I/O errors

2009-10-04 Thread Jan Hosang
Jan Hosang jan.hos...@gmail.com added the comment: Ezio, I moved the test to a separate method. Also I couldn't find something to close the file if I don't care about errors. I thought an assertRises would be wrong, as I am not debugging files here, so I added a function to call a callable I

[issue7052] from logging import * causes an error under Ubuntu Karmic

2009-10-04 Thread Gregor Lingl
Gregor Lingl gregorli...@users.sourceforge.net added the comment: As stated above: the name captureWarnings is also present *only* in __all__. Same reason, same effect. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7052

[issue5395] array.fromfile not checking I/O errors

2009-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: There doesn't seem to be any reason to introduce the expect_exception() helper, rather than to use a with statement. Am I mistaken? -- nosy: +pitrou stage: test needed - patch review versions: +Python 2.7, Python 3.2 -Python 2.6

[issue7054] Python25.chm seems to be broken

2009-10-04 Thread Mark Schlieker
Mark Schlieker sternenfaenge...@googlemail.com added the comment: Oh I found out myself: the file is ok. When the message gets displayed it has to do with security settings in Windows XP: Solution: Right click on the file in file explorer and choose properties in order to open the properties

[issue7054] Python25.chm seems to be broken

2009-10-04 Thread Mark Schlieker
Changes by Mark Schlieker sternenfaenge...@googlemail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7054 ___ ___

  1   2   >