Re: Graphical debugger/code explorer

2005-10-03 Thread Larry Bates
Eclipse - http://www.eclipse.org/ http://wiki.python.org/moin/EclipsePythonIntegration Florian Lindner wrote: > Hello, > in order to understand python code from a larger project (Zope 3) I'm > looking for a tool that helps me with that. It should also help > What (graphical) application running o

Re: Python TNEF (winmail.dat attachment access) library?

2005-10-03 Thread Larry Bates
Why not write Python class that uses CTypes and make it available as a recipe? From a performance standpoint it is unlikely you can do better than to call the .dll and have it do the work for you. Just a suggestion. -Larry Bates Petri Savolainen wrote: > Hello, > > has anyone seen such a beast

question about smtplib

2005-10-03 Thread nephish
Hey there, i am using the smtplib module in python 2.3 my question is, this works: server = smtplib.SMTP(localhost) then server.sendmail(to address, from address, message) what i want to know is, how does the connection work? when i do server.sendmail, does it connect then ? or did it connec

Re: python getopt functionality

2005-10-03 Thread M.N.A.Smadi
It is not clear to me if i can define `mandatory' options? That sounds strange but let say that the command `requires ' a value for -z or --zoo (either or should be find but one and only one of them MUST be present). Can i do that with resorting to using if statements? thanks moe smadi Fredrik

Re: Reply-To header

2005-10-03 Thread Rocco Moretti
Roel Schroeven wrote: > Peter Decker wrote: > >>On 10/3/05, Roel Schroeven <[EMAIL PROTECTED]> wrote: >> >>On lists like this, where everyone benefits by sharing information, it >>seems pretty lame to hide behind purist arguments about Reply-To: >>headers. The default behavior should be the one mo

simple AJAX with JSON

2005-10-03 Thread Wensheng
I just post a cookbook recipe on simple ajax. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440637 Hope someone find it's useful. Wensheng Wang -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Mon, 03 Oct 2005 06:59:04 +, Antoon Pardon wrote: > Declared variables have considerable labour costs, and only marginal > gains. Since the steps you take to protect against other errors will also > protect against mistyping variables, declaratio

Re: python getopt functionality

2005-10-03 Thread Micah Elliott
On Oct 03, M.N.A.Smadi wrote: > It is not clear to me if i can define `mandatory' options? That sounds > strange but let say that the command `requires ' a value for -z or > --zoo (either or should be find but one and only one of them MUST be > present). Can i do that with resorting to using if st

Dynamical loading of modules

2005-10-03 Thread Jacob Kroon
Hi, I'm having some problems with implementing dynamical module loading. First let me describe the scenario with an example: modules/ fruit/ __init__.py apple.py banana.py apple.py defines a class 'Apple', banana defines a class 'Banana'. The problem lies in the fact

Re: Where to find python c-sources

2005-10-03 Thread Szabolcs Nagy
if u just want to browse the code online then use this: http://fisheye.cenqua.com/viewrep/python/python/dist/src *much* nicer than sourceforge cvs viewer nsz -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamical loading of modules

2005-10-03 Thread Jp Calderone
On Mon, 03 Oct 2005 21:52:21 +0200, Jacob Kroon <[EMAIL PROTECTED]> wrote: >Hi, I'm having some problems with implementing dynamical module loading. >First let me >describe the scenario with an example: > >modules/ >fruit/ >__init__.py >apple.py >banana.py > >apple.py

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread Ron Adam
Steven D'Aprano wrote: > On Mon, 03 Oct 2005 06:59:04 +, Antoon Pardon wrote: > > x = 12.0 # feet > # three pages of code > y = 15.0 # metres > # three more pages of code > distance = x + y > if distance < 27: > fire_retro_rockets() > > And lo, one multi-billion dollar Mars lander starts

Re: Unicode charmap decoders slow

2005-10-03 Thread Martin v. Löwis
Tony Nelson wrote: > I had seen iconv. Even if my system supports it and it is faster than > Python's charmap decoder, it might not be available on other systems. > Requiring something unusual in order to do a trivial LUT task isn't an > acceptable solution. If I write a charmap decoder as an

Convert hex to string

