Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Steve Holden
Peter Hansen wrote: > Steve Holden wrote: > >>Fredrik Lundh wrote: >> >>>Steve Holden wrote: >>> >Can you tell me what to look for in an HTTPMessage that is an error? I >have looked at the header objects and I cannot determine an error >message. I was thinking of a number bet

Re: Python or Java or maybe PHP?

2006-01-11 Thread Steve Holden
Peter Hansen wrote: > Alex Martelli wrote: > >>One great programming principle is "Dont' Repeat Yourself": when you're >>having to express the same thing over and over, there IS something >>wrong. I believe the "DYR" phrasing is due to the so-called Pragmatic >>Programmers, who are paladins of Ru

Re: Help wanted with md2 hash algorithm

2006-01-11 Thread wjb131
Tom Anderson wrote: > On Sun, 8 Jan 2006, Tom Anderson wrote: > > > On Fri, 6 Jan 2006 [EMAIL PROTECTED] wrote: > > > >> below you find my simple python version of MD2 algorithm as described > >> in RFC1319 (http://rfc1319.x42.com/MD2). It produces correct results > >> for strings shorter than 16

Re: Python Scripts to logon to websites

2006-01-11 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Only if the userid and password are part of the content. If you're > doing the usual form-based authentication, then they are. If you're > doing an HTTP-based authentication, then they aren't - the > authentication information is in the headers, and can be p

Re: How to create a script that list itself ?

2006-01-11 Thread Mike Meyer
Tim Roberts <[EMAIL PROTECTED]> writes: > It was pointed out to me that the shortest Python program which produces > itself on stdout is: > -- Which, oddly enough, is also the shortest shell program that produces itself on stdout. http://www.mired.org/home/mwm/ Independe

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Peter Hansen <[EMAIL PROTECTED]> writes: >>>By the way, note that neither basic auth nor digest auth provide any >>>real security, and in fact with basic auth the userid and password are >>>sent *in cleartext*. For any serious product

Re: Linux NETLINK Sockets

2006-01-11 Thread Martin v. Löwis
Jeremy Moles wrote: > http://mail.python.org/pipermail/python-dev/2005-January/050834.html > > ^^ From a year ago or so--did this never get put into Python trunk? As > far as I can tell the answer is no. It's something I'd like to use in > Python if available, though, writing a small wrapper would

Re: Timeout at command prompt

2006-01-11 Thread Amit Khemka
One way would be to use 'signal' s ... something like this should work import signal TIMEOUT = 5 # number of seconds your want for timeout signal.signal(signal.SIGALRM, input) signal.alarm(TIMEOUT) def input(): try: foo = raw_input() return foo except: # timeout return cheers, amit.

Need Help in Python source code

2006-01-11 Thread Khai R. Md Safi'ee
Hi, I am in need of Python source codes that deals with both multithreading and socket programming(server-client). I need an example of a client/server multi-threading simulator for the clients to generate a high level of threading to "stress" the server side concurrently. In the end, it can benc

Re: How to create a script that list itself ?

2006-01-11 Thread Tim Roberts
Duncan Booth <[EMAIL PROTECTED]> wrote: > >Dave Hansen wrote: > >> Stealing from the old C chestnut: >> >> s="s=%c%s%c;print s%%(34,s,34)";print s%(34,s,34) > >Or a bit shorter: > >s='s=%s;print s%%`s`';print s%`s` It was pointed out to me that the shortest Python program which produces itself on

Re: can't solve an exercise-help me with it

2006-01-11 Thread Bengt Richter
On Thu, 12 Jan 2006 05:51:10 +0100, "hossam" <[EMAIL PROTECTED]> wrote: >I'm studying python newly and have an exercise that is difficult for me as a >beginner.Here it is : >"Write a program that approximates the value of pi by summing the terms of >this series: >4/1-4/3+4/5-4/7+4/9-4/11+ Th

Re: can't solve an exercise-help me with it

2006-01-11 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "hossam" <[EMAIL PROTECTED]> wrote: > I'm studying python newly and have an exercise that is difficult for me as a > beginner.Here it is : > "Write a program that approximates the value of pi by summing the terms of > this series: > 4/1-4/3+4/5-4/7+4/9-4/11+

Re: OT: Degrees as barriers to entry [was Re: - E04 - Leadership! Google, Guido van Rossum, PSF]

2006-01-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > >The major problem with professional bodies is precisely their lack of >insistence on a practical demonstration of capability. "Paper MCSEs", >for example, frequently make bad Windows system administrators because >their edu

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >Giving outstanding contributions to open-source projects or others made >feasible by the internet is, of course, another "hard to fake signal" >in terms of asymmetric-information markets. And of course, Google will >happil

Re: Real-world use cases for map's None fill-in feature?

2006-01-11 Thread David Murmann
[EMAIL PROTECTED] schrieb: > I am still left with a difficult to express feeling of > dissatifaction at this process. > > Plese try to see it from the point of view of > someone who it not a expert at Python: > > ... [explains his POV] i more or less completely agree with you, IOW i'd like izip

Re: Programming Eclipse plugins in Jython?

2006-01-11 Thread Oscar
PyDev plugin is excelent! it's easy for me to debug python scripts,but the ECLIPSE needs more memory to run . -- http://mail.python.org/mailman/listinfo/python-list

can't solve an exercise-help me with it

2006-01-11 Thread hossam
I'm studying python newly and have an exercise that is difficult for me as a beginner.Here it is : "Write a program that approximates the value of pi by summing the terms of this series: 4/1-4/3+4/5-4/7+4/9-4/11+ The program should prompt the user for n, the number of terms to sum and then o

Re: Python on WinXP Embedded

2006-01-11 Thread Godzilla
Hello rtilley, thanks for replying so soon. I wish to install WinXP Embedded on a PC/104 module and install Python on WinXP Embedded, not WinPE... The hardware which is to be acquired is about a celeron 400MHz but we just not sure how well Python will work under WinXPE... -- http://mail.python.o

Re: flatten a level one list

2006-01-11 Thread Michael Spencer
Tim Hochberg wrote: > Michael Spencer wrote: >> > Robin Becker schrieb: >> >> Is there some smart/fast way to flatten a level one list using the >> >> latest iterator/generator idioms. >> ... >> >> David Murmann wrote: >> > Some functions and timings >> ... > > Here's one more that's quite fas

Exception Handling

2006-01-11 Thread Manish Kumar (WT01 - Software Products & OSS)
Hi, We have some modules of our project implemented in python and some in C. We use shared library objects to access C functions from python. We need to catch the exceptions like segmentation fault occurring in the C module in python and print the complete stack. We tried 1) signal.signal(SIGSE

Re: Python on WinXP Embedded

2006-01-11 Thread [EMAIL PROTECTED]
Do you mean Windows PE (Pre-Install Environment)? Here are a few screen shots of Python on Windows PE. If you want more details, I can post the steps I took to get it working. http://www.bandaheart.com/bartpe/ Also note that WinPE 2.0 will come out when Vista ships in 2006. -- http://mail.pyth

can't import module in ASP

2006-01-11 Thread [EMAIL PROTECTED]
Hi all, I have found that I can't import modules in ASP (python) and those modules are in the same directory. I can surely do that with a .py file but not in ASP. I have noticed the currently working directory when python used in ASP is somewhere else rather than where the asp file is. I remember

Re: Indentation/whitespace

2006-01-11 Thread Jon Perez
thakadu wrote: > While I have no doubt that there are lousy browsers out there, the > problem is not only with browsers, but also I agree with you its not > Python's fault. The issue is that the code I am pasting may have used a > DIFFERENT indentation scheme, so lets say I used four spaces and th

Re: Indentation/whitespace

2006-01-11 Thread Jon Perez
Ilias Lazaridis wrote: >>>Is Python going to support s syntax the does not use it's infamous >>>whitespace rules? > > > Of course. > > I estimate it will take around 1 to 2 years from now, until this > whitespace-concept will become optionally. > > Backwards-compatibility will be kept, thus

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread EP
if you bought him a beer in the future he would owe you less than a beer today due to the time value of beer (which is, amazingly, much greater than the time value of money) If he buys you a beer today, you will need to go back to the future, and we must all hope this equation converges on an cros

Re: flatten a level one list

2006-01-11 Thread Tim Hochberg
Michael Spencer wrote: > > Robin Becker schrieb: > >> Is there some smart/fast way to flatten a level one list using the > >> latest iterator/generator idioms. > ... > > David Murmann wrote: > > Some functions and timings > ... Here's one more that's quite fast using Psyco, but only average w

Re: Indentation/whitespace

2006-01-11 Thread Jon Perez
Joe wrote: > Is Python going to support s syntax the does not use it's infamous > whitespace rules? I recall reading that Python might include such a > feature. Or, maybe just a brace-to-indentation preprocessor would be > sufficient. Nope never. Because that would destroy one of the most importa

win32ui.pyc can't be found

2006-01-11 Thread Terry Acree
Using py2exe to bundel a script containing the import   from pywin.mfc import object   on the PC containing the Python installation the exe in the dist folder works properly. However, when the dist folder is coppied to another PC an error message is generated: ... win32ui.pyc ? file could not

Re: Python Scripts to logon to websites

2006-01-11 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > My information about digest was either obsolete or simply wrong, as I > didn't realize it had all the nonce and anti-replay support it appears > to have. (I may have been remembering articles about how much of that > wasn't supported widely at some time i

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Peter Hansen
Paul Boddie wrote: > Peter Hansen wrote: >>Kevin wrote: >>>Can you tell me what to look for in an HTTPMessage that is an error? I >>>have looked at the header objects and I cannot determine an error >>>message. >> >>I think you're missing most of the context and detail that would help us >>provide

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Mike Meyer
Steven Bethard <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Steven Bethard writes: >>> Not to advocate one way or the other, but how often do you use >>> heterogeneous containers? >> Pretty much everything I do has heterogenous containers of some sort >> or another. > Sorry, I should have bee

Re: Can dictionaries be nested?

2006-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > First, can dictionaries contain dictionaries? Yes. > Second, how to create each successive inner dictionary when populating > it? Python doesn't have constructors and (having all of 4 weeks of > Python experience) it isn't clear to me whether in nested while loops > th

Re: flatten a level one list

2006-01-11 Thread Michael Spencer
> Robin Becker schrieb: >> Is there some smart/fast way to flatten a level one list using the >> latest iterator/generator idioms. ... David Murmann wrote: > Some functions and timings ... Here are some more timings of David's functions, and a couple of additional contenders that time faster

Re: Python Scripts to logon to websites

2006-01-11 Thread Peter Hansen
Mike Meyer wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>By the way, note that neither basic auth nor digest auth provide any >>real security, and in fact with basic auth the userid and password are >>sent *in cleartext*. For any serious production site these techniques >>should probably not

Can dictionaries be nested?

2006-01-11 Thread techiepundit
I'm parsing some data of the form: OuterName1 InnerName1=5,InnerName2=7,InnerName3=34; OuterName2 InnerNameX=43,InnerNameY=67,InnerName3=21; OuterName3 and so on These are fake names I've made up to illustrate the point more clearly. (the embedded device device can't produce XML and

Re: flatten a level one list

2006-01-11 Thread Paul Rubin
Paul Rubin writes: > >>> import operator > >>> a=[(1,2),(3,4),(5,6)] > >>> reduce(operator.add,a) > (1, 2, 3, 4, 5, 6) (Note that the above is probably terrible if the lists are large and you're after speed.) -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten a level one list

2006-01-11 Thread Paul Rubin
Robin Becker <[EMAIL PROTECTED]> writes: > f([(x0,y0),(x1,y1),]) --> [x0,y0,x1,y1,] >>> import operator >>> a=[(1,2),(3,4),(5,6)] >>> reduce(operator.add,a) (1, 2, 3, 4, 5, 6) -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten a level one list

2006-01-11 Thread David Murmann
Robin Becker schrieb: > Is there some smart/fast way to flatten a level one list using the > latest iterator/generator idioms. > > The problem arises in coneverting lists of (x,y) coordinates into a > single list of coordinates eg > > f([(x0,y0),(x1,y1),]) --> [x0,y0,x1,y1,] or > > g([

void * C array to a Numpy array using Swig

2006-01-11 Thread Krish
Hello People I hope I am On Topic. Anyways, here is my problem. Any insights would be really appreciated. I have wrapped a C IO module using SWIG -> Python Module. Suppose the name of the module is "imageio" and the reader function from the file is image_read() which returns an object ( "filled"

Psycopg2 date problems: "Can't adapt"

2006-01-11 Thread mvanier
There was a thread a while back dealing with an error message the psycopg2 Postgres interface gives when trying to convert some mxDateTime values: "can't adapt". The answer given was that psycopg2 wasn't finding the mxDateTime include files during setup, so it assumed they weren't there. I'm havi

Help me in this please--is Python the answer?

2006-01-11 Thread Ray
Hello, I've got the chance to determine the technology to use in creating a product similar to this: http://www.atomicisland.com/ Now the thing is that I need to sell this to the guy with the money. I've developed for years with C++ and Java, last 7 years J2EE, and I'm kinda sick of the "bloated

Re: flatten a level one list

2006-01-11 Thread bonono
Robin Becker wrote: > Is there some smart/fast way to flatten a level one list using the > latest iterator/generator idioms. > > The problem arises in coneverting lists of (x,y) coordinates into a > single list of coordinates eg > > f([(x0,y0),(x1,y1),]) --> [x0,y0,x1,y1,] or > > g([x0,x1,

Re: exec a string in an embedded environment

2006-01-11 Thread Jon
Tommy, same question to you... :-) -Jon -- http://mail.python.org/mailman/listinfo/python-list

flatten a level one list

2006-01-11 Thread Robin Becker
Is there some smart/fast way to flatten a level one list using the latest iterator/generator idioms. The problem arises in coneverting lists of (x,y) coordinates into a single list of coordinates eg f([(x0,y0),(x1,y1),]) --> [x0,y0,x1,y1,] or g([x0,x1,x2,..],[y0,y1,y2,]) --> [

Re: exec a string in an embedded environment

2006-01-11 Thread [EMAIL PROTECTED]
Greg Copeland wrote: > On Wed, 11 Jan 2006 04:29:32 -0800, Tommy R wrote: > > > I work on a safety critical embedded application that runs on VxWorks. > > I have successfully ported the interpreter to VW. In my solution I have > > Sure wish you would of asked...I ported Python to VxWorks > some tim

Re: cant get py2exe exe file to work

2006-01-11 Thread Blaze Bresko
sorry for double...triple posting...now iv learned it takes a while to get it up on the internet B -- http://mail.python.org/mailman/listinfo/python-list

Re: creating dictionarie names, using variables?

2006-01-11 Thread Livin
Are you saying that each child dictionary actually has its own 'key', not just the items within it? The goal is to create a dictionary with many dictionaries in it. - each child dictionary will hold a single 'device' and its related attributes. - I want to name the child dictionaries the same

Re: Accessing Windows file metadata?

2006-01-11 Thread Roger Upole
The Pywin32 package wraps the interfaces used to read and write these properties. \win32com\test\testStorage.py demonstrates how to use them. There are actually two different ways that metadata is stored. For structured storage files created by COM applications, it's embedded directly in the file

Re: how to improve this simple block of code (str.partition?)

2006-01-11 Thread David Murmann
Peter Hansen schrieb: > Matt's answer is still the only one that passes the tests. well, here's another one: - def mysplit(s, sep): x = s.rsplit(sep, 1) return x + ['']*(2-len(x)) def stripZeros(x): intpart, frac = mysplit(x, '.') frac = frac.rstrip('0

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > By the way, note that neither basic auth nor digest auth provide any > real security, and in fact with basic auth the userid and password are > sent *in cleartext*. For any serious production site these techniques > should probably not be used without add

Python on WinXP Embedded

2006-01-11 Thread Godzilla
Has anyone install Python on Windows XP Embedded? We wish to evaluate the possible solution of installing Python with WinXPE on a PC/104 plus module. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-soappy

2006-01-11 Thread Mikalai
> While talking about SOAPpy module, I'm facing an authentication problem > with it: > > I'm consuming a WebServices server requiring authentication, and I did > not found yet how to give authentication code (username:password) while > calling any mehode of the webservice. > In Apache+mod_python

Re: Python Scripts to logon to websites

2006-01-11 Thread BartlebyScrivener
Thanks, Peter. Peter Hansen wrote: > BartlebyScrivener wrote: > >>but googling for "basic authentication" and > >>maybe "realm" and/or "host" will find you other sites with less > >>technically detailed material. > > > > This looks promising, but it'll take me a week to understand it :) > > > > ht

Re: cross compile python for linux-ppc-604

2006-01-11 Thread lincr
Doug Crawford wrote: > Has anyone successfully compiled python 2.4 to run under linux powerpc > 604? I have the ELINOS cross compile environemnt working, but always > run into problems when executing make. Unfortunately, my target > embedded system does not have a complete build chain so I have to

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Paul Boddie
Peter Hansen wrote: > Kevin wrote: > > Can you tell me what to look for in an HTTPMessage that is an error? I > > have looked at the header objects and I cannot determine an error > > message. > > I think you're missing most of the context and detail that would help us > provide a useful answer fo

Re: Python Scripts to logon to websites

2006-01-11 Thread Peter Hansen
BartlebyScrivener wrote: >>but googling for "basic authentication" and >>maybe "realm" and/or "host" will find you other sites with less >>technically detailed material. > > This looks promising, but it'll take me a week to understand it :) > > http://www.voidspace.org.uk/python/articles/authenti

Re: Python+tkinter errors on OSX

2006-01-11 Thread Kevin Walzer
John Chambers wrote: > Sp my latest adventure is attempting to use python's Tkinter module on a > few machines. > On my PB (OSX 10.3.9), I got the following confusing results: > > /Users/jc: python > Python 2.3 (#1, Sep 13 2003, 00:49:11) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on d

Re: ANN: Python training, 2006 Feb 1-3, San Francisco

2006-01-11 Thread w chun
as promised, this is the FINAL reminder i'll send out about our upcoming Python course at the beginning of February. (Feb 1-3, 9a-5p PT) it'll be at a hotel with BART and CalTrain access (San Bruno stations) for those already in the Bay Area, and for those coming in from out-of-town, there's a f

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Fredrik Lundh
Steve Holden wrote: > >>I was thinking of a number between one and a thousand, and I forgot it. > >>Could someone please remind me what it was? > > > > 204. > > > Thanks. This is *such* a helpful group. I'll write it down this time. or you can look it up in the HTTP specification the next time yo

Re: Python Scripts to logon to websites

2006-01-11 Thread BartlebyScrivener
> but googling for "basic authentication" and > maybe "realm" and/or "host" will find you other sites with less > technically detailed material. This looks promising, but it'll take me a week to understand it :) http://www.voidspace.org.uk/python/articles/authentication.shtm Thanks for your help

Re: creating dictionarie names, using variables?

2006-01-11 Thread Dan Sommers
On Wed, 11 Jan 2006 15:53:48 -0700, "Livin" <[EMAIL PROTECTED]> wrote: > I need to dynamically create dictionary names using strings input at > the time of creation. These will then be placed into a "Parent" > dictionary. Don't do that. > item[5]='Kitchen Ceiling Lights' > devDictName = item[5]

Python+tkinter errors on OSX

2006-01-11 Thread John Chambers
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "c

RE: New Python.org website ?

2006-01-11 Thread Delaney, Timothy (Tim)
Steve Holden wrote: > http://beta.python.org > > Happy New Year. We could do with some help completing the conversion > if people have some free time. It would be nice if it could be > completed for PyCon. Start at Nice - except for those damned pictures taking up useful space on the home page.

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Peter Hansen
Steve Holden wrote: > Fredrik Lundh wrote: >>Steve Holden wrote: Can you tell me what to look for in an HTTPMessage that is an error? I have looked at the header objects and I cannot determine an error message. >>> >>>I was thinking of a number between one and a thousand, and I forgot

cross compile python for linux-ppc-604

2006-01-11 Thread Doug Crawford
Has anyone successfully compiled python 2.4 to run under linux powerpc 604? I have the ELINOS cross compile environemnt working, but always run into problems when executing make. Unfortunately, my target embedded system does not have a complete build chain so I have to use a cross compiler. Is th

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Thanks for the example code Larry. It _is_ easier for me to read. I > like the way you split the file on '.' I may use that. Thanks again! Warning: that will fail on names with more than one "." in them. It's generally best to use the provided tools for working with pa

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Peter Hansen
Martin Miller wrote: > [EMAIL PROTECTED] wrote: > >>Hi Peter. The guy who takes the pictures uses Photoshop to convert >>tiffs to jpegs one by one. When he does a 'Maxium Quality' conversion >>in Photoshop and I do a 100% quality conversion with Python and PIL, >>the two converted files are almost

Re: creating dictionarie names, using variables?

2006-01-11 Thread Fredrik Lundh
"Livin" wrote: > I need to dynamically create dictionary names using strings input at the > time of creation. These will then be placed into a "Parent" dictionary. if you think that you need to generate variable names, you're almost always wrong. > item[5]='Kitchen Ceiling Lights' > devDictName

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>>Can you tell me what to look for in an HTTPMessage that is an error? I >>>have looked at the header objects and I cannot determine an error >>>message. >> >>I was thinking of a number between one and a thousand, and I forgot it. >>Could someone p

Re: how to improve this simple block of code

2006-01-11 Thread Peter Hansen
Ron Griswold wrote: > How 'bout: > > X = "132.00"; > Y = int(float(X)); This fails on anything that isn't already an integer (in the math sense, not the Python type sense), such as 132.15 which was one of the OP's actual examples. Matt's answer is still the only one that passes the tests. Mel

Re: Python Scripts to logon to websites

2006-01-11 Thread Tomi Kyöstilä
BartlebyScrivener wrote: > New to Python and Programming. Trying to make scripts that will open > sites and automatically log me on. [snip] > Does anyone have a simple example of a script that opens, say, gmail or > some other commonly accessed site that requires a username and password > so that I

creating dictionarie names, using variables?

2006-01-11 Thread Livin
I need to dynamically create dictionary names using strings input at the time of creation. These will then be placed into a "Parent" dictionary. I'm new to python, and programming, so please bear with me. here's my initial thought but I don't think it will work... item[5]='Kitchen Ceiling Light

Accessing Windows file metadata?

2006-01-11 Thread EP
I'm looking for a method by which to access Windows files metadata and have not been able to find anything in the standard modules or via Google - what is the standard approach? Shamefully I really do not understand Windows file system - e.g. is properties metadata attached to the file?if I ch

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-11 Thread Neil Hodgson
Robert: > After "is_platform_unicode = ", scintilla displays some unicode > as you showed. but the win32-functions (e.g. MessageBox) still do not > pass through wide unicode. Win32 issues are better discussed on the python-win32 mailing list which is read by more of the people interested in

Linux NETLINK Sockets

2006-01-11 Thread Jeremy Moles
http://mail.python.org/pipermail/python-dev/2005-January/050834.html ^^ From a year ago or so--did this never get put into Python trunk? As far as I can tell the answer is no. It's something I'd like to use in Python if available, though, writing a small wrapper wouldn't be out of the question if

Re: how to improve this simple block of code

2006-01-11 Thread Xavier Morel
Forget about the previous mail, i just saw you were converting the string to float beforehand, in which case he would more than likely run into the good ol' float imprecision issue sooner than later. Not to mention that %g formats to scientific notation (e.g. exponential format with the exponen

Re: how to improve this simple block of code

2006-01-11 Thread Xavier Morel
Mel Wilson wrote: > py wrote: >> Say I have... >> x = "132.00" >> >> but I'd like to display it to be "132" ...dropping the trailing >> zeros... > > print '%g' % (float(x),) > > might work. > > Mel. > The input is a string, %g expects a float, TypeError exception. -- http://mail.python.o

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Martin Miller
[EMAIL PROTECTED] wrote: > Hi Peter. The guy who takes the pictures uses Photoshop to convert > tiffs to jpegs one by one. When he does a 'Maxium Quality' conversion > in Photoshop and I do a 100% quality conversion with Python and PIL, > the two converted files are almost identical and this is wha

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread David Murmann
Steve Holden schrieb: > Kevin wrote: >> Can you tell me what to look for in an HTTPMessage that is an error? I >> have looked at the header objects and I cannot determine an error >> message. >> > I was thinking of a number between one and a thousand, and I forgot it. > Could someone please remin

Re: exec a string in an embedded environment

2006-01-11 Thread Greg Copeland
On Wed, 11 Jan 2006 04:29:32 -0800, Tommy R wrote: > I work on a safety critical embedded application that runs on VxWorks. > I have successfully ported the interpreter to VW. In my solution I have Sure wish you would of asked...I ported Python to VxWorks some time back. I've been using it for s

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > New to Python and Programming. Trying to make scripts that will open > sites and automatically log me on. A common enough things to want to do. > The following example is from the urllib2 module. > > What are "realm" and "host" in this example. H

Re: batch tiff to jpeg conversion script

2006-01-11 Thread [EMAIL PROTECTED]
Thanks for the example code Larry. It _is_ easier for me to read. I like the way you split the file on '.' I may use that. Thanks again! -- http://mail.python.org/mailman/listinfo/python-list

Re: batch tiff to jpeg conversion script

2006-01-11 Thread [EMAIL PROTECTED]
Hi Peter. The guy who takes the pictures uses Photoshop to convert tiffs to jpegs one by one. When he does a 'Maxium Quality' conversion in Photoshop and I do a 100% quality conversion with Python and PIL, the two converted files are almost identical and this is what he wants... that's the only rea

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Jorge Godoy
Steve Holden <[EMAIL PROTECTED]> writes: > Kevin wrote: >> Can you tell me what to look for in an HTTPMessage that is an error? I >> have looked at the header objects and I cannot determine an error >> message. >> > I was thinking of a number between one and a thousand, and I forgot it. Could > s

Re: Memory Profiler

2006-01-11 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Dave <[EMAIL PROTECTED]> writes >Is there any memory profiler for Python programs? I Python Memory Validator http://www.softwareverify.com/pythonMemoryValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/softwar

Timeout at command prompt

2006-01-11 Thread Thierry Lam
I can use the python function raw_input() to read any input from the user but how can I add a timeout so that my program exits after x period of time when no input has been entered. Thierry -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Fredrik Lundh
Steve Holden wrote: > > Can you tell me what to look for in an HTTPMessage that is an error? I > > have looked at the header objects and I cannot determine an error > > message. > > I was thinking of a number between one and a thousand, and I forgot it. > Could someone please remind me what it wa

Re: MVC in wxPython HELP!

2006-01-11 Thread has
If folk wish to post that spiel anywhere else, be my guest. Public domain and all that. has -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I determine an HTTPMessage ?

2006-01-11 Thread Steve Holden
Kevin wrote: > Can you tell me what to look for in an HTTPMessage that is an error? I > have looked at the header objects and I cannot determine an error > message. > I was thinking of a number between one and a thousand, and I forgot it. Could someone please remind me what it was? regards St

RE: how to improve this simple block of code

2006-01-11 Thread Ron Griswold
How 'bout: X = "132.00"; Y = int(float(X)); Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mel Wilson Sent: Wednesday, January 11, 2006 1:08 PM To: python-list@python.org Subject: Re: how to impr

Re: how to improve this simple block of code

2006-01-11 Thread Mel Wilson
py wrote: > Say I have... > x = "132.00" > > but I'd like to display it to be "132" ...dropping the trailing > zeros... print '%g' % (float(x),) might work. Mel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode & Pythonwin / win32 / console?

2006-01-11 Thread Martin v. Löwis
Robert wrote: > is in a PythonWin Interactive session - ok results for cyrillic chars > (tolerant mbcs/utf-8 encoding!). > But if I do this on Win console (as you probably mean), I get also > encoding Errors - no matter if chcp1251, because cyrillic chars raise > the encoding errors also. If you d

Re: Reading from input file.

2006-01-11 Thread David Murmann
hi! i find it rather hard to understand your problem, but i'll try anyway: [EMAIL PROTECTED] schrieb: > So.. for my future Python script, the input data are in form of: > 1 > 1233.2E-3 2123.2323 2E+2 3453.3E+1 > 1233.2E-3 2123.2323 2E+2 3453.3E+1 > 1233.2E-3 2123.2323 2E+2 3453.

Re: how to improve this simple block of code

2006-01-11 Thread Peter Hansen
Peter Otten wrote: > Peter Hansen wrote: >>Of all the ideas posted, I believe only Mark Hammond's would correctly >>pass the basic obvious test cases > > Too bad he didn't post at all :-) D'oh! There was a typo in my message above. Naturally, I meant to write "M. Hammond" instead of "Mark Ha

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Hope it's not inappropriate to post this here. > > Could someone critique my code? [snip] > im.save(outfile, "JPEG", quality=100) From an effbot posting on 13 Jul 2002: '''JPEG quality 100 is overkill, btw -- it completely disables JPEG's quan

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hope it's not inappropriate to post this here. > > Could someone critique my code? I have no Python programmers in my > office to show this to. The script works OK, but should I do it > differently? I especially don't like how I check to see if jpegs exist. > > The styl

Programming Eclipse plugins in Jython?

2006-01-11 Thread Kenneth McDonald
Is it easy or difficult to implement Eclipse plugins in Jython? And if the former, are there any starter's guides you could recommend? The desire is an editor plugin for a syntactically very simple proprietary language. I'd like to have paren checking, syntax colorization and (to start with

Re: Reading from input file.

2006-01-11 Thread paczkow
I do not clearly understand what you say. I am no going to change input files in anyway. I just want to read them with Python, and postprocess. I understand: open(inputfile.txt, 'r').read() However what you mean saying split the string using '\n'. Where should I put it? After file name, or what?

Re: Reading from input file.

2006-01-11 Thread paczkow
I do not clearly understand what you say. I am no going to change input files in anyway. I just want to read them with Python, and postprocess. I understand: open(inputfile.txt, 'r').read() However what you mean saying split the string using '\n'. Where should I put it? After file name, or what?

Re: Problems with WX and program loop...

2006-01-11 Thread Chris Mellon
On 11 Jan 2006 10:33:08 -0800, Mr BigSmoke <[EMAIL PROTECTED]> wrote: > Hi everybody... I have an app that has to controll some ascii files > every 10/30 seconds... I was planning to have an GUI using wxpython. > The problems is that i wasn't able to manage my application loop and > the wxApp loop,

  1   2   >