Re: pythonXX.dll size: please split CJK codecs out

2005-08-22 Thread Thomas Heller
Martin v. Löwis [EMAIL PROTECTED] writes: Ron Adam wrote: I would put the starting minimum boundary as: 1. The minimum required to start the python interpreter with no additional required files. Currently python 2.4 (on windows) does not yet meet that guideline, so it seems some

Re: Decorator and Metaclasses Documentation

2005-08-22 Thread Michele Simionato
There are also my lectures at Oxford: http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Network Programming Information

2005-08-22 Thread Alessandro Bottoni
John Walton wrote: Hello. It's me again. Thanks for all the help with the Python Networking Resources, but does anyone know what I'll need to know to write a paper on Network Programming and Python. Like terminology and all that. Maybe I'll have a section on socketets, TCP, Clients (half

Re: pythonXX.dll size: please split CJK codecs out

2005-08-22 Thread Martin v. Löwis
Thomas Heller wrote: That seems to be true. But it will need zlib.pyd as soon if you try to import from compressed zips. So, zlib can be thought as part of the modules required for bootstrap. Right. OTOH, linking zlib to pythonXY means that you cannot build Python at all anymore unless you

Running multiple console processes and watching their output

2005-08-22 Thread Yoav
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 . Essentially these

Re: Uploading images to imageshack.us with Python

2005-08-22 Thread Ricardo Sanchez
Ok, I solved it with the unvaluable help of a nice guy in the #python channel. It is a studid as it gets, replaced files = [('fileupload', 'b.jpg', open('b.jpg').read())] by files = [('fileupload', 'b.jpg', open('b.jpg', 'rb').read())] because binary files are not opened correctly in Windows

Re: Decorator and Metaclasses Documentation

2005-08-22 Thread bruno modulix
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 are syntactic sugar for function wrapping, while descriptors are a 'protocol' to hook

Re: Uploading images to imageshack.us with Python

2005-08-22 Thread Yoav
I would love a script to upload images to Imageshack.us. Any chance you can post the latest version or email it to me? Thanks. Ricardo Sanchez wrote: I forgot to add that I'm behind a proxy, but I think that is irrelevant. If you are not behind a proxy replace this line: print

Re: network programming

2005-08-22 Thread Tom Anderson
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 to demonstrate Python's networking capabilities by writing a simple instant

Re: win32 - associate .pyw with a file extension...

2005-08-22 Thread Alessandro Bottoni
[EMAIL PROTECTED] wrote: Hello! I'm trying to associate a file extension to my wxPython script so that all I have to do is double click on the file and my python script will load up with the path of that file. For instance, I've associated all .py files to be opened up with emacs.exe.

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
On Sun, 21 Aug 2005 08:09:55 +0100, m7b52000 oh_no_you_don'[EMAIL PROTECTED] wrote: It is proving most difficult in Python. How do I pass the .get() values to my calculating function? Do I use the command option for each slider? e.g command = Calc(a.get()). Obviously not cos it doesn't

Re: Problem (or even bug?) with Tkinter

2005-08-22 Thread Matt Hammond
A fix for this has just been pointed out to me (by Reinhard Max): quote I've seen problems with non-working entry and text widgets on SUSE Linux when Tk is used with the SCIM input manager. Could you please check whether the XMODIFIERS variable exists in the environment of your Tk process? If

Re: while c = f.read(1)

2005-08-22 Thread Antoon Pardon
Op 2005-08-19, Donn Cave schreef [EMAIL PROTECTED]: In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: ... But '', {}, [] and () are not nothing. They are empty containers. Oh come on, empty is all about nothing. No it is not. There are situation where False or None

PIL: retreive image resolution (dpi)

2005-08-22 Thread AlexGreif . 2609394
Hi, I looked at the PIL Image class but cannot see a posibility to retreive the image resolution dots per inch (or pixels per inch) Could somebody please tell me how to get these metadata infos in PIL? thanks, Alex. -- http://mail.python.org/mailman/listinfo/python-list

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

2005-08-22 Thread Magnus Lycka
Miernik wrote: I noticed that all those files come in three flavours: *.py *.pyc *.pyo Is it possible that only one flavour of these files is needed, and I can delete the remaining two, any my Python installation will still work? If you remove all *.pyc and *.pyo, they will be regenerated

Re: Sandboxes

2005-08-22 Thread Magnus Lycka
42 wrote: Fair enough. I'm more or less ready to 'give up' on this fantasy of python in a sandbox. I'll either use something else, or just accept the risk. :) But is the scripting language interpreter the right place to put this? After all, any most languages would allow you to write

Re: Sandboxes

