Re: Learning C++ for Python Development

2009-05-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 joshua.pea...@gmail.com wrote: > Or, just give me some general advice on learning C++ for Python? You may want to start with Cython first. It lets you intersperse C and C level information with Python code to produce extensions. That will give you a

Re: unicode bit me

2009-05-10 Thread Terry Reedy
anuraguni...@yahoo.com wrote: so unicode(obj) calls __unicode__ on that object It will look for the existence of type(ob).__unicode__ ... > and if it isn't there __repr__ is used According to the below, type(ob).__str__ is tried first. __repr__ of list by default return a str even if __rep

Re: ISO exemplary Python scripts

2009-05-10 Thread Tim Roberts
kj wrote: > >Thanks, but the last bit of your post ("...most of which have the >ability to run by themselves") makes me wonder whether we mean the >same thing when we talk of "scripts." Can you give me an example >of a script that *does not* have the ability to run by itself? >When I use the word

Re: Importing from a module which contains more than one Class...

2009-05-10 Thread alex23
GKalman wrote: > from MyClass import * > from MyOtherClass import *     # error msg: no such module! > > As I mentioned above,  the code for MyClass & MyOtherClass is in the same > file . This program only works with a single Class in a file. That is when > the File name is the SAME as the Class n

Importing from a module which contains more than one Class...

2009-05-10 Thread GKalman
OS= MS Vista File structure: .../Module (i.e a Folder with 2 sub-folders) .../Module_Class(sub-folder #1) /MyClass.py .../Module_Class_Testing (sub_folder #2) /module_class_driver.py Here is the code for the two (simplified) Python files: #this is modul

Re: Web Based Front End?

2009-05-10 Thread Vinicius Assef
On Thu, May 7, 2009 at 10:52 PM, wrote: [snip] > > So, my question is what is the best method to be able to have a user > enter specific data on a web page, have that data be passed to the > Python script and then have the output returned to the web page? Django is the buzzword, among python com

stand alone exec

2009-05-10 Thread prakash jp
Hi all, I want to run dos commands through python stand alone execs. The created Python stand alone executable (py2exe) works fine in my machine but on transferring the "dist" folder to other systems the executable fails to run. I tried to copy the MSVCP90.dll in the "dist" folder. Also tried t

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-10 Thread Paul Rubin
Carl Banks writes: > Syntax--the thing you claim doesn't matter--got in the middle because > it was the main factor that drove the OP to look for alternatives to > Haskell. I don't think so. The OP said that "... the syntax would be a lot easier to understand, than most functional languages, li

Re: There may be a much better way to manage artillery.

2009-05-10 Thread draeath
Tobiah wrote: > I'm writing a video game with armed space ships. > I decided to make a class to manage all of the bullets > that may be on the screen at a given time: > > class Bullets(): > > def __init__(self): > self.bullets = [] > > def update(self): >

Re: How can I dynamically insert a base class in a given class

2009-05-10 Thread Gabriel Genellina
En Sun, 10 May 2009 00:04:17 -0300, Дамјан Георгиевски escribió: How can I dynamically insert a base class in a given class? Yeah, I'm writing a class decorator that needs to manipulate the class by inserting another base class in it. In this case, as you want to modify the base classes, I

Re: Pythonic way to normalize vertical whitespace

2009-05-10 Thread Stephen Hansen
On Fri, May 8, 2009 at 8:53 AM, wrote: > I'm looking for suggestions on technique (not necessarily code) about the > most pythonic way to normalize vertical whitespace in blocks of text so that > there is never more than 1 blank line between paragraphs. Our source text > has newlines normalized

Re: help with recursive whitespace filter in

2009-05-10 Thread Steve Howell
On May 10, 10:23 am, rustom wrote: > On May 10, 9:49 pm, Steve Howell wrote: > > > > > On May 10, 9:10 am, Rustom Mody wrote: > > > > I am trying to write a recursive filter to remove whitespace-only > > > nodes for minidom. > > > The code is below. > > > > Strangely it deletes some whitespace n

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-10 Thread Martin P. Hellwig
Piet van Oostrum wrote: goo...@smetj.net (g) wrote: g> Well, I think Martin's example will suit my needs. g> Thanks for the explanation! His client code is unnecessarily complicated with 3 session variables. The following code does the same: SESSION = xmlrpclib.ServerProxy(URL_PORT)

Re: Wrapping comments

2009-05-10 Thread Rhodri James
On Sun, 10 May 2009 08:32:23 +0100, Tobias Weber wrote: In article , Arnaud Delobelle wrote: A simple Alt-Q will reformat everything nicely. Now that's something. Thanks! (still not gonna use software that doesn't let me type # because it's alt+3 on a UK layout; having to re-learn or con

Re: There may be a much better way to manage artillery.

2009-05-10 Thread Rhodri James
On Mon, 11 May 2009 00:06:34 +0100, Tobiah wrote: [Snippety snip] I wanted the bullets to be responsible for destroying themselves, but a little Googling brought me to points about dangling references and how an object is not allowed (nor does it seem to have the means) to destroy itself. That

Re: mod_python and xml.dom.minidom

2009-05-10 Thread Graham Dumpleton
On May 10, 3:40 am, Paul Boddie wrote: > On 9 Mai, 01:36, dpapathanasiou wrote: > > > > > Apache's configure utility (I'm using httpd version 2.2.11) doesn't > > explicitly describe an expat library option. > > > Also, if libexpat is version 1.95.2, wouldn't I have to get version > > 2.0 to be co

