Re: optional static typing for Python

2008-01-29 Thread Kay Schluehr
On Jan 30, 12:38 am, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Python has a JIT right no > > You mean in the Java-sense (outputting native machine code)? > > /W Sure. http://psyco.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing call to PyObject_CallObject with PyEval_CallFunction

2008-01-29 Thread grbgooglefan
On Jan 30, 1:58 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 30 ene, 01:58, grbgooglefan <[EMAIL PROTECTED]> wrote: > > > How do I pass the elements populated in struct variables of this > > vector dynamically to PyEval_CallFunction, in the fashion somewhat > > like below? > > PyEval_CallF

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Paul Rubin
Santiago Romero <[EMAIL PROTECTED]> writes: > > >>> li = [1,2,3,4,5] > > >>> filter(lambda x: x != 3, li) > > [1, 2, 4, 5] > > I haven't measured it, but this should be the fast solution in all > the thread ... li.remove(3) is probably faster. -- http://mail.python.org/mailman/listinfo/python-

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Santiago Romero
> how about > > >>> li = [1,2,3,4,5] > >>> filter(lambda x: x != 3, li) > [1, 2, 4, 5] I haven't measured it, but this should be the fast solution in all the thread ... -- http://mail.python.org/mailman/listinfo/python-list

Do You Want a GSM Mobile with Amazing Features? Please click here

2008-01-29 Thread Farooq
www.enmac.com.hk GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, Digital Quran. Enjoy these products with Islamic Features (Complete Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily Supplications, Universal Qibla Direction, Prayer Timing and much more) visit our

Re: Appropriate use of Property()

2008-01-29 Thread Gabriel Genellina
On 29 ene, 23:17, [EMAIL PROTECTED] wrote: > Property() can be used to rid ourselves of the extra effort of using > two different methods (getAttrib() setAttrib()) for access of an > attribute without giving direct access to the attribute, thus making > it more elegant. So, the outsider using my m

Re: Replacing call to PyObject_CallObject with PyEval_CallFunction

