Python Trainers, Promote Thyself!

2007-07-24 Thread Jeff Rush
With the recent establishment of the wiki page on python.org for those who offer training services for the Python language, we now have 23 listed, worldwide. http://wiki.python.org/moin/PythonTraining Many of the trainers are individuals or small companies, and it can be hard to get the

Re: code packaging

2007-07-24 Thread Paul Rubin
[EMAIL PROTECTED] (John J. Lee) writes: You can go further: in addition to developing a Debian package (or a few of them) for your own project, build your OS image using debootstrap (you'll probably want your own local repository(ies), for reproducibility). Then you do your development in a

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread oren . tsur
On Jul 23, 4:46 pm, Richard Brodie [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so what's the difference? how comes parsing is fine in the first case but erroneous in the second case? You may have guessed the encoding wrong. It probably wasn't utf-8

wxPython Internationalization

2007-07-24 Thread [EMAIL PROTECTED]
I know this may have a very simple answer, nonetheless. I am wishing to find the cleanest and most pythonic way of implementing the following: I am creating a internationalized application in wxPython and have sorted the directory structure in the following manner: start.py app_name tools

Python Trainers, Promote Thyself!

2007-07-24 Thread Jeff Rush
With the recent establishment of the wiki page on python.org for those who offer training services for the Python language, we now have 23 listed, worldwide. http://wiki.python.org/moin/PythonTraining Many of the trainers are individuals or small companies, and it can be hard to get the

Re: Need Help with base64

2007-07-24 Thread Tim Roberts
pycraze [EMAIL PROTECTED] wrote: int base641_decodestring(char* pcstr,int size,char** ppcdest) { unsigned char cin[4] = {}; unsigned char cout[3] = {}; unsigned char cv = 0; int ni = 0; int nlen = 0; char* cptr = pcstr; *ppcdest = malloc(sizeof(char)*160);

Code objects

2007-07-24 Thread Evan Klitzke
I was playing around with the inspect module tonight, and I have a question about code components. Can an object have more than one code component? For example, will the following code ever create a list whose length is greater than one? import inspect # Some code here defining an

Re: Extracting attributes from compiled python code or parse trees

2007-07-24 Thread Peter Otten
Matteo wrote: I am trying to get Python to extract attributes in full dotted form from compiled expression. For instance, if I have the following: param = compile('a.x + a.y','','single') then I would like to retrieve the list consisting of ['a.x','a.y']. I have tried using inspect to

Re: Pickled objects over the network

2007-07-24 Thread Hendrik van Rooyen
Steve Holden wrote: It's difficult to establish, and then correctly implement, almost any security protocol without leaving cracks that attackers can lever open and use to inject code into your process's memory space. I can accept this - its difficult enough to write a receiver that syncs up

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: On Jul 23, 4:46 pm, Richard Brodie [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so what's the difference? how comes parsing is fine in the first case but erroneous in the second case? You may have guessed the encoding wrong. It

Re: classmethod staticmethod

2007-07-24 Thread Marc 'BlackJack' Rintsch
On Tue, 24 Jul 2007 03:19:05 +, james_027 wrote: python's staticmethod is the equivalent of java staticmethod right? Correct. `staticmethod` is essentially just a function moved into a class and accessible at the class object and instances of that class. As Python opposed to Java has

Re: classmethod staticmethod

2007-07-24 Thread Bruno Desthuilliers
james_027 a écrit : hi, python's staticmethod is the equivalent of java staticmethod right? IIRC, yes. A 'staticmethod' is in fact nothing more than a function attached to a class, and which can be called on the class or an instance of. Note that since Python supports modules and functions,

Re: Trouble with email package

2007-07-24 Thread Harel
Hi there, What was the solution you found? Could you please post it? I'm having the same problem... ;o( Thanks! Harel On Jul 16, 2:53 pm, Torsten Bronger [EMAIL PROTECTED] wrote: Hallöchen! Ingrid Bronger writes: [...] The Content-Transfer-Encoding is wrong. Okay (well, not okay but)

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread Marc 'BlackJack' Rintsch
On Tue, 24 Jul 2007 05:57:26 +, oren.tsur wrote: but the thing is that the parser parses it all right from the web (the amazon response) but fails to parse the locally saved file. I've just used wget to fetch that URL and `ElementTree` parses that local file without problems. Maybe you

Re: Where do they tech Python officialy ?

2007-07-24 Thread NicolasG
If you have a good programming background in other languages, you should easily be able to pick up Python by reading the manual. Dear all, thank you for your info. I forgot to mention that I already know how to program in Python (basic), my knowledge derives from a very good level of C

Re: Subclassing int

2007-07-24 Thread Alex Popescu
G [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: --=_Part_187401_13883248.1185238999144 Hi, I am trying to subclass int to allow a constructor to accept None. I am trying the following class INT(int): def __init__(self, x): if x is None:

Re: Where do they tech Python officialy ?

2007-07-24 Thread Bruno Desthuilliers
NicolasG a écrit : Hi, I want to be a professional python programmer, While there are (more and more) professional programmers using Python, either as their main language or not, there's no such thing as a professional Python programmer, because being a proofessional programmer requires

Re: Hacking with __new__

2007-07-24 Thread Duncan Booth
Sandra-24 [EMAIL PROTECTED] wrote: So thinking myself clever with python I thought I could change S3ResponseError to have a __new__ method which returns one of the 30 new exceptions. That way none of the raise S3ResponseError code needs changing. No problem. The trouble comes with those

Re: Where do they tech Python officialy ?

2007-07-24 Thread Paul Rubin
NicolasG [EMAIL PROTECTED] writes: The problem is that I would like to work as a Python programmer but all the job vacancies I can find requires a couple of years of professional experience ... that I don't have. How a wanna be programmer can start working as a programmer if there is no chance

Re: Where do they tech Python officialy ?

2007-07-24 Thread Jarek Zgoda
Paul Rubin napisał(a): The problem is that I would like to work as a Python programmer but all the job vacancies I can find requires a couple of years of professional experience ... that I don't have. How a wanna be programmer can start working as a programmer if there is no chance to start

Recursive lists

2007-07-24 Thread mizrandir
Can someone tell me why python doesn't crash when I do the following: a=[] a.append(a) print a [[...]] print a[0][0][0][0][0][0][0] [[...]] How does python handle this internally? Will it crash or use up lot's of memory in similar but more complicated cases? --

some parts of wxPython broken on Mac

2007-07-24 Thread ahlongxp
Sorry, I know this is not the most appropriate place to talk about wxPython. But I can't have access to wxPython mail list page(because I don't pay enough). I downloaded python2.5 and wxPython 2.8.4.0 from pythonmac.org and installed them into one of my friends' Mac 10.4.8(intel) and I found

Python pearls required for iteration across fields of data structure

2007-07-24 Thread NetHead
I want to apply a method (replaceFieldsAndIndices) in my class to a number of attributes of a data structure. Specifically, to give some context, in the variable j below, I want to replace wildcards with values. I wanted to avoid cluttering the code with multiple calls to the method

Tix not properly installed on OS X?

2007-07-24 Thread Brian Blais
Hello, I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by source (I used the binary install from the website). When I do the following, I get an error: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type help,

display image through cgi python html

2007-07-24 Thread Ladislav Andel
Hi, I'm trying to display image through my cgi script in HTML page via img src=image.cgi Can you give me an example, please? What should be in the cgi script to display it? Here is what I have in image.cgi but it is incorrect and i'm not able to find it on the web. #!/usr/bin/python print

Re: display image through cgi python html

2007-07-24 Thread Marc 'BlackJack' Rintsch
On Tue, 24 Jul 2007 11:58:47 +0200, Ladislav Andel wrote: Here is what I have in image.cgi but it is incorrect and i'm not able to find it on the web. #!/usr/bin/python print Content-Type: image/png\n print 'image.png' You have to print the image, not the name. Read the binary file and

Re: Python pearls required for iteration across fields of data structure

2007-07-24 Thread Marc 'BlackJack' Rintsch
On Tue, 24 Jul 2007 02:26:15 -0700, NetHead wrote: The code below is WRONG, but hopefully illustrates what I am trying to achieve. Any suggestions how to code this is an efficient and maintainable (and correct) manner? […] for i in wildcards: for j in i: try:

Re: Recursive lists

2007-07-24 Thread Duncan Booth
[EMAIL PROTECTED] wrote: Can someone tell me why python doesn't crash when I do the following: a=[] a.append(a) print a [[...]] print a[0][0][0][0][0][0][0] [[...]] How does python handle this internally? Will it crash or use up lot's of memory in similar but more complicated cases?

From D

2007-07-24 Thread bearophileHUGS
There are various things I like about the D language that I think Python too may enjoy. Here are few bits (mostly syntactical ones): 1) (we have discussed part of this in the past) You can put underscores inside number literals, like 1_000_000, the compiler doesn't enforce the position of such

Re: Hacking with __new__

2007-07-24 Thread Bruno Desthuilliers
Duncan Booth a écrit : (snip) I think what you want for Bar is something more along the lines: (snip) class Bar(Foo): def __new__(cls, a, b, c, *args): print 'Bar.__new__', len(args) target = cls You don't use 'target' anywhere... if not args: cls

Re: classmethod staticmethod

2007-07-24 Thread james_027
hi, The 'real' use is (are) the one(s) you'll find. FWIW, I use staticmethods for helper functions that don't need access to the class or instance but are too specific to a class to be of any use as plain functions. Which is not a very frequent case. Classmethods are more usefull - mostly as

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: On Tue, 24 Jul 2007 05:57:26 +, oren.tsur wrote: but the thing is that the parser parses it all right from the web (the amazon response) but fails to parse the locally saved file. I've just used wget to fetch that URL and `ElementTree` parses that local

Re: classmethod staticmethod

2007-07-24 Thread Bruno Desthuilliers
james_027 a écrit : hi, The 'real' use is (are) the one(s) you'll find. FWIW, I use staticmethods for helper functions that don't need access to the class or instance but are too specific to a class to be of any use as plain functions. Which is not a very frequent case. Classmethods are

Re: Where do they tech Python officialy ?

2007-07-24 Thread NicolasG
Why would you want to become a programmer? Programmers smell bad, they have no social life, they get treated like crap by everyone. They can get paid pretty well but then they spend all the money on useless electronic junk so they still live like bums. I wouldn't call this person programmer

how to get next month string?

2007-07-24 Thread Yinghe Chen
Hi, Could someone help on how to use python to output the next month string like this? AUG07, suppose now is July 2007. I think also need to consider Dec 07 case, it is supposed to output as below: JAN07. datetime module seems not supporting the arithmatic operations, any hints? Thanks in

Re: how to get next month string?

2007-07-24 Thread Yinghe Chen
My bad, for Dec 07, it shall output as JAN08. Yinghe Chen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Could someone help on how to use python to output the next month string like this? AUG07, suppose now is July 2007. I think also need to consider Dec 07 case, it is

Re: some parts of wxPython broken on Mac

2007-07-24 Thread Steve Holden
ahlongxp wrote: Sorry, I know this is not the most appropriate place to talk about wxPython. But I can't have access to wxPython mail list page(because I don't pay enough). I downloaded python2.5 and wxPython 2.8.4.0 from pythonmac.org and installed them into one of my friends' Mac

Re: display image through cgi python html

2007-07-24 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: On Tue, 24 Jul 2007 11:58:47 +0200, Ladislav Andel wrote: Here is what I have in image.cgi but it is incorrect and i'm not able to find it on the web. #!/usr/bin/python print Content-Type: image/png\n print 'image.png' You have to print the image, not

Re: display image through cgi python html

2007-07-24 Thread Ladislav Andel
Thanks for quick reply. Yes, that's the hint I needed. Lada Marc 'BlackJack' Rintsch wrote: On Tue, 24 Jul 2007 11:58:47 +0200, Ladislav Andel wrote: Here is what I have in image.cgi but it is incorrect and i'm not able to find it on the web. #!/usr/bin/python print Content-Type:

Re: Where do they tech Python officialy ?

2007-07-24 Thread gregarican
On Jul 24, 6:57 am, NicolasG [EMAIL PROTECTED] wrote: Why would you want to become a programmer? Programmers smell bad, they have no social life, they get treated like crap by everyone. They can get paid pretty well but then they spend all the money on useless electronic junk so they

Re: how to get next month string?

2007-07-24 Thread BartlebyScrivener
On Jul 24, 5:31 am, Yinghe Chen [EMAIL PROTECTED] wrote: Hi, Could someone help on how to use python to output the next month string like this? AUG07, suppose now is July 2007. I usually find time and date answers somewhere in here:

Re: Where do they tech Python officialy ?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Paul Rubin http wrote: I think Python is not used in university programs very much. Look for one that uses SICP (Scheme) or CTM (Mozart/Oz) or a functional language like Haskell, in preference to the ones that use Java (the Cobol of the 1990's). With some reasonable experience

Re: how to get next month string?

2007-07-24 Thread John Machin
On Jul 24, 8:31 pm, Yinghe Chen [EMAIL PROTECTED] wrote: Hi, Could someone help on how to use python to output the next month string like this? AUG07, suppose now is July 2007. I think also need to consider Dec 07 case, it is supposed to output as below: JAN07. datetime module seems not

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread André
On Jul 23, 11:29 am, [EMAIL PROTECTED] wrote: (this question was also posted in the devshed python forum:http://forums.devshed.com/python-programming-11/parsing-xml-with-elem... ). - (it's a bit longish but I hope I give all the information) 1. here is my

How to programmatically insert pages into MDI.

2007-07-24 Thread fynali iladijas
Hi, this query is regarding automating page insertions in Microsoft Document Imaging. I have two sets of MDIs generated fortnightly: Invoices and their corresponding Broadcast Certificates; about 150 of each. My billing application can generate one big MDI with all 150 invoices and another with

Re: The Modernization of Emacs: keyboard shortcuts pain

2007-07-24 Thread Xah Lee
Why Emacs's Keyboard Shortcuts Are Painful Xah Lee, 2007-07 A important aspect in designing keyboard shortcuts is to have keyboard shortcuts for those most frequently used commands, and, the most frequently used commands should have most easily-pressed keystrokes. For example, they should be on

Re: wxPython Internationalization

2007-07-24 Thread kyosohma
On Jul 24, 1:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I know this may have a very simple answer, nonetheless. I am wishing to find the cleanest and most pythonic way of implementing the following: I am creating a internationalized application in wxPython and have sorted the

Re: how to get next month string?

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 05:15 -0700, John Machin wrote: On Jul 24, 8:31 pm, Yinghe Chen [EMAIL PROTECTED] wrote: Hi, Could someone help on how to use python to output the next month string like this? AUG07, suppose now is July 2007. I think also need to consider Dec 07 case, it is

Re: some parts of wxPython broken on Mac

2007-07-24 Thread kyosohma
On Jul 24, 6:14 am, Steve Holden [EMAIL PROTECTED] wrote: ahlongxp wrote: Sorry, I know this is not the most appropriate place to talk about wxPython. But I can't have access to wxPython mail list page(because I don't pay enough). I downloaded python2.5 and wxPython 2.8.4.0 from

How do I 'stat' online files?

2007-07-24 Thread DB Daniel Brown
I am working on a program that needs to stat files (gif, swf, xml, dirs, etc) from the web. I know how to stat a local file... import os tplStat = os.stat(path) but I can't figure out how to stat a file that resides on a web server. I am not sure if it makes a difference, but most (maybe

Re: Tix not properly installed on OS X?

2007-07-24 Thread Jay Loden
Brian Blais wrote: Hello, I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by source (I used the binary install from the website). When I do the following, I get an error: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]

Re: How do I 'stat' online files?

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 09:07 -0400, DB Daniel Brown wrote: I am working on a program that needs to stat files (gif, swf, xml, dirs, etc) from the web. I know how to stat a local file… import os tplStat = os.stat(path) but I can’t figure out how to stat a file that resides on a web

for line in file('filename'):

2007-07-24 Thread Yoav Goldberg
I use the idiom for line in file('filename'): do_something(line) quite a lot. Does it close the opened file at the end of the loop, or do I have to explicitly save the file object and close it afterward? Yoav -- http://mail.python.org/mailman/listinfo/python-list

Re: From D

2007-07-24 Thread Stargaming
On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: There are various things I like about the D language that I think Python too may enjoy. Here are few bits (mostly syntactical ones): 1) (we have discussed part of this in the past) You can put underscores inside number literals, like

Re: Recursive lists

2007-07-24 Thread Stargaming
On Tue, 24 Jul 2007 02:14:38 -0700, mizrandir wrote: Can someone tell me why python doesn't crash when I do the following: a=[] a.append(a) print a [[...]] print a[0][0][0][0][0][0][0] [[...]] How does python handle this internally? Will it crash or use up lot's of memory in similar

Re: for line in file('filename'):

2007-07-24 Thread Steve Holden
Yoav Goldberg wrote: I use the idiom for line in file('filename'): do_something(line) quite a lot. Does it close the opened file at the end of the loop, or do I have to explicitly save the file object and close it afterward? The file will *normally* be closed in most Python

Re: Where do they tech Python officialy ?

2007-07-24 Thread Beliavsky
On Jul 23, 1:27 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: Autodidacticism is an alternative; feel free to regard URL:http://wiki.python.org/moin/PythonTraining as a member of that class. If you, for example, were to teach yourself Python, then volunteer with prominent extensions or

Re: Tix not properly installed on OS X?

2007-07-24 Thread Kevin Walzer
Jay Loden wrote: Brian Blais wrote: Hello, I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by source (I used the binary install from the website). When I do the following, I get an error: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer,

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread oren . tsur
How about trying root = ElementTree.parse(urlopen(query), encoding ='utf-8') this specific thing is not working, however, parsing the url is not problematic. the problem is that after parsing the xml at the url I save some of the fields to a local file and the local file is not being parsed

Closures / Blocks in Python

2007-07-24 Thread treble54
Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures / Blocks in Python

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 14:58 +, treble54 wrote: Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. Please describe the problem you're trying to solve. Even if Python had a direct equivalent of Ruby closures or

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: How about trying root = ElementTree.parse(urlopen(query), encoding ='utf-8') That doesn't work. this specific thing is not working, however, parsing the url is not problematic. So you tried parsing the complete XML file and it works? Then it's the way you stripped

Re: Code objects

2007-07-24 Thread Terry Reedy
Evan Klitzke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] |I was playing around with the inspect module tonight, and I have a | question about code components. Can an object have more than one | code component? As produced by CPython, a function object has one code attribute,