Re: ISO exemplary Python scripts

2009-05-10 Thread Rhodri James
On Sat, 09 May 2009 17:09:38 +0100, kj wrote: I know that in the python world the distinction between a script and a (library) module is not so clear-cut, and it is common for library modules to have "top-level" stuff (typically test code) that gets run if the module is invoked directly from th

There may be a much better way to manage artillery.

2009-05-10 Thread Tobiah
I'm writing a video game with armed space ships. I decided to make a class to manage all of the bullets that may be on the screen at a given time: class Bullets(): def __init__(self): self.bullets = [] def update(self): temp = [] fo

Re: What's the use of the else in try/except/else?

2009-05-10 Thread Scott David Daniels
kj wrote: ... I can't come with an example in which the same couldn't be accomplished with try: # do something # do something else except ...: # handle exception The only significant difference I can come up with is that in the second form, the except clause may be masking some une

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-10 Thread Carl Banks
On May 10, 12:40 pm, namekuseijin wrote: > Carl Banks wrote: > > Now, maybe readability concerns don't matter to you personally, but it > > does matter to the OP, who is trying to advocate functional > > programming but is having difficulty because most purely functional > > languages have hideous

Re: Downloading most recently modified files

2009-05-10 Thread Shawn Milochik
On Sun, May 10, 2009 at 1:04 PM, AllenLars wrote: > > Thanks Shawn. I went through the ftplib info and I was able to generate a > list. I am needing to figure out parsing the list. > > AllenLars Well, start by separating out the date and the file name. You'll want the date for sorting, and the

What's the use of the else in try/except/else?

2009-05-10 Thread kj
I know about the construct: try: # do something except ...: # handle exception else: # do something else ...but I can't come with an example in which the same couldn't be accomplished with try: # do something # do something else except ...: # handle exception The only

Re: Q's on my first python script

2009-05-10 Thread kj
Thank you all very much! I really appreciate it. kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. -- http://mail.python.org/mailman/listinfo/python-list

Re: Q's on my first python script

2009-05-10 Thread kj
In <0216ec41$0$20647$c3e8...@news.astraweb.com> Steven D'Aprano writes: >On Sun, 10 May 2009 12:52:21 +, kj wrote: >> 1. The name of the BadArgument exception class defined in the script >>does not seem to me sufficiently specific. If one were to import the >>script in order to reu

Re: import overwrites __name__

2009-05-10 Thread Peter Otten
Piet van Oostrum wrote: >> Peter Otten <__pete...@web.de> (PO) wrote: > >>PO> Piet van Oostrum wrote: This is perfectly normal. > >>PO> I'm not 100% sure of that. > > Why not? What you quoted was not code I would /normally/ write. I was playing with the context and meaning of y

Re: FLV download script works, but I want to enhance it

2009-05-10 Thread Aahz
In article , The Music Guy wrote: >On Thu, May 7, 2009 at 9:29 AM, Aahz wrote: >> >> Here's my download script to get you started figuring this out, it does >> the wget in the background so that several downloads can run in parallel >> from a single terminal window: >> >> #!/bin/bash >> >> echo

Re: Q's on my first python script