2008-01-29 Thread Gabriel Genellina
On 30 ene, 01:58, grbgooglefan <[EMAIL PROTECTED]> wrote: > How do I pass the elements populated in struct variables of this > vector dynamically to PyEval_CallFunction, in the fashion somewhat > like below? > PyEval_CallFunction(obj, "iii", > vector[0].ioparam->nionum,vector[1].ioparam->nionum,v

Re: ISO with timezone

2008-01-29 Thread Ben Finney
"Nicholas F. Fabry" <[EMAIL PROTECTED]> writes: > The constructor for class datetime has a method, .now() that returns > the current date and time, as a naive datetime object (i.e. no > tzinfo attached). It's not "the constructor for class 'datetime'" that has that method; rather, the class 'date

Re: ISO with timezone

2008-01-29 Thread Nicholas F. Fabry
On Jan 29, 2008, at 13:56, nik wrote: > Thanks, > that does help and now I have: > from datetime import datetime, tzinfo, timedelta import time class TZ(tzinfo): > ...def utcoffset(self,dt): return timedelta(seconds=time.timezone) > ... print datetime(2008,2,29,15,30,11,tz

epydoc 3.0 released

2008-01-29 Thread Edward Loper
Announcing epydoc 3.0 ~ Webpage: http://epydoc.sourceforge.net/ Download: http://tinyurl.com/yoo6d7 Epydoc is a tool for generating API documentation for Python modules, based on their docstrings. A lightweight markup language called epytext can be used to format docstring

Replacing call to PyObject_CallObject with PyEval_CallFunction

2008-01-29 Thread grbgooglefan
Hello Python Experts May you please help me on this change? I have following code: //== typedef struct IOParams { char *ioString; long lionum; double dionum; float fionum; intnionum; } *pIOParams; //

Fwd: The results of your email commands

2008-01-29 Thread Manikandan R
Hai, I am working with python 2.4. I am new to python, I need to collect all the ipaddress of the systems connected in the network for my project. While browsing I come accross Ur link. I think U peoples can help me. Can U please send me the code and guide me to g

How to collect all the IP address of the system connected in network?

2008-01-29 Thread Manikandan R
Hai, I am working with python 2.4. I am new to python, I need to collect all the ipaddress of the systems connected in the network for my project. While browsing I come accross Ur link. I think U peoples can help me. Can U please send me the code and guide me to get it. I am i

Re: Web Interface Recommendations

2008-01-29 Thread PurpleServerMonkey
On Jan 30, 12:55 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jan 30, 12:00 pm, PurpleServerMonkey <[EMAIL PROTECTED]> > wrote: > > > > > Looking for suggestions on the best framework to use for an > > applications web interface. > > > The user interface doesn't need immediate feedback and

Re: Python Standardization: Wikipedia entry

2008-01-29 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | And no two implementations are even close to compiling the same language. That is not what some alternate implementors have claimed. How you done actual tests to prove them wrong? (And, of course, 'close' would need so

Gmail imap search does not get all messages.

2008-01-29 Thread Bart Kastermans
I am trying to use imaplib with gmail. I am finding however that with the gmail server imaplib.search does not give the correct answer. See the below traces (k is a server a my department, i is gmail). k has 6 messages in the INBOX i has 3 messages in the INBOX However i.search(None, "ALL") only

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Joe Riopel
On Jan 29, 2008 9:23 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If you're going to delete elements from > a list while iterating over it, then do > it in reverse order: how about >>> li = [1,2,3,4,5] >>> filter(lambda x: x != 3, li) [1, 2, 4, 5] >>> -- http://mail.python.org/mailman/listi

Telenet nieuwsgroepen mededeling: nieuwsserver adres aanpassen/Attention: modification de l'adresse du serveur de newsgroup

2008-01-29 Thread info
Beste klant, Telenet heeft een migratie gedaan van haar nieuwsservers. Wat betekent dit concreet voor jou als gebruiker? Er verandert niets aan de service, maar om verder gebruik te maken van de Telenet nieuwsgroepen service moet je bij de instellingen van je nieuwslezer het adres van de nieuws

Re: Web Interface Recommendations

2008-01-29 Thread Graham Dumpleton
On Jan 30, 12:00 pm, PurpleServerMonkey <[EMAIL PROTECTED]> wrote: > Looking for suggestions on the best framework to use for an > applications web interface. > > The user interface doesn't need immediate feedback and will be cross > platform so a web interface is a good solution especially since i

Appropriate use of Property()

2008-01-29 Thread noemailplease0001
Property() can be used to rid ourselves of the extra effort of using two different methods (getAttrib() setAttrib()) for access of an attribute without giving direct access to the attribute, thus making it more elegant. So, the outsider using my module accesses the attribute with the syntax 'Object

Web Interface Recommendations

2008-01-29 Thread PurpleServerMonkey
Looking for suggestions on the best framework to use for an applications web interface. The user interface doesn't need immediate feedback and will be cross platform so a web interface is a good solution especially since it operates as a client\server system and not standalone. However there's ju

Re: breaking out of outer loops

2008-01-29 Thread Steven Bethard
Jeremy Sanders wrote: > [EMAIL PROTECTED] wrote: > >> Any elegant way of breaking out of the outer for loop than below, I >> seem to have come across something, but it escapes me >> >> for i in outerLoop: >>for j in innerLoop: >>if condition: >> break >>else: >>co

comparing two lists, ndiff performance

2008-01-29 Thread Zbigniew Braniecki
Hi all. I'm working on a tool for localizers. I have two Lists with Entities/Strings/Comments (each L10n file is built of those three elements). So I have sth like: l10nObject = [] l10nObject.append(Comment('foo')) l10nObject.append("string") l10nObject.append(Entity('name', 'value')) etc. I

Re: Telnet Program

2008-01-29 Thread [EMAIL PROTECTED]
On Jan 29, 12:27 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > I am having some issues writing a telnet program, using telnetlib. I > > am not sure if it is the telnet on the connections end or it is my > > program. > > > A little background, when I

Re: optional static typing for Python

2008-01-29 Thread [EMAIL PROTECTED]
On 28 jan, 11:21, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jan 28, 1:53 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > Russ P. a écrit : > > > > On Jan 27, 5:03 pm, Paddy > > > >> If static typing is optional then a program written in a dynamic > > >> language that passes such an aut

ImageFilter failing for mode = 1

2008-01-29 Thread Christian Hanemann
Hello, I'm trying to sharpen some JPEGs after resizing and am being given a valueError as per the below: File "getGraphicDetails.py", line 32, in main enhancer = ImageEnhance.Sharpness(img) File "/usr/local/lib/python2.3/site-packages/PIL/ImageEnhance.py", line 89, in __init__

Re: optional static typing for Python

2008-01-29 Thread Wildemar Wildenburger
> Python has a JIT right no > You mean in the Java-sense (outputting native machine code)? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: Decision (if, else) routine is not working as intended with CGI module

2008-01-29 Thread [EMAIL PROTECTED]
On 29 jan, 21:23, epsilon <[EMAIL PROTECTED]> wrote: > All: > > I'm running into trouble figuring this one out. It seems that my > decision routine is not working as intended. Does anyone know why my > output continues to utilize the "else" portion of the routine. Probably because the test expre

Python UML Metamodel

2008-01-29 Thread sccs cscs
Hello, I find an OPEN SOURCE tool (http://bouml.free.fr/) that Recently generates Python code from UML model. I like to model the Python language metamodel himself, with it, e.g the model of the language: I need that to better understand the language constraint of the language. for example,

Re: Decision (if, else) routine is not working as intended with CGI module

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 18:23:41 -0200, epsilon <[EMAIL PROTECTED]> escribi�: > I'm running into trouble figuring this one out. It seems that my > decision routine is not working as intended. Does anyone know why my > output continues to utilize the "else" portion of the routine. > > tag_form = cgi.

Re: object vs class oriented -- xotcl

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 16:22:24 -0200, William Pursell <[EMAIL PROTECTED]> escribi�: > I'm fairly excited at the idea of being able to > do per-object mixins in xotcl. I guess it would > look like this in python: > > BROKEN CODE: > a = object() > a.__class__.append( foo ) > a.__class__.append( bar

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Paul Hankin
On Jan 29, 8:17 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Berteun Damman <[EMAIL PROTECTED]> wrote: > > On Tue, 29 Jan 2008 09:23:16 -0800 (PST), [EMAIL PROTECTED] > ><[EMAIL PROTECTED]> wrote: > >> If you're going to delete elements from > >> a list while iterating over it, then do > >> it in

load movie frames in python?

2008-01-29 Thread Brian Blais
Hello, Is there a way to read frames of a movie in python? Ideally, something as simple as: for frame in movie('mymovie.mov'): pass where frame is either a 2-D list, or a numpy array? The movie format can be anything, because I can probably convert things, but most convenient woul

Re: ISO with timezone

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 16:56:18 -0200, nik <[EMAIL PROTECTED]> escribi�: print datetime(2008,2,29,15,30,11,tzinfo=TZ()).isoformat() > 2008-02-29T15:30:11+8:00 > > But what I want to know now it how to get the actual time into the > expression instead of typing the 2008,2,29,15 > So something

Re: Terse Syntax through External Methods

2008-01-29 Thread Diez B. Roggisch
Jens schrieb: > On Jan 25, 3:19 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Jens schrieb: >> >> >> >>> Hello Everyone >>> I'm newbie to Zope and i have a few questions regarding external >>> methods. What i wan't to do >>> is provide a terse syntax for converting urls to special tracking

Re: Removing Pubic Hair Methods

2008-01-29 Thread John Machin
On Jan 30, 9:14 am, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > Shaving is the most common removing pubic hair method. However, it > > is not the only one. > > Clearly you haven't done the Python tutorial, otherwise you'd realise > there's no distinction between pubic meth

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Paul Hankin
On Jan 29, 4:34 pm, William McBrine <[EMAIL PROTECTED]> wrote: > Look at this -- from Python 2.5.1: > > >>> a = [1, 2, 3, 4, 5] > >>> for x in a: > > ...     if x == 3: > ...         a.remove(x) > ...     print x > ... > 1 > 2 > 3 > 5 > > >>> a > [1, 2, 4, 5] > > Sure, the resulting list is correct

Re: breaking out of outer loops

2008-01-29 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Any elegant way of breaking out of the outer for loop than below, I > seem to have come across something, but it escapes me > > for i in outerLoop: >for j in innerLoop: >if condition: > break >else: >continue > break It's working

Re: Implementation of IBuyable or Interface?

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 15:52:58 -0200, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> escribi�: > I've got a IBuyable interface. The app can sell both Products and > Services > (Both "Buyables"). I'm not sure if Product and Service should also be > represented as interfaces (inherited from IBuyable)

Re: breaking out of outer loops

2008-01-29 Thread Jeremy Sanders
[EMAIL PROTECTED] wrote: > Any elegant way of breaking out of the outer for loop than below, I > seem to have come across something, but it escapes me > > for i in outerLoop: >for j in innerLoop: >if condition: > break >else: >continue > break Perhaps Python

Re: Removing Pubic Hair Methods

2008-01-29 Thread Ben Finney
[EMAIL PROTECTED] writes: > Shaving is the most common removing pubic hair method. However, it > is not the only one. Clearly you haven't done the Python tutorial, otherwise you'd realise there's no distinction between pubic methods and privy methods. Also, there's one, and preferably only one,

Re: Trying to understand Python web-development

2008-01-29 Thread Joshua Kugler
walterbyrd wrote: > Python also seems to require some sort of "long running processes" I > guess that the python interpretor has to running all of time. What you probably don't realize, is that in 99.9% of the situations you've come across, PHP is already a process running all the time. It's call

Re: Python Standardization: Wikipedia entry

2008-01-29 Thread Colin J. Williams
John Nagle wrote: > Paddy wrote: >> I would value the opinion of fellow Pythoneers who have also >> contributed to Wikipedia, on the issue of "Is Python Standardized". >> Specifically in the context of this table: >> >> http://en.wikipedia.org/wiki/Comparison_of_programming_languages#General_com

Re: Fwd: Help! - Invoke setup.py file

2008-01-29 Thread Gabriel Genellina
En Mon, 21 Jan 2008 07:38:15 -0200, Vikas Jadhav <[EMAIL PROTECTED]> escribi�: > We have setup of SVGMath* 0.3.2 (Converter- Mathml 2.0 coding to SVG). > The > setup folder contains setup.py file but we are not able to initiate this > file. Kindly help us, resolution to this query will be appr

Re: Reflection and aspect programming in Python

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 14:42:55 -0200, Jean-François Houzard <[EMAIL PROTECTED]> escribi�: > I'm a student at UCL Belgium and I have to write a paper about reflection > and introspection in Python. > > It is somewhat difficult to find advanced information about reflection in > Python, not only intr

Re: breaking out of outer loops

2008-01-29 Thread Arnaud Delobelle
On Jan 29, 8:55 pm, pataphor <[EMAIL PROTECTED]> wrote: > On Tue, 29 Jan 2008 11:51:04 -0800 (PST) > > [EMAIL PROTECTED] wrote: > > Any elegant way of breaking out of the outer for loop than below, I > > seem to have come across something, but it escapes me > > > for i in outerLoop: > >    for j in

Re: optional static typing for Python

2008-01-29 Thread Kay Schluehr
On 29 Jan., 17:00, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > Given the difficulty of statically analyzing Python, and the > limitations you need to add for either static typing or type inference > to be practical, I think that the real future for faster Python code > is JIT, not static optimizat

Re: breaking out of outer loops

2008-01-29 Thread pataphor
On Tue, 29 Jan 2008 11:51:04 -0800 (PST) [EMAIL PROTECTED] wrote: > Any elegant way of breaking out of the outer for loop than below, I > seem to have come across something, but it escapes me > > for i in outerLoop: >for j in innerLoop: >if condition: > break >else: >

Re: breaking out of outer loops

2008-01-29 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Any elegant way of breaking out of the outer for loop than below, I > seem to have come across something, but it escapes me > > for i in outerLoop: >for j in innerLoop: >if condition: > break >else: >continue > break You can do it

Re: noob stuck on reading double

2008-01-29 Thread John Machin
[I can't see Hannah's posting(s) with my news client (Thunderbird), nor with Google Groups] Joe Riopel wrote: > Since you're unpacking it with the 'd' format character I am assuming > a "doubleword" field is a double. Given Hannah has sensibly stated up front that she is a noob, I would assume

Decision (if, else) routine is not working as intended with CGI module

2008-01-29 Thread epsilon
All: I'm running into trouble figuring this one out. It seems that my decision routine is not working as intended. Does anyone know why my output continues to utilize the "else" portion of the routine. Thank you, Christopher ++ #!/usr/bin/python import cgi print "Content-type: text/

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Duncan Booth
Berteun Damman <[EMAIL PROTECTED]> wrote: > On Tue, 29 Jan 2008 09:23:16 -0800 (PST), [EMAIL PROTECTED] ><[EMAIL PROTECTED]> wrote: >> If you're going to delete elements from >> a list while iterating over it, then do >> it in reverse order: > > Why so hard? Reversing it that way creates a copy,

Re: runscript module, where are the docs...

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 13:48:58 -0200, glomde <[EMAIL PROTECTED]> escribi�: > I am going through some code and found > import runscript > > BUT I cant find and information about this module. I searched Google > did a grep in > the /usr/lib/python directory. > > What is the purpose of this module and

Re: Zipfile content reading via an iterator?

2008-01-29 Thread Gabriel Genellina
En Tue, 29 Jan 2008 11:06:12 -0200, Tim Chase <[EMAIL PROTECTED]> escribi�: > Just to follow up on this, I dropped the the 2.6 version of > zipfile.py in my project folder (where the machine is currently > running Python2.4), used the ZipFile.open() and it worked fine. > [...] > Anyways, thanks

breaking out of outer loops

2008-01-29 Thread noemailplease0001
Any elegant way of breaking out of the outer for loop than below, I seem to have come across something, but it escapes me for i in outerLoop: for j in innerLoop: if condition: break else: continue break Thanks, K -- http://mail.python.org/mailman/listinfo/python

Re: Module/package hierarchy and its separation from file structure

2008-01-29 Thread Robert Kern
Carl Banks wrote: > On Jan 29, 7:48 am, Peter Schuller <[EMAIL PROTECTED]> > wrote: >>> You can also put, in animal/__init__.py: >>> from monkey import Monkey >>> and now you can refer to it as org.lib.animal.Monkey, but keep the >>> implementation of Monkey class and all related stuff into >>> ..

Re: Extending the import mechanism - what is recommended?

2008-01-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: I need to extend the import mechanism to support another file type. I've already written the necessary C library to read the file and return a python code object. I found one example which just sub-classed imputil.ImportManager like this: from myLib import pye_code as p

Re: Telnet Program

2008-01-29 Thread Rob Wolfe
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I am having some issues writing a telnet program, using telnetlib. I > am not sure if it is the telnet on the connections end or it is my > program. > > A little background, when I log in straight from the Linux Command > prompt. The only thing I g

Re: noob stuck on reading double

2008-01-29 Thread Joe Riopel
Since you're unpacking it with the 'd' format character I am assuming a "doubleword" field is a double. You said you had 113 of them in the binary file. You should be doing something like this: file = open('data.bin', 'rb') file.seek(0) raw = file.re

Re: typename

2008-01-29 Thread Neil Cerutti
On Jan 29, 2008 2:06 PM, Neal Becker <[EMAIL PROTECTED]> wrote: > I want python code that given an instance of a type, prints the type name, > like: > > typename (0) -> 'int' typename = lambda x: type(x).__name__ -- Neil Cerutti <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/pyt

Re: ISO with timezone

2008-01-29 Thread nik
On Jan 29, 10:56 am, nik <[EMAIL PROTECTED]> wrote: > Thanks, > that does help and now I have: > > >>> from datetime import datetime, tzinfo, timedelta > >>> import time > >>> class TZ(tzinfo): > > ...def utcoffset(self,dt): return timedelta(seconds=time.timezone) > ...>>> print datetime(2008,2

Re: Mx.ODBC insert error

2008-01-29 Thread Greg Corradini
Thanks John. I now see it John Machin wrote: > > On Jan 30, 3:27 am, Greg Corradini <[EMAIL PROTECTED]> wrote: >> Hello, >> I've never gotten this traceback error before using mx.ODBC. > > "traceback error"?? I see no problem with the traceback. > >> Any ideas about >> resolving this issue? T

Re: noob stuck on reading double

2008-01-29 Thread Joe Riopel
On Jan 29, 2008 1:35 PM, Hannah Drayson <[EMAIL PROTECTED]> wrote: > It imports as a string of rubbish... > i.e. > > > >>> text = f.read() > >>> print text > ?F?C??y??>? > @[EMAIL PROTECTED]@???/???8[EMAIL PROTECTED]/[EMAIL > PROTECTED]@?Q???Q???Q???Q???Q??ǑR[???Q?

typename

2008-01-29 Thread Neal Becker
I want python code that given an instance of a type, prints the type name, like: typename (0) -> 'int' I know how to do this with the C-api, (o->tp_name), but how do I do it from python? type(0) prints "", not really what I wanted. -- http://mail.python.org/mailman/listinfo/python-list

Re: Error in parsing XML for following test data

2008-01-29 Thread John Machin
On Jan 29, 9:29 pm, abhishek <[EMAIL PROTECTED]> wrote: > Hello group, > > I am having problem parsing following data set from XML. Please > provide hints on how to rectify this problem. You have provided no hints on what your problem is. What output do you want? What have you tried? What output a

Re: noob stuck on reading double

2008-01-29 Thread Joe Riopel
On Jan 29, 2008 1:59 PM, Joe Riopel <[EMAIL PROTECTED]> wrote: > When reading the file, try using > file = open('data.bin', 'rb') > file.seek(0) > raw = file.read() > > Do the unpack on "raw". Ignore this, sorry for the confusion. -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO with timezone

2008-01-29 Thread nik
Thanks, that does help and now I have: >>> from datetime import datetime, tzinfo, timedelta >>> import time >>> class TZ(tzinfo): ...def utcoffset(self,dt): return timedelta(seconds=time.timezone) ... >>> print datetime(2008,2,29,15,30,11,tzinfo=TZ()).isoformat() 2008-02-29T15:30:11+8:00 But

Re: Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread Wildemar Wildenburger
kj wrote: > Is there any good reading (to ease the transition) for Perl > programmers trying to learn Python? > www.diveintopython.org While it is a bit dated by now (Python 2.2), that thing worked wonders for me. Shows you Python in action and presents a fair amount of its philosophy along th

Re: Mx.ODBC insert error

2008-01-29 Thread John Machin
On Jan 30, 3:27 am, Greg Corradini <[EMAIL PROTECTED]> wrote: > Hello, > I've never gotten this traceback error before using mx.ODBC. "traceback error"?? I see no problem with the traceback. > Any ideas about > resolving this issue? The statement and the error it generates are listed > below. Th

noob stuck on reading double

2008-01-29 Thread Hannah Drayson
Hi all, I have a .bin file which python just won't play ball with- Does anyone know what I'm doing wrong- is it simply incompatible? I've read it fine using a C program - its 113 doubleword fields- apparently its possible to handle these in python in a very similar way to C. I can provide the c

Re: extending Python - passing nested lists

2008-01-29 Thread Arnaud Delobelle
On Jan 29, 4:00 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > > You didn't mention speed in your original post. > > Sorry, perhaps I considered this self-evident - which it is, of course, not. > > > What about using > > array.array?  Unless I am mistaken, these are just a thin wrapper > > aro

Re: object vs class oriented -- xotcl

2008-01-29 Thread William Pursell
On Jan 24, 9:16 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/1/24, William Pursell <[EMAIL PROTECTED]>: > > Can I do it in Python? > > > class A(object): pass > class B(object): pass > > a = A() > a.__class__ = B > > That ? Maybe you meant something else. That is what I was referring

Telnet Program

2008-01-29 Thread [EMAIL PROTECTED]
I am having some issues writing a telnet program, using telnetlib. I am not sure if it is the telnet on the connections end or it is my program. A little background, when I log in straight from the Linux Command prompt. The only thing I get is a blinking cursor. Then I type in my command 'FOO' ent

Re: Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread Rick Dooling
On Jan 29, 10:39 am, kj <[EMAIL PROTECTED]> wrote: > I'd written a Perl module to facilitate the writing of scripts. > It contained all my boilerplate code for parsing and validating > command-line options, generating of accessor functions for these > options, printing of the help message and of t

Re: Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread Paddy
On Jan 29, 4:39 pm, kj <[EMAIL PROTECTED]> wrote: > It's not the Python syntax that I'm having problems with, but rather > with larger scale issues such as the structuring of packages, > techniques for code reuse, test suites, the structure of > distributions,... Python and Perl seem to come from

Re: Problem with Tkinter scrollbar callback

2008-01-29 Thread Ivan Van Laningham
No Joy. Waits the 1 second, then clicks the button once per second until the limit's reached. Sigh. Metta, Ivan On Jan 29, 2008 10:20 AM, Russell E Owen <[EMAIL PROTECTED]> wrote: > >Nope: > > > >'repeatdelay': ('repeatdelay', 'repeatDelay', 'RepeatDelay', '300', '300'), > > > >And even after I

Re: Trying to understand Python web-development

2008-01-29 Thread Bruno Desthuilliers
walterbyrd a écrit : > I don't know much php either, but running a php app seems straight > forward enough. Mmm... As long as the whole system is already installed and connfigured, *and* matches your app's expectations, kind of, yes. > Python seems to always use some sort of development environm

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Santiago Romero
> Look at this -- from Python 2.5.1: > > >>> a = [1, 2, 3, 4, 5] > >>> for x in a: > ... if x == 3: > ... a.remove(x) > ... print x Well ... you could use: >>> for i in range(len(a)-1, -1, -1): ...print a[i] ...if a[i] == 3: del a[i] ... 5 4 3 2 1 >>> print a [1, 2, 4, 5]

Implementation of IBuyable or Interface?

2008-01-29 Thread Marcelo de Moraes Serpa
Hello! It's more a design question than anything python specific. If anyone could help me, I would be grateful. If it's not the right place for this subject, please advise. I've got a IBuyable interface. The app can sell both Products and Services (Both "Buyables"). I'm not sure if Product and Se

Re: Trying to understand Python web-development

2008-01-29 Thread Joe Riopel
On Jan 29, 2008 12:11 PM, walterbyrd <[EMAIL PROTECTED]> wrote: > I am not really sure about what wsgi is supposed to accomplish. This will explain WSGI: http://www.python.org/dev/peps/pep-0333/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Berteun Damman
On Tue, 29 Jan 2008 09:23:16 -0800 (PST), [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If you're going to delete elements from > a list while iterating over it, then do > it in reverse order: Why so hard? Reversing it that way creates a copy, so you might as well do: >>> a = [ 98, 99, 100 ] >>>

RE: Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of kj > Sent: Tuesday, January 29, 2008 11:39 AM > To: python-list@python.org > Subject: Python noob SOS (any [former?] Perlheads out there?) > > > > For many months now I've been trying to learn

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread [EMAIL PROTECTED]
On Jan 29, 8:34 am, William McBrine <[EMAIL PROTECTED]> wrote: > Look at this -- from Python 2.5.1: > > >>> a = [1, 2, 3, 4, 5] > >>> for x in a: > > ... if x == 3: > ... a.remove(x) > ... print x > ... > 1 > 2 > 3 > 5 > > >>> a > [1, 2, 4, 5] > > Sure, the resulting list is correct

Re: regular expression negate a word (not character)

2008-01-29 Thread Greg Bacon
In article <[EMAIL PROTECTED]>, Dr.Ruud <[EMAIL PROTECTED]> wrote: : I negated the test, to make the regex simpler: [...] Yes, your approach is simpler. I assumed from the "need it all in one pattern" constraint that the OP is feeding the regular expression to some other program that is looki

Trying to understand Python web-development

2008-01-29 Thread walterbyrd
I don't know much php either, but running a php app seems straight forward enough. Python seems to always use some sort of development environment vs production environment scheme. For development, you are supposed to run a local browser and load 127.0.0.1:5000 - or something like that. Then to ru

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread imageguy
On Jan 29, 12:34 pm, William McBrine <[EMAIL PROTECTED]> wrote: > Look at this -- from Python 2.5.1: > > >>> a = [1, 2, 3, 4, 5] > >>> for x in a: > > ...     if x == 3: > ...         a.remove(x) > ...     print x > ... > 1 > 2 > 3 > 5 > > >>> a > [1, 2, 4, 5] > > Sure, the resulting list is correc

Re: Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread Bruno Desthuilliers
kj a écrit : > For many months now I've been trying to learn Python, but I guess > I'm too old a dog trying to learn new tricks... For better or > worse, I'm so used to Perl when it comes to scripting, that I'm > just having a very hard time getting a hang of "The Python Way." > (snip) > > I'd w

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread Berteun Damman
On Tue, 29 Jan 2008 16:34:17 GMT, William McBrine <[EMAIL PROTECTED]> wrote: > Look at this -- from Python 2.5.1: > a = [1, 2, 3, 4, 5] for x in a: > ... if x == 3: > ... a.remove(x) > ... print x > ... > 1 > 2 > 3 > 5 a > [1, 2, 4, 5] You have to iterate over a cop

Re: Module/package hierarchy and its separation from file structure

2008-01-29 Thread Carl Banks
On Jan 29, 7:48 am, Peter Schuller <[EMAIL PROTECTED]> wrote: > > You can also put, in animal/__init__.py: > > from monkey import Monkey > > and now you can refer to it as org.lib.animal.Monkey, but keep the > > implementation of Monkey class and all related stuff into > > .../animal/monkey.py > >

Reflection and aspect programming in Python

2008-01-29 Thread Jean-François Houzard
Hello, I'm a student at UCL Belgium and I have to write a paper about reflection and introspection in Python. It is somewhat difficult to find advanced information about reflection in Python, not only introspection but also the other sides of reflection. I'm using the book: "Programming Python, T

Python noob SOS (any [former?] Perlheads out there?)

2008-01-29 Thread kj
For many months now I've been trying to learn Python, but I guess I'm too old a dog trying to learn new tricks... For better or worse, I'm so used to Perl when it comes to scripting, that I'm just having a very hard time getting a hang of "The Python Way." It's not the Python syntax that I'm ha

Re: Python Standardization: Wikipedia entry

2008-01-29 Thread John Nagle
Paddy wrote: > I would value the opinion of fellow Pythoneers who have also > contributed to Wikipedia, on the issue of "Is Python Standardized". > Specifically in the context of this table: > > http://en.wikipedia.org/wiki/Comparison_of_programming_languages#General_comparison > (Comparison o

Re: MySQLdb

2008-01-29 Thread Tim Chase
> i have problem manipulating mySQL data. When i add values in a Table, > i can recieve them instantly but when i check the table from another > script, the new values dont exist. Depending on your transaction settings (both on your mysql connection object in code, and the engine used for the tabl

Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread William McBrine
Look at this -- from Python 2.5.1: >>> a = [1, 2, 3, 4, 5] >>> for x in a: ... if x == 3: ... a.remove(x) ... print x ... 1 2 3 5 >>> a [1, 2, 4, 5] >>> Sure, the resulting list is correct. But 4 is never printed during the loop! What I was really trying to do was this: apps =

Re: MySQLdb

2008-01-29 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > hello, > i have problem manipulating mySQL data. When i add values in a Table, > i can recieve them instantly but when i check the table from another > script, the new values dont exist. > > i'm not experienced in sql dbses so the problem might be something > outside py

Re: refcount

2008-01-29 Thread Mel
Benjamin wrote: > On Jan 29, 5:46 am, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Simon Pickles wrote: >>> Hi, >>> Is is possible to access the refcount for an object? >>> Ideally, I am looking to see if I have a refcount of 1 before calling del >> Help on built-in function getrefcount in module

Re: extending Python - passing nested lists

2008-01-29 Thread Mel
Christian Meesters wrote: >> You didn't mention speed in your original post. > Sorry, perhaps I considered this self-evident - which it is, of course, not. > >> What about using >> array.array? Unless I am mistaken, these are just a thin wrapper >> around normal C arrays. > The algorithm I want

Mx.ODBC insert error

2008-01-29 Thread Greg Corradini
Hello, I've never gotten this traceback error before using mx.ODBC. Any ideas about resolving this issue? The statement and the error it generates are listed below. curse.execute("Insert into FHWA_StandSamp_2008(LRS_ID_NEW) values('040210') where LRS_ID = '0403700010'") Traceback (most recen

MySQLdb

2008-01-29 Thread [EMAIL PROTECTED]
hello, i have problem manipulating mySQL data. When i add values in a Table, i can recieve them instantly but when i check the table from another script, the new values dont exist. i'm not experienced in sql dbses so the problem might be something outside python. example (i do this to add values,

Re: extending Python - passing nested lists

2008-01-29 Thread Christian Meesters
> You didn't mention speed in your original post. Sorry, perhaps I considered this self-evident - which it is, of course, not. > What about using > array.array? Unless I am mistaken, these are just a thin wrapper > around normal C arrays. The algorithm I want to implement requires several millio

  1   2   >