Re: parse data

2005-11-09 Thread Micah Elliott
On Nov 09, Dennis Benzinger wrote: Use the re module: import re your_data = person number 1 Name: bob Age: 50 person number 2 Name: jim Age: 39 names = [] for match in re.finditer(Name:(.*), your_data): names.append(match.group(1)) print names Dennis' solution is

Re: PIL- Tkinter

2005-11-09 Thread robert . dowell
I have an app that I wrote to move images from a camera/portable media to an archive directory. It is using TKInter and PIL to display each jpg as it is transfered. I can email you the code if you would like. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyFLTK - an underrated gem for GUI projects

2005-11-09 Thread Claudio Grondi
So I hope this humble message might inspire some folks to have a serious look at pyfltk. For many situations, PyFLTK can take you to break-even point quickly, and deliver net savings in time and effort after that. Animated by your posting I have downloaded: fltk-1.1.6-source.zip (3.073.432

Re: Web automation

2005-11-09 Thread qwweeeit
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. Besides that, I know that case by case every problem can be solved and in more right way, also in very difficult

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 9)

2005-11-09 Thread Cameron Laird
QOTW: The lesson for me is to spend much less time on Python discussion and much more on unfinished projects. So even if I never use the new syntax, I will have gained something ;-) - Terry Reedy In short, this group is a broad church, and those readers with brains the size of planets should

Re: PyFLTK - an underrated gem for GUI projects

2005-11-09 Thread Fredrik Lundh
Claudio Grondi wrote: Running some of the test examples (e.g. C:\Python24\pyfltk\test\doublebuffer.py) I am getting an error I have never seen before: == TitleOfMessageBox: Microsoft Visual C++ Runtime Library TheMessage:

Re: Invoking Python from Python

2005-11-09 Thread B Mahoney
I also think something along the lines of execfile() may serve the original poster. There was a thread last month about compile() and exec() with a concise example from Fredrik Lundh. Google Changing an AST in this group. With dynamically generated code I prefer the separate compile() step so

Re: append to non-existing list

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Fredrik Lundh wrote: x = 10 + 20 # should this be 30 or 1020 or 1020 or ...? I think Perl handles this case pretty well and sane. In fact, this strict but dynamic type checking is quite painful to work with, especially the new decimal class.

Re: PyFLTK - an underrated gem for GUI projects

2005-11-09 Thread Tom Anderson
On Mon, 6 Nov 2005, it was written: aum [EMAIL PROTECTED] writes: To me, wxPython is like a 12-cylinder Hummer, ... Whereas PyFLTK feels more like an average suburban 4-door sedan Interesting. What would Tkinter be at that car dealership? A '70s VW Beetle - it's been going for ever, but

Re: Newb ??

2005-11-09 Thread Norman Silverstone
: Hi all, I am new to the group. Trying to learn Python programming on my own. I am working through Michael Dawson's Book Python Programming for the absolute beginner. I am tring to write a program that is a number guessing game. I want to be able to give the user 5 tries to guess

Re: which feature of python do you like most?

2005-11-09 Thread Tim Sharpe
I also like the fact the the core language is very compact. I only code a few times a month and am not a particularly good programmer (at least in my opinion), so not having a humongous core language to remember is a plus. I was always stifled in C by the amount of stuff I had to remember. With

Re: need help extracting data from a text file

2005-11-09 Thread Tom Anderson
On Mon, 7 Nov 2005, Kent Johnson wrote: [EMAIL PROTECTED] wrote: i have a text file with a bunch of values scattered throughout it. i am needing to pull out a value that is in parenthesis right after a certain word, like the first time the word 'foo' is found, retrieve the values in the

Re: Application monitor