2005-08-22 Thread 42
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Clearly, Pyton does not directly offer any kind of useful security sandbox capability, but since Java does, I suppose JPython is an option. I know there are a lot of downsides to JPython, but it should be a genuine solution to the

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
Okay, the 1st option seems more complicated and the 2nd option, while simpler to my eye makes me worry about file descriptors, resource management and memory running out. My files are large, hence 1 character at a time, not f.read(). This is code from another employee and I'm just in the stages

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
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 unnecessary compexity. IMHO that's great practice. I like it! Thank you! The assurance that the code was clear was good

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
Donn Cave wrote: Actually I'd make it a little less compact -- put the break on its own line -- but in any case this is fine. It's a natural and ordinary way to express this in Python. ... | But I get a syntax error. | | while c = f.read(1): |^ | SyntaxError: invalid

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
I've always accepted the None vs. 0 as a cavaet of the added convenience but I think it's ultimately worth it. Sorry, I didn't want to start a nothing values evaluate to false argument. I'll go read python-dev archives a bit and see if there's anything useful for me to know. Thanks --

Re: while c = f.read(1)

2005-08-22 Thread Paul Rubin
Greg McIntyre [EMAIL PROTECTED] writes: while c = f.read(1): # ... I couldn't find any general PEPs along these lines, only specific ones (e.g. 308 re. an if-then-else expression). I often end up doing something like this: class foo: def set(self, x): self.x = x

Re: PEP: Generalised String Coercion

2005-08-22 Thread wolf
hi, i guess that anyone reading this pep will agree that *something* must be done to the state of unicode affairs in python. there are zillions of modules out there that have str() scattered all over the place, and they all *break* on the first mention of düsseldorf... i'm not quite sure myself

regular expressions use

2005-08-22 Thread max(01)*
hi everyone. i would like to do some uri-decoding, which means to translate patterns like %2b/dhg-%3b %7E into +/dhg-; ~: in practice, if a sequence like %2b is found, it should be translated into one character whose hex ascii code is 2b. i did this: ... import re import sys modello =

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
John Machin wrote: Is some way to make this code more compact and simple? It's a bit spaghetti. Not at all, IMHO. This is a simple forward-branching exit from a loop in explicable circumstances (EOF). It is a common-enough idiom that doesn't detract from readability understandability.

Reg Python Byte code

2005-08-22 Thread praba kar
Dear All, 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?. Actually After python compiled a program then that program will run from the *.pyc byte code. If I delete that byte code what

Re: regular expressions use

2005-08-22 Thread Peter Otten
max(01)* wrote: would like to do some uri-decoding, which means to translate patterns like %2b/dhg-%3b %7E into +/dhg-; ~: in practice, if a sequence like %2b is found, it should be translated into one character whose hex ascii code is 2b. i did this: ... import re import sys

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
That is both clever and useful! I never would have thought of doing that. This seems to me like a general way to workaround the Python statement/expression separation woes I've been having, in cases where I really really want it. Now, where can I copy this out to so I will be able to find it

Re: while c = f.read(1)

2005-08-22 Thread Robert Kern
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 unnecessary compexity. IMHO that's great practice. Please quote the message you are replying

Re: PIL: retreive image resolution (dpi)

