py lib 0.9.0: py.test, distributed execution, microthreads ...

2007-02-14 Thread holger krekel
py lib 0.9.0: py.test, distributed execution, greenlets and more == Welcome to the 0.9.0 py lib release - a library aiming to support agile and test-driven python development on various levels. Main API/Tool Features: *

Re: calling php function from python

2007-02-14 Thread Rob Wolfe
mark wrote: is it possible to call a php function from python and use a class from php in python? i want to use mmslib which creates mms messages and the only implementation is a php mmslib implementation. You can consider to use some kind of RPC (remote procedure call) for example XML-RPC.

Re: python not returning true

2007-02-14 Thread Terry Reedy
John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | On Feb 14, 5:45 pm, agent-s [EMAIL PROTECTED] wrote: | btw Steven you are so witty I hope to one day pwn noobs on newsgroups | too. Sorry, but you are 'pwning' yourself here ;-) | Wit has nothing to do with it. The fact

Re: python not returning true

2007-02-14 Thread Paul Rubin
John Machin [EMAIL PROTECTED] writes: What does pwn mean? http://en.wikipedia.org/wiki/Pwn -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast constant functions for Py2.5's defaultdict()

2007-02-14 Thread Raymond Hettinger
On Feb 13, 5:09 pm, Giovanni Bajo [EMAIL PROTECTED] wrote: The itertools.repeat(const).next approach wins on speed and flexibility. But it's the most unreadable too. Not really. It's unusual but plenty readable (no surprise that repeat(0) repeatedly gives you zero). I think it more

Re: Recursive calls and stack

2007-02-14 Thread Gabriel Genellina
En Wed, 14 Feb 2007 04:23:46 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I am OK with calls being stacked, but I wondering will the local variables be stacked given that return statement is followed by the function call? def test(): x = 22 y = 33 z = x+y return

Re: Recursive calls and stack

2007-02-14 Thread [EMAIL PROTECTED]
On Feb 14, 11:09 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have a program which literately finds the object that overlapping a point. The horizontal and vertical search are called recursively from inside each other. Is this way of implementation fill thestackspace with the local

Re: Recursive calls and stack

2007-02-14 Thread Terry Reedy
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am OK with calls being stacked, but I wondering will the local variables be stacked given that return statement is followed by the function call? def test(): x = 22 y = 33 z = x+y return anotherFunction(z) In

Re: _ssl.pyd is buggy?

2007-02-14 Thread Giles Brown
On 14 Feb, 00:17, Giles Brown [EMAIL PROTECTED] wrote: Something I always found useful is to use the win32traceutil to set up the trace debugging tool. You can then see the output in the pythonwin trace collector tool. This is very useful for Python services and COM servers. Best of luck,

Re: Fast constant functions for Py2.5's defaultdict()

2007-02-14 Thread Michele Simionato
On Feb 14, 9:11 am, Raymond Hettinger [EMAIL PROTECTED] wrote: On Feb 13, 5:09 pm, Giovanni Bajo [EMAIL PROTECTED] wrote: The itertools.repeat(const).next approach wins on speed and flexibility. But it's the most unreadable too. Not really. It's unusual but plenty readable (no

Re: calling php function from python

2007-02-14 Thread Benjamin Niemann
Rob Wolfe wrote: mark wrote: is it possible to call a php function from python and use a class from php in python? i want to use mmslib which creates mms messages and the only implementation is a php mmslib implementation. You can consider to use some kind of RPC (remote procedure call)

Re: python not returning true

2007-02-14 Thread John Machin
On Feb 14, 7:02 pm, Terry Reedy [EMAIL PROTECTED] wrote: John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | On Feb 14, 5:45 pm, agent-s [EMAIL PROTECTED] wrote: | btw Steven you are so witty I hope to one day pwn noobs on newsgroups | too. Sorry, but you are

Re: python not returning true

2007-02-14 Thread Michael Bentley
On Feb 14, 2007, at 3:08 AM, John Machin wrote: So enlightenment has been verbed, has it? I didn't realise that the language had been transitioned so far :-) *ALL* nouns may be verbed ;-) -michael --- # Something just doesn't seem right in those # Every kiss begins with 'K' commercials.

Re: c++ for python programmers

2007-02-14 Thread Anders Arnholm
Sam [EMAIL PROTECTED] skriver: On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn [EMAIL PROTECTED] wrote: Well, C++ is a better language than C in many ways. So, if he needs to learn one of them, why does it have to be C? Another reason some people choose C++ over Python for some tasks is that they

[no subject]

2007-02-14 Thread 3174965380
(dancing stripper on your dekstop free) -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-14 Thread Mathias
What module are you using for SSH? What's in your program that isn't pure Python? The problem is probably in some non-Python component; you shouldn't be able to force a memory protection error from within Python code. It looks like the error could be in scipy/Numeric, when a

Re: searching a list of lists as a two-dimensional array?

2007-02-14 Thread Gerard Flanagan
On Feb 12, 1:27 am, agent-s [EMAIL PROTECTED] wrote: Basically I'm programming a board game and I have to use a list of lists to represent the board (a list of 8 lists with 8 elements each). I have to search the adjacent cells for existing pieces and I was wondering how I would go about doing

Re: calling php function from python

2007-02-14 Thread Diez B. Roggisch
mark wrote: is it possible to call a php function from python and use a class from php in python? i want to use mmslib which creates mms messages and the only implementation is a php mmslib implementation. Do yourself - and the python community... :) - a favor and just translate the mmslib