2005-10-03 Thread Java and Swing
I have some output stored in a string that looks like.. >> x '\x01\xee\x1eo\xc3+\x8b\x83\xfad\xf6E\xaa\x0ea/I\x96\x83\xf5G\xa3\rQ\xfcH\xee\r' According to, http://docs.python.org/lib/typesseq-strings.html, this is "Unsigned Hexidecimal (lowercase)". How can I get this into normal Ascii so that

Re: Convert hex to string

2005-10-03 Thread jepler
it *is* a string. because most of the characters are not printable, they're presented using hex notation when you repr() the string. That's what entering an expression in the interactive interpreter does (except that it never prints 'None'). If you really want to write whatever those bytes are,

Re: Dynamical loading of modules

2005-10-03 Thread Carsten Haese
On Mon, 2005-10-03 at 15:52, Jacob Kroon wrote: > Hi, I'm having some problems with implementing dynamical module loading. > First let me > describe the scenario with an example: > > modules/ > fruit/ > __init__.py > apple.py > banana.py > > apple.py defines a class '

Re: Dynamical loading of modules

2005-10-03 Thread Carsten Haese
On Mon, 2005-10-03 at 16:41, Carsten Haese wrote: > On Mon, 2005-10-03 at 15:52, Jacob Kroon wrote: > > Hi, I'm having some problems with implementing dynamical module loading. > > First let me > > describe the scenario with an example: > > > > modules/ > > fruit/ > > __init__.py > >

Re: Reply-To header

2005-10-03 Thread Mike Meyer
Peter Decker <[EMAIL PROTECTED]> writes: > Setting the default Reply-To: to the list means that 'Reply' sends > just to the list (the desired behavior most of the time), and 'Reply > to all' sends 2 copies. No, it sends one copy to the list, and one copy to the original author. This is the behavio

Python Debug Build

2005-10-03 Thread Celine & Dave
Hi, What happens if I build Python with debug option (--with-pydebug)? Do I see any changes in my program output? What is --with-pydebug good for? Thanks. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- http://mail.p

Re: Convert hex to string

2005-10-03 Thread Larry Bates
It contains non-printing and non-ASCII characters so it can't be printed lie you want. The best Python can do is to show you the hexadecimal of those bytes (as it has done). Printable ASCII characters lie in the range 32 decimal (20 hex) to 125 decimal (7F hex). Those characters in that range ar

Re: Reply-To header

2005-10-03 Thread Mike Meyer
Roel Schroeven <[EMAIL PROTECTED]> writes: > Peter Decker wrote: >> Setting the default Reply-To: to the list means that 'Reply' sends >> just to the list (the desired behavior most of the time), and 'Reply >> to all' sends 2 copies. > The thing is: Reply-to has legitimate uses. I don't really unde

Re: Unicode charmap decoders slow

2005-10-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > I had seen iconv. Even if my system supports it and it is faster than > > Python's charmap decoder, it might not be available on other systems. > > Requiring something unusual in order to do

Re: question about smtplib

2005-10-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hey there, > > i am using the smtplib module in python 2.3 > > my question is, this works: > > server = smtplib.SMTP(localhost) > > then server.sendmail(to address, from address, message) > > > what i want to know is, how does the connection work? > > when i do ser

Re: Reply-To header

2005-10-03 Thread Roel Schroeven
Mike Meyer wrote: > Roel Schroeven <[EMAIL PROTECTED]> writes: > >>Peter Decker wrote: >> >>>Setting the default Reply-To: to the list means that 'Reply' sends >>>just to the list (the desired behavior most of the time), and 'Reply >>>to all' sends 2 copies. >> >>The thing is: Reply-to has legitim

Exception raising, and performance implications.

2005-10-03 Thread leo
Hello all - I was wondering about the performance implications of explicitly raising exceptions to get information about the current frame. Something like what the inspect module does, with: --- def currentframe(): """Return the frame object for the caller's stack frame.""" try: r

Re: Python based unacceptable language filter

2005-10-03 Thread Erik Max Francis
Andrew Gwozdziewycz wrote: > I think he may be referring to "bad" words, and 'filthy' language. At > least that's what i got from the question. > There are many PHP implementations on the web, which could be adapted > to python fairly easily. Most of which are probably not the most > ideal s

Re: Reply-To header

2005-10-03 Thread Roel Schroeven
Mike Meyer wrote: > Peter Decker <[EMAIL PROTECTED]> writes: > >>Setting the default Reply-To: to the list means that 'Reply' sends >>just to the list (the desired behavior most of the time), and 'Reply >>to all' sends 2 copies. > > > No, it sends one copy to the list, and one copy to the origin

