PIL on MacOS
I was trying to build PIL and pygame from the source on the MacOS. But when I typed 'sudo python setup.py install', it gives error msg : gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -DHAVE_LIBZ -DWORDS_BIGENDIAN -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.4/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c _imaging.c -o build/temp.macosx-10.4-fat-2.4/_imaging.o gcc: cannot specify -o with -c or -S and multiple compilations error: command 'gcc' failed with exit status 1 Is there any one who did this before?how can i solve it? Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a text file based wiki system written in Python
The base of moinmoin is called piki.It provides the simplest functions as a wiki system And there are lots of other wiki system based on piki. If I try to developed one,I'll make the text data compatible with compatible. Jack wrote: > Thanks! Because it was so well known, I thought it was database-based :) > > http://moinmoin.wikiwikiweb.de/ > > Any good and simple text file-based blog system in Python? -- http://mail.python.org/mailman/listinfo/python-list
Re: PIL show moves focus
Is the console necessary? if not, you can easily disable the console by rename the ext to .pyw [EMAIL PROTECTED] wrote: > Hi! > > I have an application where images (jpeg) have to be annotated by an > operator. I use PIL like: > > import Image > im = Image.open(Path) > im.show() > raw_input(Path + ':') > > > Python runs in a console window. Then show starts some application (in > my case "Windows picture and FAX viewer") and the picture goes to this > application window. > Then operator enteres the annotation as prompted by raw_input. So far > so good. I understand, that the approach is very minilalistic, but > suffisient for what has to be done. > > Unfortunatelly after im.show focus moves to thw "Windows picture ..." > and stays there until I move it back using the mouse. > > Question: is there any way of returning the input focus to the console > window? -- http://mail.python.org/mailman/listinfo/python-list
curses module bug in windows python?
when I type command below in windows python: import curses it gives the error msg! It can't find _curses.pyd Is this a bug? -- http://mail.python.org/mailman/listinfo/python-list
how can i write a hello world in chinese with python
I'm try to build a bundle on OS X, so I write a simple python script for a test: #!/usr/bin/env python import EasyDialogs EasyDialogs.Message("Hello,Mac!") This runs OK,but when I try to replace "Hello,Mac!" with chinese, it can't be display rightly. Then I tried some way else: #!/usr/bin/env python import EasyDialogs EasyDialogs.Message("\xe4\xb8\xad") It doesn't work! As I know mac is unicode based,how can I display chinese on the screen? -- http://mail.python.org/mailman/listinfo/python-list
Re: how can i write a hello world in chinese with python
and I tried unicode and utf-8 I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not to use Anyone knows about the setting in the python code file? Maybe python doesn't know I'm to use chinese?! On 12月13日, 下午12时47分, "bearsprite" <[EMAIL PROTECTED]> wrote: > try unicode? > > "kernel1983 写道: > " > > > I'm try to build a bundle on OS X, so I write a simple python script > > for a test: > > > #!/usr/bin/env python > > import EasyDialogs > > EasyDialogs.Message("Hello,Mac!") > > > This runs OK,but when I try to replace "Hello,Mac!" with chinese, it > > can't be display rightly. > > Then I tried some way else: > > > #!/usr/bin/env python > > import EasyDialogs > > EasyDialogs.Message("\xe4\xb8\xad") > > > It doesn't work! > > > As I know mac is unicode based,how can I display chinese on the screen? -- http://mail.python.org/mailman/listinfo/python-list
Re: how can i write a hello world in chinese with python
thanks everyone maybe this simple API doesn't fit the Chinese display but thanks everybody! At least I've got that what bundles is and maybe I can use Python to write program On 12月14日, 上午6时31分, "MRAB" <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On 12 Dec 2006 23:40:41 -0800, "kernel1983" <[EMAIL PROTECTED]> > > declaimed the following in gmane.comp.python.general: > > > > and I tried unicode and utf-8 > > > I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not > > > to use > > >"unicode" is a term covering many sins. "utf-8" is a specification > > for encoding elements of specific unicode characters using 8-bit > > elements (I believe by using certain codes x00 to x7F alone as "normal", > > and then x80 to xFF to represent an "escape" to higher [16-bit] element > > sets). > > >"\xEF\xBB\xBF" is just a byte string with no identifier of what > > encoding is in use (unless the first one or two are supposed to be > > BOM)... In the "Windows: Western" character set, it is equivalent to > > small-i-diaeresis/right-guillemot/upside-down? () In MS-DOS: Western > > Europe, those same bytes represent an > > acute-accent/double-down&left-box-drawing/solid-down&left > > >I've not done any unicode work (iso-latin-1, or subset thereof, has > > done for me). I also don't know Mac's, so I don't know if the windowing > > API has specific calls for Unicode data... But you probably have to > > encode or decod that bytestring into some compatible unicode > > representation.When you save a textfile as UTF-8 in Notepad.exe (Windows) > > it puts the > bytestring "\xEF\xBB\xBF" at the start to indicate that it's UTF-8 and > not ANSI (ie 8-bit characters). The bytes are actually the BOM > bytestring "\xFE\xFF" encoded in UTF-8. -- http://mail.python.org/mailman/listinfo/python-list
Why can't easy_install Django
I look it up in PyPI There are info about Django: Package Score Description Django096 0.96 6 Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. DjangoPaste 0.0 6 Integration of Python Paste and Django TurboDjango 0.95w2 6 Django template for TurboGears, need Django to work djangoinstall 0.1 4 Works like a shell program, but it can modify settings.py and urls.py codehosting 1.6 3 Django codehosting application for developer sites Django 0.91 3 A high-level Python Web framework that encourages rapid development and clean, pragmatic design. The version of Django is still 0.91 and can not be installed Another Django096 seems to be the lasted,but I could not install by easy_install Django096 Django is a big project. Why no one maintain this? Did the guy lost his password? -- http://mail.python.org/mailman/listinfo/python-list
About Pywin32's invoke
By reading the doc of pywin32 we can invoke COM like: o = win32com.client.Dispatch("Excel.Application") but is it possible to invoke some GUID directly? If COM was going to be invoked by python, must it support IDispatch? -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I create a linked list in Python?
Every language has its own way to do the business! Python has a more abstract data type as the common tools. Just do things in pythonic way! On 1月17日, 上午9时55分, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 16/1/2007 17:07, Dongsheng Ruan wrote: > > >Thanks for your kindly help. > >I am new CS student taking datat structure and algorithms with AHO's book > >with the same title. > > >The book is done in Pascal, which might be an outdated language. > > >However, my instructor probably wants us to understand the list ADT better > >by not using the built in list in Python.Just use the same structure as the > >book. Instead of nil, use None; > instead of new(P) where P:^Foo, use P=Foo(); records become classes > without methods... > > Anyway, implementing linked lists, dictionaries, and other basic > structures in a language like Pascal, or C -which doesn't have them > natively- may be a good learning exercise. But doing that in Python > is not a good idea. Of course, using Python in a second or third > algorithms course *is* a good idea, because you can forget about > these implementation details and concentrate on the algorithms. > > -- > Gabriel Genellina > Softlab SRL > > __ > Preguntá. Respondé. Descubrí. > Todo lo que querías saber, y lo que ni imaginabas, > está en Yahoo! Respuestas (Beta). > ¡Probalo ya!http://www.yahoo.com.ar/respuestas -- http://mail.python.org/mailman/listinfo/python-list
How can I write code using FP
In Function Program,Language can use like this: define a function: f = lambda x,y:x,y then we use f to define another function: f2 = f(1) the f2 should equal to: f2=lambda y:1,y we should be able call f2 with one parameter:f2(2) just return 1,2 but how can I implement the characteristic in Python??I think it could do like this but HOW-TO? thanks~~~ I'm a English beginner! I wish somebody understand my meaning -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I write code using FP
yeah! that's easy! althought no so clear a = lambda x,y:(x,y) b = lambda y:a(1,y) a(1,2) (1,2) b(2) (1,2) On 1月17日, 下午12时10分, Alejandro Dubrovsky <[EMAIL PROTECTED]> wrote: > kernel1983 wrote: > > In Function Program?Language can use like this: > > > define a function: > > f = lambda x,y:x,y > > > then we use f to define another function: > > f2 = f(1) > > the f2 should equal to: > > f2=lambda y:1,y > > > we should be able call f2 with one parameter:f2(2) > > just return 1,2 > > > but how can I implement the characteristic in Python??I think it could > > do like this but HOW-TO?If you are using python 2.5, then you can use > > functools.partial, otherwise > lookup one of the many curry implementations, like the ones found > inhttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 > > One found in the comments of that page by Scott David Daniels: > > def curry(*args, **kwargs): > function, args = args[0], args[1:] > def result(*rest, **kwrest): > combined = kwargs.copy() > combined.update(kwrest) > return function(*args + rest, **combined) > return result > > so, in your case: > > f = lambda x,y: (x,y) > f2 = functools.partial(f,1)>>> f2(3)1,3 -- http://mail.python.org/mailman/listinfo/python-list
Re: huge amounts of pure Python code broken by Python 2.5?
On Feb 9, 10:29 am, "Klaas" <[EMAIL PROTECTED]> wrote: > On Feb 6, 11:07 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <[EMAIL PROTECTED]> > > wrote: > > >Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > > Huge amounts of my pure Python code was broken by Python 2.5. > > > >Interesting. Could you give a few illustrations of this? (I didn't run > > >into the same problem at all, so I'm curious.) > > > There are about half a dozen examples linked from here: > > > http://twistedmatrix.com/trac/ticket/1867 > > > Check out the closed ticket linked from there or the changesets for more > > detail. > > The changes listed dont' seem particularly huge considering the size, > complexity, and boundary-pushingness of Twisted, coupled with the > magnitude of the 2.5 release. > > -Mike Just keep using python2.4 -- http://mail.python.org/mailman/listinfo/python-list