Re: How to get a unique id for bound methods?

2005-08-22 Thread Oren Tirosh
Russell E. Owen wrote: > I have several situations in my code where I want a unique identifier > for a method of some object (I think this is called a bound method). I > want this id to be both unique to that method and also stable (so I can > regenerate it later if necessary). >>> def persistent_

literal accented characters in python asp page with Microsoft IIS

2005-08-22 Thread nicolas_riesch
I try to use python as the language in an asp page with Microsoft IIS 5.0. I have these two files, req_bad.asp and req_ok.asp -- req_bad.asp - <[EMAIL PROTECTED]> <% # il y a un problème ici Response.write('Hello') %> - -- req_ok.asp --

Re: Jargons of Info Tech industry

2005-08-22 Thread Richard Bos
"jan V" <[EMAIL PROTECTED]> wrote: > > +---+ .:\:\:/:/:. > > | PLEASE DO NOT |:.:\:\:/:/:.: > > | FEED THE TROLLS | :=.' - - '.=: > > | | '=(\ 9 9 /)=' > > | Thank

Re: COM access sooo slow !?

2005-08-22 Thread nicolas_riesch
I also use Python to access database on Windows. You can speed up your program by doing that: Open PythonWin, then click on the "Tools" menu and the item "COM Makepy Utility". It will display all libraries available. Then, select "Microsoft ActiveX Data Objects 2.7 Library" or whatever last versio

Re: loop in python

2005-08-22 Thread Gregory Bond
km wrote: > Is python runtime slow at all aspects when compared to perl ? And in addition to all that everyone else has said most of this is startup time. The python interpreter is a fair bit slower to start up (i.e. does much more at startup time) than the perl one: > lenford$ time pyth

Eve from Adams' Ribs

2005-08-22 Thread Godwin
Dear Pythoneer, I'm thinking of making a class out of an rdbms table name(let's say oracle). I can dynamically query the column names and their datatypes from oracle. So at runtime can i create a class object that creates a class for example employee with methods that can manipulate that table

Re: Best way to 'touch' a file?

2005-08-22 Thread Fredrik Lundh
Peter Hansen wrote: > You've quoted selectively. He also said "Unix-style 'touch'", from > which one could quite legitimately infer nope. read his post again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sandboxes

2005-08-22 Thread 42
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 42 wrote: > > FWIW I've already given up on making python secure. I agree that odds > > are extremely high that I've missed something. I'm just curious to see > > what one of the holes I left is, preferably without wading through > > h

Re: up to date books?

2005-08-22 Thread Casey Hawthorne
Would you consider releasing an ebook in the mean time? [EMAIL PROTECTED] wrote: >Glad to hear that my efforts to cover some of 2.3's release features in >a mostly-2.2 book were appreciated. I'm probably going to do the same >thing for the 2nd edition of the Nutshell: wait until 2.5 alpha's out

Re: Python Light Revisted?

2005-08-22 Thread Tim Hoffman
Ramza Brown wrote: > Steve M wrote: > >> > Also, py2exe will work '100%' without a host python install. I have > never used it. I have my doubts though? > Yes it sure does. I have distributed at least 3 different standalone python programs using py2exe and I can absolutely garuntee that the

Re: Sandboxes

2005-08-22 Thread Leif K-Brooks
42 wrote: > FWIW I've already given up on making python secure. I agree that odds > are extremely high that I've missed something. I'm just curious to see > what one of the holes I left is, preferably without wading through > hundreds of pages :) f = [x for x in [].__class__.__bases__[0].__subc

Re: up to date books?

2005-08-22 Thread Steve Holden
[EMAIL PROTECTED] wrote: > One of my most popular talks is "re-learning Python" -- can be anywhere > between 1 and 4 hours, depending on level of detail -- it's all about > the changes 1.5.2 -> today's Python, why they came about and why you > would want to use them... > > > Alex > PyCon TX 2006

Re: Python Light Revisted?