Re: Dynamical loading of modules

2005-10-03 Thread Steve Holden
Carsten Haese wrote: > On Mon, 2005-10-03 at 16:41, Carsten Haese wrote: > >>On Mon, 2005-10-03 at 15:52, Jacob Kroon wrote: >> >>>Hi, I'm having some problems with implementing dynamical module loading. >>>First let me >>>describe the scenario with an example: >>> >>>modules/ >>>fruit/ >>>

Re: Will python never intend to support private, protected and public?

2005-10-03 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > If you have a java class instance with a private member that's (say) a > > network socket to a special port, access to the port is controlled > > entirely by that class. > > Are you sure? My understanding was that Java's introspection mechanism > could be

Re: Python Debug Build

2005-10-03 Thread Steve Holden
Celine & Dave wrote: > Hi, > > What happens if I build Python with debug option > (--with-pydebug)? Do I see any changes in my program > output? What is --with-pydebug good for? > It's used for debugging the Python interpreter itself. regards Steve -- Steve Holden +44 150 684 7255 +1

Re: Exception raising, and performance implications.

2005-10-03 Thread Paul Rubin
"leo" <[EMAIL PROTECTED]> writes: > I come from a java background, where Exceptions are a big Avoid Me, but > are the performance implications the same in Python? Well, you could measure it experimentally pretty easily, but anyway, Python exceptions are much less expensive than Java exceptions. -

Re: Exception raising, and performance implications.

2005-10-03 Thread jepler
As for performance, you'll need to benchmark it. However, I think the functionality you're asking for is available as inspect.currentframe(), and if the implementation is in "C" it may have a tiny performance advantage over the Python version. Jeff pgpENIs7apfaF.pgp Description: PGP signature -

Re: Exception raising, and performance implications.

2005-10-03 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "leo" <[EMAIL PROTECTED]> wrote: > Hello all - > > I was wondering about the performance implications of explicitly > raising exceptions to get information about the current frame. > Something like what the inspect module does, with: Python uses exceptions intern

Re: Reply-To header

2005-10-03 Thread Steve Holden
Roel Schroeven wrote: > Mike Meyer wrote: > >>Peter Decker <[EMAIL PROTECTED]> writes: >> >> >>>Setting the default Reply-To: to the list means that 'Reply' sends >>>just to the list (the desired behavior most of the time), and 'Reply >>>to all' sends 2 copies. >> >> >>No, it sends one copy to the

Re: PEP 350: Codetags

2005-10-03 Thread Magnus Lie Hetland
In article <[EMAIL PROTECTED]>, Terry Hancock wrote: [snip] >The <> terminator is evil. People will hate that. If there are no fields, >you should just be able to leave it off. This will have an additional >advantage in that many will already have compliant codetags if you leave >off this requirem

Re: Reply-To header

2005-10-03 Thread Mike Meyer
Roel Schroeven <[EMAIL PROTECTED]> writes: > Is that really the desired behaviour? IMO the least you can do if you're > searching for help is subscribing to the mailing list on which you're > looking for help. Me and many others don't like to receive replies > directly instead of via the mailing li

packaging a python project and associated graphics files

2005-10-03 Thread Rajarshi Guha
Hi, I've been trying to package a python project and I'm a little confused about how I distribute some PNG's that the program uses as icons. Using distutils I can set the data_files argument of setup() and get my data files located in, say, /usr/local/mydata. However when I write my code, it woul

Re: Will python never intend to support private, protected and public?

2005-10-03 Thread Mike Meyer
Paul Rubin writes: >> A couple of other things to think about: >> Are you sure you want to use the C++ model for privilege separation? > I'm not sure what you mean by the C++ model. If you mean the Java > model, as I keep saying, applet sandbox security relies on it, so

Re: question about smtplib

2005-10-03 Thread nephish
cool. so this line server = smtplib.SMTP(localhost) is when i connect ? i had my syntax wrong anyway, i was using server.close() instead of server.quit() thanks much -- http://mail.python.org/mailman/listinfo/python-list

Re: packaging a python project and associated graphics files

2005-10-03 Thread Mike Meyer
Rajarshi Guha <[EMAIL PROTECTED]> writes: > Hi, I've been trying to package a python project and I'm a little confused > about how I distribute some PNG's that the program uses as icons. > > Using distutils I can set the data_files argument of setup() and get my > data files located in, say, /usr/

