Data Plotting Library DISLIN 9.0

2005-11-15 Thread Helmut Michels
I am pleased to announce version 9.0 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X11, VGA,

Re: q: console widgets for *nix and windows?

2005-11-15 Thread aum
On Mon, 14 Nov 2005 20:56:36 +, Grant Edwards wrote: Can anyone please recommend a widget library for text console, that works not only on *nix systems but windows /as well/? I'm looking for something a bit higher-level than pure curses, preferably with a gui-like set of widgets, event

Re: more newbie help needed

2005-11-15 Thread bruno at modulix
Steve Holden wrote: john boy wrote: using the following program: fruit = banana index = 0 while index len (fruit): letter = fruit[index-1] print letter index= index -1 this program is supposed to spell banana backwards and in a vertical patern...it does

string help

2005-11-15 Thread john boy
using the following program: prefixes = "JKLMNOPQ" suffix = "ack" for letter in prefixes: print letter + suffix if prefixes == "O" or "Q" print letter + "u" + suffix For this program I am trying to combine the individual letters with the suffix to form names...but for O and Q I need to add in

Is Python worth it??

2005-11-15 Thread john boy
I have started out trying to learn Python for my first programming language. I am starting off with the book "how to think like a computer scientist." I spend about 4-5 hrs a day trying to learn this stuff. It is certainly no easy task. I've been at it for about 1-2 weeks now and have a very

how to think like a computer scientist

2005-11-15 Thread john boy
Does anyone know if there is an "answer key" to all of the exercises in "how to think like a computer scientist"sure would be a lot easier to refer to that instead of tying up this forum with questions about exercises I'm sure that have been asked before Yahoo! FareChase - Search multiple

Re: Addressing the last element of a list

2005-11-15 Thread Antoon Pardon
Op 2005-11-14, Mike Meyer schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] writes: Op 2005-11-10, Mike Meyer schreef [EMAIL PROTECTED]: [Context recovered from top posting.] [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Daniel Crespo wrote: Well, I hope that newcomers to Python don't

Re: Addressing the last element of a list

2005-11-15 Thread Antoon Pardon
Op 2005-11-14, Bengt Richter schreef [EMAIL PROTECTED]: On 14 Nov 2005 11:20:53 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-11-14, Paul Rubin schreef http: Antoon Pardon [EMAIL PROTECTED] writes: We could then have something like the following. a = 5 b = a a @= 7 b == would

Re: Addressing the last element of a list

2005-11-15 Thread Chris Mellon
On 11/14/05, Bengt Richter [EMAIL PROTECTED] wrote: On 14 Nov 2005 11:20:53 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-11-14, Paul Rubin schreef http: Antoon Pardon [EMAIL PROTECTED] writes: We could then have something like the following. a = 5 b = a a @= 7 b == would

Re: compare list

2005-11-15 Thread Brian van den Broek
Shi Mu said unto the world upon 2005-11-15 01:30: Hey Ben, first, as expected, the other two answers you received are better. :-) Sets are much better optimized for things like membership testing than are lists. I'm not competent to explain why; indeed, I keep overlooking them myself :-( snip

Re: compare list

2005-11-15 Thread Brian van den Broek
Ben Bush said unto the world upon 2005-11-15 01:24: top posting corrected and post trimmed Unfortunately, the indents got screwed up along the way. But the part of my code you asked about was: for item in list1: if item in list2: if item + 1 in list1 and item + 1 in list2:

Re: string help

2005-11-15 Thread Miki Tebeka
Hello John, using the following program: prefixes = JKLMNOPQ suffix = ack for letter in prefixes: print letter + suffix if prefixes == O or Q if (letter == O) or (letter == Q): print letter + u + suffix HTH. --

Re: string help

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy [EMAIL PROTECTED] wrote: using the following program: prefixes = JKLMNOPQ suffix = ack for letter in prefixes: print letter + suffix if prefixes == O or Q Here you need: if prefixes == O or prefixes == Q print letter + u + suffix For this program

Re: compare list

2005-11-15 Thread Ben Bush
On 11/15/05, Brian van den Broek [EMAIL PROTECTED] wrote: Ben Bush said unto the world upon 2005-11-15 01:24:top posting corrected and post trimmed Unfortunately, the indents got screwed up along the way. But the partof my code you asked about was:for item in list1:if item in list2:if item + 1 in