Re: c++ for python programmers

2007-02-14 Thread Nicola Musatti
On Feb 14, 12:26 am, Sam [EMAIL PROTECTED] wrote: [...] C++ is -not- strongly typed. You can cast anything to void *, and manipulate it in ways unimaginable. Plus there's the whole mess that is pointer arithmetic and a weak typesystem... The previous poster wrote strongly typed, not a straight

Re: c++ for python programmers

2007-02-14 Thread jkn
Hi Thomas On Feb 12, 6:00 pm, Thomas Nelson [EMAIL PROTECTED] wrote: I realize I'm approaching this backwards from the direction most people go, but does anyone know of a good c/c++ introduction for python programmers? They are not particularly aimed at Python programmers, but Bruce Eckel's

Re: python not returning true

2007-02-14 Thread Ben Finney
Michael Bentley [EMAIL PROTECTED] writes: # Something just doesn't seem right in those # Every kiss begins with 'K' commercials. 'Every Kiss'.startswith('K') False kisses = [kiss, kiss, kiss, kiss, kiss] kisses == [kiss for kiss in kisses ...if kiss.startswith(k)]

replacing substrings within strings

2007-02-14 Thread amadain
Hi I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr) The above code works fine but I was wondering if anybody had

Re: replacing substrings within strings

2007-02-14 Thread Diez B. Roggisch
amadain wrote: Hi I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr) The above code works fine but I was

Re: replacing substrings within strings

2007-02-14 Thread Maric Michaud
Le mercredi 14 février 2007 13:08, amadain a écrit : darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr) The above code works fine but I was wondering if anybody had another way of doing this? Why not : In [4]: s=010203040506 In [5]:

Re: replacing substrings within strings

2007-02-14 Thread Rune Strand
On Feb 14, 1:08 pm, amadain [EMAIL PROTECTED] wrote: I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr) The

Re: replacing substrings within strings

2007-02-14 Thread amadain
On Feb 14, 12:16 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: amadain wrote: Hi I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr

Re: Tkinter: how; newbie

2007-02-14 Thread Gigs_
jim-on-linux wrote: On Tuesday 13 February 2007 18:02, Gigs_ wrote: can someone explain me this code? from Tkinter import * root = Tk() def callback(event): print clicked at, event.x, event.y frame = Frame(root, width=100, height=100) frame.bind(Button-1, callback) frame.pack()

Re: replacing substrings within strings

2007-02-14 Thread Sion Arrowsmith
amadain [EMAIL PROTECTED] wrote: I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr) darr=list(010203040506) darr[:2],

Re: replacing substrings within strings

2007-02-14 Thread Rune Strand
Or, slighly slower, but more general: def swap(s, order=(3,4,2,0,1)): # assert len(s) = len(order) return ''.join([s[o] for o in order]) + s[6:] -- http://mail.python.org/mailman/listinfo/python-list