2005-08-22 Thread and-google
[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 with DPI it's not part of the main interface. For PNG and JPEG at least

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: On Sun, 21 Aug 2005 08:09:55 +0100, m7b52000 oh_no_you_don'[EMAIL PROTECTED] wrote: It is proving most difficult in Python. How do I pass the .get() values to my calculating function? Do I use the command option for each slider? e.g command = Calc(a.get()).

sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
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 packages of 300 bytes each time. So therefore the firmware file must be sent in chunks and i need a header in each

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
On Mon, 22 Aug 2005 12:16:01 +0100, m7b52000 [EMAIL PROTECTED] wrote: command = lambda : Calc(a.get()) I get the following message when I use lambda as above: TypeError: lambda() takes no arguments (1 given) Oops, forgot! The Scale widget outputs a single argument - the value of the

Re: Python for Webscripting (like PHP)

2005-08-22 Thread Fredrik Lundh
Alessandro Bottoni wrote: (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.com/support/bin/answer.py?answer=6554 /F -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: On Mon, 22 Aug 2005 12:16:01 +0100, m7b52000 [EMAIL PROTECTED] wrote: command = lambda : Calc(a.get()) I get the following message when I use lambda as above: TypeError: lambda() takes no arguments (1 given) Oops, forgot! The Scale widget outputs a single

Re: Reg Python Byte code

2005-08-22 Thread Magnus Lycka
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?. Since way back, ordinary Python bytecode uses .pyc, and optimized Python bytecode (python -O) uses .pyc. This has nothing

Re: Reg Python Byte code

2005-08-22 Thread Steve Holden
praba kar wrote: Dear All, 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 removing certain features that aren't essential to execution (things

Re: regular expressions use

2005-08-22 Thread Paul McGuire
Perhaps a bit more verbose than your Perl regexp, here is a decoder using pyparsing. -- Paul # download pyparsing at http://pyparsing.sourceforge.net from pyparsing import Word,Combine # define grammar for matching encoded characters hexnums = 0123456789ABCDEFabcdef encodedChar = Combine( % +

Re: while c = f.read(1)

2005-08-22 Thread Steve Holden
Antoon Pardon wrote: Op 2005-08-19, Donn Cave schreef [EMAIL PROTECTED]: In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: ... But '', {}, [] and () are not nothing. They are empty containers. Oh come on, empty is all about nothing. No it is not. There are situation

Re: regular expressions use

2005-08-22 Thread Fredrik Lundh
max(01)* [EMAIL PROTECTED] wrote: i would like to do some uri-decoding, which means to translate patterns like %2b/dhg-%3b %7E into +/dhg-; ~ import urllib urllib.unquote(%2b/dhg-%3b %7E) '+/dhg-; ~' /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dutch

2005-08-22 Thread Sybren Stuvel
Sybren Stuvel enlightened us with: I'd suggest learning English. The programming language is based on English anyway. Besides, everybody in The Netherlands learns English at school. Sorry, not a really helpful answer. There is plenty of docs in Dutch, which is of no surprise since Python's

Re: while c = f.read(1)

2005-08-22 Thread Steve Holden
Greg McIntyre wrote: John Machin wrote: Is some way to make this code more compact and simple? It's a bit spaghetti. Not at all, IMHO. This is a simple forward-branching exit from a loop in explicable circumstances (EOF). It is a common-enough idiom that doesn't detract from readability

Re: Python dutch

2005-08-22 Thread Harald Massa
Sybren Stuvel , I'd suggest learning English. The programming language is based on English anyway. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. To be even more exact, it would help to learn or even be

Re: network programming

2005-08-22 Thread Steve Holden
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 to demonstrate Python's networking capabilities by writing

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
A. Partial success with : command = Calc. A slider will now pass its argument to a function without problem. My Calc function however is expecting 3 arguments - 1 from each slider i.e moving any of the 3 sliders should cause a recalculation. I am now getting the following error:

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: A. Partial success with : command = Calc. A slider will now pass its argument to a function without problem. My Calc function however is expecting 3 arguments - 1 from each slider i.e moving any of the 3 sliders should cause a recalculation. I am now getting the

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread 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 packages of 300 bytes each time. So therefore the firmware file must be sent in

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Magnus Lycka
Magnus Lycka wrote: header_template = 'Chunk %05i, %03i bytes' BTW, if the header is binary, you probably want to have a look at the struct module. http://docs.python.org/lib/module-struct.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with wxPython 2.6.1

2005-08-22 Thread Vadimir
apt-get install alien apt-get install libgtk2.0-dev freeglut3-dev python2.3-dev wget http://voxel.dl.sourceforge.net/wxpython/wxPython2.6-2.6.1.0-1.src.rpm rpmbuild --rebuild --define 'pyver 2.3' wxPython2.6-2.6.1.0-1.src.rpm cd rpmdir alien *py2.3* dpkg -i *py2.3*.deb --

Re: Problem with wxPython 2.6.1

2005-08-22 Thread Vadimir
http://www.lind-beil.net/pyped/ look here, there are binary packages for ubuntu -- http://mail.python.org/mailman/listinfo/python-list

Re: while c = f.read(1)

2005-08-22 Thread Antoon Pardon
Op 2005-08-22, Steve Holden schreef [EMAIL PROTECTED]: Greg McIntyre wrote: John Machin wrote: Is some way to make this code more compact and simple? It's a bit spaghetti. Not at all, IMHO. This is a simple forward-branching exit from a loop in explicable circumstances (EOF). It is a

Re: while c = f.read(1)

2005-08-22 Thread Antoon Pardon
Op 2005-08-22, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-08-19, Donn Cave schreef [EMAIL PROTECTED]: In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: ... But '', {}, [] and () are not nothing. They are empty containers. Oh come on, empty is all

Using Signal Handler to timeout an rsh call

2005-08-22 Thread rh0dium
Hi all, I don't understand the signal module. I guess I understand what it does in principle but I can't figure out how to use it to timeout an external rsh command after a 5 seconds. Does anyone know how to do this. Here is what I have so far - which is largely based on the example on the man

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
On 2005-08-22, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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 packages of 300 bytes each time. So therefore the

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Benji York
Jim Washington wrote: I'm still working on yet another parser for JSON (http://json.org). Hi, Jim. The only problem is, it uses eval(). It's important to sanitize the incoming untrusted code before sending it to eval(). Does anyone know of any other gotchas with eval() I have not found? Or

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
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 packages of 300 bytes each time. So therefore the

loop in python

2005-08-22 Thread km
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..1000) { print $x; } # this took

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
aaah, well i believe that in Windows XPSP2 has disabled raw socket support (yes i sadly have to use windows) so that's no option. But I'll try to put a time delay and check what happens. Or otherwise perhaps i could do a socket.close each time, but that's a terrible waste of packets. --

Re: loop in python

2005-08-22 Thread Rick Wotnaz
km [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: 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

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Grant Edwards
On 2005-08-22, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: aaah, well i believe that in Windows XPSP2 has disabled raw socket support (yes i sadly have to use windows) so that's no option. But I'll try to put a time delay and check what happens. Or otherwise perhaps i could do a socket.close

Error with Python

2005-08-22 Thread Robert
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 ModVer: 2.3.5150.1012 Offset: 0003736a

Re: Sandboxes

2005-08-22 Thread Peter Hansen
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 Apache, rexec/bastion stuff, xss, issues with infinite loops and many

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Richard Brodie
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's very probable that the TCP stack will combine chunks and send out full Ethernet frames (4K bytes). You're probably going to have to either put a time delay in the loop, or wait for each chunk to be acknowledged

Re: loop in python

2005-08-22 Thread bruno modulix
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) Python 1.5.2 was released in april 1999. Current Python version is 2.4.1. Please consider upgrading - unless of course you just want to troll...

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread A.M. Kuchling
On Mon, 22 Aug 2005 13:55:45 GMT, Jim Washington [EMAIL PROTECTED] wrote: I'm still working on yet another parser for JSON (http://json.org). See http://python.ca/nas/log/200507/index.html#21_001 for another parser. I don't know if it uses eval() or not, but would bet on not because

Re: while c = f.read(1)

2005-08-22 Thread Magnus Lycka
Antoon Pardon wrote: Python doesn't guess. There are a range of values that will be treated, in a Boolean context (how perlish) as equivalent to False. Yes it does. No it doesn't! Python has no way to know what would be the most usefull Boolean interpretation of these values in a

60 GB IPOD deal found

2005-08-22 Thread spiglitz
I just completed this offer for a 60 gb photo ipod and it is awesome! My friend got one from it and he is waving it in my face and taunting me! Anyways, all you have to do is complete a promotion offer and cancel it before the 30 days trial is up and then get 8 referrals. It is so cool. Check it

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
I'm going to try the timed wait alternative, if i get it the application to work properly i'll post the results in this group and the code if anyone want's it. It's such a contrast to code a tcp-server for the microcontroller (MC9S12NE64) in C and coding in python :-) I really hope embedded python

