Wing IDE 2.1 released

2006-06-21 Thread Wingware Announce
We're happy to announce the release of Wing IDE version 2.1, an advanced development environment for the Python programming language. This is a free upgrade for Wing IDE 2.0 users. The release can be downloaded from: http://wingware.com/downloads Wing IDE provides powerful debugging, editing,

SciPy 2006 Tutorials

2006-06-21 Thread Travis N. Vaught
All, As part of this year's SciPy 2006 Conference, we've planned Coding Sprints on Monday and Tuesday (August 14-15) and a Tutorial Day Wednesday (August 16)--the normal conference presentations follow on Thursday and Friday (August 17-18). For this year at least, the Tutorials (and Sprints)

RELEASED Python 2.5 (beta 1)

2006-06-21 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the first BETA release of Python 2.5. This is an *beta* release of Python 2.5. As such, it is not suitable for a production environment. It is being released to solicit feedback and hopefully discover

Initializing a set from a list

2006-06-21 Thread Xiaolei Li
Hi, I'm trying to initialize a set from a list but am unable to do so. My list c, looks like: [(1.00909, 0.91966, -0.13550388182991072, 0), (0.874239991, 0.7001, -0.2123048713754, 0)] So basically a list of 2 tuples, each with 4 elements. Since tuples are

Re: Initializing a set from a list

2006-06-21 Thread Robert Kern
Xiaolei Li wrote: Hi, I'm trying to initialize a set from a list but am unable to do so. My list c, looks like: [(1.00909, 0.91966, -0.13550388182991072, 0), (0.874239991, 0.7001, -0.2123048713754, 0)] So basically a list of 2 tuples, each with 4

separation events

2006-06-21 Thread Ghido
Hi all, i'm writing a software with python and wxpython for manage the quality/environmental/security system for the my factory. I want to separate the gui structure from the events and database operations for obtain a very modular software, for this reason i start to use sqlalchemy. Unfortunately

Re: Python is fun (useless social thread) ;-)

2006-06-21 Thread Terry Hancock
John Salerno wrote: Did you have to learn it for a job? No, for me, programming is primarily a hobby. I worked on scientific programming in Fortran in the 1980s and in C in the 1990s. Later I did some sys admin work, and managed to use a bit of Python in that. Or did you just like what you

Re: Simple question regarding module initialization

2006-06-21 Thread Terry Hancock
On 6/20/06, Patrick M. Nielsen [EMAIL PROTECTED] wrote: for module in modules: print Loading %s... % module exec 'import %s' % module Although I like the outcome of writing it like this, I don't feel good about it. Is this against standard Python conventions or morals? Loading

Re: Problem Py2exe pygtk and Pil

2006-06-21 Thread thomas carpentier
I have already read the py2exe docs. When I come back at home, I will write a message who contains the script and the errors faulkner a écrit : read the py2exe docs. py2exe should put everything a new user should need in the dist directory. if it doesn't, copy the libraries [be they .pyc or

Re: Initializing a set from a list

2006-06-21 Thread Xiaolei
Robert Kern wrote: Xiaolei Li wrote: Hi, I'm trying to initialize a set from a list but am unable to do so. My list c, looks like: [(1.00909, 0.91966, -0.13550388182991072, 0), (0.874239991, 0.7001, -0.2123048713754, 0)] So basically a list

Re: need all python dialog equivalent

2006-06-21 Thread [EMAIL PROTECTED]
dialog binary is 110 KB. Won't it fit ? Eric S. Johansson wrote: I'm creating a dialogue style interface for an application on a dedicated system. All I have is basic Python 2.3. Is there anything like an all Python dialog equivalent floating around? I'm currently hacking away in curses

Re: Iteration over recursion?

2006-06-21 Thread Kay Schluehr
You might use a separate prime generator to produce prime factors. The factorize algorithm becomes quite simple and configurable by prime generators. For demonstration purposes I use the eratosthenes sieve. def eratosthenes(): memo = {} q = 2 while True: p = memo.pop(q, None)

Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread EP
This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script. Any insight appreciated in advance. I am trying to reduce duplicate files in storage at home - I have a large