2005-11-09 Thread Magnus Lycka
Daniel Crespo wrote: Respect Twisted... Mmm... I already started with another networking library (TCPServer and SimpleXMLRPCServer), and I wouldn't like to mix things because I don't know so much about those libraries. I know that Twisted can do what I already have. But replacing it can be a

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-09 Thread vinjvinj
Unfortunately this in not an options since all the processes share objects in memory which are about 1gig for each node. Having a copy of this in each user process is just not an options. I think I'm going to use RestrictedPython from zope3 svn which should take care of 70-80 % of the problem. --

Re: Web automation

2005-11-09 Thread Paul Boddie
[EMAIL PROTECTED] wrote: While I was posting the reply to Mike I saw the last contribution of Paul Boddie. From what he says I infer that he is a Windows programmer Far from it! OutlookExplorer was written as an experiment when I had to use Windows in a corporate environment. I don't run

Re: append to non-existing list

2005-11-09 Thread Fredrik Lundh
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's because __float__ is there to let you control what

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Steve Holden
Gerhard Häring wrote: Vittorio wrote: [...] Nonetheless, I was unable to find any documentation about such a different behaviour between Pysqlite and Pysqlite2; from my beginner point of view the Pysqlite (Magnus' version) paramstyle looks a better and more pythonic choice and I don't grasp

Re: Application monitor

2005-11-09 Thread Daniel Crespo
Magnus Lycka wrote: You *could* use twisted.runner for process control even if you don't use twisted for your networking code. It does seem like a funny thing to do, but there's nothing stopping you from doing that. The example code in twisted.runner starts up a few shell scripts that die on

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

2005-11-09 Thread Steve Holden
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, which i do to not use in final code but can be real

Python obfuscation

2005-11-09 Thread petantik
Are there any commercial, or otherwise obfuscators for python source code or byte code and what are their relative advantages or disadvantages. I wonder because there are some byte code protection available for java and .NET, although from what i've read these seem to be not comprehensive as

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Jean-Paul Calderone
On Wed, 09 Nov 2005 17:57:46 +, Steve Holden [EMAIL PROTECTED] wrote: Gerhard Häring wrote: Vittorio wrote: [snip] I think about the only place I wrote a bit about the differences was in the pysqlite 2.0 final announcement: http://lists.initd.org/pipermail/pysqlite/2005-May/43.html

Re: not able to HTTPS page from python

2005-11-09 Thread Steve Holden
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: AM NOT GETTING ANY ERRORS EITHER BUT ITS NOT READING THE LINKS, THAT ARE PRESENT IN THE GIVEN HTTPS PAGE HAVE YOU TRIED ADDING A PRINT STATEMENT TO THE FEED LOOP SO YOU CAN SEE WHAT YOU'RE GETTING BACK FROM THE SERVER ? COULD YOU GUYS BE

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

2005-11-09 Thread Paddy
Hi, I am using gvim 6.4 which has Python colorising, and The menu tools-folding-fold method-indent :help folding May give you more info. Cheers, Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON LOOSING FOR JAVA???????

2005-11-09 Thread James Colannino
Bill Mill wrote: +1 QOTW My ignorance shows here. What does that mean? :-P James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ If Carpenters made houses the way programmers design programs, the first woodpecker to come along would destroy all of

Re: triangulation

2005-11-09 Thread Shi Mu
Delaunay triangulations On 11/9/05, Robert Kern [EMAIL PROTECTED] wrote: Shi Mu wrote: is there any sample code to triangulation? many thanks! Triangulation of what? Scattered points in a plane? 2D manifolds embedded in a 3D space? Delaunay triangulations? Constrained triangulations? --

Re: Hi, from my login i want to login as a other user ,

2005-11-09 Thread Steve Holden
sumi wrote: Hi, i am very new to python , it is just 2 days i started reading abt it. I did not understand the above statement. what i want to do is , i want to login as a super user eg : $su xyz , and then i need to enter the passwd, i want to do these steps using python , how can i do

Re: triangulation

2005-11-09 Thread Kristian Zoerhoff
On 11/9/05, Shi Mu [EMAIL PROTECTED] wrote: Delaunay triangulations On 11/9/05, Robert Kern [EMAIL PROTECTED] wrote: Shi Mu wrote: is there any sample code to triangulation? many thanks! Triangulation of what? Scattered points in a plane? 2D manifolds embedded in a 3D space?

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

2005-11-09 Thread Tom Anderson
On Mon, 7 Nov 2005, Claire McLister wrote: We've been working with Google Maps, and have created a web service to map origins of emails to a group. Top stuff! The misses are, if anything, more interesting than the hits! I, apparently, am in Norwich. I have been to Norwich a few times, and,

Re: Python obfuscation

2005-11-09 Thread Fredrik Lundh
petantik [EMAIL PROTECTED] wrote: Are there any commercial, or otherwise obfuscators for python source code or byte code and what are their relative advantages or disadvantages. I wonder because there are some byte code protection available for java and .NET, although from what i've read

Re: PIL- Tkinter

2005-11-09 Thread Tuvas
That would be extremely useful.Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON LOOSING FOR JAVA???????

2005-11-09 Thread Fredrik Lundh
James Colannino wrote +1 QOTW My ignorance shows here. What does that mean? :-P +1 = http://www.python.org/peps/pep-0010.html QOTW = Quote Of The Week /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-09 Thread Steve Holden
petantik wrote: Are there any commercial, or otherwise obfuscators for python source code or byte code and what are their relative advantages or disadvantages. I wonder because there are some byte code protection available for java and .NET, although from what i've read these seem to be not

Re: PYTHON LOOSING FOR JAVA???????

2005-11-09 Thread Grant Edwards
On 2005-11-09, James Colannino [EMAIL PROTECTED] wrote: Bill Mill wrote: +1 QOTW My ignorance shows here. What does that mean? :-P It's a vote for Qutoe of the Week. -- Grant Edwards grante Yow! Are we live or at

Re: Python obfuscation

2005-11-09 Thread [EMAIL PROTECTED]
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 ;-) Fredrik Lundh wrote: hmm. is google

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread carlo
Gerhard Häring ha scritto: The reason why pysqlite 0.x/1.x used paramstyle pyformat, based on Python string substitution for SQL parameters is that at the time pysqlite was started, SQLite 2.x did not have any support for parameter binding. So we had to fake it in Python, just like the MySQL