Re: Is Python worth it??

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy [EMAIL PROTECTED] wrote: I have started out trying to learn Python for my first programming language. I am starting off with the book how to think like a computer scientist. I spend about 4-5 hrs a day trying to learn this stuff. It is certainly no easy task. I've been

Re: about invalid syntax

2005-11-15 Thread adDoc's networker Phil
. I've been schooled with various versions of several languages, but I'm just now learning python: I've not yet personally experienced any python debugger . . I understand the python`IDLE (integrated DeveL Envir) comes with the std distro, and here is the part in the doc's that you might find

Re: compare list

2005-11-15 Thread Shi Mu
On 11/15/05, Brian van den Broek [EMAIL PROTECTED] wrote: Shi Mu said unto the world upon 2005-11-15 01:30: Hey Ben, first, as expected, the other two answers you received are better. :-) Sets are much better optimized for things like membership testing than are lists. I'm not competent

Re: Proposal for adding symbols within Python

2005-11-15 Thread Ben Sizer
Grant Edwards wrote: In the situations described, I always use strings and have never felt the need for something else: ... I don't think I even understand what the objection is. What is needed is a code fragment that shows how the use of strings is untenable. myObject.value = 'value1'

Re: Parse file into array

2005-11-15 Thread Andrew Nelis
If it helps, there's a builtin module for figuring out mimetypes; http://docs.python.org/lib/module-mimetypes.html import mimetypes mimetypes.guess_type('.gif') ('image/gif', None) Cheers, Andy. -- http://mail.python.org/mailman/listinfo/python-list

AJAX = APAX? Or: is there support for python in browsers?

2005-11-15 Thread Roger Erens
Hello, I remember that the first time I read about Python as a programming language was when reading the W3C's HTML 4.01 specification a few years ago. In the section on objects, images and applets (http://www.w3.org/TR/html401/struct/objects.html) an example was given like POBJECT

[ANN] Data Plotting Library DISLIN 9.0

2005-11-15 Thread Helmut Michels
I am pleased to announce version 9.0 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X11, VGA,

Re: how to think like a computer scientist

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy [EMAIL PROTECTED] wrote: Does anyone know if there is an answer key to all of the exercises in how to think like a computer scientistsure would be a lot easier to refer to that instead of tying up this forum with questions about exercises I'm sure that have been asked

Re: SciPy python 2.4 wintel binaries

2005-11-15 Thread jelle
Claudio, Thanks a lot for this link! -- http://mail.python.org/mailman/listinfo/python-list

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Shi Mu [EMAIL PROTECTED] wrote: it does not work. len(set(lisA).intersection(set(lisB))) == 2 Traceback (most recent call last): File interactive input, line 1, in ? NameError: name 'set' is not defined 'set' is introduced as a built-in at Python 2.4. If you have 2.3, there's

Re: Proposal for adding symbols within Python

2005-11-15 Thread Steven D'Aprano
On Tue, 15 Nov 2005 01:57:53 -0800, Ben Sizer wrote: I don't think I even understand what the objection is. What is needed is a code fragment that shows how the use of strings is untenable. myObject.value = 'value1' #... 100 lines of code elided... if myObject.value = 'Value1':

Re: generate HTML

