Re: M2Crypto 0.18 - new version, same old build bugs - more details

2007-09-24 Thread Heikki Toivonen
John Nagle wrote: > But notice that the -D entry didn't appear on the SWIG command line. > Neither did the "-includeall". The "swig_opts" values around line > 129 aren't actually being used. I think that's left over from the code > intended > to allow builds with Python 2.3 and earlier. The "sel

Re: Making a small change to a large XML document

2007-09-24 Thread Gerard Flanagan
On Sep 25, 12:38 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: > Say I want to take an existing XML document, and change the value="9997" > and value="9998" to two different numbers, without changing any of the > rest of the document - not even changing comments or indentation, if > avoidable. > > W

Re: Nested For and While Statements

2007-09-24 Thread metawilm
On Sep 24, 10:10 pm, Zentrader <[EMAIL PROTECTED]> wrote: > > Your for loops both use the same counting index. > > Since those variables are local to the for loop, No, "for" loops don't introduce a scope. The one variable named "j" is shared. > for j in range( 10 ): > print j, "first loop" >

Re: Making a small change to a large XML document

2007-09-24 Thread Shriphani
Dan Stromberg wrote: > Say I want to take an existing XML document, and change the value="9997" > and value="9998" to two different numbers, without changing any of the > rest of the document - not even changing comments or indentation, if > avoidable. > > What's the best way of doing it in python

Re: calling the function of one class from another class

2007-09-24 Thread Mridula Ramesh
thanks! ... sorry, i lacked access to the internet for a bit there... um, no, i'm not trying to write in java style in python, because i don't even know java!! i tried the "self" thing but that wasnt enough. I had to (as Furkan Kuru said) use a new instance of that class and only then call the func

Re: directpython question

2007-09-24 Thread Tim Roberts
"veki" <[EMAIL PROTECTED]> wrote: > >Hello, >I've got IBM Thinkpad 30 laptop with configuration: >... >,then I have been install directx 9.0c,Python 2.5 and directpython for >python 2.5.On my two computers directpython works but on this >laptop it don't want work e.g: > >When I want execute this sc

Re: sorting a list numbers stored as strings

2007-09-24 Thread Amit Khemka
On 9/24/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-09-24 at 16:53 +0530, Amit Khemka wrote: > > On 9/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > >>> l = ["1", "11", "2", "22"] > > >>> sorted(l, cmp = lambda x, y: cmp(int(x), int(y))) # provide your > > own compare

RE: sorting a list numbers stored as strings

2007-09-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > On Mon, 2007-09-24 at 19:58 +0800, Delaney, Timothy (Tim) wrote: >> I'm sure that in some version of Python it would have given a >> ValueError (due to the default radix being 0) but it appears to have >> changed to a default radix of 10 somewhere along the way. > > Not eve

RE: Almost There - os.kill()

2007-09-24 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: > Nope - pretty sure that an earlier version of Python defaulted to a > radix of 0, but it appears to default to a radix of 10 in Python 2.5. > > In any case, I've submitted a bug report and suggested new text for > the documentation of int() to make it clear what ha