Re: How to use generators?

2005-11-09 Thread Tom Anderson
On Wed, 9 Nov 2005, Sybren Stuvel wrote: Ian Vincent enlightened us with: I have never used generators before but I might have now found a use for them. I have written a recursive function to solve a 640x640 maze but it crashes, due to exceeding the stack. The only way around this I can

Re: web interface

2005-11-09 Thread Tom Anderson
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 time for running. Can someone suggest me a starting point for me? (like pointers

Re: Make an exe file as a Windows Service

2005-11-09 Thread [EMAIL PROTECTED]
py2exe has an option to create a MS Windows service (see http://www.py2exe.org) from a Python script -- http://mail.python.org/mailman/listinfo/python-list

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.split(

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 deg; 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

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

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:

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 byte

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* explicit for

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 time for

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 routine

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: 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-speak

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 deg; in which aren't understood by xml.minidom. deg; is not a standard entity in XML (see below). These give this error. xml.parsers.expat.ExpatError: undefined entity: line 12,

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: 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 %.4d, but

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 But

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 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 you use the

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 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 something

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 inquiries of

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 Edwards

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, which i do to

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 setting

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 something

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 since the

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} py doit(**aud)

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: 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

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's because

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 like

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: 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/ --

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 area.

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

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 to

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 sequence,

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 used it before one

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

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 --

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

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 used

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

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: 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 this:

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: 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.

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: 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

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(d, pack(d, x))[0] == x True unpack(f, pack(f, x))[0] == x False Jeff pgpB2b9owxZs7.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

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 handling

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 ;-)

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: 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): ... return

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. Ah well, I

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 suggestions...besides

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 ! --

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 --

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? Lots of

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. If

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: 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?

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. Further issues

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

<    1   2   3   >