Re: Reply-To header

2005-10-03 Thread sszmidt
On Monday 03 October 2005 11:50, Roel Schroeven wrote: > Peter Decker wrote: > Unfortunately AFAIK most of the popular mail clients don't offer a > 'Reply to list' button. Even mutt only offers that functionality of you Of course if you have kmail it has full list support and allows you to do tha

Re: Python Debug Build

2005-10-03 Thread sszmidt
On Monday 03 October 2005 17:41, Steve Holden wrote: > Celine & Dave wrote: > > Hi, > > > > What happens if I build Python with debug option > > (--with-pydebug)? Do I see any changes in my program > > output? What is --with-pydebug good for? > > It's used for debugging the Python interpreter itsel

Re: Exception raising, and performance implications.

2005-10-03 Thread jepler
On Mon, Oct 03, 2005 at 02:34:40PM -0700, leo wrote: > I come from a java background, where Exceptions are a big Avoid Me, but > are the performance implications the same in Python? We're expecting a > big load on our app (100,000 users/hour) , so we'd like to be as tuned > as possible. I don't kn

Re: packaging a python project and associated graphics files

2005-10-03 Thread Robert Kern
Rajarshi Guha wrote: > Hi, I've been trying to package a python project and I'm a little confused > about how I distribute some PNG's that the program uses as icons. > > Using distutils I can set the data_files argument of setup() and get my > data files located in, say, /usr/local/mydata. > > Ho

Re: Where to find python c-sources

2005-10-03 Thread Peter Hansen
Michael wrote: > John J. Lee wrote: >>You believe that Tor is dumb enough not to think of searching for >>"socketmodule.c" when, um, searching for socketmodule.c? > > He said he had tried google - OK, not in the first post but early in this > thread - I don't equate that with being dumb - just du

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread marduk
> egold = 0: > while egold < 10: > if test(): > ego1d = egold + 1 > Both pylint and pychecker pick this up. I wrapped the code in a function (to prevent importing from running in an infinite loop) and ran both pylint and pychecker: plyint: W: 5:myfunc: Unused variable 'ego1d' py

Re: Reply-To header

2005-10-03 Thread Andrew Gwozdziewycz
On Oct 3, 2005, at 7:10 PM, [EMAIL PROTECTED] wrote:On Monday 03 October 2005 11:50, Roel Schroeven wrote: Peter Decker wrote:Unfortunately AFAIK most of the popular mail clients don't offer a'Reply to list' button. Even mutt only offers that functionality of you Of course if you have kmail it has

Re: Will python never intend to support private, protected and public?

2005-10-03 Thread Bengt Richter
On 03 Oct 2005 14:45:43 -0700, Paul Rubin wrote: >Mike Meyer <[EMAIL PROTECTED]> writes: >> > If you have a java class instance with a private member that's (say) a >> > network socket to a special port, access to the port is controlled >> > entirely by that class. >> >

Thread's, async_chat and asyncore

2005-10-03 Thread Jos
Hello. I'm using the asyncore and _chat modules to create a network server. I also have, running in a separate thread(s), a "producer" which needs to "push" data onto the network connection(s). (This is all for a multi-player game server, so the threads would be individual games, that need to upda

Re: Thread's, async_chat and asyncore

2005-10-03 Thread Jos
Gaaa, i just did a run with 999 threads pushing data, and i'm getting "IndexError: deque" problems, so i'm guessing its _not_ thread safe... Bummer. jos -- http://mail.python.org/mailman/listinfo/python-list

help w/ simple GPIB prog.

2005-10-03 Thread whoopsi
Hi, Could someone give me some simple commands for communicating with GPIB devices. All I want is to aquire values from a multimeter/fiber optic attenuator/and a power meter. Nothing too complex. I was able to do so using Matlab (however, I was using the serail port) and communicating via SCPI l

help w/ simple GPIB prog.

2005-10-03 Thread whoopsi
Hi, Could someone give me some simple commands for communicating with GPIB devices. All I want is to aquire values from a multimeter/fiber optic attenuator/and a power meter. Nothing too complex. I was able to do so using Matlab (however, I was using the serail port) and communicating via SCPI l

Controlling who can run an executable