Re: WindowsNT user authentication

2007-02-14 Thread billie
Another question, I'm sorry. Do you got any idea about how to get permissions of a file/directory given the username? For example: I would like to know if C:\my_file.ext is readable/ writable by user 'x' or not. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing HTML

2007-02-14 Thread Frederic Rentsch
mtuller wrote: Alright. I have tried everything I can find, but am not getting anywhere. I have a web page that has data like this: tr td headers=col1_1 style=width:21% span class=hpPageText LETTER/span/td td headers=col2_1 style=width:13%; text-align:right span class=hpPageText

Re: WindowsNT user authentication

2007-02-14 Thread Tim Golden
billie wrote: Another question, I'm sorry. Do you got any idea about how to get permissions of a file/directory given the username? For example: I would like to know if C:\my_file.ext is readable/ writable by user 'x' or not. This is an unfortunately messy question. The easiest answer -- and

Re: WindowsNT user authentication

2007-02-14 Thread Tim Golden
Tim Golden wrote: billie wrote: Another question, I'm sorry. Do you got any idea about how to get permissions of a file/directory given the username? For example: I would like to know if C:\my_file.ext is readable/ writable by user 'x' or not. This is an unfortunately messy question.

Re: replacing substrings within strings

2007-02-14 Thread Diez B. Roggisch
Thats the same code. I was wondering if the string manipulation can be done without an excursion into the list world. That's the price to pay for immutable strings. If you have to to lots of stuff like that, then keep things a list, and join only when you need the result as a string. Diez --

Re: WindowsNT user authentication

2007-02-14 Thread billie
On 14 Feb, 14:30, Tim Golden [EMAIL PROTECTED] wrote: Tim Golden wrote: billie wrote: Another question, I'm sorry. Do you got any idea about how to get permissions of a file/directory given the username? For example: I would like to know if C:\my_file.ext is readable/ writable by user

Re: c++ for python programmers

2007-02-14 Thread Neil Cerutti
On 2007-02-13, Sam [EMAIL PROTECTED] wrote: On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn [EMAIL PROTECTED] wrote: Well, C++ is a better language than C in many ways. So, if he needs to learn one of them, why does it have to be C? Another reason some people choose C++ over Python for some tasks

Re: Recursive calls and stack

2007-02-14 Thread Neil Cerutti
On 2007-02-14, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 14 Feb 2007 03:09:37 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: Is this way of implementation fill the stack space with the local variables inside each call. If this is not good, is there a better way to

How to print the variable?

2007-02-14 Thread Hans Schwaebli
Hi, am am a Python beginner with Java knowledge background. Infact I need to use Jython. My first beginner question is how to determine of what type a variable is? In program which supports Jython there is a variable called rc available. I can use the methods on that variable

Re: replacing substrings within strings

2007-02-14 Thread bearophileHUGS
Diez B. Roggisch: That's the price to pay for immutable strings. Right, but CPython has array.array(c) too. Using Diez Roggisch's code: from array import array arrs = array(c, 010203040506) arrs[:2], arrs[4:5] = arrs[4:6], arrs[:2] arrs.tostring() '0302013040506' Using such arrays is

Re: How to print the variable?