2009-05-10 Thread Dave Angel
kj wrote: Below is my very firs python script. This was just a learning exercise; the script doesn't do anything terribly exciting: for an argument of the form YYMMDD (year, month, day) it prints out the corresponding string YYMMDDW, where W is a one-letter abbreviation for the day of the week

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-10 Thread namekuseijin
Carl Banks wrote: On May 9, 10:57 am, namekuseijin wrote: Carl Banks wrote: On May 8, 7:19 pm, namekuseijin wrote: On May 8, 10:13 pm, Carl Banks wrote: In Haskell, Lisp and other functional programming languages, any extra syntax gets converted into the core lambda constructs. So? The us

Re: import overwrites __name__

2009-05-10 Thread Piet van Oostrum
> Peter Otten <__pete...@web.de> (PO) wrote: >PO> Piet van Oostrum wrote: >>> >>> This is perfectly normal. >PO> I'm not 100% sure of that. Why not? >PO> Just in case you didn't notice: I'm not the OP. The above piece of junk >code >PO> was my attempt to keep as close to the code he pos

Re: how GNU stow is complementary rather than alternative to distutils

2009-05-10 Thread P.J. Eby
At 12:04 PM 5/10/2009 -0600, Zooko Wilcox-O'Hearn wrote: The thing that prevents this from working with setuptools is that setuptools creates a file named easy_install.pth during the "python ./ setup.py install --prefix=foo" if you build two different Python packages this way, they will each cr

Re: [Python-Dev] how GNU stow is complementary rather than alternative to distutils

2009-05-10 Thread Zooko O'Whielacronx
following-up to my own post to mention one very important reason why anyone cares: On Sun, May 10, 2009 at 12:04 PM, Zooko Wilcox-O'Hearn wrote: > It is a beautiful, elegant hack because it is sooo dumb.  It is also very > nice to use the same tool to manage packages written in any programming >

Re: how GNU stow is complementary rather than alternative to distutils

2009-05-10 Thread Martin v. Löwis
Zooko Wilcox-O'Hearn wrote: > On May 10, 2009, at 11:18 AM, Martin v. Löwis wrote: > >> If GNU stow solves all your problems, why do you want to use >> easy_install in the first place? > > That's a good question. The answer is that there are two separate jobs: > building executables and putting

Re: Re: import overwrites __name__

2009-05-10 Thread Dave Angel
Scott David Daniels wrote: Piet van Oostrum wrote: Peter Otten <__pete...@web.de> (PO) wrote: PO> $ cat x.py PO> import sys PO> globals().update(zip(*(range(110),)*2)) PO> y = 42 PO> print __name__ PO> if __name__ == "__main__": PO> a = b = 42 PO> print len(dir()) PO> from x import y as z

Re: php to python code converter

2009-05-10 Thread kay
On 8 Mai, 17:19, Pascal Chambon wrote: > Hello > > That's funny, I was precisely thinking about a php to python converter, > some weeks ago. > Such a tool, allowing for example to convert some CMS like Drupal to > python, would be a killer app, when we consider the amount of php code > available.

how GNU stow is complementary rather than alternative to distutils

2009-05-10 Thread Zooko Wilcox-O'Hearn
On May 10, 2009, at 11:18 AM, Martin v. Löwis wrote: If GNU stow solves all your problems, why do you want to use easy_install in the first place? That's a good question. The answer is that there are two separate jobs: building executables and putting them in a directory structure of the

Re: import overwrites __name__

2009-05-10 Thread Peter Otten
Piet van Oostrum wrote: >> Peter Otten <__pete...@web.de> (PO) wrote: > >>PO> $ cat x.py >>PO> import sys >>PO> globals().update(zip(*(range(110),)*2)) >>PO> y = 42 >>PO> print __name__ >>PO> if __name__ == "__main__": >>PO> a = b = 42 >>PO> print len(dir()) >>PO> from x import y as z >>P

Re: help with recursive whitespace filter in

2009-05-10 Thread Scott David Daniels
Rustom Mody wrote: I am trying to write a recursive filter to remove whitespace-only nodes for minidom. The code is below. Strangely it deletes some whitespace nodes and leaves some. If I keep calling it -- like so: fws(fws(fws(doc))) then at some stage all the ws nodes disappear Does anybody

Re: Nimrod programming language