2005-10-03 Thread Cigar
I am developing a program for a client. She runs a shop where her clients bring in items for sale or short term buyback. Development of the program has been going great but she's mentioned that there is a 'feature' coming up in the next couple of weeks that she'd like me to implement that has me

Re: Controlling who can run an executable

2005-10-03 Thread Mike Meyer
"Cigar" <[EMAIL PROTECTED]> writes: > Now that I'm three months into the development of this program, my > client tells me she would like to protect her investment by preventing > her employees from doing the same to her. (Going to the competition > and using her program.) First thing to know; yo

Re: Controlling who can run an executable

2005-10-03 Thread Paul Rubin
"Cigar" <[EMAIL PROTECTED]> writes: > Now that I'm three months into the development of this program, my > client tells me she would like to protect her investment by preventing > her employees from doing the same to her. (Going to the competition > and using her program.) Exactly what is the thr

Re: help w/ simple GPIB prog.

2005-10-03 Thread Torsten Bronger
Hallöchen! "whoopsi" <[EMAIL PROTECTED]> writes: >Could someone give me some simple commands for communicating with > GPIB devices. If you find a file called visa32.dll on your system, you can just use . NI ships this file bundled with their GPIB hardware, and

Converting C++ array into Python

2005-10-03 Thread Deshdeep, Singh (IE10)
I am extending C++ application with python. I am not able to convert a C++ array in Python.   If anyone has the experience of the below :- 1)   How to handle the C++ array in the Python code and how to input that from the script ?   Awaiting for the solution   Regards DD  

semi-newbie module namespace confusion

2005-10-03 Thread pnau
I've stuck my neck out and am in the integration stage of a rather important project at my company, which wears dot net blinders. The program is not too big: I've cranked out 3K lines of code, quite a bit of which is unit tested, but my eyes are starting to glaze, and now I'm stuck (and not just m

Re: Python Debug Build

2005-10-03 Thread Fredrik Lundh
"Celine & Dave" wrote: > What happens if I build Python with debug option > (--with-pydebug)? Do I see any changes in my program > output? What is --with-pydebug good for? from the README: --with-pydebug: Enable additional debugging code to help track down memory management problems. T

Re: Controlling who can run an executable

2005-10-03 Thread Myles Strous
Mike Meyer wrote: > You don't need to install special hardware to get that. There are a > number of pieces of hardware that you can find in a modern computer > that may have a unique serial number you can use as a > dongle. Possibilities include a CPU serial number, an HD serial > number, and the

Re: Where to find python c-sources

2005-10-03 Thread Fredrik Lundh
Peter Hansen wrote: > Sorry, but this defense is less than weak. Using "python > socketmodule.c" you actually get the right answer as the third result, > while with the even-more-obvious-to-a-rookie "socketmodule.c" you get it > as the *first* result. using just "python" gives you a link to the

Re: question about smtplib

2005-10-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > cool. so this line > server = smtplib.SMTP(localhost) > is when i connect ? http://www.python.org/doc/lib/module-smtplib.html "If the optional host and port parameters are given, the SMTP connect() method is called with those parameters during initiali

Re: semi-newbie module namespace confusion

2005-10-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The main jist of the problem is that I'm trying add data from one > module to a list and a dictionary in another module, and it doesn't > seem to stick over there. > > The programs below seem to illustrate the issue. (The results follow > the programs). > Why are the re

Re: Background process for ssh port forwarding

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

Re: Recursive Property of Octal Numbers

2005-10-03 Thread Tim Roberts
James Stroud <[EMAIL PROTECTED]> wrote: > >I'm very curious about what is going on here. I'm sure my curiosity has >something to do with ignorance of some fundamental concept of computer >science (maybe that 8 is just a vertical infinity?): > >py> b = '\xb6' 8 doesn't have anything to do with it

Re: Controlling who can run an executable

2005-10-03 Thread Svennglenn
> What I want: > - the simplest thing that could possibly work! > Have the program check for a file hidden somewhere on the computer. For instance, if the file dummyfile.dll doesn't exist in the windows/system32 folder the program just doesn't start. And when you install the program on her compute

Re: question about smtplib

2005-10-03 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >cool. so this line >server = smtplib.SMTP(localhost) >is when i connect ? Use the source, Luke. Source code for every standard module is included on your hard disk. If you look in the __init__ for "class SMTP", your question will be answered. -- - Tim Roberts, [EMAIL

<    1   2