Photogallery written in Python?

2005-12-30 Thread Arthur Pemberton
Does anyone know of a photo gallery implemented in python? Preferably one as featureful as those used at kde-look.org and art.gnome.org?Thank you. -- As a boy I jumped through Windows, as a man I play with Penguins. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange interaction between exec, dictionary subtypes, and global variables in 2.4

2005-12-30 Thread Alex Martelli
Crutcher <[EMAIL PROTECTED]> wrote: ... > Except that there is some niggling edge case dealing with variables > which have been marked 'global'. It seems that if a compiled chunk of > python contains a 'global VAR' statement, anywhere, then that VAR, and > only that VAR, will bypass the subclass

Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread homepricemaps
never mind i figured out what you were saying,. worked like a charm! thanks for your help. yaffa -- http://mail.python.org/mailman/listinfo/python-list

Re: UpDate For SCSIPython Storage device test library

2005-12-30 Thread sam
Just a added note,that these routines will access any storage drive that is mounted under Windows. The Scsi Pass Through layer maps all Pcmcia,IDE,andSCSI drives to use SCSI commands. This allows a user to access all these interfaces with a common command set. Sam Schulenburg -- http://mail.pyth

Re: Memoization and encapsulation

2005-12-30 Thread Raymond Hettinger
Steven D'Aprano wrote: > I was playing around with simple memoization and came up with something > like this: > > _cache = {} > def func(x): > global _cache > if _cache.has_key(x): > return _cache[x] > else: > result = x+1 # or a time consuming calculation... >

Re: Memoization and encapsulation

2005-12-30 Thread Raymond Hettinger
Steven D'Aprano wrote: > I was playing around with simple memoization and came up with something > like this: > > _cache = {} > def func(x): > global _cache > if _cache.has_key(x): > return _cache[x] > else: > result = x+1 # or a time consuming calculation... >

Re: Memoization and encapsulation

2005-12-30 Thread bonono
Steven D'Aprano wrote: > I was playing around with simple memoization and came up with something > like this: > > _cache = {} > def func(x): > global _cache > if _cache.has_key(x): > return _cache[x] > else: > result = x+1 # or a time consuming calculation... >

Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2005 20:22:52 -0800, homepricemaps wrote: > if i use the code below to write a list to a file > > list = (food, price, store) Why are you shadowing the built in type list? This is bad practice. Sooner or later you will do this: list = [1, 2, 3] something = process(list) ... lots

Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread limodou
30 Dec 2005 20:44:29 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > i want them to be on the same line when they are written to the file. > right now they are written like this: > > food > price > store > > i want them to be written like this > > food price store > > how do i do that? > >>> prin

Re: questions about py2exe and wax

2005-12-30 Thread Hans Nowak
iclinux wrote: > Using py2exe, I can convert a GUI Application with PythonCard to a > standalone windows program, and it works. > Then I try another GUI Toolkit named Wax, implement a GUI App, it > works. And I convert that app by py2exe. But this time, when run, it > show a messagebox that says:

Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread homepricemaps
i want them to be on the same line when they are written to the file. right now they are written like this: food price store i want them to be written like this food price store how do i do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread limodou
30 Dec 2005 20:22:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > if i use the code below to write a list to a file > > list = (food, price, store) > data.append(list) > f = open(r"test.txt", 'a') > f.write ( os.linesep.join( list ) ) > > > it outputs to a file like this > > apple > .49 > star m

Memoization and encapsulation

2005-12-30 Thread Steven D'Aprano
I was playing around with simple memoization and came up with something like this: _cache = {} def func(x): global _cache if _cache.has_key(x): return _cache[x] else: result = x+1 # or a time consuming calculation... _cache[x] = result return result w

why writing list to file puts each item from list on seperate line?