2009-05-10 Thread Tomasz Rola
On Fri, 8 May 2009, Andreas Rumpf wrote: > Dear Python-users, > > I invented a new programming language called "Nimrod" that combines > Python's readability with C's performance. Please check it out: > http://force7.de/nimrod/ > Any feedback is appreciated. > > Regards, > Andreas Rumpf Inter

Re: Q's on my first python script

2009-05-10 Thread MRAB
Andre Engels wrote: On Sun, May 10, 2009 at 5:56 PM, Steven D'Aprano wrote: 5. The variable wd is meant to be "global" to the script. In other languages I've programmed in I've seen some typographic convention used for the name of such variables (e.g. all caps) to signal this widened

Re: help with recursive whitespace filter in

2009-05-10 Thread MRAB
rustom wrote: On May 10, 9:49 pm, Steve Howell wrote: On May 10, 9:10 am, Rustom Mody wrote: I am trying to write a recursive filter to remove whitespace-only nodes for minidom. The code is below. Strangely it deletes some whitespace nodes and leaves some. If I keep calling it -- like so:

Re: Q's on my first python script

2009-05-10 Thread Scott David Daniels
Steven D'Aprano wrote: On Sun, 10 May 2009 12:52:21 +, kj wrote: 5. The variable wd is meant to be "global" to the script. In other languages I've programmed in I've seen some typographic convention used for the name of such variables (e.g. all caps) to signal this widened sco

Re: help with recursive whitespace filter in

2009-05-10 Thread rustom
On May 10, 9:49 pm, Steve Howell wrote: > On May 10, 9:10 am, Rustom Mody wrote: > > > > > I am trying to write a recursive filter to remove whitespace-only > > nodes for minidom. > > The code is below. > > > Strangely it deletes some whitespace nodes and leaves some. > > If I keep calling it --

Re: [Python-Dev] .pth files are evil

2009-05-10 Thread Martin v. Löwis
> GNU stow does handle these issues. If GNU stow solves all your problems, why do you want to use easy_install in the first place? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping comments

2009-05-10 Thread David Robinow
On Sun, May 10, 2009 at 3:32 AM, Tobias Weber wrote: > In article , >  Arnaud Delobelle wrote: > >> A simple Alt-Q will reformat everything nicely. > > Now that's something. Thanks! > > (still not gonna use software that doesn't let me type # because it's > alt+3 on a UK layout; having to re-lear

Re: Wrapping comments

2009-05-10 Thread Scott David Daniels
Steven D'Aprano wrote: On Sun, 10 May 2009 13:41:15 +1200, Lawrence D'Oliveiro wrote: If I had to print out all the code and documentation I have to look at, I'd need to add another room to my house. You are allowed to throw it away when you're done with it :) Except here in Portland, where

Re: import overwrites __name__

2009-05-10 Thread Scott David Daniels
Piet van Oostrum wrote: Peter Otten <__pete...@web.de> (PO) wrote: PO> $ cat x.py PO> import sys PO> globals().update(zip(*(range(110),)*2)) PO> y = 42 PO> print __name__ PO> if __name__ == "__main__": PO> a = b = 42 PO> print len(dir()) PO> from x import y as z PO> try: PO> print my_n

Re: Downloading most recently modified files

2009-05-10 Thread AllenLars
Thanks Shawn. I went through the ftplib info and I was able to generate a list. I am needing to figure out parsing the list. AllenLars Shawn Milochik wrote: > > On Thu, May 7, 2009 at 2:19 PM, AllenLars wrote: >> >> I am trying to code a script that will allow me to go to ftp site and >> do

Re: Q's on my first python script

2009-05-10 Thread Andre Engels
On Sun, May 10, 2009 at 5:56 PM, Steven D'Aprano wrote: >> 5. The variable wd is meant to be "global" to the script.  In other >>    languages I've programmed in I've seen some typographic convention >>    used for the name of such variables (e.g. all caps) to signal this >>    widened scope.  Do

Re: help with recursive whitespace filter in

2009-05-10 Thread Steve Howell
On May 10, 9:10 am, Rustom Mody wrote: > I am trying to write a recursive filter to remove whitespace-only > nodes for minidom. > The code is below. > > Strangely it deletes some whitespace nodes and leaves some. > If I keep calling it -- like so: fws(fws(fws(doc)))  then at some > stage all the w

Re: Java-style futures in Python - only better