2005-11-15 Thread s99999999s2003
hi thanks for all the help actually i am doing it the hard way alist = [ 'div align=rightfont size=-1TESTbr', 'p align=centerstrongbr', 'blah' ] f = open('test.html,'w') f.writelines(alist) f.close() but everytime i hit ... alist = [ 'div align=rightfont size=-1 ValueError: unsupported

Re: compare list

2005-11-15 Thread Shi Mu
On 11/15/05, Simon Brunning [EMAIL PROTECTED] wrote: On 15/11/05, Shi Mu [EMAIL PROTECTED] wrote: it does not work. len(set(lisA).intersection(set(lisB))) == 2 Traceback (most recent call last): File interactive input, line 1, in ? NameError: name 'set' is not defined 'set' is

Re: string help

2005-11-15 Thread Steven D'Aprano
On Tue, 15 Nov 2005 09:35:00 +, Simon Brunning wrote: On 14/11/05, john boy [EMAIL PROTECTED] wrote: using the following program: prefixes = JKLMNOPQ suffix = ack for letter in prefixes: print letter + suffix if prefixes == O or Q Here you need: if prefixes == O or

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Shi Mu [EMAIL PROTECTED] wrote: Yes, i am using python 2.3, I have used from sets import * but still report the same error: Traceback (most recent call last): File interactive input, line 1, in ? NameError: name 'set' is not defined I said analogous, not identical. try

Re: compare list

2005-11-15 Thread Richie Hindle
[Shi] Yes, i am using python 2.3, I have used from sets import * but still report the same error: Traceback (most recent call last): File interactive input, line 1, in ? NameError: name 'set' is not defined It's 'Set', not 'set'. Try this: import sets dir(sets) -- Richie

Re: Python obfuscation

2005-11-15 Thread Ben Sizer
Mike Meyer wrote: Ben Sizer [EMAIL PROTECTED] writes: Decompyle (http://www.crazy-compilers.com/decompyle/ ) claims to be pretty advanced. I don't know if you can download it any more to test this claim though. No, it doesn't claim to be advanced. It claims to be good at what it does.

Re: compare list

2005-11-15 Thread Ben Bush
On 11/15/05, Simon Brunning [EMAIL PROTECTED] wrote: On 15/11/05, Shi Mu [EMAIL PROTECTED] wrote: Yes, i am using python 2.3, I have used from sets import * but still report the same error: Traceback (most recent call last): File interactive input, line 1, in ? NameError: name 'set' is

Re: Post/View Open Source Jobs

2005-11-15 Thread Scott David Daniels
Superior Staffing Solutions wrote: Post/View Open Source Jobs http://groups.yahoo.com/group/opensourcejobs If you have jobs to announce, there is a jobs forum on python.org. If you are advertising a web site, like other trolls, you should curl up and --Scott David Daniels [EMAIL

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Ben Bush [EMAIL PROTECTED] wrote: an error reported: Traceback (most recent call last): File C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py, line 310, in RunScript exec codeObject in __main__.__dict__ File C:\temp\try.py, line 8, in ? from

Re: compare list

2005-11-15 Thread Ben Bush
On 11/15/05, Simon Brunning [EMAIL PROTECTED] wrote: On 15/11/05, Ben Bush [EMAIL PROTECTED] wrote: an error reported: Traceback (most recent call last): File C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py, line 310, in RunScript exec codeObject in __main__.__dict__ File

Re: compare list

2005-11-15 Thread Richie Hindle
Ben, But the logic output is wrong. from sets import Set as set lisA=[1,2,5,9] lisB=[9,5,0,2] lisC=[9,5,0,1] def two(sequence1, sequence2): set1, set2 = set(sequence1), set(sequence2) return len(set1.intersection(set2)) == 2 print two(lisA,lisB) False(should be true!) Slow

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Ben Bush [EMAIL PROTECTED] wrote: I found I named the following python file as sets.py, which brought the problem (is that right?). i changed it to other name and it works. But the logic output is wrong. from sets import Set as set lisA=[1,2,5,9] lisB=[9,5,0,2] lisC=[9,5,0,1]

Re: 3-dimensional plot in Python?

2005-11-15 Thread Frithiof Andreas Jensen
questions? [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I want to make a 3d plot. x is a vector(discrete), y is also a vector(discrete), for each pairwise x,y I have a value z(x,y)(it is not a function, just discrete values for each pair of x,y) I want to show them on a two

Re: codecs

2005-11-15 Thread André Malo
* TK [EMAIL PROTECTED] wrote: sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout) What does this line mean? Wrap stdout with an UTF-8 stream writer. See the codecs module documentation for details. nd -- http://mail.python.org/mailman/listinfo/python-list

codecs

2005-11-15 Thread TK
Hi there, sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout) What does this line mean? Thanks. o-o Thomas -- http://mail.python.org/mailman/listinfo/python-list

Background process for ssh port forwarding

2005-11-15 Thread Jesse Rosenthal
Hello all, I'm writing a script which will backup data from my machine to a server using rsync. It checks to see if I am on the local network. If I am, it runs rsync over ssh to 192.168.2.6 using the pexpect module to log in. That's the easy part. Now, when I'm not on the local network, I first

Python for Gaim

2005-11-15 Thread Boichenko Sergey
Hello everybody. We wrote a Python plugin for Gaim. Now you can write plugins for Gaim and use Python. ALL Gaim API are available for developers under Python. You can download this on http://sourceforge.net/projects/pygaim Please include it as a plugin for GAIM(like perl) Best regards,

Re: compare list

2005-11-15 Thread [EMAIL PROTECTED]
Simon Brunning wrote: On 15/11/05, Ben Bush [EMAIL PROTECTED] wrote: I found I named the following python file as sets.py, which brought the problem (is that right?). i changed it to other name and it works. But the logic output is wrong. from sets import Set as set lisA=[1,2,5,9]

Re: generate HTML

2005-11-15 Thread Jim
Perhaps you are trying to do this: 'text to go here: %s' % ('text',) ? For that you need a double-quoted string: text to go here: %s % ('text',) (or triple-doubles: .. as you noted). Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: 3-dimensional plot in Python?

2005-11-15 Thread Robert Kern
Frithiof Andreas Jensen wrote: questions? [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I want to make a 3d plot. x is a vector(discrete), y is also a vector(discrete), for each pairwise x,y I have a value z(x,y)(it is not a function, just discrete values for each pair of x,y) I

RE: Is Python worth it??

2005-11-15 Thread Sells, Fred
I second what others have said about the tutorials. I have not read how to think like a ... but from other posting here I have reservations about it as a starting point. -Original Message- From: Simon Brunning [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 15, 2005 4:42 AM To: john

_winreg doc unclear on DeleteValue()

2005-11-15 Thread rtilley
A portion from the _winreg Documnetation: - DeleteValue(key, value) 1. Removes a named value from a registry key. -- OK 2. key is an already open key, or one of the predefined HKEY_* constants. -- OK 3. value is a

Re: Is Python worth it??

2005-11-15 Thread jmdeschamps
Simon Brunning wrote: On 14/11/05, john boy [EMAIL PROTECTED] wrote: I have started out trying to learn Python for my first programming language. I am starting off with the book how to think like a computer scientist. I spend about 4-5 hrs a day trying to learn this stuff. It is

simulating #include in python

2005-11-15 Thread Nick Craig-Wood
We are currently investigating whether to move the data files from our application into python for ease of maintenance. Each data item turns into a class definition with some class data. The python approach looks great, but there is one feature that we'd like to have. Currently the data files

Re: Where can I find an example that uses FTP standard library?

2005-11-15 Thread Larry Bates
Pick up a copy of the Python Cookbook, it is full of examples. You also might want to check out this site: http://aspn.activestate.com/ASPN/Cookbook/Python It contains 100's of code samples that might help. The archives of this list are also a good place to look. Google is also your friend. I

Re: AJAX = APAX? Or: is there support for python in browsers?

2005-11-15 Thread Larry Bates
Roger Erens wrote: Hello, I remember that the first time I read about Python as a programming language was when reading the W3C's HTML 4.01 specification a few years ago. In the section on objects, images and applets (http://www.w3.org/TR/html401/struct/objects.html) an example was given

Sending an event from a python COM server to a VB COM client

2005-11-15 Thread Gary Kshepitzki
Hello I am trying to send an event from a Python COM server to a VB (or VB.NET) COM client. I am a newbie both in VB and in python. Can anyone give me a simple (but complete) code example both of the Python server side and the VB client side for raising a single event. Any answer would be

Re: simulating #include in python

2005-11-15 Thread Peter Otten
Nick Craig-Wood wrote: I'd really like to be able to run an __import__ in the context of the file thats running the include() but I haven't figured that out. execfile()? Peter -- http://mail.python.org/mailman/listinfo/python-list

A way for launch an app monitor

2005-11-15 Thread Daniel Crespo
Hello, I'm in the way for creating an application and its monitor. Yes, there are 2 applications: The main app, and a monitor. The last one monitors the main application for keeping it alive, and viceversa. But if I close the main app, I want to close the monitor. That is very easy under nt

A way for closing an app monitor

2005-11-15 Thread Daniel Crespo
Hello, I'm in the way for creating an application and its monitor. Yes, there are 2 applications: The main app, and a monitor. The last one monitors the main application for keeping it alive, and viceversa. But if I close the main app, I want to close the monitor. That is very easy under nt

Re: q: console widgets for *nix and windows?

2005-11-15 Thread Grant Edwards
On 2005-11-15, aum [EMAIL PROTECTED] wrote: On Mon, 14 Nov 2005 20:56:36 +, Grant Edwards wrote: Can anyone please recommend a widget library for text console, that works not only on *nix systems but windows /as well/? I'm looking for something a bit higher-level than pure curses,

Re: Proposal for adding symbols within Python

2005-11-15 Thread Grant Edwards
On 2005-11-15, Ben Sizer [EMAIL PROTECTED] wrote: Grant Edwards wrote: In the situations described, I always use strings and have never felt the need for something else: ... I don't think I even understand what the objection is. What is needed is a code fragment that shows how the use of

wxpython and EVT_KILL_FOCUS

2005-11-15 Thread Stefanie Wagner
Hello, I am fighting with EVT_KILL_FOCUS for quite a time now and I don't succeed at all. Situation: If a user leaves a textfield the entered information should be checked and an additional window should be opened to make a search possible to complete the entry. Basic solution: def

Re: generate HTML

2005-11-15 Thread Kent Johnson
Jim wrote: Perhaps you are trying to do this: 'text to go here: %s' % ('text',) ? For that you need a double-quoted string: text to go here: %s % ('text',) Uh, no, not in Python: 'text to go here: %s' % ('text',) 'text to go here: text' text to go here: %s % ('text',) 'text to go

Re: generate HTML

2005-11-15 Thread Thomas Guettler
Am Tue, 15 Nov 2005 02:52:54 -0800 schrieb ss2003: alist = [ 'div align=rightfont size=-1 ValueError: unsupported format character '' (0x22) at index 14 Look at this: === python Python 2.3.4 (#1, Feb 7 2005, 15:50:45) [GCC 3.3.4 (pre 3.3.5 20040809)] on linux2 Type help,

Need advice on subclassing code

2005-11-15 Thread Rusty Shackleford
Hi -- We have some code that returns an object of a different class, depending on some parameters. For example: if param x is 1 and y is 1, we make an object of class C_1_1. if param x is 1 and y is 2, we make an object of class C_1_2. C_1_1 and C_1_2 share a common C ancestor, and in practice

Re: Is Python worth it??

2005-11-15 Thread bytecolor
http://www.norvig.com/21-days.html -- bytecolor -- http://mail.python.org/mailman/listinfo/python-list

Re: Background process for ssh port forwarding

2005-11-15 Thread Micah Elliott
On Nov 15, Jesse Rosenthal wrote: Whatever I do, though, I'll need to use pexpect to spawn the processes, since I'll need to log in to ssh servers with a password. You might save yourself this effort by setting up ssh for non-interactive use with keys instead of password authentication: $

Re: Need advice on subclassing code

2005-11-15 Thread [EMAIL PROTECTED]
Would the approach of using a switch to decide to instatite which class good for you, like: py class C: py. name = 'C' py. py class D: py. name = 'D' py. py switch = { (1, 1): C, (1,2): D } py x = 1 py y = 2 py c = switch[(x,y)]() py print c.name D py --

Inheritance in nested classes

2005-11-15 Thread Martin Skou
I'm experimenting with using Python for a small web interface, using Mark Hammond's nice win32 extensions. I use a small class hierarchy which uses inheritance and nested classes. Here are a small extract of the code: class page: def __init__(self): self.head=[]

Re: Default method arguments

2005-11-15 Thread Bill Mill
On 15 Nov 2005 08:03:26 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ) print x All I want is to make self.data the default argument for self.f(). (I

Re: Default method arguments

2005-11-15 Thread Nicola Larosa
I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ) print x All I want is to make self.data the default argument for self.f(). (I want to use 'A' class as following : myA = A(5) myA.f() and get printed '5' as a

Re: Default method arguments

2005-11-15 Thread Nicola Larosa
def f(self, x=None): if not x: Ha! You fell for it! ;-D (Hint: what about x being passed with a value of zero? :-) ) x = self.data print x -- Nicola Larosa - [EMAIL PROTECTED] ...Linux security has been better than many rivals. However, even the best

Re: Default method arguments

2005-11-15 Thread Duncan Booth
Nicola Larosa wrote: # use new-style classes, if there's no cogent reason to do otherwise class A(object): def __init__(self, n): self.data = n def f(self, x = None) # do NOT use if not x ! if x is None: print self.data else:

Default method arguments

2005-11-15 Thread gregory . petrosyan
Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ) print x All I want is to make self.data the default argument for self.f(). (I want to use 'A' class as following : myA = A(5) myA.f() and get printed '5' as a

Re: Default method arguments

2005-11-15 Thread Bill Mill
On 11/15/05, Nicola Larosa [EMAIL PROTECTED] wrote: def f(self, x=None): if not x: Ha! You fell for it! ;-D (Hint: what about x being passed with a value of zero? :-) ) I wasn't sure if you saw my post before you posted - good call. I just tossed off an answer without thinking

Re: Default method arguments

2005-11-15 Thread Gregory Petrosyan
I want to find REALLY NICE AND PYTHONIC solution (if any) -- http://mail.python.org/mailman/listinfo/python-list

Re: Default method arguments

2005-11-15 Thread Nicola Larosa
Using None might be problematic if None could be a valid argument. That's like saying that NULL could be a significant value in SQL. In Python, None *is* the empty, not significant value, and should always be used as such. Specifically, never exchange None for False. -- Nicola Larosa - [EMAIL

Re: simulating #include in python

2005-11-15 Thread Nick Craig-Wood
Peter Otten [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: I'd really like to be able to run an __import__ in the context of the file thats running the include() but I haven't figured that out. execfile()? Yes thats exactly what I was looking for - thank you very much! -- Nick

Re: Need advice on subclassing code

2005-11-15 Thread bruno at modulix
Rusty Shackleford wrote: Hi -- We have some code that returns an object of a different class, depending on some parameters. For example: if param x is 1 and y is 1, we make an object of class C_1_1. if param x is 1 and y is 2, we make an object of class C_1_2. C_1_1 and C_1_2 share a

Re: Need advice on subclassing code

2005-11-15 Thread Kent Johnson
Rusty Shackleford wrote: Hi -- We have some code that returns an object of a different class, depending on some parameters. For example: if param x is 1 and y is 1, we make an object of class C_1_1. if param x is 1 and y is 2, we make an object of class C_1_2. C_1_1 and C_1_2 share a

Re: Default method arguments

2005-11-15 Thread bruno at modulix
[EMAIL PROTECTED] wrote: Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ) print x All I want is to make self.data the default argument for self.f(). (I want to use 'A' class as following : myA = A(5)

Re: Is Python worth it??

2005-11-15 Thread Paul Watson
Simon Brunning wrote: On 14/11/05, john boy [EMAIL PROTECTED] wrote: I have started out trying to learn Python for my first programming language. I am starting off with the book how to think like a computer scientist. I spend about 4-5 hrs a day trying to learn this stuff. It is certainly no

Re: Is Python worth it??

2005-11-15 Thread Luis M. Gonzalez
I was in you situation, and I'll tell you what worked for me: Online tutorials: I suggest starting out with Josh Cogliati's Non-Programmers tutorial for Python (http://www.honors.montana.edu/~jjc/easytut/easytut/) . It is an ideal introduction for a complete beginner, very easy to follow and

Re: Inheritance in nested classes

2005-11-15 Thread Diez B. Roggisch
Martin Skou wrote: I'm experimenting with using Python for a small web interface, using Mark Hammond's nice win32 extensions. I use a small class hierarchy which uses inheritance and nested classes. Here are a small extract of the code: class page: def __init__(self):

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread Alex Martelli
Neal Norwitz [EMAIL PROTECTED] wrote: Alex Martelli wrote: So, I thought I'd turn to the wisdom of crowds... how would YOU guys go about adding to your automated regression tests one that checks that a certain memory leak has not recurred, as cross-platform as feasible? In particular,

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread Alex Martelli
MrJean1 [EMAIL PROTECTED] wrote: My suggestion would also be to use sbrk() as it provides a high-water mark for the memory usage of the process. That's definitely what I would have used in the '70s -- nowadays, alas, it ain't that easy. Below is the function hiwm() I used on Linux (RedHat).

Re: Default method arguments

2005-11-15 Thread Gregory Petrosyan
Thanks a lot, but that's not what I do really want. 1) f() may have many arguments, not one 2) I don't whant only to _print_ x. I want to do many work with it, so if I could simply write def f(self, x = self.data) (*) it would be much better. By the way, using class

Re: Inheritance in nested classes

2005-11-15 Thread George Sakkis
Diez B. Roggisch [EMAIL PROTECTED] wrote: But I hope you are aware that nested classes aren't quite the same as they are in java, are you? Actually they are more like java's static inner classes. If you want to simulate non-static inner classes in python, you may check the recipe here:

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread MrJean1
For some more details on Linux' mallinfo, see ftp://gee.cs.oswego.edu/pub/misc/malloc.h and maybe function mSTATs() in glibc/malloc/malloc.c (RedHat). /Jean Brouwers -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread MrJean1
For some more details on Linux' mallinfo, see ftp://gee.cs.oswego.edu/pub/misc/malloc.h and maybe function mSTATs() in glibc/malloc/malloc.c (RedHat). /Jean Brouwers -- http://mail.python.org/mailman/listinfo/python-list

Re: Default method arguments

2005-11-15 Thread Alex Martelli
Gregory Petrosyan [EMAIL PROTECTED] wrote: ... def f(self, x = self.data) (*) ... So I think (*) is the best variant, but it doesn't work :( It DOES work -- it just does not work the way you _expect_ it to work, but rather, it works the way it's _defined_ to

PyPy sprint announcement: Gothenburg 7th - 11th December 2005

2005-11-15 Thread Carl Friedrich Bolz
Gothenburg PyPy Sprint II: 7th - 11th December 2005 == (NOTE: internal EU-only sprint starts on the 5th!) The next PyPy sprint is scheduled to be in December 2005 in Gothenborg, Sweden. Its main focus is heading towards phase 2, which means JIT

Re: Need advice on subclassing code

2005-11-15 Thread Michael Spencer
Kent Johnson wrote: Rusty Shackleford wrote: ... C_1_1 and C_1_2 share a common C ancestor, and in practice may be identical, but theoretically, could have the same function name with two different implementations underneath. ... How are you instantiating the correct class? You should be

Re: Default method arguments

2005-11-15 Thread bruno at modulix
Dennis Lee Bieber wrote: (snip) but that may not be desirable if None is a valid value = myA.f(None), so... class A(object): def __init__(self, n): self.data =n def f(self, *arg): if len(arg) == 0: x = self.data else: x =

Re: Addressing the last element of a list

2005-11-15 Thread Bengt Richter
On 15 Nov 2005 08:51:59 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-11-14, Bengt Richter schreef [EMAIL PROTECTED]: [...] You may be interested in reviewing http://groups.google.com/group/comp.lang.python/browse_thread/thread/f96b496b6ef14e2/32d3539e928986b3 before continuing

Re: Needed class whose instances are many test cases

2005-11-15 Thread Sumit
Thanks for comments .setup() is going the Run Before every testcase Run. But i need to create resource for set of testcases , it is one time only . I can not create at every instant before testcases Run . thats why Unittest.testsuit is goingto help me out . There __init__() can be Run One time and

Re: Default method arguments

2005-11-15 Thread Duncan Booth
Nicola Larosa wrote: Using None might be problematic if None could be a valid argument. That's like saying that NULL could be a significant value in SQL. In Python, None *is* the empty, not significant value, and should always be used as such. Specifically, never exchange None for False.

Re: Python-based Document Management System?

2005-11-15 Thread Dieter Maurer
W. Borgert [EMAIL PROTECTED] writes on Thu, 10 Nov 2005 14:43:14 +0100: I'm looking for a Python-based DMS, but I don't know any. The following points are relevant: - suitable for 10..100 users with more than 1 documents - documents are mostly proprietary formats: MS Word, MS Excel,

Re: AJAX = APAX? Or: is there support for python in browsers?

2005-11-15 Thread [EMAIL PROTECTED]
Crackajax uses py2js to convert python code to client-side Javascript (so you develop in python). I've not used it, but am interested in hearing from anyone who has. http://www.aminus.org/blogs/index.php/phunt/2005/10/06/subway_s_new_ajax_framework

python and VisualFox dbf

2005-11-15 Thread lux
Hi, I've a dfb written in VisualFox, I need to send a pack and reindex but in odbc is not supported... Anybody know how to do this? TIA, Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread matt
Perhaps you could extend Valgrind (http://www.valgrind.org) so it works with python C extensions? (x86 only) matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Background process for ssh port forwarding

2005-11-15 Thread mwilliams
Actually, an even better solution would be to set up public keys WITH a password, then simply use an ssh-agent to keep it in memory. That way, you can leave the processes to do what deeds they will, and the keys are still protected with a password in the event they are stolen. On Nov 15,

is parameter an iterable?

2005-11-15 Thread py
I have function which takes an argument. My code needs that argument to be an iterable (something i can loop over)...so I dont care if its a list, tuple, etc. So I need a way to make sure that the argument is an iterable before using it. I know I could do... def foo(inputVal): if

Re: Default method arguments

2005-11-15 Thread Martin Miller
Alex Martelli wrote, in part: If it's crucial to you to have some default argument value evaluated at time X, then, by Python's simple rules, you know that you must arrange for the 'def' statement itself to execute at time X. In this case, for example, if being able to have self.data as the

  1   2   3   >