Re: Lookuperror : unknown encoding : utf-8

2006-10-29 Thread thebjorn
Sachin Punjabi wrote: > I wanted to read a file encoded in utf-8 and and using the following > syntax in my source which throws me an error specifying Lookuperror : > unknown encoding : utf-8. Also I am working on Python version 2.4.1. You shouldn't have to do anything to have the utf-8 encoding a

Re: Lookuperror : unknown encoding : utf-8

2006-10-29 Thread Leo Kislov
Sachin Punjabi wrote: > Hi, > > I wanted to read a file encoded in utf-8 and and using the following > syntax in my source which throws me an error specifying Lookuperror : > unknown encoding : utf-8. Also I am working on Python version 2.4.1. > > import codecs > fileObj = codecs.open( "data.txt",

Re: subprocess decoding?

2006-10-29 Thread Leo Kislov
MC wrote: > Hi! > > On win-XP (french), when I read subprocess (stdout), I must use > differents decoding (cp1252,cp850,cp437, or no decoding), depending of > the "launch mode" of the same Python's script: > - from command-line > - from start+run > - from icon > - by Python-COM-server >

Lookuperror : unknown encoding : utf-8

2006-10-29 Thread Sachin Punjabi
Hi, I wanted to read a file encoded in utf-8 and and using the following syntax in my source which throws me an error specifying Lookuperror : unknown encoding : utf-8. Also I am working on Python version 2.4.1. import codecs fileObj = codecs.open( "data.txt", "r", "utf-8" ) Can anyone please gu

Re: Is there a way to get utf-8 out of a Unicode string?

2006-10-29 Thread Gerrit Holl
Hei, On 2006-10-30 08:25:41 +0100, thebjorn wrote: > def unfk(s): > return eval(repr(s)[1:]).decode('utf-8') > > i.e. chopping off the u in the repr of a unicode string, and relying on > eval to interpret the \xHH sequences. > > Is there a less hack'ish way to do this? Slightly lack hac

Re: Is there a way to get utf-8 out of a Unicode string?

2006-10-29 Thread Fredrik Lundh
thebjorn wrote: > I've got a database (ms sqlserver) that's (way) out of my control, > where someone has stored utf-8 encoded Unicode data in regular varchar > fields, so that e.g. the string 'Blåbærsyltetøy' is in the database > as 'Bl\xc3\xa5b\xc3\xa6rsyltet\xc3\xb8y' :-/ > > Then I read the da

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Fredrik Lundh
Bjoern Schliessmann wrote: >> If that is not an option, then you are faced with a problem of >> connecting a threaded programming model with an event based model >> (twisted and and such). > > I don't really see how threads could avoid a problem with delays in > one connection ... by running the

Is there a way to get utf-8 out of a Unicode string?

2006-10-29 Thread thebjorn
I've got a database (ms sqlserver) that's (way) out of my control, where someone has stored utf-8 encoded Unicode data in regular varchar fields, so that e.g. the string 'Blåbærsyltetøy' is in the database as 'Bl\xc3\xa5b\xc3\xa6rsyltet\xc3\xb8y' :-/ Then I read the data out using adodbapi (which

Re: Is it possible to use python to unit test C++ code?

2006-10-29 Thread Fredrik Lundh
Liu HuaDong-E6754C wrote: > Did any one used python to do C++ unit test? > If u did, could u give some actions how to do unit test by using python. use a standard tool to generate a binding for the relevant C++ libraries: http://www.effbot.org/pyfaq/how-do-i-interface-to-c-objects-from-python.ht

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Bjoern Schliessmann
Nick Vatamaniuc wrote: > If that is not an option, then you are faced with a problem of > connecting a threaded programming model with an event based model > (twisted and and such). I don't really see how threads could avoid a problem with delays in one connection ... Regards, Björn -- BOFH

Re: beginner's refcount questions

2006-10-29 Thread Fredrik Lundh
Jens Theisen wrote: > Thus, the following code > > class Foo: > def __del__(self): > print "deled!" > > def foo(): > f = Foo() > > foo() > print "done!" > > prints > > deled! > done! > > and not the other way round. the behaviour you see in this simple program is not guarant

Re: Very simple request about argument setting.

2006-10-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > ArdPy wrote: >> There is an error in the syntax the star must prefix the variable name >> not suffix it. >> Then the items variable will accept the parameter value as a tuple. > > Hmm, tuples are immutable, right? I need something mutable so that when > the player picks

Is it possible to use python to unit test C++ code?

2006-10-29 Thread Liu HuaDong-E6754C
    Did any one used python to do C++ unit test? If u did, could u give some actions how to do unit test by using python.     [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am attempting to view all files in a directory and if those files > have not been modified within the last couple days I will remove them. > In order to do this I need to look at the file date modied and check > the date. I know how to look at each file name and I know

[wxPython] wxFrame don't have Bind attribute ??

2006-10-29 Thread Jia Lu
Hi all I am using wxPy 2.6.3.2-2, But when run an application with self.Bind , I got an error that there is no Bind. How can I fix it. thanx -- http://mail.python.org/mailman/listinfo/python-list

Re: Very simple request about argument setting.

2006-10-29 Thread [EMAIL PROTECTED]
Thank you very much for your information. -- http://mail.python.org/mailman/listinfo/python-list

Re: Very simple request about argument setting.

2006-10-29 Thread ArdPy
[EMAIL PROTECTED] wrote: > ArdPy wrote: > > There is an error in the syntax the star must prefix the variable name > > not suffix it. > > Then the items variable will accept the parameter value as a tuple. > > Hmm, tuples are immutable, right? I need something mutable so that when > the player pic

Re: How to Split Chinese Character with backslash representation?

2006-10-29 Thread jim-on-linux
On Friday 27 October 2006 17:21, jim-on-linux wrote: > On Thursday 26 October 2006 23:43, you wrote: > > Hi all, > > > > I was trying to split a string that > > > > represent chinese characters below: > > >>> str = '\xc5\xeb\xc7\xd5\xbc' > > >>> print str2, > > > > ??? > > > > >>> fields2 = split(

Open Source?

2006-10-29 Thread Nick Vatamaniuc
You can always start with open source. Find a project that you really like based on Python, and get involved -- look at the source, create add-ons, fix bugs. This way you get to learn, and you get to contribute and help others out as well. After a while you will have under your belt and perhaps i

Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Jia Lu
[EMAIL PROTECTED] wrote: > Greetings, > > I am attempting to view all files in a directory and if those files > have not been modified within the last couple days I will remove them. > In order to do this I need to look at the file date modied and check > the date. I know how to look at each file

Re: looping through two list simultenously

2006-10-29 Thread Paul McGuire
"CSUIDL PROGRAMMEr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > folks > I have two lists > > i am trying to loop thorough them simultenously. > > Here is the code i am using > > f1 = os.popen('ls chatlog*.out') > data1=f1.readlines() > f1.close() > > data1=[x.strip() for x in da

Re: Very simple request about argument setting.

2006-10-29 Thread [EMAIL PROTECTED]
ArdPy wrote: > There is an error in the syntax the star must prefix the variable name > not suffix it. > Then the items variable will accept the parameter value as a tuple. Hmm, tuples are immutable, right? I need something mutable so that when the player picks up an item, it's no longer in the r

Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Praveen
I hope this sample code helps def getfileinfo(filename): print 'Filename : %s' % filename stats = os.stat(filename) size = stats[stat.ST_SIZE] print 'File Size is %d bytes' % size accessed = stats[stat.ST_ATIME] modified = stats[stat.ST_MTIME]

I want to work on Python

2006-10-29 Thread ArdPy
Hi there, these days I am desperately searching everywhere on the Internet for part time python jobs. The reason is I want to get actively involved with python programming and get some practical exposure. Please help me in whatever way you can. -- http://mail.python.org/mailman/listinfo/python-li

Re: importing class

2006-10-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Thanks, I got that part. The problem I'm still having is that it's not > seeing things like text_1, which are defined in the program. How can I > make it see that? > Your module is intended to work with many different main programs, so it shouldn't make any assumptions

wxPython for web development?

2006-10-29 Thread walterbyrd
I assume that wxWidgets can not be used if all you have is mod-python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Very simple request about argument setting.

2006-10-29 Thread ArdPy
[EMAIL PROTECTED] wrote: > I have the argument items in my class room. > > class room: > def __init__(self, name, description, items*): > > I thought I remembered from a tutorial I read once, and I've read so > many I feel like an expert of them, that putting a little star* above > an item m

How to access file last modified dates on each file in a directory

2006-10-29 Thread RAMohrmann
Greetings, I am attempting to view all files in a directory and if those files have not been modified within the last couple days I will remove them. In order to do this I need to look at the file date modied and check the date. I know how to look at each file name and I know how to remove the fil

Re: beginner's refcount questions

2006-10-29 Thread Terry Reedy
"Jens Theisen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > python uses gc only where refcounts alone haven't yet done the > job. /python/The CPython implementation/ > And some other minor question: Is there a way to query the use count > of an object? This would be useful for

wxPython changed ??

2006-10-29 Thread Jia Lu
Hi all. I'm using wxPython 2.6.3.2-2 on FC 6. I wrote a demo used 'self.Bind(xx)' but I got an error says: " MyFrame instance has no attribute 'Bind' " I did that when I used FC 5 and it worked. Is new wxPy changed about the Bind method?? thanx -- http://mail.python.org/mailman/list

Very simple request about argument setting.

2006-10-29 Thread [EMAIL PROTECTED]
I have the argument items in my class room. class room: def __init__(self, name, description, items*): I thought I remembered from a tutorial I read once, and I've read so many I feel like an expert of them, that putting a little star* above an item makes it accept the argument as a list.

Re: beginner's refcount questions

2006-10-29 Thread Jean-Paul Calderone
On 30 Oct 2006 00:30:53 +, Jens Theisen <[EMAIL PROTECTED]> wrote: >Hello, > >python uses gc only where refcounts alone haven't yet done the >job. Thus, the following code > >class Foo: >def __del__(self): >print "deled!" > >def foo(): >f = Foo() > >foo() >print "done!" > >print

Re: simple oop question (hopefully)

2006-10-29 Thread [EMAIL PROTECTED]
I am tagging this so I can find it again (google groups) www.dexrow.com [EMAIL PROTECTED] wrote: > I am just trying to acess a function in wordgrid (savefile) to a button > that is defined in TestFrame. I can't seem to make it work I either > get an error that my variable isn't global or it makes

Re: Observation on "Core Python Programming"

2006-10-29 Thread David Lees
John Coleman wrote: > Greetings, >My copy of the second edition of Chun's "Core Python Programming" > just arrived from Amazon on Friday. What really jumped out at me is an > interesting feature about how it sequences its topics, namely, > (user-defined) functions are not introduced until chapt

simple oop question (hopefully)

2006-10-29 Thread [EMAIL PROTECTED]
I am just trying to acess a function in wordgrid (savefile) to a button that is defined in TestFrame. I can't seem to make it work I either get an error that my variable isn't global or it makes other complaints. thanks in advance.. sorry for the simple question.. import wx import wx.grid as

Re: Reverse function python? How to use?

2006-10-29 Thread [EMAIL PROTECTED]
If you wanted to keep the original list intact, you could do... [code] foo = [x1,x2,x3,x4,x5] bar = [math.sqrt(math.fabs(x))+5*math.pow(x,3) for x in foo] bar_reversed = reversed(bar) [/code] On Oct 29, 4:23 pm, "Murali" <[EMAIL PROTECTED]> wrote: > Something like this? > > [code] > foo = [x1,x2,

beginner's refcount questions

2006-10-29 Thread Jens Theisen
Hello, python uses gc only where refcounts alone haven't yet done the job. Thus, the following code class Foo: def __del__(self): print "deled!" def foo(): f = Foo() foo() print "done!" prints deled! done! and not the other way round. In c++, this is a central technique used

Re: Observation on "Core Python Programming"

2006-10-29 Thread UrsusMaximus
I must say I find Wesley Chun's explanations to be most understandable. I cant' exactly figure out why yet, but he has a way of explaining something, like, say, decorators, that in minimal words elucidates for me the intent behind why they are useful. That helps me understand how they work. I just

Re: enumerate improvement proposal

2006-10-29 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: > >> The code is for an economist. She is insistent on starting with the >> first bin as 1. > > > leaky abstractions in reverse, in other words? that's not a good design > approach. > > > Okay, I've googled "leaky abstractions" (as was probably y

Re: looping through two list simultenously

2006-10-29 Thread jim-on-linux
On Sunday 29 October 2006 15:28, CSUIDL PROGRAMMEr wrote: > folks > I have two lists > > i am trying to loop thorough them > simultenously. > Try something like this. for eachline in data1: print eachline for line in data:: print line You might also think about a while loop

Re: lossless transformation of jpeg images

2006-10-29 Thread jim-on-linux
On Sunday 29 October 2006 15:17, Daniel Nogradi wrote: > > Hi all, > > > > Last time I checked PIL was not able to apply > > lossless transformations to jpeg images so > > I've created Python bindings (or is it a > > wrapper? I never knew the difference :)) for > > the jpegtran utility of the Inde

Re: enumerate improvement proposal

2006-10-29 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > >>> print enumerate("ABCDE") > > >>> print list(enumerate("ABCDE")) > [(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E')] > > >> def obstinate_economist_enumerate(items): > ... seq = [(i+1, x) for (i, x) in enumerate(items)] >

Re: enumerate improvement proposal

2006-10-29 Thread Ben Finney
James Stroud <[EMAIL PROTECTED]> writes: > Fredrik Lundh wrote: > > why is it this function's job to add an offset to the actual > > sequence index? > > The code is for an economist. She is insistent on starting with the > first bin as 1. Note that 'enumerate' is actually a built-in type, and 'en

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Good point. enterprise.adbapi is designed to solve the problem. The other interface was deprecated. Thanks, Nick Vatamaniuc Jean-Paul Calderone wrote: > On 29 Oct 2006 13:13:32 -0800, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: > >Snor wrote: > >> I'm attempting to create a lobby & game server fo

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Try the --skip-networking option for mysqld Paul Rubin wrote: > "Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > > The simplest solution is to change your system and put the DB on the > > same machine thus greatly reducing the time it takes for each DB query > > to complete (avoid the TCP stack com

Re: Reverse function python? How to use?

2006-10-29 Thread Ben Finney
"frankie_85" <[EMAIL PROTECTED]> writes: > I made a little program which basically the a, b, c, d, e which I > have listed below and basically I want it th result to be printed > reverse so instead doing "print e, d, c, b, a", I'd like to use the > reverse function As was pointed out before, your

Re: looping through two list simultenously

2006-10-29 Thread [EMAIL PROTECTED]
CSUIDL PROGRAMMEr wrote: > folks > I have two lists > > i am trying to loop thorough them simultenously. > > Here is the code i am using > > f1 = os.popen('ls chatlog*.out') You can replace this by py> import glob py> f1 = glob.glob('chatlog*.out') it will return a list of filenames in f1, so yo

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Felipe Almeida Lessa
29 Oct 2006 14:18:02 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid>: > "Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > > The simplest solution is to change your system and put the DB on the > > same machine thus greatly reducing the time it takes for each DB query > > to complete (avoid the TCP

Re: Observation on "Core Python Programming"

2006-10-29 Thread Nick Vatamaniuc
...Skimmed through the previous edition. I don't normally read programming books -- just use the chapters that I need when I need them, unless of course there is a clever plot twist coming up ahead (for ex.: "Next: The revenge of lambdas. Will they stay or will they go?" ;-) Why? Have you read

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Paul Rubin
"Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > The simplest solution is to change your system and put the DB on the > same machine thus greatly reducing the time it takes for each DB query > to complete (avoid the TCP stack completely). Since when do any db's let you avoid the TCP stack, even on

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Carl Banks
Snor wrote: > As this occurs, there is a > small amount of lag while the communication with the mySQL server takes > place, and there could be another 100 clients waiting to make a request > at this point, meanwhile the server is idling while waiting for a > response from the mySQL server - obvious

Re: Observation on "Core Python Programming"

2006-10-29 Thread Nick Vatamaniuc
I meant "omitted" not as complete omission but as not being there sooner... John Coleman wrote: > A is not ommitted from DBECAFG - it just appears in a non-standard > order. If the book simply ommitted functions then it would be a > shocking ommission. As it is, it is just a curious way of sequenc

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Jean-Paul Calderone
On 29 Oct 2006 13:13:32 -0800, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: >Snor wrote: >> I'm attempting to create a lobby & game server for a multiplayer game, >> and have hit a problem early on with the server design. I am stuck >> between using a threaded server, and using an event driven server

Re: Get pexpect to work

2006-10-29 Thread drake
Jurian Sluiman wrote: > Ok, somebody helped my and found with "help(child.sendline)" that the > number (7) is the number of characters from my password. > > Still there doesn't seem to be that anything strange is happening. With > the logfile printed out, I found that child.expect places a 0 behin

Re: Reverse function python? How to use?

2006-10-29 Thread Murali
Something like this? [code] foo = [x1,x2,x3,x4,x5] bar = [math.sqrt(math.fabs(x))+5*math.pow(x,3) for x in foo] bar.reverse() print bar [/code] frankie_85 wrote: > Ok I'm really lost (I'm new to python) how to use the reverse function. > > > I made a little program which basically the a, b, c, d,

Re: Observation on "Core Python Programming"

2006-10-29 Thread John Coleman
A is not ommitted from DBECAFG - it just appears in a non-standard order. If the book simply ommitted functions then it would be a shocking ommission. As it is, it is just a curious way of sequencing topics. Functions are in chapter 11 out of 23 chapters - sounds like the "core" of the book to me.

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Snor, The simplest solution is to change your system and put the DB on the same machine thus greatly reducing the time it takes for each DB query to complete (avoid the TCP stack completely). This way you might not have to change your application logic. If that is not an option, then you are fac

Re: Get pexpect to work

2006-10-29 Thread Jurian Sluiman
Ok, somebody helped my and found with "help(child.sendline)" that the number (7) is the number of characters from my password. Still there doesn't seem to be that anything strange is happening. With the logfile printed out, I found that child.expect places a 0 behind the next rule. Is this always

Re: "from module import *" and modifying module's top-level vars

2006-10-29 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi everyone, > > I define some vars and functions in a "support" module which gets > called from my > main app module. Using Python 2.5. > > I import all symbols in the support module at the top of the main > module through: > > from support import * > > Is there a

Re: Observation on "Core Python Programming"

2006-10-29 Thread Fredrik Lundh
Nick Vatamaniuc wrote: > I would consider that an omission. Functions are very important in > Python. I think the user/reader should see the _def_ and _class_ > statement fairly soon in the introduction. The name of the book is > thus somewhat misleading, because functions are at the "core" of >

Re: looping through two list simultenously

2006-10-29 Thread Daniel Nogradi
> folks > I have two lists > > i am trying to loop thorough them simultenously. > > Here is the code i am using [...] > Is there any efficient doing this > Try the zip function: >>> list1 = [ 'a', 'b', 'c' ] >>> list2 = [ 'A', 'B', 'C' ] >>> for i, j in zip( list1, list2 ): ... print i, j

Re: looping through two list simultenously

2006-10-29 Thread Michael S
What if you do it in 2 separate threads? --- CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > folks > I have two lists > > i am trying to loop thorough them simultenously. > > Here is the code i am using > > f1 = os.popen('ls chatlog*.out') > data1=f1.readlines() > f1.close() > > data1=[x.str

Re: looping through two list simultenously

2006-10-29 Thread Björn Lindström
"CSUIDL PROGRAMMEr" <[EMAIL PROTECTED]>: > folks I have two lists > > i am trying to loop thorough them simultenously. > > Is there any efficient doing this Try the built-in function zip. >>> zip(['a', 'b', 'c'], [1, 2, 3]) [('a', 1), ('b', 2), ('c', 3)] -- Björn Lindström <[EMAIL PROTECTED]>

looping through two list simultenously

2006-10-29 Thread CSUIDL PROGRAMMEr
folks I have two lists i am trying to loop thorough them simultenously. Here is the code i am using f1 = os.popen('ls chatlog*.out') data1=f1.readlines() f1.close() data1=[x.strip() for x in data1] f1 = os.popen('ls chatlog*.txt') data=f1.readlines() f1.close() for eachline in data1 and line

"from module import *" and modifying module's top-level vars

2006-10-29 Thread lemke_juergen
Hi everyone, I define some vars and functions in a "support" module which gets called from my main app module. Using Python 2.5. I import all symbols in the support module at the top of the main module through: from support import * Is there a way for me to modify a top-level ("global"?) variab

Re: lossless transformation of jpeg images

2006-10-29 Thread Daniel Nogradi
> Hi all, > > Last time I checked PIL was not able to apply lossless transformations > to jpeg images so I've created Python bindings (or is it a wrapper? I > never knew the difference :)) for the jpegtran utility of the > Independent Jpeg Group. > > The jpegtran utility is written in C and is very

Re: Observation on "Core Python Programming"

2006-10-29 Thread Nick Vatamaniuc
I would consider that an omission. Functions are very important in Python. I think the user/reader should see the _def_ and _class_ statement fairly soon in the introduction. The name of the book is thus somewhat misleading, because functions are at the "core" of Python. Functions should be right

Re: Reverse function python? How to use?

2006-10-29 Thread Nick Vatamaniuc
Use the list's reverse() function. The only thing to keep in mind is that it will reverse in-place. Here is an example: In [1]: l=[1,2,3] In [2]: l.reverse() In [3]: l Out[3]: [3, 2, 1] So you could accumulate your results in a

Re: logo design - BZZZT! OT!

2006-10-29 Thread Gerard Flanagan
John Bokma wrote: > Xah Lee is a well-known spammer, almost all his messages contain at least > one link to his site in the body. > > Somehow this time he limited his post to 3 groups instead of the usual 5. > Maybe talking with the right people does work. It did with Dreamhost. And > I am sure hi

Re: question about True values

2006-10-29 Thread Carl Banks
Steven D'Aprano wrote: > It isn't often that I make an appeal to authority, but this is one of > them. No offense, but when it comes to language design its a brave or > foolish programmer who bucks the language idioms that Guido chose. Well, it's pretty clear you consider some abstact notion of un

Reverse function python? How to use?

2006-10-29 Thread frankie_85
Ok I'm really lost (I'm new to python) how to use the reverse function. I made a little program which basically the a, b, c, d, e which I have listed below and basically I want it th result to be printed reverse so instead doing "print e, d, c, b, a", I'd like to use the reverse function Can som

Re: logo design - BZZZT! OT!

2006-10-29 Thread John Bokma
"Paul McGuire" <[EMAIL PROTECTED]> wrote: > Does the "power-that-be of lispers" spend much time on c.l.py? Even > though Python is mentioned in passing in this post, it really doesn't > need to be cross-posted here. Xah Lee is a well-known spammer, almost all his messages contain at least one

lossless transformation of jpeg images

2006-10-29 Thread Daniel Nogradi
Hi all, Last time I checked PIL was not able to apply lossless transformations to jpeg images so I've created Python bindings (or is it a wrapper? I never knew the difference :)) for the jpegtran utility of the Independent Jpeg Group. The jpegtran utility is written in C and is very efficient, fa

Re: logo design - BZZZT! OT!

2006-10-29 Thread Paul McGuire
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... Again: the primary purpose of this message, is to beseach that the power-that-be of lispers, seriously think about getting themselves a official logo. Thanks. Does the "power-that-be of lispers" spend much time on c.l.py?

Re: ANN: Leo 4.4.2.1 final released

2006-10-29 Thread John Henry
I downloaded the Windows exe, ran it and a small blank message window poped up and that was it. I am still running 2.3. Edward K. Ream wrote: > Leo 4.4.2.1 final is now available at: > http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 > > Leo 4.4.2.1 final fixes a recent

wx.EVT_TOOL_RCLICKED

2006-10-29 Thread g.franzkowiak
Hi everybody, I want use wx.EVT_TOOL_RCLICKED for an toolbar, but I've got no responcses under Linux. The following part works under MSW, but under Linux..., the "wx.EVT_TOOL_RCLICKED" generate nothing: tb.AddTool(TB_ID, './*.png',isToggle=True) self.Bind(wx.EVT_TOOL, self.OnToolLeftCl

Re: Regular Expression help for parsing html tables

2006-10-29 Thread Paddy
[EMAIL PROTECTED] wrote: > Hello, > > I am having some difficulty creating a regular expression for the > following string situation in html. I want to find a table that has > specific text in it and then extract the html just for that immediate > table. > > the string would look something like th

Printing out the objects stack

2006-10-29 Thread Fabiano Sidler
Hi folks! For getting a plan how a stack-based VM like Python works, I added a function that prints out the current object stack. Unfortunately, it crashes the VM. Could someone here take a look at it? What's wrong with it?: --- snip --- static PyObject * sys_stack(PyObject *self) { PyFra

Re: importing class

2006-10-29 Thread gmarkowsky
Thanks, I got that part. The problem I'm still having is that it's not seeing things like text_1, which are defined in the program. How can I make it see that? Another question I should ask is whether I should even bother doing this. That is, it seems that the elegant and approved way of doing thi

Re: Computer locks up when running valid stand alone Tkinter file.

2006-10-29 Thread jim-on-linux
Thanks for responding, For those who care. The solution to the problem was; First, I did not give a parent to the Yview scrollbar. Next, I used the pack geometry for this class and everything else is grid geometry. When run stand alone it ran fine because the Yview scrollbar attached itself

Re: importing class

2006-10-29 Thread gmarkowsky
Yep, that fixed it. Many thanks. Greg Dennis Lee Bieber wrote: > On 27 Oct 2006 09:22:00 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > It's supposed to just make a Tkinter window with two choices. The > > problem is that when I import it from a module, I get the fo

Observation on "Core Python Programming"

2006-10-29 Thread John Coleman
Greetings, My copy of the second edition of Chun's "Core Python Programming" just arrived from Amazon on Friday. What really jumped out at me is an interesting feature about how it sequences its topics, namely, (user-defined) functions are not introduced until chapter 11, fully 400 pages into th

ANN: Leo 4.4.2.1 final released

2006-10-29 Thread Edward K. Ream
Leo 4.4.2.1 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo 4.4.2.1 final fixes a recent bug that caused Leo not to create the .leoRecentFiles.txt file properly in some situations. There are no known significant bugs in this version of Leo

Re: enumerate improvement proposal

2006-10-29 Thread Georg Brandl
James Stroud wrote: > I think that it would be handy for enumerate to behave as such: > > def enumerate(itrbl, start=0, step=1): >i = start >for it in itrbl: > yield (i, it) > i += step > > This allows much more flexibility than in the current enumerate, > tightens up code in m

Re: enumerate improvement proposal

2006-10-29 Thread Peter Otten
James Stroud wrote: > I think that it would be handy for enumerate to behave as such: > > def enumerate(itrbl, start=0, step=1): >i = start >for it in itrbl: > yield (i, it) > i += step > > This allows much more flexibility than in the current enumerate, > tightens up code in m

PyCon: proposals due by Tuesday 10/31

2006-10-29 Thread A.M. Kuchling
Final reminder: if you want to submit a proposal to PyCon, you should do it by end of Tuesday, October 31st. for more info The deadline for tutorials is November 15th: http://us.pycon.org/TX2007/CallForTutorials PyCon is the Python community confere

Re: Where do nested functions live?

2006-10-29 Thread Frederic Rentsch
Fredrik Lundh wrote: > Frederic Rentsch wrote: > > >> At some later point I need to increment my units some more and probably >> will again a number of times. Clearly this has to go into a function. >> > > since Python is an object-based language, clearly you could make your > counter int

Re: enumerate improvement proposal

2006-10-29 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: > >> The code is for an economist. She is insistent on starting with the >> first bin as 1. > > leaky abstractions in reverse, in other words? that's not a good design > approach. > > > I'm not sure I understand what "leaky abstractions" means. I

Re: enumerate improvement proposal

2006-10-29 Thread Fredrik Lundh
James Stroud wrote: > The code is for an economist. She is insistent on starting with the > first bin as 1. leaky abstractions in reverse, in other words? that's not a good design approach. -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate improvement proposal

2006-10-29 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: > >> def enumerate(itrbl, start=0, step=1): >>i = start >>for it in itrbl: >> yield (i, it) >> i += step > > that's spelled > > izip(count(start), sequence) > > in today's Python. > > > def in_interval(test, bounds, first=1, rev

Re: enumerate improvement proposal

2006-10-29 Thread James Stroud
Fredrik Lundh wrote: > why is it this function's job to add an offset to the actual sequence > index? > > The code is for an economist. She is insistent on starting with the first bin as 1. I'm guessing, practically, binning linerizes data and the bin number may potentially become a divisor o

Re: unescape HTML entities

2006-10-29 Thread Frederic Rentsch
Rares Vernica wrote: > Hi, > > How can I unescape HTML entities like " "? > > I know about xml.sax.saxutils.unescape() but it only deals with "&", > "<", and ">". > > Also, I know about htmlentitydefs.entitydefs, but not only this > dictionary is the opposite of what I need, it does not have " ".

Re: question about True values

2006-10-29 Thread Steven D'Aprano
On Sun, 29 Oct 2006 00:31:23 -0700, Carl Banks wrote: > Steven D'Aprano wrote: >> Carl Banks: >> > Overall, your objections don't really apply, since you're arguing what >> > ought to be whereas my argument is pragmatic. Practically speaking, in >> > realistic situations, "if len(a)>0" will work

Re: enumerate improvement proposal

2006-10-29 Thread Fredrik Lundh
James Stroud wrote: > def enumerate(itrbl, start=0, step=1): >i = start >for it in itrbl: > yield (i, it) > i += step that's spelled izip(count(start), sequence) in today's Python. > def in_interval(test, bounds, first=1, reverse=False): why is it this function's job t

Re: Providing full interaction with the run time

2006-10-29 Thread Fredrik Lundh
Dale Strickland-Clark wrote: > We have a system we're developing which runs as a server. It has an xml-rpc > interface which I've extended to provide some debugging facilities. This > has already proved very useful and will continue to be so as the system is > prepared for live deployment. > > Th

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Bjoern Schliessmann
Snor wrote: > There is a lot of interaction between the clients and they would > often need to write to the same list of values, which of course > becomes a problem with a threaded server - so event driven solves > that problem, and I assumed it would solve all my problems. Which problem, and why

Re: enumerate improvement proposal

2006-10-29 Thread James Stroud
James Stroud wrote: > I think that it would be handy for enumerate to behave as such: > > def enumerate(itrbl, start=0, step=1): > i = start > for it in itrbl: > yield (i, it) > i += step > > This allows much more flexibility than in the current enumerate, > tightens up code in many

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Fredrik Lundh
Snor wrote: > Is the only solution to use a threaded server to let my clients make > their requests and receive a response in the fastest possible time? since the problem is that you need to wait for database anyway, maybe you could use one or more threads to deal with the database, and keep u

enumerate improvement proposal

2006-10-29 Thread James Stroud
I think that it would be handy for enumerate to behave as such: def enumerate(itrbl, start=0, step=1): i = start for it in itrbl: yield (i, it) i += step This allows much more flexibility than in the current enumerate, tightens up code in many cases, and seems that it would break

Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Snor
I'm attempting to create a lobby & game server for a multiplayer game, and have hit a problem early on with the server design. I am stuck between using a threaded server, and using an event driven server. I've been told time and time again that I should use an event driven server design (that is, u

  1   2   >