2009-05-10 Thread Brian Quinlan
Colin J. Williams wrote: Brian, Since the word "future" is part of the Python lingo: A future statement is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a specified future release of Python. The future statement is

help with recursive whitespace filter in

2009-05-10 Thread Rustom Mody
I am trying to write a recursive filter to remove whitespace-only nodes for minidom. The code is below. Strangely it deletes some whitespace nodes and leaves some. If I keep calling it -- like so: fws(fws(fws(doc))) then at some stage all the ws nodes disappear Does anybody have a clue? from x

Re: [Python-Dev] .pth files are evil

2009-05-10 Thread Zooko Wilcox-O'Hearn
On May 9, 2009, at 9:39 AM, P.J. Eby wrote: It would be really straightforward, though, for someone to implement an easy_install variant that does this. Just invoke "easy_install -Zmaxd /some/tmpdir packagelist" to get a full set of unpacked .egg directories in /some/tmpdir, and then move

Re: unicode bit me

2009-05-10 Thread anuraguni...@yahoo.com
yes but my list sometimes have list of lists On May 10, 2:59 pm, "Diez B. Roggisch" wrote: > anuraguni...@yahoo.com schrieb: > > > ok that explains it, > > so > > unicode(obj) calls __unicode__ on that object and if it isn't there > > __repr__ is used > > __repr__ of list by default return a str

Re: Nimrod programming language

2009-05-10 Thread Florian Wollenschein
Andreas Rumpf wrote: Dear Python-users, I invented a new programming language called "Nimrod" that combines Python's readability with C's performance. Please check it out: http://force7.de/nimrod/ Any feedback is appreciated. Regards, Andreas Rumpf

Re: strip part of string

2009-05-10 Thread John Machin
On May 11, 1:34 am, MRAB wrote: > Francesco Pietra wrote: > > Hi: > > I would like to delete everything from column 54 on for each line > > beginning with "ATOM". In the example in the attachment (sorry for the > > attachment; I found no way with Google mail to have plain text mail) > > the new li

Re: Q's on my first python script

2009-05-10 Thread Steven D'Aprano
On Sun, 10 May 2009 12:52:21 +, kj wrote: > 1. The name of the BadArgument exception class defined in the script >does not seem to me sufficiently specific. If one were to import the >script in order to reuse its wkday_abbrev function, I'd like this >exception's name to be more un

Re: ANN: Python process utility (psutil) 0.1.2 released

2009-05-10 Thread Giampaolo Rodola'
On 9 Mag, 11:30, Nick Craig-Wood wrote: > Giampaolo Rodola' wrote: > >  psutil is a module providing an interface for retrieving information > >  on running processes and system utilization (CPU, memory) in a > >  portable way by using Python, implementing many functionalities > >  offered by too

Re: strip part of string

2009-05-10 Thread John Machin
On May 11, 1:18 am, Francesco Pietra wrote: > Hi: > I would like to delete everything from column 54 on for each line > beginning with "ATOM". In the example in the attachment (sorry for the > attachment; I found no way with Google mail to have plain text mail) Many of your audience won't have se

Re: strip part of string

2009-05-10 Thread Steven D'Aprano
On Sun, 10 May 2009 17:18:51 +0200, Francesco Pietra wrote: > Hi: > I would like to delete everything from column 54 on for each line > beginning with "ATOM". In the example in the attachment (sorry for the > attachment; I found no way with Google mail to have plain text mail) the > new line would

Re: strip part of string

2009-05-10 Thread MRAB
Francesco Pietra wrote: Hi: I would like to delete everything from column 54 on for each line beginning with "ATOM". In the example in the attachment (sorry for the attachment; I found no way with Google mail to have plain text mail) the new line would become: ATOM 49 NH1 ARG84 84.

strip part of string

2009-05-10 Thread Francesco Pietra
Hi: I would like to delete everything from column 54 on for each line beginning with "ATOM". In the example in the attachment (sorry for the attachment; I found no way with Google mail to have plain text mail) the new line would become: ATOM 49 NH1 ARG84 84.628 41.570 44.395 witho

Re: import overwrites __name__

2009-05-10 Thread Piet van Oostrum
> Peter Otten <__pete...@web.de> (PO) wrote: >PO> $ cat x.py >PO> import sys >PO> globals().update(zip(*(range(110),)*2)) >PO> y = 42 >PO> print __name__ >PO> if __name__ == "__main__": >PO> a = b = 42 >PO> print len(dir()) >PO> from x import y as z >PO> try: >PO> print my_name >PO> ex