2005-08-22 Thread Steve Holden
Bryan wrote: >>Someone recently produced a distribution capable of running from a CD >>and designed to make it easy to use Python on machines where it wasn't >>actually installed. That might be a useful starting point too, but I >>can't find the right incantation to get Google to bring it up. >>

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
> On the other hand, if you've already planned another pass over the code, that might be the time to look into this. Exactly. And when I do that pass I will definitely try buffering the data 10 or 100 meg at a time before entring the 1 char-at-a-time loop, or using mmap to similar ends. -- http:

Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
John Hunter wrote: >>"Robert" == Robert Kern <[EMAIL PROTECTED]> writes: > > Robert> Greg McIntyre wrote: > >> The 2nd option has real potential for me. Although the total > >> amount of code is greater, it factors out some complexity away > >> from the actual job, so that code

Re: Python Light Revisted?

2005-08-22 Thread Bryan
> Someone recently produced a distribution capable of running from a CD > and designed to make it easy to use Python on machines where it wasn't > actually installed. That might be a useful starting point too, but I > can't find the right incantation to get Google to bring it up. > > regards >

Re: up to date books?

2005-08-22 Thread aleaxit
One of my most popular talks is "re-learning Python" -- can be anywhere between 1 and 4 hours, depending on level of detail -- it's all about the changes 1.5.2 -> today's Python, why they came about and why you would want to use them... Alex -- http://mail.python.org/mailman/listinfo/python-lis

Re: up to date books?

2005-08-22 Thread aleaxit
Glad to hear that my efforts to cover some of 2.3's release features in a mostly-2.2 book were appreciated. I'm probably going to do the same thing for the 2nd edition of the Nutshell: wait until 2.5 alpha's out so I can mention _its_ feechurz in a mostly-2.4 book... meaning the 2nd ed of the Nuts

Re: while c = f.read(1)

2005-08-22 Thread John Hunter
> "Robert" == Robert Kern <[EMAIL PROTECTED]> writes: Robert> Greg McIntyre wrote: >> The 2nd option has real potential for me. Although the total >> amount of code is greater, it factors out some complexity away >> from the actual job, so that code is not obscured by >> un

Re: Best way to 'touch' a file?

2005-08-22 Thread Steve Holden
Peter Hansen wrote: > Fredrik Lundh wrote: > >>Peter Hansen wrote: >> >>>I guess it depends on whether "touch" implies creation-when-missing, as >>>with the command line version, or just updating the time. >> >>the OP wanted "to update the modification time of a file without actually >>modifying i

Re: loop in python

2005-08-22 Thread Terry Reedy
"Benjamin Niemann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > km wrote: > >> Hi all, >> >>> thing. If *all* your loops are going to do is print stuff, then you're >>> doing the right thing with the version that "emits values". >> >> ya most of the loops print values. > > In th

Re: Best way to 'touch' a file?