Re: Initializing a set from a list

2006-06-21 Thread Xiaolei
Sybren Stuvel wrote: Xiaolei enlightened us with: from pylab import * You'd better not do that. Just use import pylab. If I remove the first line, I correctly get: [1, 2, 3, 3] type 'set' set([1, 2, 3]) Pylab shadows the built-in set name, which is one of the reasons you should

Re: Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread Justin Ezequiel
EP wrote: This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script. This is on Windows XP. def hashit(pth): fs=open(pth,'r').read() sh=sha.new(fs).hexdigest()

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Anton van Straaten
Marshall wrote: Joe Marshall wrote: They *do* have a related meaning. Consider this code fragment: (car a string) [...] Both `static typing' and `dynamic typing' (in the colloquial sense) are strategies to detect this sort of error. The thing is though, that putting it that way makes it

Re: Iteration over recursion?

2006-06-21 Thread Nick Maclaren
In article [EMAIL PROTECTED], Kay Schluehr [EMAIL PROTECTED] writes: | | You might use a separate prime generator to produce prime factors. The | factorize algorithm becomes quite simple and configurable by prime | generators. For demonstration purposes I use the eratosthenes sieve. That is a

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Pascal Costanza
David Hopwood wrote: Pascal Costanza wrote: Rob Thorpe wrote: Pascal Costanza wrote: Matthias Blume wrote: Pascal Costanza [EMAIL PROTECTED] writes: (slot-value p 'address) is an attempt to access the field 'address in the object p. In many languages, the notation for this is p.address.

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread per9000
Hi, just a thought: if you *always* work with floats with two decimals, you are in fact working with integers, but you represent them as a floats - confusing for the internal representation. So why not work with int(float * 100) instead? This way you only have to take care of roundoffs etc when

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread per9000
oops, should be something like this: int / int = int / int, int % int /per9000 -- http://mail.python.org/mailman/listinfo/python-list

wxStyledTextCtrl and sql syntax highlightning

2006-06-21 Thread pierre_py
Hi. I use wxPy version 2.4.2 for Python 2.3. Now I wanted to use the wxStyledTextCtrl for viewing (editing) of sql code. I have the following: self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl( self, wx.NewId(),

Re: dynamic inheritance

2006-06-21 Thread Michele Simionato
alf wrote: I did not think about any particular problem, just thought it would be cool to abstract out the base class. In fact you can do that in C++ (to some extend) using templates and parameterizing the base class. Python is ways cooler than C++. This is a sensible use case where you may

Are any python-LVM bindings available?

2006-06-21 Thread Meta
I need to execute LVM operations from within python ... are there any packages containing direct bindings available or is forking a shell the only solution? Any thoughts would be much appreciated. cheers. -- http://mail.python.org/mailman/listinfo/python-list

Search substring in a string and get index of all occurances

2006-06-21 Thread Nico Grubert
Hi there, I would like to search for a substring in a string and get the index of all occurances. mystring = 'John has a really nice powerbook.' substr = ' ' # space I would like to get this list: [4, 8, 10, 17, 22] How can I do that without using for i in mystring which might be

Re: Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread Tim Peters
[EP [EMAIL PROTECTED]] This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script It's your script. Always open binary files in binary mode. It's a disaster on Windows if

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread jean-michel bain-cornu
just a thought: if you *always* work with floats with two decimals, you are in fact working with integers, but you represent them as a floats - confusing for the internal representation. So why not work with int(float * 100) instead? This way you only have to take care of roundoffs etc when

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Pierre Quentel
mystring = 'John has a really nice powerbook.' substr = ' ' # space pos = 0 indices = [] while True: i = mystring.find(substr,pos) if i==-1: break indices.append(i) pos = i+1 print indices [4, 8, 10, 17, 22] Pierre --

Re: wxStyledTextCtrl and sql syntax highlightning

2006-06-21 Thread jean-michel bain-cornu
I have the following: self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl( self, wx.NewId(), style=wxPython.wx.wxNO_FULL_REPAINT_ON_RESIZE) self.__m_styled_text_ctrl.SetLexer(wxPython.stc.wxSTC_LEX_SQL)

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread Nick Maclaren
In article [EMAIL PROTECTED], per9000 [EMAIL PROTECTED] writes: | | just a thought: if you *always* work with floats with two decimals, | you are in fact working with integers, but you represent them as a | floats - confusing for the internal representation. No, you aren't - you are working

OT: wxPython GUI designer

2006-06-21 Thread Frithiof Andreas Jensen
Don Taylor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I find it easy to use sizers in wxGlade. Just gave is a spin yesterday: How does on fix the size of layout; I can only manage to get sizers to distribute space evently amongst the fields, which is *not* what I want. --

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Torben Ægidius Mogensen
Rob Thorpe [EMAIL PROTECTED] writes: Andreas Rossberg wrote: No, variables are insignificant in this context. You can consider a language without variables at all (such languages exist, and they can even be Turing-complete) and still have evaluation, values, and a non-trivial type

Re: Specifing arguments type for a function

2006-06-21 Thread Mike Duffy
Paolo Pantaleo wrote: I have a function def f(the_arg): ... and I want to state that the_arg must be only of a certain type (actually a list). Is there a way to do that? I wrote a cool function decorator just for that purpose. It's posted on the Python Decorator Library at:

Re: separation events

2006-06-21 Thread Bruno Desthuilliers
Ghido wrote: Hi all, i'm writing a software with python and wxpython for manage the quality/environmental/security system for the my factory. I want to separate the gui structure from the events and database operations for obtain a very modular software, for this reason i start to use

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
David Hopwood wrote: Oh, but it *does* make sense to talk about dynamic tagging in a statically typed language. It even makes perfect sense to talk about dynamic typing in a statically typed language - but keeping the terminology straight, this rather refers to something like described in

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Matthias Blume wrote: Rob Thorpe [EMAIL PROTECTED] writes: I think we're discussing this at cross-purposes. In a language like C or another statically typed language there is no information passed with values indicating their type. You seem to be confusing does not have a type with no

help() on stdout.closed

2006-06-21 Thread Pekka Karjalainen
Python 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type help, copyright, credits or license for more information. from sys import stdout help (stdout.closed) If I do this, it gives me help on the bool object. Also: stdout.closed.__doc__ 'bool(x) -

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
Rob Thorpe wrote: I think this should make it clear. If I have a xyz in lisp I know it is a string. If I have xyz in an untyped language like assembler it may be anything, two pointers in binary, an integer, a bitfield. There is no data at compile time or runtime to tell what it is, the

What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Hari Sekhon
I want to wrap a whole script in try ... except. What is the best way of doing this? Consider the following: - try: import modules CODE def notifyme(traceback): code to tell me there is a problem except Exception, traceback: notifyme(traceback) Would this code not

Re: help() on stdout.closed

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], Pekka Karjalainen wrote: from sys import stdout help (stdout.closed) If I do this, it gives me help on the bool object. stdout.closed is a bool. What were you expecting it to show you? -- http://mail.python.org/mailman/listinfo/python-list

Re: help() on stdout.closed

2006-06-21 Thread Fredrik Lundh
Pekka Karjalainen wrote: from sys import stdout help (stdout.closed) If I do this, it gives me help on the bool object. that's probably because sys.stdout.closed *is* a bool object: sys.stdout.closed False type(sys.stdout.closed) type 'bool' there's no way the reflection system can

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? You could do this maybe: import sys def excepthook(exc_type, exc_value, tb): import modules_needed_to_notify_exception ... sys.excepthook =

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Bruno Desthuilliers
Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? Consider the following: - try: import modules CODE def notifyme(traceback): code to tell me there is a problem except Exception, traceback:

Re: difference between import from mod.func() and x=mod.func()

2006-06-21 Thread Hari Sekhon
I take it that it's not worth listening to that tutorial and just using good old import from, which I suspect is better anyway since it imports less...uneducated premature optimisation - I take it this is insulting a that programmer's progexuality...! import from it is then unless anybody has

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Fredrik Lundh
Nico Grubert wrote: I would like to search for a substring in a string and get the index of all occurances. mystring = 'John has a really nice powerbook.' substr = ' ' # space I would like to get this list: [4, 8, 10, 17, 22] the find and index methods take an optional start argument,

Re: WinPops

2006-06-21 Thread Hari Sekhon
If you were going to do this you may as well just do something likeif sys.platform='win32': os.system('net send somemachine somemessage')elif sys.platform[:5]='linux' os.system('smblcient -M machine etc...') This would be more portable and simpler than the alternatives I've seen. It would be

Re: wxStyledTextCtrl and sql syntax highlightning

2006-06-21 Thread pierre_py
Hi. Thanks it works now .. i must reset the default styles with StyleClearAll and then set the styles apropriate again. Is there a way that the keyword list isn't case sensitive, as sql isn't. reg, Pierre jean-michel bain-cornu wrote: I have the following: self.__m_styled_text_ctrl

Re: memory error with zipfile module

2006-06-21 Thread Hari Sekhon
On 20/05/06, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Roger Miller a écrit : The basic problem is that the zipfile interface only reads and writes whole files, so it may perform poorly or fail on huge files. At one time I implemented a patch to allow reading files in chunks. However I believe

embedded Python calling app via COM

2006-06-21 Thread Jim
I have a C++ app which fires up a Python script using C API calls. That script operates the app via Automation calls, like this: from win32com.client import * from mywrapper import * myapp = Application() myapp.Visible = True mydoc = myapp.Documents.Open(...) My problem is to make sure the

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Andreas Rossberg schrieb: Rob Thorpe wrote: Hmm. You're right, ML is no-where in my definition since it has no variables. Um, it has. Mind you, it has no /mutable/ variables, but that was not even what I was talking about. Indeed. A (possibly nonexhaustive) list of program entities that

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Matthias Blume schrieb: Joachim Durchholz [EMAIL PROTECTED] writes: Matthias Blume schrieb: Perhaps better: A language is statically typed if its definition includes (or ever better: is based on) a static type system, i.e., a static semantics with typing judgments derivable by typing rules.

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread per9000
Nick Maclaren wrote: | just a thought: if you *always* work with floats with two decimals, | you are in fact working with integers, but you represent them as a | floats - confusing for the internal representation. No, you aren't - you are working with fixed-point Nick, your answer has so

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Pascal Costanza schrieb: (It's really important to understand that the idea is to use this for deployed programs - albeit hopefully in a more structured fashion - and not only for debugging. The example I have given is an extreme one that you would probably not use as such in a real-world

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Hari Sekhon
Jon Ribbens wrote: In article [EMAIL PROTECTED], Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? You could do this maybe: import sys def excepthook(exc_type, exc_value, tb): import

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Uppal
Anton van Straaten wrote: But a program as seen by the programmer has types: the programmer performs (static) type inference when reasoning about the program, and debugs those inferences when debugging the program, finally ending up with a program which has a perfectly good type scheme. It's

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Uppal
Darren New wrote: [me:] Personally, I would be quite happy to go there -- I dislike the idea that a value has a specific inherent type. Interestingly, Ada defines a type as a collection of values. It works quite well, when one consistantly applies the definition. I have never been very

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Uppal
David Hopwood wrote: When people talk about types being associated with values in a latently typed or dynamically typed language, they really mean *tag*, not type. I don't think that's true. Maybe /some/ people do confuse the two, but I am certainly a counter-example ;-) The tag (if any) is

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Uppal
Chris Smith wrote: It would be interesting to see what a language designed specifically to support user-defined, pluggable, and perhaps composable, type systems would look like. [...] You mean in terms of a practical programming language? If not, then lambda calculus is used in

Re: Iteration over recursion?

2006-06-21 Thread Tim Peters
[Kay Schluehr] You might use a separate prime generator to produce prime factors. The factorize algorithm becomes quite simple and configurable by prime generators. Alas, yours was _so_ simple that it always takes time proportional to the largest prime factor of n (which may be n) instead of

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Hari Sekhon
Jon Ribbens wrote: In article [EMAIL PROTECTED], Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? You could do this maybe: import sys def excepthook(exc_type, exc_value, tb): import

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Maric Michaud
Another variant, I feel this one more natural as it doesn't contain a C-looking infinite loop (also I made it a generator but this is not the topic). In [160]: def indices(s, subs) : .: last = 0 .: for ind, part in in enumerate(s.split(subs)[:-1]) : .: yield

Re: help() on stdout.closed

2006-06-21 Thread Pekka Karjalainen
On 2006-06-21, Fredrik Lundh [EMAIL PROTECTED] wrote: have you tried things like [...] I have now. I'm not sure what the results are supposed to tell me, but I am not going to press the issue. Suppose I had no idea what sys.stdout.closed was and wanted to find out. Where would I look it up?

Re: help() on stdout.closed

2006-06-21 Thread Fredrik Lundh
Pekka Karjalainen wrote: Suppose I had no idea what sys.stdout.closed was and wanted to find out. Where would I look it up? help(sys.stdout) ... | closed = attribute 'closed' of 'file' objects | True if the file is closed ... in case anyone feels like hacking, support for something

Re: help() on stdout.closed

2006-06-21 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Pekka Karjalainen wrote: Suppose I had no idea what sys.stdout.closed was and wanted to find out. Where would I look it up? `sys.stdout` is a file (like) object: http://docs.python.org/lib/bltin-file-objects.html Ciao, Marc 'BlackJack' Rintsch --

Re: Iteration over recursion?

2006-06-21 Thread MTD
I've been testing my recursive function against your iterative function, and yours is generally a quite steady 50% faster on factorizing 2**n +/- 1 for 0 n 60. I think that, for a challenge, I'll try to make a recursive function that matche or beats the iterative function -- it's worth the

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Fredrik Lundh
Maric Michaud wrote: Another variant, I feel this one more natural as it doesn't contain a C-looking infinite loop doing things in a convoluted way because you think that non-infinite while- loops are not natural? you can get help for that, you know ;-) Actually it's even more efficient

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
So, will y'all just switch from using dynamically typed to latently typed, and stop talking about any real programs in real programming languages as being untyped or type-free, unless you really are talking about situations in which human reasoning doesn't come into play? I think you'll find

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread K.S.Sreeram
Maric Michaud wrote: Actually it's even more efficient than Lundh's effbot's solution finds overlapping occurrences, whereas your solution finds non-overlapping occurrences. So efficiency comparisons are not valid. e.g: indices( 'a', 'aa' ) your solution gives: 0,2 effbots's solution:

urllib2 OpenerDirector question on usage.

2006-06-21 Thread Ant
Hello all, I am using urllib2 as a part of a web testing tool. One of the things I am testing is the effect of two different people perforing the same actions on the website - do they interfer with each other or not. So to emulate this, I essentially have the following function: def

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Tim Chase
I would like to search for a substring in a string and get the index of all occurances. mystring = 'John has a really nice powerbook.' substr = ' ' # space I would like to get this list: [4, 8, 10, 17, 22] How can I do that without using for i in mystring which might be

Re: Segmentation fault only on Iinux

2006-06-21 Thread Kiran
Unfortunately (i guess), I am not doing any XML. However, I am taking the previous suggestion of putting print lines in every other line of my code and then seeing where it crashes. Hopefully, that will solve the problem. thanks for the suggestions everybody -- Kiran Frank Millman wrote:

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Hari Sekhon
Hari Sekhon wrote: Jon Ribbens wrote: In article [EMAIL PROTECTED], Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? You could do this maybe: import sys def excepthook(exc_type, exc_value,

very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread bussiere maillist
i truly didn't understand this error :Traceback (most recent call last): File D:\Programmation\FrancePaquet\FrancePaquet.py, line 77, in ? cabtri = zz + chiffrescabtri + clefcTypeError: coercing to Unicode: need string or buffer, int found if someone could help me i will be glad, this program

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
Chris Uppal wrote: I have never been very happy with relating type to sets of values (objects, whatever). Indeed, this view is much too narrow. In particular, it cannot explain abstract types, which is *the* central aspect of decent type systems. There were papers observing this as early as

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread bearophileHUGS
Maric Michaud: I'd love str implement a xsplit(sub, start, end) method, so I could have wrote : enumerate(s.xsplit(subs, 0, -1)). Some of such str.x-methods (or str.i-methods, etc) can be useful (especially for Py3.0), but keeping APIs simple and compact is very important, otherwise when you

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Pascal Costanza
Joachim Durchholz wrote: Pascal Costanza schrieb: (It's really important to understand that the idea is to use this for deployed programs - albeit hopefully in a more structured fashion - and not only for debugging. The example I have given is an extreme one that you would probably not use

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Maric Michaud
Le Mercredi 21 Juin 2006 14:01, Fredrik Lundh a écrit : Another variant, I feel this one more natural as it doesn't contain a C-looking infinite loop doing things in a convoluted way because you think that non-infinite while- loops are not natural? you can get help for that, you know ;-)

Delivery reports about your e-mail

2006-06-21 Thread dpsp2004
-This message contained a computer virus which has been detected and deleted by the BT Business Email Virus Filter to avoid infecting your computer. - -You may wish to contact the sender of this email requesting they remove any virus infection from their PC before re-sending the email and

Re: need all python dialog equivalent

2006-06-21 Thread Eric S. Johansson
[EMAIL PROTECTED] wrote: dialog binary is 110 KB. Won't it fit ? missing library. I have ncurses and newt and dialog seems to require something called ncursesw. I've been trying to find the Python newt module as well and that seems to be as invisible as the creature it's named after. --

How to override the doc of an object instance.

2006-06-21 Thread David Huard
Hi, I'm not really sure about the right terminology, but here is my question, boiled down to this code: class widget (object): This is a widget. def __init__(self): self._x = None def fget(self): return self._x def fset(self, value): self._x = value

Re: need all python dialog equivalent

2006-06-21 Thread Eric S. Johansson
Miki wrote: Hello Eric, Is there anything like an all Python dialog equivalent floating around? http://www.pythonware.com/library/tkinter/introduction/ I'm sorry. I should have been more explicit. I need a textbased interface such as the ones you would get with curses and dialogue.

Re: very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread Max Erickson
bussiere maillist [EMAIL PROTECTED] wrote: --=_Part_118629_1441854.1150895040355 i truly didn't understand this error : Traceback (most recent call last): File D:\Programmation\FrancePaquet\FrancePaquet.py, line 77, in ? cabtri = zz + chiffrescabtri + clefc TypeError: coercing

Re: OS specific command in Python

2006-06-21 Thread diffuser78
I have a question on getpass. Since I am a newbie you might find it a little dumb. By using the getpass, are u trying to retrieve the username and password of remote mahcine or local ? Avell Diroll wrote: [EMAIL PROTECTED] wrote: When you connect (via ssh or telnet) to a remote machine, you

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Fredrik Lundh
K.S.Sreeram wrote: effbot's solution finds overlapping occurrences, whereas your solution finds non-overlapping occurrences. So efficiency comparisons are not valid. oops. my bad. here's a fixed version: result = []; pos = 0 try: while 1: pos =

Re: How to override the doc of an object instance.

2006-06-21 Thread Maric Michaud
Le Mercredi 21 Juin 2006 06:50, David Huard a écrit : class widget (object):     This is a widget.     def  __init__(self):         self._x = None     def fget(self):         return self._x     def fset(self, value):         self._x = value         print self._x, 'Ok'     x =

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Matthias Blume
Rob Thorpe [EMAIL PROTECTED] writes: Matthias Blume wrote: Rob Thorpe [EMAIL PROTECTED] writes: I think we're discussing this at cross-purposes. In a language like C or another statically typed language there is no information passed with values indicating their type. You seem to be

Re: OS specific command in Python

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: So basically, instead of typing in on the command line argument I want to have it in a python program and let it do the action. Try exec() and execfile() from the standard library (IIRC) Ths os.spawn...() functions are likely to be

Re: How to override the doc of an object instance.

2006-06-21 Thread David Huard
On Wed, 21 Jun 2006 15:39:02 +0200, Maric Michaud wrote: This is w.__class__.x.__doc__. Thanks, So in order to implement what I want, I should rather consider an ipython hack to print w.__class__.x.__doc__ when it exists, instead of w.x.__doc_ ? Does this makes sense or it will ruin the

Re: need all python dialog equivalent

2006-06-21 Thread Grant Edwards
On 2006-06-21, Eric S. Johansson [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: dialog binary is 110 KB. Won't it fit ? missing library. I have ncurses and newt and dialog seems to require something called ncursesw. I've been trying to find the Python newt module as well and that

Re: Psyco performance

2006-06-21 Thread [EMAIL PROTECTED]
Place all the code in a function. Even without psyco you might get somewhat better performances then. And I doubt psyco can optimise code that isn't in a function anyway. Another thing I wasn't considering is that the first call with psyco enabled might be slower. The 2nd time the

Re: OS specific command in Python

2006-06-21 Thread diffuser78
Hi Avell, I want to communicate using subprocess module but my task is a little different. May be you can guide me. I have a linux box, from where I remotely execute all the commands. The remote machine is windows machine. I installed an OpenSSH server for windows to send the shutdown command. I

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Chris Uppal schrieb: Chris Smith wrote: I think Marshall got this one right. The two are accomplishing different things. In one case (the dynamic case) I am safeguarding against negative consequences of the program behaving in certain non- sensical ways. In the other (the static case) I am

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Matthias Blume schrieb: Joachim Durchholz [EMAIL PROTECTED] writes: Matthias Blume schrieb: Joachim Durchholz [EMAIL PROTECTED] writes: Matthias Blume schrieb: Perhaps better: A language is statically typed if its definition includes (or ever better: is based on) a static type system,

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Matthias Blume wrote: Rob Thorpe [EMAIL PROTECTED] writes: Matthias Blume wrote: Rob Thorpe [EMAIL PROTECTED] writes: I think we're discussing this at cross-purposes. In a language like C or another statically typed language there is no information passed with values indicating

Re: [OT] code is data

2006-06-21 Thread Anton Vredegoor
Bruno Desthuilliers wrote: You mean like 'converting' javascript to python or python to ruby (or converting any home-grown DSL to Python, etc) ? Yes, but also what some other posters mentioned, making Pythons internal parsing tree available to other programs (and to Python itself) by using a

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joachim Durchholz
Pascal Costanza schrieb: Static type systems potentially change the semantics of a language in ways that cannot be captured by dynamically typed languages anymore, and vice versa. Very true. I also suspect that's also why adding type inference to a dynamically-typed language doesn't give

Remote Boot Manager Scripting (Python)

2006-06-21 Thread diffuser78
I just started to write a small project in Python. I was wondering if there can be something like remote boot manager. I have to remotely start a computer. It has dual boot (WinXP and Linux). My remote computer is Linux which will send command to remotely boot the other computer. Can we write

Re: new python icons for windows

2006-06-21 Thread and-google
Istvan Albert wrote: But these new icons are too large, too blocky and too pastel. Hooray! Glad to see *someone* doesn't like 'em, I'll expect a few more when b1 hits. :-) Although I can't really see 'large', 'blocky' or 'pastel'... they're the same size and shape as other Windows document

returning index of minimum in a list of lists

2006-06-21 Thread JJLaRocque
Hi all, Is there a simple python function to return the list index of the minimum entry in a list of lists? ie, for [[3,3,3,3], [3,3,3,1], [3,3,3,3]] to return 2,4. Or, same question but just for a list of numbers, not a list of lists. Thanks, Josh --

Re: How to override the doc of an object instance.

2006-06-21 Thread Paul McGuire
David Huard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Wed, 21 Jun 2006 15:39:02 +0200, Maric Michaud wrote: This is w.__class__.x.__doc__. Thanks, So in order to implement what I want, I should rather consider an ipython hack to print w.__class__.x.__doc__ when it

Re: Search substring in a string and get index of all occurances

2006-06-21 Thread Fredrik Lundh
Tim Chase wrote: indicies = [i for i in xrange(len(mystring)) if mystring.startswith(substr, i)] indicies [4, 8, 10, 17, 22] is my preferred way of doing this. it's things like this that makes me wonder why I spent a week speeding up the string implementation for Python 2.5 (with

  1   2   3   >