2005-12-30 Thread homepricemaps
if i use the code below to write a list to a file list = (food, price, store) data.append(list) f = open(r"test.txt", 'a') f.write ( os.linesep.join( list ) ) it outputs to a file like this apple .49 star market and i want it to do apple, .49. star market any ideas -- http://mail.python.or

why writing list to file puts each item from list on seperate line?

2005-12-30 Thread homepricemaps
if i use the code below to write a list to a file list = (food, price, store) data.append(list) f = open(r"test.txt", 'a') f.write ( os.linesep.join( list ) ) it outputs to a file like this apple .49 star market and i want it to do apple, .49. star market any ideas -- http://mail.python.or

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread grahamd
> as great as mod_python is, there are lots of restrictions and > limitations to what youc an do with it because of limitations of apache > itself, and I am refereing to apache 2.x as well as 1.x, like others > are saying if you don't need apache specific things it will just be one > more thing to

Re: Global Variables in OOP and Python

2005-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2005 20:00:51 -0500, Mike Meyer wrote: >> The other way I thought of is to create a separate class that consists >> of the variables and to use the >> >> from import * >> >> in all of the files (namespaces) where it is needed. > > Except for one detail, this is a Pythonesque meth

Re: List index method for complex list item types?

2005-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2005 18:56:47 -0800, techiepundit wrote: > Mike, > > I'm trying to figure out dictionaries using the documentation. Clicking > on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is > that the documentation for the dictionary type? If so, I do not see an > "append"

Re: List index method for complex list item types?

2005-12-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I'm trying to figure out dictionaries using the documentation. Clicking > on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is > that the documentation for the dictionary type? If so, I do not see an > "append" or "add" or "insert" method defined in th

questions about py2exe and wax

