Re: What do you use as symbols for Python ?

2005-11-09 Thread Erik Max Francis
Pierre Barbier de Reuille wrote: > When you need some symbols in your program, what do you use in Python ? > > For example, an object get a state. This state is more readable if > expressed as a symbols, for example "opened", "closed", "error". > Typically, in C or C++, I would use an enum for th

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread George Sakkis
"Steve Holden" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > Itertools is your friend in this case: > > > from itertools import takewhile > list(takewhile(p, xrange(1000))) > > > > [0, 1] > > Maybe, but the code also implies an esoteric knowledge that the trught > value of the

What do you use as symbols for Python ?

2005-11-09 Thread Pierre Barbier de Reuille
When you need some symbols in your program, what do you use in Python ? For example, an object get a state. This state is more readable if expressed as a symbols, for example "opened", "closed", "error". Typically, in C or C++, I would use an enum for that: enum OBJECT_STATE { opened, closed, er

Re: which feature of python do you like most?

2005-11-09 Thread egbert
python is almost pseudocode, so much so that you don't need pseudocode anymore. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set program name in Python? ($0 in Perl)

2005-11-09 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>>Is there a way to set the program name in Python, similar to $0 in >>>Perl? >>> From `man perlvar`: >>> >>>$0 Contains the name of the program being executed. On some oper- >>> ating systems assigning to "$0" modifies the a

Re: How to set program name in Python? ($0 in Perl)

2005-11-09 Thread Fredrik Lundh
Steve Holden wrote: > > Is there a way to set the program name in Python, similar to $0 in > > Perl? > > > >>From `man perlvar`: > > > > $0 Contains the name of the program being executed. On some oper- > >ating systems assigning to "$0" modifies the argument > > area that >

Re: How to set program name in Python? ($0 in Perl)

2005-11-09 Thread Steve Holden
Swaroop C H wrote: > Hi, > > Is there a way to set the program name in Python, similar to $0 in > Perl? > >>From `man perlvar`: > > $0 Contains the name of the program being executed. On some oper- >ating systems assigning to "$0" modifies the argument > area that >

Re: Addressing the last element of a list

2005-11-09 Thread Donn Cave
Quoth Steven D'Aprano <[EMAIL PROTECTED]>: ... | So when working with ints, strs or other immutable objects, you aren't | modifying the objects in place, you are rebinding the name to another | object: | | py> spam = "a tasty meat-like food" | py> alias = spam # both names point to the same str ob

Re: xml.minidom and user defined entities

2005-11-09 Thread Nick Craig-Wood
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > > I'm using xml.minidom to parse some of our XML files. Some of these > > have entities like "°" in which aren't understood by xml.minidom. > > ° is not a standard entity in XML (see below). No probably not... > > These gi

ANN: P(x) 0.2 applet builder

2005-11-09 Thread Mike Meyer
P(x) is hard to describe. It might be called a "Framework", but that's a grandiose word for a couple of hundred lines of code. It might be called a programmable calculator, but it has none of the things one associates with calculators. It might be called a programming language, but it's just Python

Re: Python obfuscation

2005-11-09 Thread The Eternal Squire
Two things: 1) The decrypted modules should only reside in RAM, never in virtual memory. Those RAM locations should be rendered inaccessible to Python code. 2) Only sell to an honest customer willing to be locked into nondisclosure agreements. This goes back to the maxim of good salesmanship:

Re: Floating numbers and str

2005-11-09 Thread Christian Stapfer
"Tuvas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Ei, > > > x=.13241414515 > y=str(x)+" something here" > > But somehow limiting that to 4 sign. digits. I know that if you us

Re: need an example of Python numarray to C++ and back again, Boost / SWIG?

2005-11-09 Thread Fernando Perez
PL wrote: > I want to pass a 2D array from Python to C++, manipulate it in C++ (for > example, add 1 to each element) and pass it back to Python. > > With these building blocks I will be able to figure out all the rest of > what I need to do for my project. I am very familiar with Python, but >

Re: Iterator addition

2005-11-09 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Is there a good reason to not define iter1+iter2 to be the same as > If you mean for *ALL* built-in types, such as generators, lists, files, > dicts, etc, etc -- I'm not so sure. Yes, that's what I mean. > Right now, if I mistakenly try to add a list