2007-02-14 Thread Cristiano Paris
Hans Schwaebli wrote: Hi, am am a Python beginner with Java knowledge background. Infact I need to use Jython. My first beginner question is how to determine of what type a variable is? Let v be the var, 'print type(v)' should* work. [* I've never used Jython before]. You can print

Re: How to print the variable?

2007-02-14 Thread Jean-Paul Calderone
On Wed, 14 Feb 2007 05:47:31 -0800 (PST), Hans Schwaebli [EMAIL PROTECTED] wrote: Hi, am am a Python beginner with Java knowledge background. Infact I need to use Jython. My first beginner question is how to determine of what type a variable is? In program which supports Jython there

Re: replacing substrings within strings

2007-02-14 Thread amadain
Thanks all. I usually turn strings into arrays for processing. I was looking to see if that was the best way to do it from others that use python. No one else uses python in my company so its nice to get different points of view from other python users from lists like this. A --

Re: replacing substrings within strings

2007-02-14 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Diez B. Roggisch: That's the price to pay for immutable strings. Right, but CPython has array.array(c) too. Using Diez Roggisch's code: Ahhh, ze arrayz. I alwayz forget about the arrayz. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print the variable?

2007-02-14 Thread Paul McGuire
On Feb 14, 8:00 am, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On Wed, 14 Feb 2007 05:47:31 -0800 (PST), Hans Schwaebli [EMAIL PROTECTED] wrote: Hi, am am a Python beginner with Java knowledge background. Infact I need to use Jython. My first beginner question is how to determine

Re: replacing substrings within strings

2007-02-14 Thread Paul McGuire
On Feb 14, 6:08 am, amadain [EMAIL PROTECTED] wrote: Hi I was wondering if there was a nicer way to swap the first 2 characters in a string with the 4th and 5th characters other than: darr=list(010203040506) aarr=darr[:2] barr=darr[4:6] darr[:2]=barr darr[4:6]=aarr result=.join(darr)

Re: Scripting Visio using Python

2007-02-14 Thread Harry George
Paul Watson [EMAIL PROTECTED] writes: I would like to create some additional shapes in Microsoft Visio using the Python language. It would appear that Visio can use any CLR language. Has anyone done this? Can I use the Python package from python.org, or must I use IronPython? An

Re: python not returning true

2007-02-14 Thread Grant Edwards
On 2007-02-14, Terry Reedy [EMAIL PROTECTED] wrote: | Wit has nothing to do with it. The fact that you are a Python noob is | also irrelevant. Your problem statement was unintelligible, as is your | response. What does pwn mean? I believe that it is a misspelling of 'own' used by pvp (person

multi processes

2007-02-14 Thread amadain
Hi Heres a poser. I want to start a program 4 times at exactly the same time (emulating 4 separate users starting up the same program). I am using pexpect to run the program from 4 separate locations accross the network. How do I start the programs running at exactly the same time? I want to time

rot13 in a more Pythonic style?

2007-02-14 Thread Andy Dingley
I'm trying to write rot13, but to do it in a better and more Pythonic style than I'm currrently using. What would you reckon to the following pretty ugly thing? How would you improve it? In particular, I don't like the way a three-way selection is done by nesting two binary selections. Also I

Re: threading and multicores, pros and cons

2007-02-14 Thread garrickp
On Feb 13, 9:07 pm, Maric Michaud [EMAIL PROTECTED] wrote: I've heard of a bunch of arguments to defend python's choice of GIL, but I'm not quite sure of their technical background, nor what is really important and what is not. These discussions often end in a prudent python has made a choice

Re: threading and multicores, pros and cons

2007-02-14 Thread Istvan Albert
On Feb 14, 1:33 am, Maric Michaud [EMAIL PROTECTED] wrote: At this time, it 's not easy to explain him that python is notflawed compared to Java, and that he will not regret his choice in the future. Database adaptors such as psycopg do release the GIL while connecting and exchanging data.

Re: multi processes

2007-02-14 Thread garrickp
On Feb 14, 7:53 am, amadain [EMAIL PROTECTED] wrote: Hi Heres a poser. I want to start a program 4 times at exactly the same time (emulating 4 separate users starting up the same program). I am using pexpect to run the program from 4 separate locations accross the network. How do I start the

Re: multi processes

2007-02-14 Thread amadain
On Feb 14, 3:32 pm, [EMAIL PROTECTED] wrote: On Feb 14, 7:53 am, amadain [EMAIL PROTECTED] wrote: Hi Heres a poser. I want to start a program 4 times at exactly the same time (emulating 4 separate users starting up the same program). I am using pexpect to run the program from 4 separate

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Rune Strand
You could try some_string.encode('rot_13') -- http://mail.python.org/mailman/listinfo/python-list

How much memory used by a name

2007-02-14 Thread Bernard Lebel
Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and toward the end, the file is

Re: c++ for python programmers

2007-02-14 Thread Nicola Musatti
On Feb 14, 2:41 pm, Neil Cerutti [EMAIL PROTECTED] wrote: [...] Don't forget the lack of standard garbage collection. Optional garbage collection is highly likely to be included in the next C++ standard, due out in a couple of years. Also there's the hell known as exception safety. Python

ANN: py lib 0.9.0: py.test, distributed execution, microthreads ...

2007-02-14 Thread holger krekel
py lib 0.9.0: py.test, distributed execution, greenlets and more == Welcome to the 0.9.0 py lib release - a library aiming to support agile and test-driven python development on various levels. Main API/Tool Features: *

RE: [pywin32] - Excel COM problem

2007-02-14 Thread Stefan Schukat
Characters is a parameterized property. So you can't call it without a generated wrapper. see inside the wrapper: # Result is of type Characters # The method GetCharacters is actually a property, but must be used as a method to correctly pass the arguments def

How to ping and shutdown a remote computer?

2007-02-14 Thread joja15
I am working on a Python script to perform as a remote computer manager. So far I have a WOL function working and I would like to add the ability to show if a machine is on or off (I figured I would do so by pinging the machine and seeing if I get a response). I would also like to add the ability

Re: How to ping and shutdown a remote computer?

2007-02-14 Thread Christophe
[EMAIL PROTECTED] a écrit : I am working on a Python script to perform as a remote computer manager. So far I have a WOL function working and I would like to add the ability to show if a machine is on or off (I figured I would do so by pinging the machine and seeing if I get a response). I

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Neil Cerutti
On 2007-02-14, Andy Dingley [EMAIL PROTECTED] wrote: I'm trying to write rot13, but to do it in a better and more Pythonic style than I'm currrently using. What would you reckon to the following pretty ugly thing? How would you improve it? In particular, I don't like the way a three-way

Re: How much memory used by a name

2007-02-14 Thread Diez B. Roggisch
Bernard Lebel wrote: Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and

Re: How to ping and shutdown a remote computer?

2007-02-14 Thread Tim Golden
[EMAIL PROTECTED] wrote: Here is my current setup: [... BSD ...] - Windows XP machine with folder share (What packet is sent over the network to remotely shutdown a Windows XP machine?) My hope is to have a script then when you start it will list all your remote computers/servers and

Re: Testers please

2007-02-14 Thread Don Taylor
martien friedeman wrote: I have written this tool that allows you to look at runtime data and code at the same time. And now I need people to test it. The easiest way to see what I mean is to look at some videos: http://codeinvestigator.googlepages.com/codeinvestigator_videos It

Urllib2 and timeouts

2007-02-14 Thread Johny
In my script I started using urllib2 to connect to a list of servers.It works well but only until a server from the list is not available.Then if it is down , there is a timeout and my script ends with the error. So, if I have a list of 10 servers, and the second from the list is not available ,

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Martin P. Hellwig
Andy Dingley wrote: I'm trying to write rot13, but to do it in a better and more Pythonic style than I'm currrently using. What would you reckon to the following pretty ugly thing? How would you improve it? In particular, I don't like the way a three-way selection is done by nesting two

Re: Urllib2 and timeouts

2007-02-14 Thread Larry Bates
Johny wrote: In my script I started using urllib2 to connect to a list of servers.It works well but only until a server from the list is not available.Then if it is down , there is a timeout and my script ends with the error. So, if I have a list of 10 servers, and the second from the list

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Andy Dingley
On 14 Feb, 16:23, Neil Cerutti [EMAIL PROTECTED] wrote: str.translate is what I'd do. That's what I hope to do too, but it might not be possible (for the live, complex example). It looks as if I have to make a test, then process the contents of the code differently depending. There might well

list of range of floats

2007-02-14 Thread Steve
I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the following DeprecationWarning: integer argument expected, got float. How can I store a list of floats?

Re: list of range of floats

2007-02-14 Thread Simon Brunning
On 2/14/07, Steve [EMAIL PROTECTED] wrote: I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the following DeprecationWarning: integer argument expected,

Re: list of range of floats

2007-02-14 Thread Dale Strickland-Clark
Steve wrote: I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the following DeprecationWarning: integer argument expected, got float. How can I store

Re: list of range of floats

2007-02-14 Thread Steve
On Wed, 14 Feb 2007 17:27:06 +, Dale Strickland-Clark wrote: Steve wrote: I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the following

Re: list of range of floats

2007-02-14 Thread Matimus
fits = list(float(a) for a in range(0, 10)) Another way of writing that: flts = map(float,range(10)) -- http://mail.python.org/mailman/listinfo/python-list

Re: list of range of floats

2007-02-14 Thread Larry Bates
Steve wrote: I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the following DeprecationWarning: integer argument expected, got float. How can I

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Gabriel Genellina
En Wed, 14 Feb 2007 14:04:17 -0300, Andy Dingley [EMAIL PROTECTED] escribió: I still don't understand what a lambda is _for_ in Python. I know what they are, I know what the alternatives are, but I still haven't found an instance where it permits something novel to be done that couldn't be

Re: list of range of floats

2007-02-14 Thread [EMAIL PROTECTED]
a = 0.0 b = 10.0 inc = .2 flts = [] while a b: flts.append(a) a += inc -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance of a dynamic list of classes?

2007-02-14 Thread Peter Otten
Neil Cerutti wrote: On 2007-02-13, Peter Otten [EMAIL PROTECTED] wrote: Well, what problems ocurring with class A: pass class B: pass class C(A, B): pass could be avoided by writing class A: pass class B(A): pass class C(B): pass instead? With multiple inheritance, the choice of

Re: multiple inheritance of a dynamic list of classes?

2007-02-14 Thread Peter Otten
massimo s. wrote: On 13 Feb, 12:46, Peter Otten [EMAIL PROTECTED] wrote: Well, what problems ocurring with class A: pass class B: pass class C(A, B): pass could be avoided by writing class A: pass class B(A): pass class C(B): pass instead? Classes have to be designed for

Re: How to ping and shutdown a remote computer?

2007-02-14 Thread joja15
On Feb 14, 10:09 am, Christophe [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I am working on a Python script to perform as a remote computer manager. So far I have a WOL function working and I would like to add the ability to show if a machine is on or off (I figured I would do

Re: Newbie Question

2007-02-14 Thread David Boddie
On Tuesday 13 February 2007 11:04, [EMAIL PROTECTED] wrote: To be true, I don't know if any of these toolkits (GTK, wxWindows, QT) and their GUIDesigners have the features you like in Delphi. What I know is that: 1/ these three toolkits have everything *needed* to write serious GUI apps 2/

Re: list of range of floats

2007-02-14 Thread Steve
On Wed, 14 Feb 2007 17:29:26 +, Simon Brunning wrote: On 2/14/07, Steve [EMAIL PROTECTED] wrote: I'm trying to create a list range of floats and running into problems. I've been trying something like: a = 0.0 b = 10.0 flts = range(a, b) fltlst.append(flts) When I run it I get the

Re: list of range of floats

2007-02-14 Thread Simon Brunning
On 2/14/07, Steve [EMAIL PROTECTED] wrote: After re-reading my original post I was pretty vague. I'm trying to creat a list of ranges of floats, 0.0 10.0, 11 20, etc then checking to see if an float, example 12.5 falls in the list and if so get the list index of where it is in the index. Does

Re: Testers please

2007-02-14 Thread Martien Friedeman
That's amazing! We had the same idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance of a dynamic list of classes?

2007-02-14 Thread Neil Cerutti
On 2007-02-14, Peter Otten [EMAIL PROTECTED] wrote: Neil Cerutti wrote: On 2007-02-13, Peter Otten [EMAIL PROTECTED] wrote: Well, what problems ocurring with class A: pass class B: pass class C(A, B): pass could be avoided by writing class A: pass class B(A): pass class C(B): pass

try...except...finally problem in Python 2.5

2007-02-14 Thread redawgts
I keep getting this error local variable 'f' referenced before assignment in the finally block when I run the following code. try: f = file(self.filename, 'rb') f.seek(DATA_OFFSET) self.__data = f.read(DATA_SIZE) self.isDataLoaded = True

Re: try...except...finally problem in Python 2.5

2007-02-14 Thread Jean-Paul Calderone
On 14 Feb 2007 11:41:29 -0800, redawgts [EMAIL PROTECTED] wrote: I keep getting this error local variable 'f' referenced before assignment in the finally block when I run the following code. try: f = file(self.filename, 'rb') f.seek(DATA_OFFSET)

Re: try...except...finally problem in Python 2.5

2007-02-14 Thread Robert Kern
redawgts wrote: I keep getting this error local variable 'f' referenced before assignment in the finally block when I run the following code. try: f = file(self.filename, 'rb') f.seek(DATA_OFFSET) self.__data = f.read(DATA_SIZE)

Re: try...except...finally problem in Python 2.5

2007-02-14 Thread Andrew Koenig
redawgts [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I keep getting this error local variable 'f' referenced before assignment in the finally block when I run the following code. try: f = file(self.filename, 'rb') f.seek(DATA_OFFSET)

Re: try...except...finally problem in Python 2.5

2007-02-14 Thread Larry Bates
redawgts wrote: I keep getting this error local variable 'f' referenced before assignment in the finally block when I run the following code. try: f = file(self.filename, 'rb') f.seek(DATA_OFFSET) self.__data = f.read(DATA_SIZE)

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Beej
On Feb 14, 9:04 am, Andy Dingley [EMAIL PROTECTED] wrote: I still don't understand what a lambda is _for_ in Python. Python supports functional programming to a certain extent, and lambdas are part of this. http://linuxgazette.net/109/pramode.html I know what they are, I know what the

Re: try...except...finally problem in Python 2.5

2007-02-14 Thread Paul Rubin
redawgts [EMAIL PROTECTED] writes: try: f = file(self.filename, 'rb') ... Can someone tell me what's wrong with the code? Various people have explained the error: if the file open attempt fails, f is never assigned. Doing it the right way (i.e. handling the potential

Re: Segmentation faults using threads

2007-02-14 Thread John Nagle
Mathias wrote: What module are you using for SSH? What's in your program that isn't pure Python? The problem is probably in some non-Python component; you shouldn't be able to force a memory protection error from within Python code. It looks like the error could be in

Re: How much memory used by a name

2007-02-14 Thread Bruno Desthuilliers
Bernard Lebel a écrit : Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and

reference data in a dictionary

2007-02-14 Thread Wensui Liu
dear all, i am new to python and have a question about referencing data in a dict. is there anyway that allows me to do something like: dict[['row1', 'row2', .'row100']] thanks much. -- WenSui Liu A lousy statistician who happens to know a little programming

Re: threading and multicores, pros and cons

2007-02-14 Thread Nikita the Spider
In article [EMAIL PROTECTED], Maric Michaud [EMAIL PROTECTED] wrote: This is a recurrent problem I encounter when I try to sell python solutions to my customers. I'm aware that this problem is sometimes overlooked, but here is the market's law. I've heard of a bunch of arguments to

Re: reference data in a dictionary

2007-02-14 Thread Ben Finney
Wensui Liu [EMAIL PROTECTED] writes: i am new to python and have a question about referencing data in a dict. is there anyway that allows me to do something like: dict[['row1', 'row2', .'row100']] What behaviour would you expect from that statement? If we know what you're trying to do,

Re: How much memory used by a name

2007-02-14 Thread Bernard Lebel
Diez: thanks, I will try that. However isn't sum() returning an integer that here would represent the number of elements? Bruno: good question. We're talking about text files that can have 300,000 lines, if not more. Currently, the way I have coded the file writing, every line calls for a

Re: reference data in a dictionary

2007-02-14 Thread Wensui Liu
I know dict['row1'] will always work. but it will only get 1 row out of the dict. is there anyway i can get multiple (1) rows out of dict by directly refeencing them, something like dict[['row1', 'row2']]. thank you for reply, Ben. wensui On 2/14/07, Ben Finney [EMAIL PROTECTED] wrote: Wensui

Re: reference data in a dictionary

2007-02-14 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Wensui Liu wrote: I know dict['row1'] will always work. but it will only get 1 row out of the dict. is there anyway i can get multiple (1) rows out of dict by directly refeencing them, something like dict[['row1', 'row2']]. Not by directly referencing them, but with a

f---ing typechecking

2007-02-14 Thread Sergey Dorofeev
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. (1,)+[1] Traceback (most recent call last): File stdin, line 1, in module TypeError: can only concatenate tuple (not list) to tuple [1]+(1,)

  1   2   >