Re: loop in python

2005-08-22 Thread Daniel Dittmar
km wrote: Why is it that the implementation of empty loop so slow in python when compared to perl ? [...] Is python runtime slow at all aspects when compared to perl ? No I really wonder what makes python slower than perl ? It could be that the Perl compiler recognizes such a for loop

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm going to try the timed wait alternative, if i get it the application to work properly i'll post the results in this group and the code if anyone want's it. It's such a contrast to code a tcp-server for the microcontroller (MC9S12NE64) in C and coding in python :-)

Re: loop in python

2005-08-22 Thread D H
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..1000) {

Re: Decorator and Metaclasses Documentation

2005-08-22 Thread Mike C. Fletcher
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 are syntactic sugar for function wrapping, while

Re: loop in python

2005-08-22 Thread km
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 range() instead of xrange() in

split function

2005-08-22 Thread Mohammed Altaj
Hi All 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 looks like 1 3 3 4 5 2 6 1 I tried to with my data as it, but i couldn't , so i removed the spaces 13 34 52 61 But when i deal with large number

Re: Sandboxes

2005-08-22 Thread D H
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 need much; it needs to work with C#, and be able to easily interact with

Re: Python for Webscripting (like PHP)

2005-08-22 Thread Paul Rubin
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.com/support/bin/answer.py?answer=6554 I don't see anything about Python at that url. I've heard

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,

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

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

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 slow

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 speed

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

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

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

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

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 .

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=alllang=pythonsort=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. If

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

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

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

Re: global interpreter lock

2005-08-22 Thread Mike Meyer
Paul Rubin http://[EMAIL PROTECTED] 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 problem -

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 other

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 code

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

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

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

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 need much; it

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

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

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

  1   2   >