Re: Iterator addition

2005-11-09 Thread Alex Martelli
Paul Rubin wrote: > Is there a good reason to not define iter1+iter2 to be the same as > itertools.chain(iter1, iter2)? No -- feel free to define __add__ accordingly in every one of your iterator classes. If you mean for *ALL* built-in types, such as generators, lists,

Iterator addition

2005-11-09 Thread Paul Rubin
Is there a good reason to not define iter1+iter2 to be the same as itertools.chain(iter1, iter2)? Examples: # all lines in a collection of files, like perl <> all_lines = file1 + file2 + file3 candidate_primes = (2,) + (1+2*i for i in itertools.count(1)) # candidate_primes is 2,3,5,7

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-09 Thread casevh
> > Will you be updating the information in setup.py file? > > Done, in the current CVS version. I will grab the CVS version and create installers. > > Which versions of Python do you want to support? > > I have tested gmpy with 2.3 and 2.4 on Mac, and those two and also 2.2 > on Linux. I think

Re: ANN: Wing IDE for Python 2.0.4 released

2005-11-09 Thread AllenDang
Thanks! Learning how to write a templateI also think the macro script is a big fun. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread [EMAIL PROTECTED]
George Sakkis wrote: > >>> list(takewhile(p, xrange(1000))) > [0, 1] thanks. that is what I am doing now, in a more generic form : takewhile(p, (x for x in xrange(1))) -- http://mail.python.org/mailman/listinfo/python-list

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Steve Holden
George Sakkis wrote: > "[EMAIL PROTECTED]" wrote: > > >>Alex Martelli wrote: >> >>>This becomes a valid list comprehension by writing 'if' instead of >>>'when'. >> >>valid, yes. efficient, I am not sure. >> >>[ x for x in xrange(1000) if p(x) ] >> >>means I need to go through the whole range

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread [EMAIL PROTECTED]
I just try to use list/generator expression when possible and found I need dropwhile/takewhile from time to time and see if there will be a construct like this. As I sort of think that the language in general encouraging this style(like the talk about dropping map/filter/reduce). Alex Martelli wr

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread George Sakkis
"[EMAIL PROTECTED]" wrote: > Alex Martelli wrote: > > This becomes a valid list comprehension by writing 'if' instead of > > 'when'. > > valid, yes. efficient, I am not sure. > > [ x for x in xrange(1000) if p(x) ] > > means I need to go through the whole range even if p = lambda x: x < 2 Ite

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread [EMAIL PROTECTED]
I thought I read some where there these are intended to be dropped(or at least moved out of built-in) ? George Sakkis wrote: > What about the future of itertools in python 3K ? IIRC, several > functions and methods that currently return lists are going to return > iterators. Could this imply that

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > This becomes a valid list comprehension by writing 'if' instead of > > 'when'. > valid, yes. efficient, I am not sure. > > [ x for x in xrange(1000) if p(x) ] > > means I need to go through the whole range even if p = la

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Alex Martelli
George Sakkis <[EMAIL PROTECTED]> wrote: ... > > > FP functions like dropwhile/takewhile etc. > > > > No way -- the itertools module is and remains a PRECIOUS resource. > > If you want an iterator rather than a list, itertools.ifilter is quite > > appropriate here. > > What about the future of

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > This becomes a valid list comprehension by writing 'if' instead of > 'when'. valid, yes. efficient, I am not sure. [ x for x in xrange(1000) if p(x) ] means I need to go through the whole range even if p = lambda x: x < 2. -- http://mail.python.org/mailman/listinfo/p

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread George Sakkis
"Alex Martelli" wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > FP functions like dropwhile/takewhile etc. > > No way -- the itertools module is and remains a PRECIOUS resource. > If you want an iterator rather than a list, itertools.ifilter is quite > appropriate here. What about th

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Jay Parlar
On Nov 9, 2005, at 7:30 PM, Alex Martelli wrote: > No way -- the itertools module is and remains a PRECIOUS resource. If > you want an iterator rather than a list, itertools.ifilter is quite > appropriate here. Or if you're on 2.4 and want an iterator: (x for x in xrange(10) if p(x)) Jay P.

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I am wondering if there is such a thing, as python is moving away from This becomes a valid list comprehension by writing 'if' instead of 'when'. > FP functions like dropwhile/takewhile etc. No way -- the itertools module is and remains a

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-09 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > I made a successful installer for Windows using Mingw32 and Python 2.4. Great, thanks. > I needed to edit setup.py to list gmp as a required library. > > if sys.version.find('MSC')==-1: > gmpy_ext = Extension('gmpy', sources=['src/gmpy.c'], > # lib

ANN: Wing IDE for Python 2.0.4 released

2005-11-09 Thread sdeibel
Hi, Wing IDE for Python 2.0.4 has been released. This is a bugfix release and is a free upgrade for Wing IDE 2.0 users. It can be downloaded from: http://wingware.com/downloads Highlights of this release include: * Preference for syntax highlighting colors in Python, C/C++, and Java file

[ x for x in xrange(10) when p(x) ]

2005-11-09 Thread [EMAIL PROTECTED]
Hi, I am wondering if there is such a thing, as python is moving away from FP functions like dropwhile/takewhile etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-09 Thread Alex Martelli
Anand S Bisen <[EMAIL PROTECTED]> wrote: > I dont know much !! But if somebody asks me this question my answer > would be to convert some of the meat inside my programs to C/C++ and > then provide the interface to those novel ideas to Python using swig. > And for another level of protection mayb

Re: Newb ??

2005-11-09 Thread Alex Martelli
Norman Silverstone <[EMAIL PROTECTED]> wrote: ... > challenging. What I am thinking about at the moment is how to program for > the computer to guess the number which I select. I know it can be done but > I suspect it requires an approach which I have not yet learnt. I would > welcome suggestion

Re: Newb ??

2005-11-09 Thread Chad Everett
Hey guys, Thanks for your help. I am glad to know there is a community out there willing to put the effort out to help us newbies. I will work on it. Some of the suggestions are things that I have not covered yet but I am sure I will figure it out. Thanks again. I am sure I will be back wi

Re: Looking Python script to compare two files

2005-11-09 Thread david
Hello Tim: One more thing: There some Python scripts that can extract text from PDF or WORD file? Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking Python script to compare two files

2005-11-09 Thread david
Hello Tim: One more thing: There some Python scripts that can extract text from PDF or WORD file? Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking Python script to compare two files

2005-11-09 Thread david
Hello Tim: One more thing: There some Python scripts that can extract text from PDF or WORD file? Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonising the vim (e.g. syntax popups) -> vimpst

2005-11-09 Thread Jeffrey Schwab
Roman Roelofsen wrote: >>Evening, >> >>Is there a decent way to get that help into vim? Or like showing docstrings >>or help that I get through pydoc on request? I've been working myself >>through a pile of vim macros/plugins but couldn't find even one which >>simplifies programming in Python. Furt

Re: Looking Python script to compare two files

2005-11-09 Thread david
Hello Tim: Thanks for your reply! I want to compare PDF-PDF files and WORD-WORD files. It seems that the right way is : First, extract text from PDF file or Word file. Then, use Difflib to compare these text files. Would you please give me some more information about the external diff tools? Th

Re: Sending email in utf-8?

2005-11-09 Thread morphex
By turning everything into unicode objects (unicode(string)) and then running body.encode('utf-8') and using quoted printable, it works. Thanks for all the help, it's really appreciated! -- http://mail.python.org/mailman/listinfo/python-list

Re: XML GUI

2005-11-09 Thread William Park
py <[EMAIL PROTECTED]> wrote: > Looking for information on creating a GUI using a configuration file > (like an XML file or something). Also, how do you map actions (button > clicks, menu selections, etc) to the XML? > > Any other suggestions for building GUI's for Python projects...even > Jython

Re: how to identify a particular directory / file on remote machine

2005-11-09 Thread Mike Meyer
"Swarna" <[EMAIL PROTECTED]> writes: > Hi all, > > I am trying to find out whether a particular directory is present on a > remote machine or not from my local Python script in Linux . Can anyone > help me with the command that i need to issue to os.system in my python > script to acheive this? L

Re: Floating numbers and str

2005-11-09 Thread Jeffrey Schwab
Tuvas wrote: > Wait, one more question. If the number is something like: > > 1.32042 > > It is like > "1.32 stuff" > > I would like it's size to remain constant. Any way around this? s/%g/%f >>> print "%.4f stuff" % 1.3241414515 1.3241 stuff >>> print "%.4f stuff" % 1.32042 1.3204 stuff >>>

how to identify a particular directory / file on remote machine

2005-11-09 Thread Swarna
Hi all, I am trying to find out whether a particular directory is present on a remote machine or not from my local Python script in Linux . Can anyone help me with the command that i need to issue to os.system in my python script to acheive this? Thanks, for all your time ! -- http://mail.pytho

Re: parse data

2005-11-09 Thread Larry Bates
py wrote: > I have some data (in a string) such as > > person number 1 > > Name: bob > Age: 50 > > > person number 2 > > Name: jim > Age: 39 > > ...all that is stored in a string. I need to pull out the names of the > different people and put them in a list or something. Any > suggestio

Re: Floating numbers and str

2005-11-09 Thread Grant Edwards
On 2005-11-10, Dan Bishop <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> On 2005-11-09, Tuvas <[EMAIL PROTECTED]> wrote: >> >> > I would like to limit a floating variable to 4 signifigant digits, when >> > running thorugh a str command. >> >> Sorry, that's not possible. > > Technically, it is

Re: Floating numbers and str

2005-11-09 Thread Dan Bishop
Grant Edwards wrote: > On 2005-11-09, Tuvas <[EMAIL PROTECTED]> wrote: > > > I would like to limit a floating variable to 4 signifigant digits, when > > running thorugh a str command. > > Sorry, that's not possible. Technically, it is. >>> class Float4(float): ...def __str__(self): ...

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread ej
Ah! Well! That explains it. I started to suspect that but (obviously) did not know that. LOL Thanks for your prompt reply, Grant. :) -ej -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-09 Thread Carl Friedrich Bolz
hi! [EMAIL PROTECTED] wrote: > How effective can it be when python is designed to make writing this > kind of code hard(hopefully impossible) ? The most effective would be > renaming function and may be variables but if the functions are kept > short, they would at most looks like haskell ;-) >