Support for Vim (was: vim - what's a smarttab?)

2007-09-24 Thread Ben Finney
7stud <[EMAIL PROTECTED]> writes: > Thanks! I spent an hour hunting around on google with no > success. :( > > Another question if you don't mind Rather than have comp.lang.python turn into a support forum for questions about specific editors, I'll point you to the Vim site: http://www.vim

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 23:51:57 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > What I meant was that it's not an option because I'm trying to learn > regular > expressions. RE is just as built in as anything else. Ok, let's analyze what you want. You have for instance this text: "" which s

Re: vim - what's a smarttab?

2007-09-24 Thread 7stud
On Sep 24, 4:49 am, Marco <[EMAIL PROTECTED]> wrote: > > > Alternatively, what is a smarttab? > > in VIM type :help smarttab and you'll see the following: > Thanks! I spent an hour hunting around on google with no success. :( Another question if you don't mind. I'm using vim 6.2, and I am tryin

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Steve Holden
Robert Dailey wrote: > What I meant was that it's not an option because I'm trying to learn > regular expressions. RE is just as built in as anything else. > > On 9/24/07, *Steve Holden * <[EMAIL PROTECTED] > > wrote: > > Robert Dailey wrote: > > > > >

Re: shutil.copy2 error

2007-09-24 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Horse wrote: > I should've mentioned earlier, but this is > running on a windows 2000 system, and the destination folder is a > samba share on a Linux server. Could it be the connection to the Samba server has gone down temporarily? -- http://mail.python.org/mailm

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
What I meant was that it's not an option because I'm trying to learn regular expressions. RE is just as built in as anything else. On 9/24/07, Steve Holden <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > > > > > On 9/24/07, *Gabriel Genellina* <[EMAIL PROTECTED] > >

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 23:17:59 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> >> Yes: forget about regular expressions. ElementTree does that for free: > > That's not an option. Ok, keep fighting with REs - good luck! -- Gabriel

Re: subprocess -popen - reading stdout from child - hangs

2007-09-24 Thread Karthik Gurusamy
On Sep 24, 2:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 23, 2:58 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > > On Sep 22, 8:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Let's say I have this Python file called loop.py: > > > > import sys > > > print

Re: TRying to import files from my folder not pythons lib folder

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 22:36:38 -0300, Luis M. González <[EMAIL PROTECTED]> escribi�: > I solved the problem! > You were right. It seems there was a module that was causing problems, > although I don't know which one... > I just moved all the .py files on my desktop to a new folder, and > everythin

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Steve Holden
Robert Dailey wrote: > > > On 9/24/07, *Gabriel Genellina* <[EMAIL PROTECTED] > > wrote: > > Yes: forget about regular expressions. ElementTree does that for free: > > > That's not an option. > Even though it's built into Python 2.5? That's a strange requirement

re: Confused about 'positive lookbehind assertion'

2007-09-24 Thread Robert Dailey
Hi, I've been reading the python documentation on 'positive lookbehind assertion' and I don't understand at all how it works. The python docs give the following example: "**(?<=abc)def will find a match in "abcdef", since the lookbehind will back up 3 characters and check if the contained pattern

Re: PIL GIF transparency

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 21:53:46 -0300, David <[EMAIL PROTECTED]> escribi�: > I have a large number of smallish icons (GIFs with transparency) that > I'd like to tile into a grid in one large GIF image. The background > color of the image should be GIF-transparent. Currently, I can set it > to be wh

Re: Python script to optimize XML text

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 17:36:05 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > I'm currently seeking a python script that provides a way of optimizing > out > useless characters in an XML document to provide the optimal size for the > file. For example, assume the following XML script: > >

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > Yes: forget about regular expressions. ElementTree does that for free: > That's not an option. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 22:53:57 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > Any easier way to do a 'replace' then using start(), end(), and slicing > operations? I'm currently doing it manually. Yes: forget about regular expressions. ElementTree does that for free: source = """ """

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
Thanks. Any easier way to do a 'replace' then using start(), end(), and slicing operations? I'm currently doing it manually. On 9/24/07, Miles <[EMAIL PROTECTED]> wrote: > > On 9/24/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm attempting to create a regular expression that rem

Re: execfile and function call

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 16:59:52 -0300, Dave Westerman <[EMAIL PROTECTED]> escribi�: > I've got a Jython script where I'm doing an execfile() to pull in a > small script that contains a function, which I then call. > > execfile(app_applscript) > optionList = createOptionList(applOptions) > > When I

Re: TRying to import files from my folder not pythons lib folder

2007-09-24 Thread Luis M . González
On Sep 24, 5:00 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 23 Sep 2007 22:01:39 -0300, Luis M. González <[EMAIL PROTECTED]> > escribi?: > > > This is exactly what I did, but I have a new problem now: > > After setingPYTHONPATHI'm no longer able to start IDLE from the > > start men

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Miles
On 9/24/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I'm attempting to create a regular expression that removes redundancy in > empty XML elements. For example: > > > > The regular expression would convert the XML above into: > > If you can guarantee that the XML is well-formed, then

Re: TRying to import files from my folder not pythons lib folder

2007-09-24 Thread Luis M . González
On Sep 24, 5:00 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 23 Sep 2007 22:01:39 -0300, Luis M. González <[EMAIL PROTECTED]> > escribi?: > > > This is exactly what I did, but I have a new problem now: > > After setingPYTHONPATHI'm no longer able to start IDLE from the > > start men

Re: Nested For and While Statements

2007-09-24 Thread Ben Finney
Roberto Bonvallet <[EMAIL PROTECTED]> writes: > On Sep 24, 3:28 pm, [EMAIL PROTECTED] wrote: > > [...] where I start getting some errors. > > I'm hoping I won't have to post my code > > "Doctor, I'm feeling bad. I hope I won't have to tell you my > symptoms. What do I have?" > > Please provide

Re: An Editor that Skips to the End of a Def

2007-09-24 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Neil Cerutti wrote: > On 2007-09-22, Lawrence D'Oliveiro > <[EMAIL PROTECTED]> wrote: > >> In message <[EMAIL PROTECTED]>, Bjoern >> Schliessmann wrote: > >>> Nah. Use vim. >> >> Every other text editor I have ever used understands that the >> current position in a

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Bruno Desthuilliers
Ratko a écrit : > bruno a écrit >>Another solution is to compare the functions wrapped by the methods: >> >>class EvtHandler: >> def __init__(self): >> onKey = getattr(self, 'onKey') >> if onKey.im_func is EvtHandler.onKey.im_func: s/is/is not/, of course >> regi

Re: vim - what's a smarttab?

2007-09-24 Thread Ben Finney
7stud <[EMAIL PROTECTED]> writes: > Alternatively, what is a smarttab? (Marco has already shown that you can read the Vim help for this topic, so I won't repeat that.) There's no such thing as "a smarttab", and that's not what the option means. It's the name of an option that enables or disables

PIL GIF transparency

2007-09-24 Thread David
Hello alll, Apologies if this isn't the correct list. I'm getting my feet wet with the Python Imaging Library (PIL) 1.1.6 on Python 2.5.1. I have played around quite a bit with transparent GIFs, and from what I can tell, PIL should support what I want to do - except I can't seem to get it to wor

Re: shutil.copy2 error

2007-09-24 Thread Horse
On Sep 24, 6:34 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > On Sep 24, 7:34 am, Horse <[EMAIL PROTECTED]> wrote: > > > > > I've written a python script that copies a nightly Oracle backup file > > to another server. Every couple days, the script fails with this > > error message: > > > Error

Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
Hi, I'm attempting to create a regular expression that removes redundancy in empty XML elements. For example: The regular expression would convert the XML above into: And another complex example: would be: So far I've been unsuccessful in creating a regular expression to do this. Belo

ironpython with nosetest

2007-09-24 Thread belred
has anyone tried nosetest with ironpython? i installed IPCE-r6, copied the nose directory below the .egg directory from my cpython directory and copied to IPCE-r6/lib. i then created a file called n.py which contained two lines: import nose none.run() i was then able to run it against a test fi

Re: is there some module update(install tools)?

2007-09-24 Thread Adonis Vargas
hyena wrote: > Hi, > > I am quite new to python and am looking for some tools that can > install and update modules a bit more intelligent then "python setup.py > install". Is there some thing like "yum" in fedora which can search and > install/update packages automatically? > > thanks in ad

Re: execfile and function call

2007-09-24 Thread timaranz
I'm not sure why it doesn't work, but a better way would be to use the import statement: import app_applscrip app_applscript.createOptionList(applOptions) Cheers Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: calling the function of one class from another class

2007-09-24 Thread cmpython
On Sep 24, 2:27 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Furkan Kuru wrote: > > > On 9/22/07, *Mridula Ramesh* <[EMAIL PROTECTED] > > > wrote: > > > hi. > > > i currently have code structured like this: > > > classA(): > > def __init__(): >

is there some module update(install tools)?

2007-09-24 Thread hyena
Hi, I am quite new to python and am looking for some tools that can install and update modules a bit more intelligent then "python setup.py install". Is there some thing like "yum" in fedora which can search and install/update packages automatically? thanks in advance! -- http://mail.pytho

Making a small change to a large XML document

2007-09-24 Thread Dan Stromberg
Say I want to take an existing XML document, and change the value="9997" and value="9998" to two different numbers, without changing any of the rest of the document - not even changing comments or indentation, if avoidable. What's the best way of doing it in python? My

Re: shutil.copy2 error

2007-09-24 Thread Karthik Gurusamy
On Sep 24, 7:34 am, Horse <[EMAIL PROTECTED]> wrote: > I've written a python script that copies a nightly Oracle backup file > to another server. Every couple days, the script fails with this > error message: > > Error copying Q:/Oradata/GISPROD/Backups/3UISN35R_1_1 to s:/gisprod/ > backups/3UISN3

Re: strange behavious of the logging module?

2007-09-24 Thread Vinay Sajip
On Sep 24, 4:29 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Vinay Sajip wrote: > > On Sep 24, 8:03 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > >> It would still be a good idea to file a bug report. > > > Not sure where the bug is. The script below, when called, prints > > "Information" to the c

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Raymond Hettinger
On Sep 24, 8:23 am, Ratko <[EMAIL PROTECTED]> wrote: > Hi all, > > I was wondering if something like this is possible. Can a base class > somehow know if a certain method has been overridden by the subclass? > I appreciate any ideas. > Thanks, > > Ratko It's not hard. Both bound and unbound meth

Re: Nested For and While Statements

2007-09-24 Thread Paul Hankin
First the bugs... On Sep 24, 9:52 pm, [EMAIL PROTECTED] wrote: > ... > avcsasdoc = workspace + "\avcsas.txt" > ... There's quite a few cases like this where you don't escape backslashes, so your filenames are mostly mangled. Here \a produces character code 7, which is definitely wrong. Eithe

Re: Newbie completely confused

2007-09-24 Thread John Machin
On Sep 25, 1:51 am, Jeroen Hegeman <[EMAIL PROTECTED]> wrote: > > Your code does NOT include any statements that could have produced the > > above line of output -- IOW, you have not posted the code that you > > actually ran. > > Oh my, I must have cleaned it up a bit too much, hoping that people >

Re: Nested For and While Statements

2007-09-24 Thread Paul Hankin
First the bugs... On Sep 24, 9:52 pm, [EMAIL PROTECTED] wrote: > ... > avcsasdoc = workspace + "\avcsas.txt" > ... There's quite a few cases like this where you don't escape backslashes, so your filenames are mostly mangled. Here \a produces character code 7, which is definitely wrong. Eithe

Re: Nested For and While Statements

2007-09-24 Thread richyjsm
On Sep 24, 4:52 pm, [EMAIL PROTECTED] wrote: > Here is my code, in the hopes that there is a reason why it isn't > running. Thanks guys. [code snipped] You're missing the closing parenthesis on the last line of the inner for loop. Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: scope, modyfing outside object from inside the method

2007-09-24 Thread Ricardo Aráoz
Marcin Stępnicki wrote: > Hello. > > I thought I understand this, but apparently I don't :(. I'm missing > something very basic and fundamental here, so redirecting me to the > related documentation is welcomed as well as providing working code :). > > Trivial example which works as expected: >

Re: subprocess -popen - reading stdout from child - hangs

2007-09-24 Thread [EMAIL PROTECTED]
On Sep 23, 2:58 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > On Sep 22, 8:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Let's say I have this Python file called loop.py: > > > import sys > > print 'hi' > > sys.stdout.flush() > > Add sys.stdout.close() > Adding sys.stdout.close

I don't undestand why sometime python (or other) add "tmpWvk7zy" (tmp + random string) after "buildout-eggs" in path of python script

2007-09-24 Thread KLEIN Stephane
Hi, first, I think that my question is generalist and don't impact only zopeproject and/or Paste package. Instance, when I trace (debug) some scripts, its name is "/home/harobed/ buildout-eggs/tmpWvk7zy/PasteScript-1.3.6-py2.5.egg/paste/script/ serve.py" instead of "/home/harobed/buildout-eggs/P

Re: Nested For and While Statements

2007-09-24 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > My actual code has different variables, but thanks for pointing that > out. I'm so used to coding in VB, where indenting isn't a problem, so > all this indenting is new to me how Python wants it dictated. statement: block line 1 block line 2 # end state

Re: Nested For and While Statements

2007-09-24 Thread koutoo
On Sep 24, 3:44 pm, Roberto Bonvallet <[EMAIL PROTECTED]> wrote: > On Sep 24, 3:28 pm, [EMAIL PROTECTED] wrote: > > > [...] where I start getting some errors. > > I'm hoping I won't have to post my code > > "Doctor, I'm feeling bad. I hope I won't have to tell you my > symptoms. What do I have?"

Re: [lxml-dev] Python script to optimize XML text

2007-09-24 Thread Sidnei da Silva
If your XML is well-formed, a XSLT is probably your best choice. I believe even the most trivial 'pass through' example might produce the output you expect here. -- Sidnei da Silva Enfold Systemshttp://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 -- ht

Re: Nested For and While Statements

2007-09-24 Thread Roberto Bonvallet
On Sep 24, 3:28 pm, [EMAIL PROTECTED] wrote: > [...] where I start getting some errors. > I'm hoping I won't have to post my code "Doctor, I'm feeling bad. I hope I won't have to tell you my symptoms. What do I have?" Please provide the actual errors and the actual code. It is easier, less err

Re: Nested For and While Statements

2007-09-24 Thread koutoo
On Sep 24, 3:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Sep 24, 2:28 pm, [EMAIL PROTECTED] wrote: > > > > > > > I start my code with some constants then a while statement. But I > > have some For statements towards the end within the While statement > > where I start getting some errors.

Re: M2Crypto 0.18 - new version, same old build bugs - more details

2007-09-24 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>Back in March, I posted this: >> >> >>>Hit that with OpenSSL. Red Hat took elliptical curve cryptography >>>out of Fedora 6 for patent reasons. With that missing, M2Crypto won't >>>build. It ought to; the implementor of M2Crypto thought of that

Python script to optimize XML text

2007-09-24 Thread Robert Dailey
Hi, I'm currently seeking a python script that provides a way of optimizing out useless characters in an XML document to provide the optimal size for the file. For example, assume the following XML script: By running this through an XML optimizer, the file would appear as: N

Re: Nested For and While Statements

2007-09-24 Thread Zentrader
In addition, "for" is lower case, i.e not "For". If this doesn't solve the problem then please post the actual error message. "Next Line hits snag here? Where should this line be?" is not specific enough. -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Python with VC8 on x64 Vista

2007-09-24 Thread Martin v. Löwis
> It doesn't look like these are x86, though. Ok. Can you then check symbol lists also?: undefined symbols in the object file, and defined symbols in the library, wrt. PyExc_IndexError (say). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested For and While Statements

2007-09-24 Thread Zentrader
> Your for loops both use the same counting index. Since those variables are local to the for loop, theoretically it should work with both loops using the same variable. Although bad practice, I tested it on my machine and the following code does indeed work as expected, so it appears that the pr

Re: SOAPpy Error

2007-09-24 Thread Steve Holden
linuxprog wrote: > linuxprog a écrit : [obscure soappy question] [...] >> wha's wrong ? >> >> Thanks >> > still no answer !? Four hours, and the Intarweb hasn't come up with the answer to your question?!?!?!?!?!?!?! I'd ask Al Gore for your money back if I were you ... regards Steve -- Ste

Re: Nested For and While Statements

2007-09-24 Thread Paul McGuire
On Sep 24, 2:28 pm, [EMAIL PROTECTED] wrote: > I start my code with some constants then a while statement. But I > have some For statements towards the end within the While statement > where I start getting some errors. I'm hoping I won't have to post my > code, but it looks something like this:

execfile and function call

2007-09-24 Thread Dave Westerman
I've got a Jython script where I'm doing an execfile() to pull in a small script that contains a function, which I then call. execfile(app_applscript) optionList = createOptionList(applOptions) When I do this at the global level in my main script, it works just fine. However, when I move this c

Re: Nested For and While Statements

2007-09-24 Thread James Stroud
[EMAIL PROTECTED] wrote: > I start my code with some constants then a while statement. But I > have some For statements towards the end within the While statement > where I start getting some errors. I'm hoping I won't have to post my > code, but it looks something like this: > > Import os, stri

Re: An Editor that Skips to the End of a Def

2007-09-24 Thread alex
W. Watson wrote: > Well, you may. Unfortunately, there are many NGs that do the opposite. > > Bruno Desthuilliers wrote: >> W. Watson a écrit : >>> How about in the case of MS Win? >>> >>> Ben Finney wrote: (Please don't top-post. Instead, reply below each point to which you're resp

Nested For and While Statements

2007-09-24 Thread koutoo
I start my code with some constants then a while statement. But I have some For statements towards the end within the While statement where I start getting some errors. I'm hoping I won't have to post my code, but it looks something like this: Import os, string while this: All Code indent

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Steven Bethard
Ratko wrote: > I was wondering if something like this is possible. Can a base class > somehow know if a certain method has been overridden by the subclass? You can try using the __subclasses__() method on the class:: >>> def is_overridden(method): ... for cls in method.im_class.__su

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
On Sep 24, 12:56 pm, Stéphane Larouche <[EMAIL PROTECTED]> wrote: > What about something like: > > class A(object): > def my_method(self): > print "A.my_method" > def call_my_method(self): > if type(self).my_method == A.my_method: >

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
> Ok. The simplest solution, then, is simply to not implement the method > in the base class, ie: > > class EvtHandler: > def __init__(self): > if hasattr(self, 'onKey'): > register_for_key_events() > > #def onKey(self): > #pass > > class MyHandler(EvtHan

Re: Passing parameters at the command line (New Python User)

2007-09-24 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Hi there. I just wondered whether anyone could recommend the correct > way I should be passing command line parameters into my program. I am > currently using the following code: > > def main(argv = None): > > > file1= "directory1" > file2 = "directory2" > >

Re: puzzled about floats

2007-09-24 Thread Marc 'BlackJack' Rintsch
On Mon, 24 Sep 2007 14:13:18 -0400, Neal Becker wrote: > from math import modf > > class nco (object): > def __init__ (self, delta): > self.delta = delta > self.phase = 0.0 > def __call__ (self): > self.phase += self.delta > f,i = modf (self.phase) >

Re: Newbie completely confused

2007-09-24 Thread Istvan Albert
Two comments, > ... > self.item3 = float(foo[c]); c+=1 > self.item4 = float(foo[c]); c+=1 > self.item5 = float(foo[c]); c+=1 > self.item6 = float(foo[c]); c+=1 > ... this here (and your code in general) is mind boggling and not in a good way, as for you original question, I don't think that read

Re: Small changes in side library

2007-09-24 Thread Vircom
On Sep 24, 10:26 pm, Vircom <[EMAIL PROTECTED]> wrote: > On Sep 24, 1:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Sat, 22 Sep 2007 22:07:27 -0300, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> escribi?: > > > > I have the side library which provides wide set of different > > >

Re: Small changes in side library

2007-09-24 Thread Vircom
On Sep 24, 1:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 22 Sep 2007 22:07:27 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribi?: > > > > > I have the side library which provides wide set of different > > functions, but I'm going to replace some of them with mine and > > pr

Re: calling the function of one class from another class

2007-09-24 Thread Steve Holden
Furkan Kuru wrote: > > > On 9/22/07, *Mridula Ramesh* <[EMAIL PROTECTED] > > wrote: > > hi. > > i currently have code structured like this: > > classA(): > def __init__(): > .. > .. >

Re: xml-rpc timeout

2007-09-24 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steve > Holden wrote: > >> Timeouts shouldn't be a normal feature of TCP communications. > > On the contrary, they should. How else are you going to detect that the > other side has died? You missed the point, which is that TCP hosts s

puzzled about floats

2007-09-24 Thread Neal Becker
from math import modf class nco (object): def __init__ (self, delta): self.delta = delta self.phase = 0.0 def __call__ (self): self.phase += self.delta f,i = modf (self.phase) print modf (self.phase) if (self.phase > 1.0): self.p

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Stéphane Larouche
What about something like: class A(object): def my_method(self): print "A.my_method" def call_my_method(self): if type(self).my_method == A.my_method: print "Calling base class method." else:

Re: Is there some sort of portable IDE?

2007-09-24 Thread Paul McNett
Lamonte Harris wrote: > Like say you don't got python installed, but you want to test code is > there a way?(School) Like way, dude, check this out: http://www.portablepython.com/ -- pkm ~ http://paulmcnett.com -- http://mail.python.org/mailman/listinfo/python-list

Is there some sort of portable IDE?

2007-09-24 Thread Lamonte Harris
Like say you don't got python installed, but you want to test code is there a way?(School) -- http://mail.python.org/mailman/listinfo/python-list

Re: An Editor that Skips to the End of a Def

2007-09-24 Thread Manuel Graune
Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: > In message <[EMAIL PROTECTED]>, Manuel Graune wrote: > >> Matthew Woodcraft <[EMAIL PROTECTED]> writes: >> >>> Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote:> >>> >>> >> And "cu

Re: elementtree question

2007-09-24 Thread Tim Arnold
Thanks for the great answers--I learned a lot. I'm looking forward to the ET 1.3 version. I'm currently working on some older HP10.20ux machines and haven't been able to compile lxml all the way through yet. thanks again, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Bruno Desthuilliers
Ratko a écrit : >> If your use case is to make sure a given ('abstract') method has been >> overriden, the canonical solution is to raise NotImplementedError in the >> base class's implementation > > I am not really interested in forcing the subclass to implement a > method. I am interested in kno

Re: Converting numbers to unicode charaters

2007-09-24 Thread Larry Bates
How about: ord=''.join([unichr(int(x,16)) for x in hexs]) I don't know if its faster, but I'll bet it is. -Larry [EMAIL PROTECTED] wrote: > Here's how I'm doing this right now, It's a bit slow. I've just got > the code working. I was wondering if there is a more efficient way of > doing this...

type compatibility warnings -- building python on windows 64-bit x64

2007-09-24 Thread nichols . alan
I am attempting to build the SVN release of python on Visual Studio 8. I get the warning messages such as the following: ..\..\Modules\cPickle.c(527) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data ..\..\Modules\binascii.c(285) : warning C4244: '=' : conversio

Re: Converting numbers to unicode charaters

2007-09-24 Thread Peter Otten
Duncan Booth wrote: > Laurent Pointal <[EMAIL PROTECTED]> wrote: > >> You may eventually use a more condensed expression and avoid n >> concatenation of n chars using join, like this: >> >> >>> u''.join(unichr(int(x,16)) for x in ['42','72','61','64']) >> u'Brad' > > Or even avoid the loop com

CLAIM YOUR TWO FREE UNIVERSAL STUDIOS TICKETS!

2007-09-24 Thread Sword, Robyn
how do you claim your tickets? CLAIM YOUR TWO FREE UNIVERSAL STUDIOS TICKETS! CLAIM YOUR TWO FREE UNIVERSAL STUDIOS TICKETS! lisawill4u at yahoo.com Sat Nov 20 21:35:53 CET

Re: building a GUI

2007-09-24 Thread cyberco
Try BoaConstructor and the wxPython library, both are wonderfull. If you don't mind using Java Swing, and there are good reasons for that, go for jython. It simplifies the java swingcode so much you don't have to use a graphical GUI builder anymore :) -- http://mail.python.org/mailman/listinfo/py

Re: database persistence with mysql, sqlite

2007-09-24 Thread coldpizza
On Sep 24, 7:23 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, coldpizza > wrote: > > > So far, with mysql I use 'SELECT * FROM TABLE LIMIT L1, L2' where L1 > > and L2 define the range for the 'Next' and 'Previous' commands. I > > have

Re: building a GUI

2007-09-24 Thread Oleg Batrashev
On Sep 23, 5:21 pm, yadin <[EMAIL PROTECTED]> wrote: > if i were up to make a GUI chich are the advantages of choosing python > over matlab or java? Haven't seen any free visual layout program for swing, swing is somewhat messy - unnecessary complex layout classes. Compile - run cycle without visu

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Chris Mellon
On 9/24/07, Ratko <[EMAIL PROTECTED]> wrote: > > If your use case is to make sure a given ('abstract') method has been > > overriden, the canonical solution is to raise NotImplementedError in the > > base class's implementation > > I am not really interested in forcing the subclass to implement a >

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Marc 'BlackJack' Rintsch
On Mon, 24 Sep 2007 15:48:07 +, Ratko wrote: > I have a base class EvtHandler that has methods defined to handle > certain events. You then subclass from EvtHandler and override the > methods for the events you want to receive. If a method has been > overridden, the base class will automatical

Re: Newbie completely confused

2007-09-24 Thread Jeroen Hegeman
> > Your code does NOT include any statements that could have produced the > above line of output -- IOW, you have not posted the code that you > actually ran. Oh my, I must have cleaned it up a bit too much, hoping that people would focus on the issue instead of the formatting of the output

Re: Newbie completely confused

2007-09-24 Thread Jeroen Hegeman
Thanks for the comments, > > (First, I had to add timing code to ReadClasses: the code you posted > doesn't include them, and only shows timings for ReadLines.) > > Your program uses quite a bit of memory. I guess it gets harder and > harder to allocate the required amounts of memory. Well, I gue

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
> If your use case is to make sure a given ('abstract') method has been > overriden, the canonical solution is to raise NotImplementedError in the > base class's implementation I am not really interested in forcing the subclass to implement a method. I am interested in knowing *whether* it did imp

To Andrey Khavryuchenko <[EMAIL PROTECTED]> was: Who can develop the following Python script into working application ?

2007-09-24 Thread http://members.lycos.co.uk/dariusjack/
to Andrey Khavryuchenko <[EMAIL PROTECTED]> he said: " Actually, I am a python (and django) developer, looking for a contract, owning Nokia 770 and contacted original poster with no response. -- Andrey V Khavryuchenko http://a.khavr.com/ Chytach - unflood your feeds http://www.chytach.com/ S

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Michele Simionato
On Sep 24, 5:23 pm, Ratko <[EMAIL PROTECTED]> wrote: > Hi all, > > I was wondering if something like this is possible. Can a base class > somehow know if a certain method has been overridden by the subclass? > I appreciate any ideas. > Thanks, > > Ratko The first time I used Zope, I immediately h

Re: Google and Python

2007-09-24 Thread Alex Martelli
Bryan Olson <[EMAIL PROTECTED]> wrote: ... > > YouTube (one of Google's most valuable properties) is essentially > > all-Python (except for open-source infrastructure components such as > > lighttpd). Also, at Google I'm specifically "Uber Tech Lead, Production > > Systems": while I can't discu

  1   2   >