2005-12-30 Thread iclinux
Using py2exe, I can convert a GUI Application with PythonCard to a standalone windows program, and it works. Then I try another GUI Toolkit named Wax, implement a GUI App, it works. And I convert that app by py2exe. But this time, when run, it show a messagebox that says: """ This application req

Re: On threads and constructors

2005-12-30 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I have a class: > > class ServerThreadManager(threading.Thread): > def __init__(self): > threading.Thread.__init__(self) > # and a bunch of constructor statements > > def run(self): > self.ReqHandlingLoop() > > # and a bunch of other

Re: List index method for complex list item types?

2005-12-30 Thread techiepundit
Mike, I'm trying to figure out dictionaries using the documentation. Clicking on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is that the documentation for the dictionary type? If so, I do not see an "append" or "add" or "insert" method defined in the list of methods on that p

Re: python coding contest

2005-12-30 Thread Christoph Zwerschke
Mark Dickinson wrote: > Here's a variant of André's brilliant idea that's > 119 characters long, and fully printable: > > j=''.join;seven_seg=lambda z:j(j(' _ | |_ _|_|' > [ord('^r|=Zm.:v\r'[int(a)])%u*2:][:3]for a in z) > +"\n"for u in(3,7,8)) You have an escaped CR (\r) as the last character

On threads and constructors

2005-12-30 Thread techiepundit
I have a class: class ServerThreadManager(threading.Thread): def __init__(self): threading.Thread.__init__(self) # and a bunch of constructor statements def run(self): self.ReqHandlingLoop() # and a bunch of other methods ServerObj = ServerThreadManager() pr

Re: Global Variables in OOP and Python

2005-12-30 Thread Brian van den Broek
Gary Herron said unto the world upon 30/12/05 08:03 PM: > newbie wrote: > > >>Hello, >> >>I have questions about global variables in OOP (in general) and Python >>(in specific). I understand (I think) that global variables are >>generally not a good idea. However, if there are variables that nee

Re: List index method for complex list item types?

2005-12-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have a list of sockets that I use for select.select calls like this: [...] > But a thought struck me while writing this: Does Python not provide a > way to search a list of sublists to find something on, say, the value > of the first sublist item field as a way to find

Re: Global Variables in OOP and Python

2005-12-30 Thread Gary Herron
newbie wrote: >Hello, > >I have questions about global variables in OOP (in general) and Python >(in specific). I understand (I think) that global variables are >generally not a good idea. However, if there are variables that need to >be accessed by a number of classes that exists in separate nam

python coding contest

2005-12-30 Thread Mark Dickinson
Here's a variant of André's brilliant idea that's 119 characters long, and fully printable: j=''.join;seven_seg=lambda z:j(j(' _ | |_ _|_|' [ord('^r|=Zm.:v\r'[int(a)])%u*2:][:3]for a in z) +"\n"for u in(3,7,8)) Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: IRC sockets and queries

2005-12-30 Thread J4Y
kk -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuning a select() loop for os.popen3()

2005-12-30 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Christopher DeMarco <[EMAIL PROTECTED]> wrote: > I've written a class to provide an interface to popen; I've included > the actual select() loop below. I'm finding that "sometimes" popen'd > processes take "a really long time" to complete and "other times" I > get

List index method for complex list item types?

2005-12-30 Thread techiepundit
I'm a Python newbie who just started learning the language a few weeks ago. So these are beginner questions. I have a list of sockets that I use for select.select calls like this: ReadList,WriteList,EventList = select.select(self.SocketList,[],[],3) In parallel with that list of sockets I want s

Re: Global Variables in OOP and Python

2005-12-30 Thread Mike Meyer
"newbie" <[EMAIL PROTECTED]> writes: > So far, I have approached the problem by making the variables > attributes of one class and passing instances of the class as variables > to the other class' methods. That's the standard way to do it in OO languages. > The other way I thought of is to create

Strange interaction between exec, dictionary subtypes, and global variables in 2.4

2005-12-30 Thread Crutcher
I've been playing with dictionary subtypes for custom environments, and I encountered a strange interaction between exec, dictionary subtypes, and global variables. I've attached a test program, but first I'd like to give some background. Python uses dictionary objects as symbol tables in it's exe

Re: IRC sockets and queries

2005-12-30 Thread Heiko Wundram
Heiko Wundram wrote: > Yeah, me too. How lame do you think we are?! I won't feed the trolls... I won't feed the trolls... I won't feed the trolls... I won't feed the trolls... --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: IRC sockets and queries

2005-12-30 Thread Heiko Wundram
Jay wrote: > LMFAO! Yeah, me too. How lame do you think we are?! --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

generators in Java?

2005-12-30 Thread Tom Sheffler
This may have been discussed before, so I apologize. Does Java have generators? I am aware of the "Iterator" interface, but it seems much more restrictive. Python generators are useful for many more things than simply list enumeration, but the Java Iterator seems limited. Tom -- http://mail.p

Re: Global Variables in OOP and Python

2005-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2005 15:03:54 -0800, newbie wrote: > Hello, > > I have questions about global variables in OOP (in general) and Python > (in specific). I understand (I think) that global variables are > generally not a good idea. However, if there are variables that need to > be accessed by a num

Re: IRC sockets and queries

2005-12-30 Thread J4Y
http://h1.ripway.com/jay001/PyIRCnMo.txt -- http://mail.python.org/mailman/listinfo/python-list

Re: IRC sockets and queries

2005-12-30 Thread Jay
LMFAO! those were jokes for my friends. lol.and btw the dccpoper and bot and crap were jokes that i made up for my friends on the #python channel in freenode... It was a joke.Anyway.. My bad, its ok if u dont want to help... no one likes me on this group anyway... u guys just joined the crowd... bt

python encoding bug?

2005-12-30 Thread garabik-news-2005-05
I was playing with python encodings and noticed this: [EMAIL PROTECTED]:~$ python2.4 Python 2.4 (#2, Dec 3 2004, 17:59:05) [GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> unicode('\x9d', 'iso8859_1') u'\x9d' >>> U+009D is NOT a

Global Variables in OOP and Python

2005-12-30 Thread newbie
Hello, I have questions about global variables in OOP (in general) and Python (in specific). I understand (I think) that global variables are generally not a good idea. However, if there are variables that need to be accessed by a number of classes that exists in separate namespaces (files), what

Re: Guido at Google

2005-12-30 Thread John J. Lee
Robert Kern <[EMAIL PROTECTED]> writes: [...] > No, it's not a silly idea. Dean Baker, the Co-Director the Center for Economic > and Policy Research, has proposed for the U.S. government to establish a > Software Developer's Corps. For $2 billion per year, it could fund about > 20,000 > developers

Re: python coding contest

2005-12-30 Thread Marius Gedminas
I managed it with vim. -- http://mail.python.org/mailman/listinfo/python-list

Re: compare dictionary values

2005-12-30 Thread Tim Williams (gmail)
In <[EMAIL PROTECTED]>, rbt wrote: > What's a good way to compare values in dictionaries? Do you need to compare dictionaries, if its an option it would be simpler/cheaper  to compare  each entry from your file listing with entries in a single dict and act accordingly, mainly because you will alrea

Re: python coding contest

2005-12-30 Thread André
Claudio Grondi wrote: > > P.S. By the way: on Windows XP with UltraEdit there was no problem to > input the special characters. There is an ASCII table and a HEX editor > mode available for it. Any hints which free editor makes it possible, too? I simply used Pythonwin. (print chr(3), then cut an

Re: python coding contest

2005-12-30 Thread André
Shane Hathaway wrote: > Claudio Grondi wrote: > > so I tried all which made sense in the context of '0' conversion and > > found out, that it should be the > > > >' _ |_|_ _| |' > > > > not the at http://aroberge.blogspot.com/ > > > >' _ |_|_ _| |' > > The HTML source has the three spaces

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread fuzzylollipop
as great as mod_python is, there are lots of restrictions and limitations to what youc an do with it because of limitations of apache itself, and I am refereing to apache 2.x as well as 1.x, like others are saying if you don't need apache specific things it will just be one more thing to work aroun

Re: Guido working on Pypy?

2005-12-30 Thread Vincent Wehren
"Andrew Durdin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On 29 Dec 2005 04:12:53 -0800, Luis M. González <[EMAIL PROTECTED]> wrote: |> |> According to this blog entry, it says that Guido has been hired by |> Google to work on Pypy: |> http://zephyrfalcon.org/weblog2/arch_e10_0

Re: compare dictionary values

2005-12-30 Thread rbt
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, rbt wrote: > >> What's a good way to compare values in dictionaries? > > Look them up and then compare!? ;-) > >> I want to find >> values that have changed. I look for new keys by doing this: >> >> new = [k for k in file_info_cur.iterk

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Claudio Grondi wrote: > so I tried all which made sense in the context of '0' conversion and > found out, that it should be the > >' _ |_|_ _| |' > > not the at http://aroberge.blogspot.com/ > >' _ |_|_ _| |' The HTML source has the three spaces. If the code had been surrounded by

Re: compare dictionary values

2005-12-30 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, rbt wrote: > What's a good way to compare values in dictionaries? Look them up and then compare!? ;-) > I want to find > values that have changed. I look for new keys by doing this: > > new = [k for k in file_info_cur.iterkeys() if k not in > file_info_old.iterkeys()]

Re: python coding contest

2005-12-30 Thread Claudio Grondi
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. > > Enjoy! > > André > It doesn't work for me as described on that page. The output is scrumbled. It seems, that the

Re: csrss.exe & Numeric

2005-12-30 Thread Tim Peters
[jelle] > I have a function that uses the Numeric module. When I launch the > function csrss.exe consumes 60 / 70 % cpu power rather than having > python / Numeric run at full speed. Has anyone encountered this problem > before? It seriously messes up my Numeric performance. > > I'm running 2.4.2 o

Re: Xah's Edu Corner: Tech Geekers and their Style

2005-12-30 Thread Harlan Messinger
[followups to comp.infosystems.www.authoring stylesheets, since that's the only newsgroup the OP addressed where this is relevant (LISP?? what was he thinking?] Xah Lee wrote: > Sometimes you want your text to flow into multiple columns, as in > newspaper's layout. However, as of 2005-12 this is

Re: csrss.exe & Numeric

2005-12-30 Thread Travis E. Oliphant
jelle wrote: > I have a function that uses the Numeric module. When I launch the > function csrss.exe consumes 60 / 70 % cpu power rather than having > python / Numeric run at full speed. Has anyone encountered this problem > before? It seriously messes up my Numeric performance. > Are you memory

Re: python coding contest

2005-12-30 Thread Tim Hochberg
Shane Hathaway wrote: > André wrote: > >>For the few that might be interested, I will be posting the details of >>a 117 character long solution to the challenge on my blog >>http://aroberge.blogspot.com/. >> >>Enjoy! > > > You took advantage of prime numbers, enabling you to extract encoded > i

Tuning a select() loop for os.popen3()

2005-12-30 Thread Christopher DeMarco
Hi all... I've written a class to provide an interface to popen; I've included the actual select() loop below. I'm finding that "sometimes" popen'd processes take "a really long time" to complete and "other times" I get incomplete stdout. E.g: - on boxA ffmpeg returns in ~25s; on boxB (compa

Re: oop in python

2005-12-30 Thread jmdeschamps
(addendum) ... And even ... >>> eval("t").max() 12 >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: oop in python

2005-12-30 Thread jmdeschamps
Larry Bates wrote: > novice wrote: > > hello over there! > > I have the following question: > > Suppose I created a class: class Point: > > pass > > then instanciated an instance: new = Point() > > So now how to get the insta

compare dictionary values

2005-12-30 Thread rbt
What's a good way to compare values in dictionaries? I want to find values that have changed. I look for new keys by doing this: new = [k for k in file_info_cur.iterkeys() if k not in file_info_old.iterkeys()] if new == []: print new, "No new files." else:

Re: python coding contest

2005-12-30 Thread Shane Hathaway
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. > > Enjoy! You took advantage of prime numbers, enabling you to extract encoded information using a single modulus op

Re: IRC sockets and queries

2005-12-30 Thread Heiko Wundram
David Wahler wrote: > > Not only is this obnoxious, it doesn't even work. > > Not only is this _extremely_ obnoxious, but it doesn't even work. Don't > expect any help from me. > Thanks for pointing that out (I must've missed those two examples when I read the code). And I even pointed him in

Re: python coding contest

2005-12-30 Thread André
For the few that might be interested, I will be posting the details of a 117 character long solution to the challenge on my blog http://aroberge.blogspot.com/. Enjoy! André -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-30 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Thomas Heller wrote: > >>X=' _ _ _ | _| _ |_|_' >>Y=0x23018F406A3530EC273F008 >>j="".join >>seven_seg=lambda n:j(j(c)+"\n"for c in zip(*[X[Y>>m+int(d)*9&7::8]for d in n >>for m in(6,3,0)])) > > > Interesting bit: > > Although there are more 3-char combinations

Re: Newbie - SOAP return message with embedded ZIP file

2005-12-30 Thread Diez B. Roggisch
Rodney schrieb: > Hi again, thanks for the help with figuring out how to parse a SOAP return > message. I know have a return message that has an embedded ZIP file in it. > Can anyone help me figure out how to extract this file from the SOAP return > message. The message looks as following: Yo

Re: Xah's Edu Corner: Tech Geekers and their Style

2005-12-30 Thread Pascal Bourguignon
"Xah Lee" <[EMAIL PROTECTED]> writes: > Sometimes you want your text to flow into multiple columns, as in > newspaper's layout. However, as of 2005-12 this is not yet possible. > One can make-do by hard-coding it into HTML TABLE using multiple > columns. It is a pain because when you change your t

Re: Xah's Edu Corner: Tech Geekers and their Style

2005-12-30 Thread Michael Winter
On 30/12/2005 16:45, Xah Lee wrote: [Follow-ups trimmed to c.i.w.a.stylesheets] [snip] > A proposed solution is in CSS3 “Multi-column layout”, drafted in > 2001 but not yet in any mainstream browsers as of 2005-12. Quite rightly so, in my opinion. The Multi-column layout module is currently a

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Szabolcs Nagy wrote: > my two solutions (well I wasn't so clever to encode everything in > strings instead of numbers, but at least it won't give warnings about > non ascii characters): > 128: > j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b > in(4,2,1))+'\n'for i in(306775

Re: MidiToText : EventDispatcher instance has no attribute 'sysex_events'

2005-12-30 Thread tim
Carsten Haese wrote: On Fri, 2005-12-30 at 09:52, tim wrote: Trying to convert midi to text using MidiToText.py. I get the following: midi_port: 0 Traceback (most recent call last): File "MidiToText.py", line 176, in ? midiIn.read() File "C:\Python24\Lib\site-packages\midi\MidiInFile.p

Re: When Python *Eggs* better than Python *distutils*?? What's Eggs?

2005-12-30 Thread Phillip J. Eby
[EMAIL PROTECTED] wrote: > I have been using distuils for a while and was wondering when > Python Eggs (new project) is better? If you have a relatively simple setup script, don't need to upload your package to PyPI, and don't include any files other than .py files and C extensions in your distrib

Re: python for with double test

2005-12-30 Thread Alan Franzoni
Il 30 Dec 2005 09:02:30 -0800, [EMAIL PROTECTED] ha scritto: > hi all > the is a way for doing a for with double test: what's a 'double test' exactly? :-) 'for' does no test, it just iterates over a list. If you want to execute the iteration only if f is 1, do this: if f==1: for i in r

Re: When Python *Eggs* better than Python *distutils*?? What's Eggs?

2005-12-30 Thread Phillip J. Eby
Paul Boddie wrote: > Could anyone enlighten me/us as to why the Smart Package Manager [1] > (written in Python, presented at EuroPython this year) isn't being more > closely investigated as part of a suitable solution? More closely investigated by whom, as a solution for what? Surely there is som

Re: python coding contest

2005-12-30 Thread Szabolcs Nagy
my two solutions (well I wasn't so clever to encode everything in strings instead of numbers, but at least it won't give warnings about non ascii characters): 128: j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b in(4,2,1))+'\n'for i in(306775170,1060861645,524130191)) 122:

Re: python for with double test

2005-12-30 Thread Szabolcs Nagy
for i in range(0,10): if f!=1: break ... i=0 while i<10 and f==1: ... i+=1 -- http://mail.python.org/mailman/listinfo/python-list

Re: python for with double test

2005-12-30 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > hi all > the is a way for doing a for with double test: >example > for i in range(0,10) and f==1: > Not sure if you're asking a question, but is this what you are trying to do? : if f == 1: for i in range(0,10):

Pyrex on Darwin, gcc 3.3 optimization trouble

2005-12-30 Thread Will Ware
I am trying to build a Pyrex module on Mac OS X version 10.3.9 (don't know which big cat that is). It already builds fine on Mandrake Linux and Windows XP. I have one source file where gcc hangs if given an optimization setting of -O2 or -O3, but a level of -O works fine. Can anybody suggest an ap

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Tim Hochberg wrote: > g=''.join;seven_seg=lambda i:g( > g(' _|x|'[ord("~$]m'k{d\x7fo"[int(n)])>>s&j] > for n in i for j in(2,1,4))+'\n'for s in(6,0,3)) > > I've replaced the unprintable characters and added some preemptive > linebreaks so that hopefully this won't get too munged. It's all clear

python for with double test

2005-12-30 Thread [EMAIL PROTECTED]
hi all the is a way for doing a for with double test: example for i in range(0,10) and f==1: thanx everyone -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-30 Thread Michael Spencer
Tim Hochberg wrote: > Shane Hathaway wrote: >> Andrew Durdin wrote: >> >>> On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >>> >>> I just found a 125 character solution. It's actually faster and more readable than the 133 character solution (though it's still obscure.) >>> >>> Hav

Xah's Edu Corner: Tech Geekers and their Style

2005-12-30 Thread Xah Lee
Sometimes you want your text to flow into multiple columns, as in newspaper's layout. However, as of 2005-12 this is not yet possible. One can make-do by hard-coding it into HTML TABLE using multiple columns. It is a pain because when you change your text, you have to manually cut and paste to just

Xah's Edu Corner: Tech Geekers and their Style

2005-12-30 Thread Xah Lee
Sometimes you want your text to flow into multiple columns, as in newspaper's layout. However, as of 2005-12 this is not yet possible. One can make-do by hard-coding it into HTML TABLE using multiple columns. It is a pain because when you change your text, you have to manually cut and paste to just

Re: python coding contest

2005-12-30 Thread Tim Hochberg
Shane Hathaway wrote: > Andrew Durdin wrote: > >>On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >> >> >>>I just found a 125 character solution. It's actually faster and more >>>readable than the 133 character solution (though it's still obscure.) >> >> >>Having spent a good deal of time a

Re: new-style classes multiplication error message isn't veryinformative

2005-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2005 13:23:30 +, Jon Guyer wrote: > Steven D'Aprano REMOVETHIScyber.com.au> writes: > >> >> On Fri, 30 Dec 2005 03:47:30 +, Jon Guyer wrote: >> >> > We have a rather complicated class that, under certain circumstances, knows >> > that it cannot perform various arithmetic

Re: WMI - invalid syntax error?

2005-12-30 Thread py
py wrote: >Something must be happening somewhere causing it > to get fouled up. I'm gonna try on a different PC. I tried on another PC, same problem. Also, I added "reload(wmi)" before I create an instance of wmi.WMI just to see what happens, so I hve... import wmi def ppn(machine=None): t

Re: MidiToText : EventDispatcher instance has no attribute 'sysex_events'

2005-12-30 Thread Carsten Haese
On Fri, 2005-12-30 at 09:52, tim wrote: > Trying to convert midi to text using MidiToText.py. > I get the following: > > midi_port: 0 > Traceback (most recent call last): > File "MidiToText.py", line 176, in ? > midiIn.read() > File "C:\Python24\Lib\site-packages\midi\MidiInFile.py", line

Re: python code optimization

2005-12-30 Thread Peter Hansen
Darius Kučinskas wrote: > I know that sometimes optimization is not good idea. It's neither good nor bad. Whether or not to optimize is merely a decision that should not be made without considering the cost, and without a real need driving it. The need can only be seen by profiling your code a

Re: oop in python

2005-12-30 Thread Larry Bates
novice wrote: > hello over there! > I have the following question: > Suppose I created a class: class Point: > pass > then instanciated an instance: new = Point() > So now how to get the instance new as a string: like ' new '

Re: query on python list

2005-12-30 Thread Larry Bates
I'm having trouble determining what you want but I think there are a couple of problems in your code: list2 = ['1','2','5',4] did you mean list2 = ['1','2','3','4'] Note missing quotes around the 4 and 5 instead of 3 If you want to know if list2 is found in list 1 it is as simple as: if list2

Re: WMI - invalid syntax error?

2005-12-30 Thread py
Tim Golden wrote: > > import wmi > wmi._DEBUG = True > > c = wmi.WMI () > # This will print a moniker looking something like this: > # > winmgmts:{impersonationLevel=Impersonate,authenticationLevel=Default}/ro > ot/cimv2 > > > and let me know what comes out. I ran it twice, first it worked, seco

RE: WMI - invalid syntax error?

2005-12-30 Thread Tim Golden
[py] | Tim Golden wrote: | > Could you just post (or send by private email if you prefer) | > the exact script you're running? If you want to send it | > privately, please us mail timgolden.me.uk. | | I am truly unsure what the problem could be, and the fact that the | error says "invalid syntax"

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

2005-12-30 Thread Ilias Lazaridis
Martin P. Hellwig wrote: [...] - (complex elaborations) > So the sum it up my unanswered question to you so far are: > - What is your definition of "Efficiency" http://lazaridis.com/efficiency/definitions.html (as stated on the website, any feedback is welcome. But please not within this thread

Re: WMI - invalid syntax error?

2005-12-30 Thread py
Tim Golden wrote: > Could you just post (or send by private email if you prefer) > the exact script you're running? If you want to send it > privately, please us mail timgolden.me.uk. I am truly unsure what the problem could be, and the fact that the error says "invalid syntax" ...just doesn't ma

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread Larry Bates
Matt Helm wrote: > > I am starting the design phase of a large project (ERP) where the > backend will mostly be Python (or Ruby) providing web services. > > In this type of usage, is there any benenfit to running under Apache > as opposed to a pure Python solution using Medusa, TwistedMatrix, or

MidiToText : EventDispatcher instance has no attribute 'sysex_events'

2005-12-30 Thread tim
Trying to convert midi to text using MidiToText.py. I get the following: midi_port: 0 Traceback (most recent call last): File "MidiToText.py", line 176, in ? midiIn.read() File "C:\Python24\Lib\site-packages\midi\MidiInFile.py", line 24, in read p.parseMTrkChunks() File "C:\Python24\

RE: WMI - invalid syntax error?

2005-12-30 Thread Tim Golden
[py] > import wmi > # the ip of my own local desktop > machine = "1.2.3.4" > try: > w = wmi.WMI(machine) # also tried, wmi.WMI(computer=machine) > except Exception, e: > print "ERROR:", e . . > c:>python > >>> from MyScript import * > >>> ERROR: -0x7ffbfe1c - Invalid syntax . . > here's t

Re: WMI - invalid syntax error?

2005-12-30 Thread py
one more note, I am using WMI v0.6 however, I also tried it with the latest version 1.0 rc2. -- http://mail.python.org/mailman/listinfo/python-list

Re: WMI - invalid syntax error?

2005-12-30 Thread py
here's the trace... File "MyScript.py", line 10, wmiObj = wmi.WMI(machine) File "wmi.py", line 519, in __init__ handle_com_error (error_info) File "wmi.py", line 131, in handle_com_error raise x_wmi, "\n".join (exception_string) x_wmi: -0x7ffbfe1c - Invalid syntax -- http://mai

python code optimization

2005-12-30 Thread Darius Kučinskas
Hi,I know that sometimes optimization is not good idea.So I want to know what you think about this one:we have code like this: tables = []for i in ... :    tables.extend(...)we optimize code like this:tables = []pfTablesExtend = tables.extendfor i in ... :    pfTablesExtend(...)I what to know is

WMI - invalid syntax error?

2005-12-30 Thread py
Hi, I am running python 2.4.2 on win xp pro. I have the WMI module from Tim Golden (http://tgolden.sc.sabren.com/python/wmi.html). I have some code which does this... MyScript.py -- import wmi # the ip of my own local desktop machine = "1.2.3.4" try: w = wmi.WMI(machine) #

Re: Application Portability?

2005-12-30 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Neil Benn wrote: >> I know that this isn't a fashionable thing to write on a >>dynamic language newsgroup but I would really recommend switching to >>Java for your work if you are looking at recoding it. > > I was thinking this to myself as well, as Java should

  1   2   >