Pythonising the vim (e.g. syntax popups) -> vimpst

2005-11-09 Thread Roman Roelofsen
> Evening, > > Is there a decent way to get that help into vim? Or like showing docstrings > or help that I get through pydoc on request? I've been working myself > through a pile of vim macros/plugins but couldn't find even one which > simplifies programming in Python. Further issues would be han

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread jepler
Use 'd' as the format character for 64-bit double precision numbers with struct. >>> x = 148.73 >>> unpack(">> unpack(" pgpB2b9owxZs7.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread Robert Kern
ej wrote: > If that's true, then I guess I am confused why Python is displaying > 148.72999572753906 when you unpack the 4 bytes, implying a lot more > precision that was available in the original 32-bits? Python is doing > 64-bit floating point here? I'm obviously not understanding somethin

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread Grant Edwards
On 2005-11-09, ej <> wrote: > If that's true, then I guess I am confused why Python is displaying > 148.72999572753906 when you unpack the 4 bytes, implying a lot more > precision that was available in the original 32-bits? Python is doing > 64-bit floating point here? Yes. C-Python "float"

Re: Invoking Python from Python

2005-11-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: . . . >It's very flexible - but at this point, the "configuration file" is a >Python program, and not really suitable to use by non-programmers.

struct, IEEE-754 and internal representation

2005-11-09 Thread ej
I ran into something today I don't quite understand and I don't know all the nitty gritty details about how Python stores and handles data internally. (I think) I understand why, when you type in certain floating point values, Python doesn't display exactly what you typed (because not all decimal

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-09 Thread Neil Hodgson
Steven D'Aprano: > You write a function: > > def myfunct(s): > # input arg s is a string > foo = s*3 > bar = s.upper() + foo # LINE 2 > blob = foo.lower() + bar > return blob > > You enter the debugger and single-step to the marked line LINE 2. Then you > edit the code to t

Re: which feature of python do you like most?

2005-11-09 Thread matt . schinckel
>>>I have no idea why people are so facinating with python. > Hey, I'm fascinating even without python! >And so modest, too :-) People as good as us usually are. -- http://mail.python.org/mailman/listinfo/python-list

Re: triangulation

2005-11-09 Thread Robert Kern
Shi Mu wrote: > Delaunay triangulations Besides Delny, which runs the external program qhull to do its calculations, I've recently written a package for scipy that uses Steve Fortune's sweep-line code to calculate Delaunay triangulations. I don't think there are any public implementations of Delau

Re: overloading *something

2005-11-09 Thread Robert Kern
James Stroud wrote: > That **kwargs insists on using the C-side interface is precisely the > annoyance > to which I am referring. I should be able to write a dictionary-like > interface in python and **kwargs should in turn be able to use it. If the > retort is that the C-side interface is use

Re: Python obfuscation

2005-11-09 Thread Grant Edwards
On 2005-11-09, Anand S Bisen <[EMAIL PROTECTED]> wrote: > I dont know much !! But if somebody asks me this question my > answer would be to convert some of the meat inside my programs > to C/C++ and then provide the interface to those novel ideas > to Python using swig. And for another level of p

Re: user account logon from python

2005-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Philippe C. Martin wrote: > I am attempting to write a linux logon manager with python. Have you considered looking at the sources of xdm/gdm/kdm/... to see how they solve the problems you have? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/lis

Re: Python obfuscation

2005-11-09 Thread Anand S Bisen
I dont know much !! But if somebody asks me this question my answer would be to convert some of the meat inside my programs to C/C++ and then provide the interface to those novel ideas to Python using swig. And for another level of protection maybe use these offuscator on the remaining Python s

Re: overloading *something

2005-11-09 Thread [EMAIL PROTECTED]
Robert Kern wrote: > James Stroud wrote: > > > Does anyone else find the following annoying: > > > > py> from UserDict import UserDict > > py> aud = UserDict({"a":1, "b":2}) > > py> def doit(**kwargs): > > ... print kwargs > > UserDict only exists for backwards compatibility with old code that us

Re: Python obfuscation

2005-11-09 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > Step one: globally replace all names in all python module withb names > that are composed of long strings of l, 1, 0 and 0. Fixing > cross-module references should be fun. Don't just make them random - > make them all start with the same sequence, and end with the same > sequenc

Re: Cursor Position.

2005-11-09 Thread Diez B. Roggisch
> That is my exact problem. I want to have the mouse event captured from > another application window. In this case an image window opened in Paint > Shop Pro that by the way uses Python to make scripts. I would like to be > able to click on the image and get the X,Y positions. I have been able

Re: Pythonising the vim (e.g. syntax popups)

2005-11-09 Thread Lonnie Princehouse
There is a Python folding script, as someone already mentioned. That will help you track indentation, although it's not perfect (iirc, long triple quoted strings cause folding malfunctions) I don't know of any way to get dynamic help about functions, although it seems like an ideal use of Vim's b

Re: Python obfuscation

2005-11-09 Thread petantik
Yu-Xi Lim wrote: > Steve Holden wrote: > > Before adding complex protection mechanisms to your code you first need > > some code worth protecting, which is to say it should have some novel > > features or represent a lot of work that offers useful integrated > > functionality for a task or a skill

Re: PIL-> Tkinter

2005-11-09 Thread robert . dowell
I'm having issues with gmail at work but I will try to email it from home tonight. -- http://mail.python.org/mailman/listinfo/python-list

Re: append to non-existing list

2005-11-09 Thread James Stroud
On Wednesday 09 November 2005 07:00, Yves Glodt wrote: > > I will never mention any p-language except python in this list anymore... +1 QOTW -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mai

Re: triangulation

2005-11-09 Thread Jorgen Grahn
On Wed, 9 Nov 2005 04:14:22 -0800, Shi Mu <[EMAIL PROTECTED]> wrote: > is there any sample code to triangulation? many thanks! Don;t know if this is what you're looking for, but I have some code here: http://www.algonet.se/~jgrahn/comp/projects/geese-1.6.tar.gz find(neighbors) Find a (x, y)

Re: Python obfuscation

2005-11-09 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > How effective can it be when python is designed to make writing this > kind of code hard(hopefully impossible) ? The most effective would be > renaming function and may be variables but if the functions are kept > short, they would at most looks lik

Re: append to non-existing list

2005-11-09 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Float doesn't handle implicit conversion to anything but but builtin types. >> In particular, it doesn't check to see if the object beinng added has a >> __float__ method, and invoke that to do the conversion if it does. > > that

Re: not able to HTTPS page from python

2005-11-09 Thread Larry Bates
It is possible that the links have been obscured (something I do on my own web pages) by inserting Javascript that creates the links on the fly using document.write(). That way web spiders can't go through the web pages and easily pick up email addresses to send spam to all my employees. Just a t

Re: Pythonising the vim (e.g. syntax popups)

2005-11-09 Thread Micah Elliott
On Nov 09, Christoph Haas wrote: > I'm an addicted vim user and don't really use the IDLE for anything > more than calculations where I'm too lazy to start KCalc. But one > feature is very pretty: the built-in help for function calls while > you type. Like you enter... > > var1,var2=mystring.split

Re: overloading *something

2005-11-09 Thread James Stroud
On Tuesday 08 November 2005 22:54, Robert Kern wrote: > James Stroud wrote: > > Does anyone else find the following annoying: > > > > py> from UserDict import UserDict > > py> aud = UserDict({"a":1, "b":2}) > > py> def doit(**kwargs): > > ... print kwargs > > ... > > py> aud > > {'a': 1, 'b': 2}

Re: where to download md5.py?

2005-11-09 Thread Jorgen Grahn
On Wed, 2 Nov 2005 18:59:28 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "Bell, Kevin" wrote: > >> I've been looking around, but haven't found a place to download the >> md5.py module. I need it to run the dupinator.py > > md5 is a standard Python module (written in C). it's been in Python s

Re: Web automation

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hi Mike, > thank you very much for your reply. > I know that mine could be considered >> a "very" silly way to define automation. > but I'm not a purist nor a professional > programmer. Yes, but you still need to communicate with other people. Using words to mean someth

Re: Flat file, Python accessible database?

2005-11-09 Thread Jorgen Grahn
On Tue, 1 Nov 2005 21:02:20 + (UTC), Karlo Lozovina <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (=?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=) wrote in > news:[EMAIL PROTECTED]: > >> If you need it to be SQL-like, SQLite seems to be the right thing. > > Tried that one, but had some problems setti

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-09 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: >> On Tue, 08 Nov 2005 13:38:28 -0500, python wrote: > [...] >>>as i mentioned even micro$soft can do this using statically type languages >>>like visual basic and csharp. >>> also, both visualbasic and csharp have goto statements,

Re: Floating numbers and str

2005-11-09 Thread Grant Edwards
On 2005-11-09, Tuvas <[EMAIL PROTECTED]> wrote: > Wait, one more question. If the number is something like: > > 1.32042 > > It is like > "1.32 stuff" > > I would like it's size to remain constant. Any way around this? http://www.python.org/doc/current/lib/typesseq-strings.html#l2h-211 -- Grant E

Re: Python obfuscation

2005-11-09 Thread Yu-Xi Lim
Steve Holden wrote: > Before adding complex protection mechanisms to your code you first need > some code worth protecting, which is to say it should have some novel > features or represent a lot of work that offers useful integrated > functionality for a task or a skill area. > > Most inquirie

Re: Floating numbers and str

2005-11-09 Thread Fredrik Lundh
"Tuvas" <[EMAIL PROTECTED]> wrote: >I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Ei, > > x=.13241414515 > y=str(x)+" something here" > > But somehow limiting that to 4 sign. digits. I know that if you use the > print statement, you can do

Re: Floating numbers and str

2005-11-09 Thread Tuvas
Wait, one more question. If the number is something like: 1.32042 It is like "1.32 stuff" I would like it's size to remain constant. Any way around this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating numbers and str

2005-11-09 Thread Grant Edwards
On 2005-11-09, Tuvas <[EMAIL PROTECTED]> wrote: > I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Sorry, that's not possible. > x=.13241414515 > y=str(x)+" something here" > > But somehow limiting that to 4 sign. digits. I know that if > y

Re: Floating numbers and str

2005-11-09 Thread Tuvas
Yep, I was thinking in C, not python. Thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating numbers and str

2005-11-09 Thread Jeremy Moles
I think you answered your own question. :) x = 0.12345678 y = "%.4f something here" % x On Wed, 2005-11-09 at 11:52 -0800, Tuvas wrote: > I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Ei, > > > x=.13241414515 > y=str(x)+" something here