2005-08-22 Thread Peter Hansen
Fredrik Lundh wrote: > Peter Hansen wrote: >>I guess it depends on whether "touch" implies creation-when-missing, as >>with the command line version, or just updating the time. > > the OP wanted "to update the modification time of a file without actually > modifying it". os.utime does exactly tha

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Jim Washington
On Mon, 22 Aug 2005 22:12:25 +0200, Fredrik Lundh wrote: > however, running a tokenizer over the source string and rejecting any string > that contains unknown tokens (i.e. anything that's not a literal, comma, > colon, > or square or curly bracket) before evaluation might be good enough. > > (y

Re: Can I send files through xmlrpc connections?

2005-08-22 Thread Fredrik Lundh
"dcrespo" wrote: > I'm sorry, I didn't the right question... Of course that I can break > the file and rewrite it on an xmlrpc protocol for transmition, or send > a byte each time through the socket lib. I meant is there a program > already developed that sends and receives files based on xmlrpc c

Re: Jargons of Info Tech industry

2005-08-22 Thread Ulrich Hobelmann
Keith Thompson wrote: > "Xah Lee" <[EMAIL PROTECTED]> writes: > [the usual] At least he noticed that tar sucks. There's nothing better than tarring your backup back to disk, only to notice that the pathnames were "too long." Great! -- I believe in Karma. That means I can do bad things to pe

Re: X-Platform method of remote execution of Windows programs

2005-08-22 Thread utabintarbo
Well, I can do this using WMI thru VBScript for Windows-Windows connections. What I would like is a method using python for both Windows-Windows and Linux-Windows connections. I've looked at pyWMI (http://tgolden.sc.sabren.com/python/wmi.html), and found it unclear in it's dealings with remote boxe

Re: Best way to 'touch' a file?

2005-08-22 Thread Fredrik Lundh
Peter Hansen wrote: > And, depending on your needs, quite ineffective: > > >>> import os > >>> os.utime('missing.file', None) > Traceback (most recent call last): > File "", line 1, in ? > OSError: [Errno 2] No such file or directory: 'missing.file' > > >>> from path import path > >>> path('miss

Re: network programming

2005-08-22 Thread Tom Anderson
On Mon, 22 Aug 2005, Steve Holden wrote: > Tom Anderson wrote: > >> On Sun, 21 Aug 2005, John Walton wrote: >> >>> Hello, everyone. I just began school, and they already assigned us >>> science fair. Since I'm in 8th grade, I get to do demonstrations for our >>> projects. I'm probably going t

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Diez B. Roggisch
> Another thing you can do is use the compile message and then only allow > certain bytecodes. Of course this approach means you need to implement > this in a major version-dependent fashion, but it saves you the work of > mapping source code to python. Eventually there will be another form > ava

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Tom Anderson
On Mon, 22 Aug 2005, Grant Edwards wrote: > On 2005-08-22, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >>> Hi, I'm working on a project were a need to be able to upload firmware >>> to a microcontroller based Ethernet device. But because of the memory >>> constraints the controller can only handle

Re: Jargons of Info Tech industry

2005-08-22 Thread Keith Thompson
"jan V" <[EMAIL PROTECTED]> writes: >> +---+ .:\:\:/:/:. >> | PLEASE DO NOT |:.:\:\:/:/:.: >> | FEED THE TROLLS | :=.' - - '.=: >> | | '=(\ 9 9 /)=' >> | Thank you,

Re: Can I send files through xmlrpc connections?

2005-08-22 Thread dcrespo
I'm sorry, I didn't the right question... Of course that I can break the file and rewrite it on an xmlrpc protocol for transmition, or send a byte each time through the socket lib. I meant is there a program already developed that sends and receives files based on xmlrpc calls? Thanks. -- http:/

Re: Best way to 'touch' a file?

2005-08-22 Thread Peter Hansen
Fredrik Lundh wrote: > Peter Hansen wrote: >>from path import path >>path('myfile').touch() > > import os > os.utime('myfile', None) > > is a bit shorter, of course. And, depending on your needs, quite ineffective: >>> import os >>> os.utime('missing.file', None) Traceback (most recent call l

Re: How to print the name of a list?

2005-08-22 Thread oriana . falco
Wow, thanks.that's a neat little functionI'll still check out the dictionary stuff. For now, this helps a lot though... THANKS!!! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and the web

2005-08-22 Thread Terry Hancock
On Monday 22 August 2005 03:51 pm, Joe T. wrote: > 1. Is python something that you would recommend using for server side web > programming? Something like C# or Java? If so, are there any resources > that you could point me to that would help me with server side python > programming for dynamic h

Re: Sandboxes

2005-08-22 Thread 42
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 42 wrote: > > I was planning on "sanitizing" the language instead of relying on rexec > > and bastion so issues with them shouldn't be relevant. > > I think in dealing with security, deciding what might be relevant before > you fully u

Re: Jargons of Info Tech industry

2005-08-22 Thread Chris Hills
In article <[EMAIL PROTECTED]>, jan V <[EMAIL PROTECTED]> writes >> +---+ .:\:\:/:/:. >> | PLEASE DO NOT |:.:\:\:/:/:.: >> | FEED THE TROLLS | :=.' - - '.=: >> | | '=(\ 9 9 /)

Re: loop in python

2005-08-22 Thread Terry Reedy
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I agree that python emphasizes on readability which i didnt see in many > of the languages, but when the application concern is speed, does it > mean that python is not yet ready? even most of the googling abt python Funny you sh

Re: Well, another try Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
Steve Holden wrote: > Robert Kern wrote: >>Coincidentally, those are exactly the reasons why I posted it in the >>first place. I care not a whit about decluttering the newgroup, an >>impossible task. > > It's clear that you care not a whit about it. Unfortunately the only way > to preserve ban

Re: loop in python

2005-08-22 Thread Benjamin Niemann
km wrote: > Hi all, > >> thing. If *all* your loops are going to do is print stuff, then you're >> doing the right thing with the version that "emits values". > > ya most of the loops print values. In that case, you are interested in IO performance. The time spent handling the loop is not sign

Revised PEP 349: Allow str() to return unicode strings

2005-08-22 Thread Neil Schemenauer
[Please mail followups to [EMAIL PROTECTED] The PEP has been rewritten based on a suggestion by Guido to change str() rather than adding a new built-in function. Based on my testing, I believe the idea is feasible. It would be helpful if people could test the patched Python with their own applic

Re: Python and the web

2005-08-22 Thread Fredrik Lundh
"Joe T." wrote: > 2. I know there's a Jpython but what use would I get from using Python > with > Java? If I'm already familiar with Java programming why would I want to > use > Python with Java? see, e.g. http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html http://www.javaworld

Re: combining namespaces when importing two modules

2005-08-22 Thread Fredrik Lundh
Donnal Walter wrote: >I would like to be able to write something like: > > import dcw as dw > import xyz as dw > > such that the 'dw' namespace includes definitions from both dcw and xyz, > but in the script above names from dcw1 are lost. How can I combine the > two? (I'd rather not use 'import *'

Re: Sandboxes

2005-08-22 Thread Peter Hansen
42 wrote: > I was planning on "sanitizing" the language instead of relying on rexec > and bastion so issues with them shouldn't be relevant. I think in dealing with security, deciding what might be relevant before you fully understand the problem is somewhat premature... but it's your neck. :-)

Re: Best way to 'touch' a file?

2005-08-22 Thread Fredrik Lundh
Peter Hansen wrote: > from path import path > path('myfile').touch() import os os.utime('myfile', None) is a bit shorter, of course. >>> help(os.utime) Help on built-in function utime: utime(...) utime(path, (atime, utime)) utime(path, None) Set the access and modified time of the

Re: combining namespaces when importing two modules

2005-08-22 Thread Peter Hansen
Donnal Walter wrote: > I would like to be able to write something like: > > import dcw as dw > import xyz as dw > > such that the 'dw' namespace includes definitions from both dcw and xyz, > but in the script above names from dcw1 are lost. How can I combine the > two? (I'd rather not use 'impo

Re: loop in python

2005-08-22 Thread rafi
km wrote: > Also the first thing any newbie to python asks me is abt "raw speed > in comparison with similar languages like perl" when i advocate > python to perl. Always the same chorus... Just tell the newbies that speed is not on their top list. If most of the world's computer programs wh

Re: PIL: retreive image resolution (dpi)

2005-08-22 Thread Do Re Mi chel La Si Do
Hi ! The size of a image is an element ; but resolution is another. It is the link, between the image and the reality. Size AND resolution can to give the scale. Exemple : when you scan a document, the size (in pixels) is not sufficient, for to reproduce the document. Size + resolution, yes.

Re: Can I send files through xmlrpc connections?

2005-08-22 Thread Fredrik Lundh
"dcrespo" wrote: > ...If the answer is Yes, can you give me an example either in the > server side and the client side? > > I googled a lot, but I can't find nothing regarding this. the XML-RPC specification http://www.xmlrpc.com/spec mentions the following data types four-byte signed i

Re: loop in python

2005-08-22 Thread Peter Hansen
km wrote: >>thing. If *all* your loops are going to do is print stuff, then you're >>doing the right thing with the version that "emits values". > > ya most of the loops print values. No, you missed my point. I said if *all* the loops are going to do is print stuff. In other words, no other

Re: split function

2005-08-22 Thread rafi
Mohammed Altaj wrote: > Dear All > > What i want to do is , my input is like > 0 2 > 0 3 > 0 4 > 1 2 > 1 4 > 2 3 > 3 4 > > I am comparing and put the number in group , like ,the first three lines > , all has zero as first input for each line, so the out put should look > like > 0 2 3 4 > and so o

Python and the web

2005-08-22 Thread Joe T.
Hello group, I'm new to Python and have a couple of beginner questions that I'm hoping someone can answer. 1. Is python something that you would recommend using for server side web programming? Something like C# or Java? If so, are there any resources that you could point me to that would help m

Re: Jargons of Info Tech industry

2005-08-22 Thread Roedy Green
On 22 Aug 2005 11:43:09 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote or quoted : >the unix morons, think that the world should truncate lines just like >their incompetent operating system silently truncate lines (and it >still DOES, folks! e.g. ps, tar, tcsh.) Around 1998 when i was using >Outlook E

Re: loop in python

2005-08-22 Thread Bruno Desthuilliers
km a écrit : > Hi all, > > ya i am sorry i tried with an empty loop first and then one which emits a > value as the snippet. I have tested it on my machine and now ... > > 1) perl (v 5.8) does the job in 0.005 seconds > 2) but python (v 2.4.1) is horribly slow its 0.61 seconds. > and using ran

Re: split function

2005-08-22 Thread William Park
Mohammed Altaj <[EMAIL PROTECTED]> wrote: > > Dear All > > What i want to do is , my input is like > 0 2 > 0 3 > 0 4 > 1 2 > 1 4 > 2 3 > 3 4 > > I am comparing and put the number in group , like ,the first three lines > , all has zero as first input for each line, so the out put should look > li

Re: loop in python

2005-08-22 Thread Bill Mill
> If you want a fast language, try Holden. I've just invented it. > Unfortunately it gets the answer to every problem wrong unless the > answer is 42, but boy it runs quickly. +1 QOTW (sometimes the zen master has to whack the student on the head) Peace Bill Mill bill.mill at gmail.com -- http:

Re: loop in python

2005-08-22 Thread Steve Holden
km wrote: > Hi all, > > Why is it that the implementation of empty loop so slow in python when > compared to perl ? > > #i did this in python (v 1.5) > for x in xrange(1000): > print x > # this took 0.017 seconds > -- > #similar code in perl (v 5.6): > for $x (0..1

Can I send files through xmlrpc connections?

2005-08-22 Thread dcrespo
...If the answer is Yes, can you give me an example either in the server side and the client side? I googled a lot, but I can't find nothing regarding this. A lot of thanks. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a unique id for bound methods?

2005-08-22 Thread Fredrik Lundh
Russell E. Owen wrote: >>>The current issue is associated with Tkinter. I'm trying to create a tk >>>callback function that calls a python "function" (any python callable >>>entity). >>> >>>To do that, I have to create a name for tk that is unique to my python >>>"function". A hash-like name would

Re: Well, another try Re: while c = f.read(1)

2005-08-22 Thread Steve Holden
Robert Kern wrote: > Paul Rubin wrote: > >>Robert Kern <[EMAIL PROTECTED]> writes: >> >> >http://www.catb.org/~esr/faqs/smart-questions.html Is it a *smart* way or *necessary* way? >>> >>>It's the polite way. And probably the only way you're going to get >>>your questions actually ans

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Fredrik Lundh
Jim Washington wrote: > 4. List comprehensions might be troublesome, though it's not clear to me > how a DoS or exploit is possible with these. see item 1. > Or is eval() simply too evil? yes. however, running a tokenizer over the source string and rejecting any string that contains unknown t

Re: Jargons of Info Tech industry

2005-08-22 Thread Steve Holden
Rich Teer wrote: > On Mon, 22 Aug 2005, jan V wrote: > > >>Please don't use ASCII art... not everyone uses a fixed-width font for his >>newsreader... > > > Then I humbly submit thet they are using broken and/or badly > configured readers. ;-) > Not to mention the fact that if they

split function

2005-08-22 Thread Mohammed Altaj
Dear all Sorry , I confused between two things , what i said in the last e-mail i already managed to do using C code , But what i need to do using python is : my input data : 0 2 3 4 1 2 4 2 3 3 4 what i suppose to do is , using the first line and start searching number by number ,first i hav

Re: global interpreter lock

2005-08-22 Thread Michael Sparks
Paul Rubin wrote: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Even simpler to program in is the model used by Erlang. It's more CSP >> than threading, though, as it doesn't have shared memory as part of >> the model. But if you can use the simpler model to solve your problem >> - you probably shoul

Re: Jargons of Info Tech industry

2005-08-22 Thread Rich Teer
On Mon, 22 Aug 2005, jan V wrote: > Please don't use ASCII art... not everyone uses a fixed-width font for his > newsreader... Then I humbly submit thet they are using broken and/or badly configured readers. ;-) -- Rich Teer, SCNA, SCSA, OpenSolaris CAB member President, Rite Onli

Re: How to print the name of a list?

2005-08-22 Thread Tomi Kyöstilä
[EMAIL PROTECTED] wrote: > Hi! > > I was wondering what can I do to print the name of a list that is > inside a list. For example: > > > exported = ['123','456'] > imported = ['789','012'] > > client1 = ['cl1b','cl1a'] > client2 = ['cl2a','cl2b'] > > host = ['imported','exported'] > client = [

split function

2005-08-22 Thread Mohammed Altaj
Dear All What i want to do is , my input is like 0 2 0 3 0 4 1 2 1 4 2 3 3 4 I am comparing and put the number in group , like ,the first three lines , all has zero as first input for each line, so the out put should look like 0 2 3 4 and so on 1 2 4 2 3 3 4 I managed to do what i need , but i

Re: Jargons of Info Tech industry

2005-08-22 Thread jan V
> +---+ .:\:\:/:/:. > | PLEASE DO NOT |:.:\:\:/:/:.: > | FEED THE TROLLS | :=.' - - '.=: > | | '=(\ 9 9 /)=' > | Thank you, | ( (_) ) >

combining namespaces when importing two modules

2005-08-22 Thread Donnal Walter
I would like to be able to write something like: import dcw as dw import xyz as dw such that the 'dw' namespace includes definitions from both dcw and xyz, but in the script above names from dcw1 are lost. How can I combine the two? (I'd rather not use 'import *'.) Thanks. Best regards, Donnal

Re: Jargons of Info Tech industry

2005-08-22 Thread Keith Thompson
"Xah Lee" <[EMAIL PROTECTED]> writes: [the usual] +---+ .:\:\:/:/:. | PLEASE DO NOT |:.:\:\:/:/:.: | FEED THE TROLLS | :=.' - - '.=: | | '=(\ 9 9 /)=' | Thank you,

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Scott David Daniels
Diez B. Roggisch wrote: >> Does anyone know of any other "gotchas" with eval() I have not found? Or >> is eval() simply too evil? > > > Yes - and from what I can see on the JSON-Page, it should be _way_ > easier to simply write a parser your own - that ensures that only you > decide what pytho

Re: Decorator and Metaclasses Documentation

2005-08-22 Thread Bruno Desthuilliers
Mike C. Fletcher a écrit : > bruno modulix wrote: > >> Mike C. Fletcher wrote: >> (snip) >> >> >>> Though the don't go into extreme detail on decorators (they are >>> basically syntactic sugar for a particular type of descriptor). >>> >>> >> >> Err... Could you elaborate on this ? Decorators

Re: Error with Python

2005-08-22 Thread Scott David Daniels
Robert wrote: > Hello > > I have created a tool in Python 2.3 under WinXP > Now I extended this tool and now my tool makes Python crash. I see Dr Watson > showing a stacktrace. > This tool also uses wxPython. > > Dr Watson says: > AppName: python.exe > AppVer: 0.0.0.0 > ModName: python23.dll > Mo

Re: Creating anonymous functions using eval

2005-08-22 Thread Julian Smith
On 12 Jul 2005 08:28:45 -0700 "Devan L" <[EMAIL PROTECTED]> wrote: [ here's some context: > > I've been playing with a function that creates an anonymous function by > > compiling a string parameter, and it seems to work pretty well: > > > > def fn( text): > > exec 'def foo' + text.st

Re: Reg Python Byte code

2005-08-22 Thread Scott David Daniels
Warning: this post contains arcane knowledge. Steve Holden wrote: > praba kar wrote: >> Python 2.3 creates byte code with *.pyc >> extention. But Python 2.4 creates bytes code with >> *.pyo. Is there any difference between *.pyc >> and *.pyo?. >> > Yes. The .pyo files are optimized by remo

Re: Jargons of Info Tech industry

2005-08-22 Thread Xah Lee
Unix, RFC, and Line Truncation [Note: unix tradition requires that a return be inserted at every 70 characters in email messages or so so that each line are less than 80 characters. Unixers made this as a requirement into an RFC document.] Xah Lee, 20020511 This truncation of lines business is a

Re: while c = f.read(1)

2005-08-22 Thread Donn Cave
Before leaving this topic, I wanted to make a rare visit to the ruins of Google's USENET archive and pull out this giant post on the subject of True and False, when they were being considered for adoption into Python. There is some stuff to ignore, where she addresses questions that didn't go anyw

setup install question

2005-08-22 Thread David Pratt
I have two versions of python running - 2.4.1 and 2.3.5. Python 2.4.1 is most current and will execute from 'python' at command line where 2.3.5 will execute from 'python2.3'. A recent problem I have is installing rdflib. It installed and works fine on 2.4.1. rdflib uses 'python setup insta

Re: Sandboxes

2005-08-22 Thread 42
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 42 wrote: > > Or is this a hopeless cause? > > > > Finally, either way, would anyone recommend a different script engine > > that might be more suitable for what I'm trying to accomplish that I > > might not have looked at. I don't nee

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
yeah, i didn't mean running python on the HC12 but using compiled python on a ARM7 or simular would be nice. There was a project for embedded python but it seems to have died. Yeah i've been thinking about using UDP but then i would have to impliment checksums and having a reliable way to send and

Weekly Python Patch/Bug Summary

2005-08-22 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 352 open ( +0) / 2898 closed ( +2) / 3250 total ( +2) Bugs: 926 open (+13) / 5177 closed (+15) / 6103 total (+28) RFE : 190 open ( -1) / 179 closed ( +1) / 369 total ( +0) New / Reopened Patches __ fix smtpl

Re: Sandboxes

2005-08-22 Thread 42
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 42 wrote: > > But for what its worth, I *am* curious what sorts of holes persist. I > > did try googling the archives, but with no idea what I'm looking for -- > > python security brings up a mess of unrelated issues... Python in > > A

Re: while c = f.read(1)

2005-08-22 Thread Mike Meyer
"Greg McIntyre" <[EMAIL PROTECTED]> writes: > My files are large, hence 1 character at a time, not f.read(). There are alternatives between the two. You could read in a chunk of reasonable size for your platform. Say 10meg on a recent workstation, or 100meg on a current workstation. > This is cod

Re: global interpreter lock

2005-08-22 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Sat, 20 Aug 2005 22:30:43 -0400, Mike Meyer <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: >> with these issues. If I ever find myself having to have non-trivial >> threads again, I'll check the state of the threading models in

Re: global interpreter lock

2005-08-22 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Even simpler to program in is the model used by Erlang. It's more CSP >> than threading, though, as it doesn't have shared memory as part of >> the model. But if you can use the simpler model to solve your pro

Re: How to print the name of a list?

2005-08-22 Thread Lonnie Princehouse
In general, no --- there is no unique mapping between references and names. For debugging, however, it is sometimes useful to try this kind of reverse lookup by iterating over the global dictionary: def guess_name(thing): for name, reference in globals.iteritems(): if thing is referen

Re: network programming

2005-08-22 Thread Irmen de Jong
John Walton wrote: > Hello, everyone. I just began school, and they > already assigned us science fair. Since I'm in 8th > grade, I get to do demonstrations for our projects. > I'm probably going to demonstrate Python's networking > capabilities by writing a simple instant messenger > program.

Re: PIL: retreive image resolution (dpi)

2005-08-22 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > >> I looked at the PIL Image class but cannot see a posibility to retreive >> the image resolution dots per inch (or pixels per inch) > > Not all formats provide a DPI value; since PIL doesn't do anything wit

Re: loop in python

2005-08-22 Thread Bill Mill
They come out even in the computer language shootout: http://shootout.alioth.debian.org/benchmark.php?test=all&lang=python&sort=fullcpu (tied 8-8 in execution time, although perl wins 4-12 on memory consumption) Peace Bill Mill On 8/23/05, km <[EMAIL PROTECTED]> wrote: > Hi all, > > > thing.

Re: Running multiple console processes and watching their output

2005-08-22 Thread Diez B. Roggisch
Yoav wrote: > I need to run multiple console apps in the background and to watch their > output. I have no idea if this is possible, and I don't even know where > to start looking. The processes are watchers, meaning that they watch > folders and mail boxes and do operations on items in them . E

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Diez B. Roggisch
> Does anyone know of any other "gotchas" with eval() I have not found? Or > is eval() simply too evil? Yes - and from what I can see on the JSON-Page, it should be _way_ easier to simply write a parser your own - that ensures that only you decide what python code gets called. Diez _ -- http:

Re: can I delete one of *.py *.pyc *.pyo in /usr/lib/python2.3 ?

2005-08-22 Thread Scott David Daniels
Magnus Lycka wrote: > If you remove all *.pyc and *.pyo, they will be regenerated as needed. > If your code only uses a small fraction of the standard library, you > will save quite some space here. The only reason they are generated on > installation is to save some runtime on first use of a modul

Re: How to get a unique id for bound methods?

2005-08-22 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) wrote: >On Fri, 19 Aug 2005 16:33:22 -0700, "Russell E. Owen" <[EMAIL PROTECTED]> >wrote: >[...] >> >>The current issue is associated with Tkinter. I'm trying to create a tk >>callback function that calls a python "function" (any

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Nick Craig-Wood
Grant Edwards <[EMAIL PROTECTED]> wrote: > You have no control over packet size in TCP if you use the > normal socket interface. About the only thing you can to is > put delays between calls to send() in hope that the TCP stack > will send a packet. You can set the MTU (maximum transfer unit)

Re: loop in python

2005-08-22 Thread km
Hi all, > thing. If *all* your loops are going to do is print stuff, then you're > doing the right thing with the version that "emits values". ya most of the loops print values. > know this). Since you haven't got any working code, it's not possible > that you *need* whatever negligible spee

Re: loop in python

2005-08-22 Thread Terry Reedy
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ya i am sorry i tried with an empty loop first and then one which emits > a value as the snippet. I have tested it on my machine and now ... > > 1) perl (v 5.8) does the job in 0.005 seconds > 2) but python (v 2.4.1) is horribly

Re: split function

2005-08-22 Thread Peter Hansen
Mohammed Altaj wrote: > I am reading data from file using readlines() to list , my question > is how to deal with space between any two numbers , I mean , my data What do you mean by "deal with"? Please describe the input and the desired output, or what operations you are trying to perform,

How to print the name of a list?

2005-08-22 Thread oriana . falco
Hi! I was wondering what can I do to print the name of a list that is inside a list. For example: exported = ['123','456'] imported = ['789','012'] client1 = ['cl1b','cl1a'] client2 = ['cl2a','cl2b'] host = ['imported','exported'] client = ['client1','client2'] list = ['host', 'client'] My g

Re: loop in python

2005-08-22 Thread Peter Hansen
km wrote: > ya i am sorry i tried with an empty loop first and then one which > emits a value as the snippet. I have tested it on my machine > and now ... > > what more do i need to accept python is slow when it comes to > loops concept ? You've sort of missed some of the points being made,

Re: Python for Webscripting (like PHP)

2005-08-22 Thread Simon Brunning
On 22 Aug 2005 09:16:41 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > > (Python has even been told to be used by Yahoo! and Google, among others, > > > but nobody was able to demonstrate this, so far) > > hint: > > http://mail.google

  1   2   >