Re: Get multiprocessing.Queue to do priorities

2009-05-10 Thread uuid
Dear Jesse, thanks for the hint. I see you are already assigned to the FIFO bug (http://bugs.python.org/issue4999), so I won't burden you even more. Clearly, a reliable FIFO behavior of multiprocessing.Queue helps more than a priority queue, since it can be used to build one, so that should r

Re: Nimrod programming language

2009-05-10 Thread Paul Boddie
On 10 Mai, 10:40, Paul Rubin wrote: > > Looks nice in many ways.  You also know about PyPy and Felix > (felix.sf.net)? Try http://felix-lang.org/ for the latter, I believe. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with datetime.datetime.strptime

2009-05-10 Thread Tuomas Vesterinen
Nick Craig-Wood wrote: Tuomas Vesterinen wrote: I hoped that I could get rid of my special module _strptime2 when porting to Python 3.0. But testing is a disappointment. [snip] C : strftime('%a %b %e %H:%M:%S %Y')='Sat May 9 11:26:12 2009' strptime('Sat May 9 11:26:12 2009','%a %

Re: Get multiprocessing.Queue to do priorities

2009-05-10 Thread Jesse Noller
On Sat, May 9, 2009 at 6:11 PM, uuid wrote: > The Queue module, apparently, is thread safe, but *not* process safe. If you > try to use an ordinary Queue, it appears inaccessible to the worker process. > (Which, after all, is quite logical, since methods for moving items between > the threads of t

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-10 Thread Geoff Gardiner
Aahz wrote: > > What directory are you running this from? What happens if you switch to > running "python Lib/test/regrtest.py"? Taking a closer look, this looks > more like a plain import error. > Thank you for your suggestion. I couldn't do quite that because there's no Lib, but inste

Missing c.l.py posts (was Re: php to python code converter)

2009-05-10 Thread skip
PS : Am I the only one having most of answers rejected by the antispam system of python-list ? That's humiliating :p >>> >>> I've had several messages not make it through. >>> >>> :( >> >> Same here ("Message has a suspicious header"). Aahz> I've b

Q's on my first python script

2009-05-10 Thread kj
Below is my very firs python script. This was just a learning exercise; the script doesn't do anything terribly exciting: for an argument of the form YYMMDD (year, month, day) it prints out the corresponding string YYMMDDW, where W is a one-letter abbreviation for the day of the week. E.g. % wd

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-10 Thread Aahz
In article , Geoff Gardiner wrote: > >geg...@gegard:~$ python >Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) >[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 >Type "help", "copyright", "credits" or "license" for more information. from test import regrtest regrtest.main() >test_grammar

Re: OT (humor): 'import antigravity' in action!

2009-05-10 Thread Aahz
In article , Shawn Milochik wrote: > >I know you've probably all seen this 50 times, but just in case: >http://xkcd.com/353/ > >And here's the result: >http://icanhascheezburger.com/2009/05/06/funny-pictures-behavior-20/ Thanks! -- Aahz (a...@pythoncraft.com) <*> http://www.py

Learning C++ for Python Development

2009-05-10 Thread joshua.pea...@gmail.com
I am a recovering C# web developer who has recently picked up Django and I'm loving it. I would eventually like to get a job as a Django/Python developer. It seems that many Python jobs require that you also be a C++ developer. While I want to remain primarily a web developer, I don't want be stuc

Missing c.l.py posts (was Re: php to python code converter)

2009-05-10 Thread Aahz
In article , MRAB wrote: >J. Cliff Dyer wrote: >> On Fri, 2009-05-08 at 17:19 +0200, Pascal Chambon wrote: >>> >>> PS : Am I the only one having most of answers rejected by the >>> antispam >>> system of python-list ? That's humiliating :p >> >> I've had several messages not make it through. >>

Java-style futures in Python - only better

2009-05-10 Thread Brian Quinlan
Hey all, I've been working on an Java-style futures implementation in Python. Futures are a way of representing asynchronous operations e.g. operations that are run in another thread or process. The are are a easy but powerful way of parallelizing sequential operations. The also provide a con

Re: Wrapping comments

2009-05-10 Thread Steven D'Aprano
On Sun, 10 May 2009 13:41:15 +1200, Lawrence D'Oliveiro wrote: > If I had to print out all the code and documentation I have to look at, > I'd need to add another room to my house. You are allowed to throw it away when you're done with it :) -- Steven -- http://mail.python.org/mailman/listin

Re: "Beginning Python Visualization" by Shai Vaingast

2009-05-10 Thread Shawn Milochik
Thanks for the review and the podcast. I ordered the book on Friday. I look forward to playing with it. Also (assuming you're Ron Stephens), thanks for the Python 411 podcast. It's a great resource, and I recommend it to all list members. Shawn -- http://mail.python.org/mailman/listinfo/python-lis

Re: unicode bit me

2009-05-10 Thread Diez B. Roggisch
anuraguni...@yahoo.com schrieb: ok that explains it, so unicode(obj) calls __unicode__ on that object and if it isn't there __repr__ is used __repr__ of list by default return a str even if __repr__ of element is unicode so my only solution looks like to use my own list class everywhere i use l

Re: unicode bit me

2009-05-10 Thread anuraguni...@yahoo.com
ok that explains it, so unicode(obj) calls __unicode__ on that object and if it isn't there __repr__ is used __repr__ of list by default return a str even if __repr__ of element is unicode so my only solution looks like to use my own list class everywhere i use list class mylist(list): def __

Re: Nimrod programming language

2009-05-10 Thread Paul Rubin
Andreas Rumpf writes: > I invented a new programming language called "Nimrod" that combines > Python's readability with C's performance. Please check it out: > http://force7.de/nimrod/ Any feedback is appreciated. Looks nice in many ways. You also know about PyPy and Felix (felix.sf.net)? It se

Re: Help needed with filenames

2009-05-10 Thread Yinon Ehrlich
> I did notice that when a windows command window does a directory > listing of these files the characters seem to be translated into close > approximations (long dash to minus, special double quotes to simple > double quotes, but still retains many of the accent chars).  I looked > at translate t

Re: Help needed with filenames

2009-05-10 Thread Martin v. Löwis
> Can anyone tell me what I should be doing here? The console uses the "OEM code page". The Windows conversion routine from Unicode to the OEM code page provides the lossy conversion that you observe in listing. Unfortunately, the OEM code page conversion is not available from Python. What you ca

Re: xml in python

2009-05-10 Thread uuid
On 2009-05-10 09:24:36 +0200, Piet van Oostrum said: These days ElementTree is considered the most pythonic way. http://docs.python.org/library/xml.etree.elementtree.html There is also a reimplementation of the ElementTree API based on libxml2 and libxslt, which has more features but require

Re: import overwrites __name__

2009-05-10 Thread Peter Otten
MRAB wrote: > Marco wrote: >> Hi, >> >> There happened something that I do not understand. Actually I don't even >> know how it can be possible. >> >> I import a module and then the name space of the importing module seems >> do be overwritten. >> >> my_name = __name__ >> print my_name >> print

Help needed with filenames

2009-05-10 Thread pdenize
I have a program that reads files using glob and puts them into an XML file in UTF-8 using unicode(file, sys.getfilesystemencoding()).encode("UTF-8") This all works fine including all the odd characters like accents etc. However I also print what it is doing and someone pointed out that many cha

Re: unicode bit me

2009-05-10 Thread Nick Craig-Wood
anuraguni...@yahoo.com wrote: > First of all thanks everybody for putting time with my confusing post > and I apologize for not being clear after so many efforts. > > here is my last try (you are free to ignore my request for free > advice) > > # -*- coding: utf-8 -*- > > class A(object):

Re: Problems with datetime.datetime.strptime

2009-05-10 Thread Nick Craig-Wood
Tuomas Vesterinen wrote: > I hoped that I could get rid of my special module _strptime2 when > porting to Python 3.0. But testing is a disappointment. [snip] > C : > strftime('%a %b %e %H:%M:%S %Y')='Sat May 9 11:26:12 2009' > strptime('Sat May 9 11:26:12 2009','%a %b %e %H:%M:%S %Y'

Re: xml in python

2009-05-10 Thread Piet van Oostrum
> Shawn Milochik (SM) wrote: >SM> On Fri, May 8, 2009 at 3:46 AM, Rustom Mody wrote: >>> Can someone give me a heads up on xml parsing in python? >>> The context is that I want to write a simple docbook to text converter. >>> DOM is alright -- dont want to break my head with SAX just for per