Re: Floating numbers and str

2005-11-09 Thread Jeffrey Schwab
Tuvas wrote: > I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Ei, > > > x=.13241414515 > y=str(x)+" something here" > > But somehow limiting that to 4 sign. digits. I know that if you use the > print statement, you can do something like %

Re: Cursor Position.

2005-11-09 Thread Samantha
Diez, > Won't be easy - a toolkit (like tkinter) will only capture your mouse > events that are directed towards it's own windows. That is my exact problem. I want to have the mouse event captured from another application window. In this case an image window opened in Paint Shop Pro that by the

Re: xml.minidom and user defined entities

2005-11-09 Thread Fredrik Lundh
Nick Craig-Wood wrote: > I'm using xml.minidom to parse some of our XML files. Some of these > have entities like "°" in which aren't understood by xml.minidom. ° is not a standard entity in XML (see below). > These give this error. > > xml.parsers.expat.ExpatError: undefined entity: line 12,

Re: Invoking Python from Python

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > I'll rein myself in and suggest an even easier introduction > to this subject: configuration files. RARELY is the correct > answer to create a new syntax, although many development > organizations give the impression that's their first choice. > ".ini"-

Floating numbers and str

2005-11-09 Thread Tuvas
I would like to limit a floating variable to 4 signifigant digits, when running thorugh a str command. Ei, x=.13241414515 y=str(x)+" something here" But somehow limiting that to 4 sign. digits. I know that if you use the print statement, you can do something like %.4d, but how can I do this with