Re: Closures / Blocks in Python

2007-07-24 Thread Neil Cerutti
On 2007-07-24, treble54 [EMAIL PROTECTED] wrote: Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. Python's nameless functions are week. So it supports iterators and generators using protocols, comprehensions and a few

Re: Closures / Blocks in Python

2007-07-24 Thread Jason
On Jul 24, 8:58 am, treble54 [EMAIL PROTECTED] wrote: Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. Python isn't Ruby. Python has a lambda function for creating anonymous functions, but many of the common use

Re: Closures / Blocks in Python

2007-07-24 Thread Bruno Desthuilliers
treble54 a écrit : Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. Instead of looking for what you think is the solution, you'd be better explaining your concrete problem. --

wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Robert Dailey
Hi, I have 3 columns in my list control, each with a different type of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no avail. I need the user to be able to click any of the column

Re: classmethod staticmethod

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Alex Popescu [EMAIL PROTECTED] wrote: Bruno Desthuilliers [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: [snip...] Not necessarily - you can access class attributes from within an instance method (but obviously a classmethod cannot access instance attributes).

datetime.time() class - How to pass it a time string?

2007-07-24 Thread Robert Dailey
Hi, I have a string in the following format: 00:00:25.886411 I would like to pass this string into the datetime.time() class and have it parse the string and use the values. However, the __init__() method only takes integers (which means I'd be forced to parse the string myself). Does anyone

Any python module for Traversing HTML files

2007-07-24 Thread johnny
Any python module for navigating and selecting, parsing HTML files? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tix not properly installed on OS X?

2007-07-24 Thread Brian Blais
On Jul 24, 2007, at Jul 24:10:28 AM, Kevin Walzer wrote: You need an up-to-date installation of the base Tix package on your system, in the same path as your Tcl/Tk libraries. I downloaded and built the most recent version of Tix from http://tix.sf.net (dated November 2006) and the Python

Re: code indentation

2007-07-24 Thread vedrandekovic
On 24 srp, 05:20, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... [EMAIL PROTECTED] escribió: If you are using the tokenize module as suggested some time ago, try to analyze the token sequence you get using { } (or perhaps begin/end pairs in

Re: Tix not properly installed on OS X?

2007-07-24 Thread Kevin Walzer
Brian Blais wrote: So I tried to build Tix, and it complains about a tcl header file (tclPort.h). My Tcl stuff is in /System/Library/Frameworks/Tcl.framework/Versions/8.4/, but the header file doesn't exist. I assume I need to download the source for Tcl and build that, or is it enough

exec and func_code

2007-07-24 Thread Prepscius, Colin (IT)
Does anybody know how to pass parameters to 'exec somefunction.func_code'? def f1(): print 'this is f1' def f2(p): print 'this is f2, p =', str(p) exec f1.func_code THIS RESULTS IN: this is nf1 WHICH IS NICE exec f2.func_code THIS RESULTS IN: TypeError: f2() takes exactly 1

Memory Logging

2007-07-24 Thread NuclearOnslaught
Hey all, I'm running some data analysis scripts that, due to the input file size, tend to be quite memory intensive. I've been reading up on Python's memory allocation (I'm using 2.4 and am locked into it, so I don't have the new fixes in 2.5) but because of the nature of its looping I don't

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Miles
On 7/24/07, Robert Dailey wrote: Hi, I have a string in the following format: 00:00:25.886411 I would like to pass this string into the datetime.time() class and have it parse the string and use the values. However, the __init__() method only takes integers (which means I'd be forced to

Reading a Directory of Emails - Problems

2007-07-24 Thread Ryan Rosario
Hi, I have a directory that contains a bunch of email messages and I would like to parse them using the email and mailbox packages. The emails were exported from Apple Mail. From what I gather, I need to use MHMailbox, but I can't get it to do anything useful and I cannot find any examples of

Re: exec and func_code

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 13:24 -0400, Prepscius, Colin (IT) wrote: Does anybody know how to pass parameters to 'exec somefunction.func_code'? def f1(): print 'this is f1' def f2(p): print 'this is f2, p =', str(p) exec f1.func_code THIS RESULTS IN: this is nf1 WHICH IS

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread kyosohma
On Jul 24, 11:21 am, Robert Dailey [EMAIL PROTECTED] wrote: Hi, I have 3 columns in my list control, each with a different type of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no

Re: Any python module for Traversing HTML files

2007-07-24 Thread Clement
On Jul 24, 10:12 pm, johnny [EMAIL PROTECTED] wrote: Any python module for navigating and selecting, parsing HTML files? try beautyfulshop -- http://mail.python.org/mailman/listinfo/python-list

Problem in Socket.....

2007-07-24 Thread Clement
Is it possible to close the socket connection immediately in Python.. Because i am getting error even though i close it after all the transfer I read from one article it is possible in C socket Whether is it possible in Python? -- http://mail.python.org/mailman/listinfo/python-list

RE: exec and func_code

2007-07-24 Thread Prepscius, Colin (IT)
Actually, thx to Gabrielle Genellina, who wrote earlier: Instead of using exec, rebuild a new function from the unmarshalled code: import new f3 = new.function(f2.func_code, globals()) f3(parameter) I haven't tried it yet, but will today... -Original Message- From: [EMAIL PROTECTED]

Re: Any python module for Traversing HTML files

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 17:36 +, Clement wrote: On Jul 24, 10:12 pm, johnny [EMAIL PROTECTED] wrote: Any python module for navigating and selecting, parsing HTML files? try beautyfulshop Failing that, try BeautifulSoup. -- Carsten Haese http://informixdb.sourceforge.net --

Re: Hacking with __new__

2007-07-24 Thread Sandra-24
On Jul 24, 5:20 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: IIRC, __new__ is supposed to return the newly created object - which you are not doing here. class Bar(Foo): def __new__(cls, a, b, c, *args): print 'Bar.__new__', len(args) if not args:

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Jason
On Jul 24, 10:21 am, Robert Dailey [EMAIL PROTECTED] wrote: Hi, I have 3 columns in my list control, each with a different type of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no

Re: Any python module for Traversing HTML files

2007-07-24 Thread Kelvie Wong
I think he meant Beautiful Soup. On 7/24/07, Clement [EMAIL PROTECTED] wrote: On Jul 24, 10:12 pm, johnny [EMAIL PROTECTED] wrote: Any python module for navigating and selecting, parsing HTML files? try beautyfulshop -- http://mail.python.org/mailman/listinfo/python-list -- Kelvie --

Re: From D

2007-07-24 Thread Bjoern Schliessmann
Stargaming wrote: On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: While in a syntax like: for i in xrange(1_000_000): my eyes help me group them at once. Sounds like a good thing to be but the arbitrary positioning doesnt make any sense. Checking underscore positions would

Re: code indentation

2007-07-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: On 24 srp, 05:20, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... [EMAIL PROTECTED] escribió: If you are using the tokenize module as suggested some time ago, try to analyze the token sequence you get using { } (or

Re: Problem in Socket.....

2007-07-24 Thread Diez B. Roggisch
Clement schrieb: Is it possible to close the socket connection immediately in Python.. Because i am getting error even though i close it after all the transfer I read from one article it is possible in C socket Whether is it possible in Python? Which error? And usually the

Re: Technology solutions for Ruby?

2007-07-24 Thread vasudevram
Bruno Desthuilliers wrote: s/some/great/g Both Ruby and Python are known for this. Thanks for the info. (I don't know much about metaprogramming etc. in either languages - just started exploring those topics recently.) I'd say that - wrt/ advanced programming tricks - *most* of what you can

Re: Problem in Socket.....

2007-07-24 Thread Grant Edwards
On 2007-07-24, Clement [EMAIL PROTECTED] wrote: Is it possible to close the socket connection immediately in Python.. Sure. Just call the socket's close() method. [You really ought to get that sticky '.' key fixed.] Because i am getting error even though i close it after all the

Re: Can a low-level programmer learn OOP?

2007-07-24 Thread Eddie Corns
Paul McGuire [EMAIL PROTECTED] writes: On Jul 23, 12:43 pm, [EMAIL PROTECTED] (Eddie Corns) wrote: Paul McGuire [EMAIL PROTECTED] writes: On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: Wolfgang Strobl [EMAIL PROTECTED] writes: few of James Gimple's snippets from Algorithms in

Re: Any python module for Traversing HTML files

2007-07-24 Thread Stefan Behnel
johnny wrote: Any python module for navigating and selecting, parsing HTML files? Since you didn't name any specific requirements, consider taking the best one. lxml.html provides loads of goodies like Python iterators, XPath or CSS selection for navigation, or a clean() function for removing

Re: Technology solutions for Ruby?

2007-07-24 Thread Chris Mellon
On 7/16/07, vasudevram [EMAIL PROTECTED] wrote: [ Though the OP posted his message to comp.lang.ruby, I'm cross- posting it to comp.lang.python, since he mentions Python as a possible alternative he's looking at, and also because I've recommended Python for his stated needs. Also, interested

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Robert Dailey [EMAIL PROTECTED] wrote: Hi, I have a string in the following format: 00:00:25.886411 I would like to pass this string into the datetime.time() class and have it parse the string and use the values. However, the __init__() method only takes integers (which

Re: Any python module for Traversing HTML files

2007-07-24 Thread Benjamin
On Jul 24, 12:12 pm, johnny [EMAIL PROTECTED] wrote: Any python module for navigating and selecting, parsing HTML files? htmlparse -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Benjamin
On Jul 24, 11:21 am, Robert Dailey [EMAIL PROTECTED] wrote: Hi, I have 3 columns in my list control, each with a different type of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no

Re: Hacking with __new__

2007-07-24 Thread Duncan Booth
Bruno Desthuilliers [EMAIL PROTECTED] wrote: Duncan Booth a écrit : (snip) I think what you want for Bar is something more along the lines: (snip) class Bar(Foo): def __new__(cls, a, b, c, *args): print 'Bar.__new__', len(args) target = cls You don't use 'target'

Good String Tokenizer

2007-07-24 Thread JamesHoward
I have searched the board and noticed that there isn't really any sort of good implementation of a string tokenizer that will tokenize based on a custom set of tokens and return both the tokens and the parts between the tokens. For example, if I have the string: Hello, World! How are you? And

Re: Good String Tokenizer

2007-07-24 Thread James Stroud
JamesHoward wrote: I have searched the board and noticed that there isn't really any sort of good implementation of a string tokenizer that will tokenize based on a custom set of tokens and return both the tokens and the parts between the tokens. For example, if I have the string: Hello,

  1   2   >