Re: Python obfuscation

2005-11-09 Thread Jean-Paul Calderone
On 9 Nov 2005 11:34:38 -0800, The Eternal Squire <[EMAIL PROTECTED]> wrote: >Perhaps this could be a PEP: > >1) Add a system path for decryption keys. >2) Add a system path for optional decryptors supplied by user > (to satisfy US Export Control) >3) When importing a module try: import rout

Re: web interface

2005-11-09 Thread Jean-Paul Calderone
On Wed, 9 Nov 2005 19:08:28 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >On Mon, 7 Nov 2005, Ajar wrote: > >> I have a stand alone application which does some scientific >> computations. I want to provide a web interface for this app. The app is >> computationally intensive and may take long tim

Re: append to non-existing list

2005-11-09 Thread bruno at modulix
Yves Glodt wrote: (snip) > > ok I see your point, and python's... > > (just FYI, and not to start a flamewar ;-): > In php, the [] means "append to an array object". yes, I know this. > If the array does not exist yet, it's created. Which is what I don't like. It should crash. > [] *is* expli

Re: Can python 'read disk sectors' like/via linux:dd ?

2005-11-09 Thread Tauno Voipio
[EMAIL PROTECTED] wrote: > OP wrote: > }in order to justify learning another language I'd first need to be > }convinced that python could easily do the following:- > } > }ReadSectors2Bufr(hdx, StartSectr, SectrCnt, Bufr); <-- like linux:dd > }PrintDecOf4Bytes(Offset, Bufr); <-- and also 1 and 2 b

Re: [OT] Map of email origins to Python list

2005-11-09 Thread Michael
Paul McGuire wrote: > "Claire McLister" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > We've been working with Google Maps, and have created a web service to > map origins of emails to a group. As a trial, we've developed a map of > emails to this group at: > > http://www.zee

Re: Python obfuscation

2005-11-09 Thread The Eternal Squire
Perhaps this could be a PEP: 1) Add a system path for decryption keys. 2) Add a system path for optional decryptors supplied by user (to satisfy US Export Control) 3) When importing a module try: import routine except importation error : for all decryptors present for all keys present run

xml.minidom and user defined entities

2005-11-09 Thread Nick Craig-Wood
I'm using xml.minidom to parse some of our XML files. Some of these have entities like "°" in which aren't understood by xml.minidom. These give this error. xml.parsers.expat.ExpatError: undefined entity: line 12, column 1 Does anyone know how to add entities when using xml.minidom? I've spen

Re: Pythonising the vim (e.g. syntax popups)

2005-11-09 Thread Jeffrey Schwab
Christoph Haas wrote: > Evening, > > I'm an addicted vim user and don't really use the IDLE for anything more > than calculations where I'm too lazy to start KCalc. But one feature is > very pretty: the built-in help for function calls while you type. Like you > enter... > > var1,var2=mystring

  1   2   3   >