Pygame - jerky motion

2005-03-11 Thread donn
Hi- just installed pygame, not sure where to go for some help. I am on Fedora 3 running an ATI card but without the GL drivers installed. When I run any of the examples they work fine but they are very jerky. The animation is smooth for a few seconds and then the entire thing pauses for a heartb

Re: Pygame - jerky motion

2005-03-11 Thread donn
donn wrote: > Hi- just installed pygame, not sure where to go for some help. > I am on Fedora 3 running an ATI card but without the GL drivers installed. > > When I run any of the examples they work fine but they are very jerky. > The animation is smooth for a few seconds and

Re: Insane crazy question - printing commands

2007-11-06 Thread Donn
eback (most recent call last): File "inspect.py", line 1, in ? import inspect File "/home/donn/Projects/pythoning/fontyPython/extending/cairotests/containers/inspect.py", line 9, in ? print inspect.getsource(x.draw) AttributeError: 'module' object h

Re: String formatting with %s

2007-12-02 Thread Donn
> dictionary-key/value syntax), you can do something like: > >>> number = lambda x: dict((str(i+1), v) for (i,v) in enumerate(x)) > >>> "%(2)s and %(1)s" % number(["A", "B"]) Whoa - that'll take me a little while to figure out, but it looks intriguing! Tah. \d -- http://mail.python.org/mailman/l

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-12 Thread Donn
Martin, I really appreciate your reply. I have been working in a vacuum on this and without any experience. I hope you don't mind if I ask you a bunch of questions. If I can get over some conceptual 'humps' then I'm sure I can produce a better app. > That's a bug in the app. It shouldn't assume

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, Thanks, food for thought indeed. > On Unix, yes. On Windows, NTFS and VFAT represent file names as Unicode > strings always, independent of locale. POSIX file names are byte > strings, and there isn't any good support for recording what their > encoding is. I get my filenames from two sour

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, > Yes. It does so when it fails to decode the byte string according to the > file system encoding (which, in turn, bases on the locale). That's at least one way I can weed-out filenames that are going to give me trouble; if Python itself can't figure out how to decode it, then I can also

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
> So on *your* system, today: what encoding are the filenames encoded in? > We are not talking about arbitrary files, right, but about font files? > What *actual* file names do these font files have? > > On my system, all font files have ASCII-only file names, even if they > are for non-ASCII chara

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
> If you can all ls them, and if the file names come out right, then > they'll have the same encoding. Could it not be that the app doing the output (say konsole) could be displaying a filename as best as it can (doing the ignore/replace) trick and using whatever fonts it can reach) and this woul

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
> No. It may use replacement characters (i.e. a question mark, or an empty > square box), but if you don't see such characters, then the terminal has > successfully decoded the file names. Whether it also correctly decoded > them is something for you to check (i.e. do they look right?) Okay. So, t

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, I want to thank you for your patience, you have been sterling. I have an overview this evening that I did not have this morning. I have started fixing my code and the repairs may not be that extreme after all. I'll hack-on and get it done. I *might* bug you again, but I'll resist at all

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Well, that didn't take me long... Can you help with this situation? I have a file named "MÖgul.pog" in this directory: /home/donn/.fontypython/ I set my LANG=C Now, I want to open that file from Python, and I create a path with os.path.join() and an os.listdir() which resul

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
> Now you are mixing two important concepts - the *contents* > of the file with the *name* of the file. Then I suspect the error may be due to the contents having been written in utf8 from previous runs. Phew! It's bedtime on my end, so I'll try it again when I get a chance during the week. Th

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-14 Thread Donn
> Can you please type > paf = ['/home/donn/.fontypython/M\xc3\x96gul.pog'] > f = open(paf, "r") I think I was getting a ghost error from another try somewhere higher up. You are correct, this does open the file - no matter what the locale is. I have decided to kee

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-14 Thread Donn
Given that getlocale() is not to be used, what's the best way to get the locale later in the app? I need that two-letter code that's hidden in a typical locale like en_ZA.utf8 -- I want that 'en' part. BTW - things are hanging-together much better now, thanks to your info. I have it running in

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-14 Thread Donn
> You get the full locale name with locale.setlocale(category) (i.e. > without the second argument) Ah. Can one call it after the full call has been done: locale.setlocale(locale.LC_ALL,'') locale.setlocale(locale.LC_ALL) Without any issues? > > I need that two-letter code that's hidden in a > > t

Re: piping into a python script

2008-01-24 Thread Donn
> wget -i - > it doesn't do anything, just waits for your input. Your applications > probably should behave the same. Okay, that works for me. > Paddy wrote: > > ls *.a | ./fui.py -f - *.b > It doesn't seem to me that -f parameter is necessary for your > application. Yes and no, I have another op

Re: piping into a python script

2008-01-24 Thread Donn
Thanks for the tips, I'll decode and try 'em all out. > Ah yes, Groo. Ever wonder who would win if Groo and Forrest Gump fought > each other? Heh ;) I reckon they'd both die laughing. Be fun to watch -- if anyone else survived! \d -- "A computer without Windows is like chocolate cake without

Re: piping into a python script

2008-01-25 Thread Donn
Andrew, Thanks for your tips. I managed to get a working script going. I am sure there will be stdin 'issues' to come, but I hope not. If anyone wants to have a look, it's on the cheese shop at: http://pypi.python.org/pypi/fui \d -- "You know, I've gone to a lot of psychics, and they've told me

pyZui - anyone know about this?

2009-12-10 Thread Donn
Hi, I happened upon this youtube link: http://www.youtube.com/watch?v=57nWm984wdY It fairly blew my socks off. In it a fellow by the name of David Roberts demos a zui written in Python. Aside from the zooming (which is impressive enough) it show embedding of images, pdf files, web pages and text.

Re: pyZui - anyone know about this?

2009-12-11 Thread Donn
On Friday 11 December 2009 12:38:46 Daniel Fetchinson wrote: > Youtube has a link 'Send message' on the profile of users, maybe > sending a message to the person who uploaded the video will give you a > useful response. > I'm a Tube-tard so that never crossed my mind. Will give it a go. \d -- ht

Re: pyZui - anyone know about this?

2009-12-14 Thread Donn
On Monday 14 December 2009 00:10:52 David Boddie wrote: > Doesn't the author give his e-mail address at the end of the video? > (Maybe I'm thinking of a different video.) > Yes, in a quick and garbled way :) I have yet to try to contact the author or the youtube poster -- been too busy. I was ho

Re: pyZui - anyone know about this?

2009-12-14 Thread Donn
On Tuesday 15 December 2009 01:43:52 David Boddie wrote: > I managed to catch his address and sent him a message saying that people > were discussing PyZUI in this thread. > Oooh. Sits,fidgets and waits. I want my socks back! (OP) :D \d -- \/\/ave: donn.in...@googlewave.com home: http://otherwis

Re: pyZui - anyone know about this?

2009-12-15 Thread Donn
On Tuesday 15 December 2009 04:29:39 David Roberts wrote: > Yes, the toolkit used is PyQt. \me makes note to start learning PyQt asap. > and employs pyramidal tiling for efficiency \me ... time to hit Wikipedia :) > (I haven't used any Qt/KDE voodoo in this regard). Imho, your code should *becom

Re: pyZui - anyone know about this?

2009-12-15 Thread Donn
On Tuesday 15 December 2009 11:12:21 Martijn Arts wrote: > You could do some really awesome stuff with that! I love the webpage > example where you zoom in on the exclamation mark and there's a new page. > It is very cool, but I would inject a note of caution here: I'd a hate a zui to become a c

Re: pyZui - anyone know about this?

2009-12-16 Thread Donn
On Wednesday 16 December 2009 09:42:14 David Roberts wrote: > PyZUI 0.1 has been released: Magic! Grabbed a tarball yesterday. \d -- \/\/ave: donn.in...@googlewave.com home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://s

Re: pyZui - anyone know about this?

2009-12-16 Thread Donn
On Wednesday 16 December 2009 07:03:19 David Roberts wrote: > It involves scaling an image to various resolutions, and partitioning > them into fixed-size tiles. It's roughly the same technique used by > Google Maps/Earth. Thanks. That gives me something to go on. Wikipedia didn't like my search t

Re: pyZui - anyone know about this?

2009-12-17 Thread Donn
On Thursday 17 December 2009 10:54:59 David Roberts wrote: > Have you seen Eagle Mode[1]? > Yes. It's a strange beast. Good start I think; but addicted to zooming, to the detriment of the managing aspects I think. Still, here I sit writing no code and pontificating! \d -- \/\/ave: donn.in...@g

Re: pyZui - anyone know about this?

2009-12-17 Thread Donn
On Thursday 17 December 2009 19:46:41 Terry Reedy wrote: > His idea was for a document rather than > app centric plain. These days I find the notion of monolithic apps to be a pita. The concept of many small black boxes (but open source) that each do a single job and pipe in/out is so much more

Re: Significant whitespace

2010-01-01 Thread Donn
On Saturday 02 January 2010 00:02:36 Dan Stromberg wrote: > I put together a page about significant whitespace (and the lack thereof). The only thing about Python's style that worries me is that it can't be compressed like javascript can*, and perhaps that will prevent it becoming a browser-side

Re: SVG PIL decoder

2009-09-30 Thread Donn
On Wednesday 30 September 2009 18:01:50 Patrick Sabin wrote: > I would like to open svg files with PIL, but svg doesn't seem to be > supported. Does anyone know about a svg decoder for the PIL? Have a look at Cairo (python-cairo) in conjunction with librsvg (python-rsvg) -- that'll fix you up. You

Re: SVG PIL decoder

2009-09-30 Thread Donn
On Thursday 01 October 2009 01:08:28 Patrick Sabin wrote: > Thanks for the tip. Got it work, although it was a bit tricky, as > resizing doesn't seem to be supported by python-rsvg and > cairo.ImageSurface.create_from_png doesn't allow StringIO or My best suggestions are to visit the Cairo website

Re: organizing your scripts, with plenty of re-use

2009-10-03 Thread Donn
Great description - wish the Python docs could be as clear. Thanks. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Skeletal animation

2009-10-05 Thread Donn
On Monday 05 October 2009 18:09:46 Manowar wrote: > just need to know if i can manipulate the bones in > realtime with python. If you are looking for some kind of "from awesome import Bones", then I really don't know of anything. You should look at the various 3D toolkits (like Panda 3D, python-

Re: What do I do now?

2009-10-11 Thread Donn
On Monday 12 October 2009 00:53:42 Someone Something wrote: > 1) What should I start programming (project that takes 1-2 months, not very > short term)? > 2) Whtat are some good open source projects I can start coding for? These kinds of questions amaze me. Surely you are a kid in a candy shop when

Re: Unexpected exit of Python script

2009-10-14 Thread Donn
On Wednesday 14 October 2009 14:23:11 vicky wrote: > I just want to know that, due to any reason if a script exits, is > their some way to release all the resources acquired by the script > during execution ? Python cleans-up after itself so I would not worry about that until you are an expert and

Re: how to write a unicode string to a file ?

2009-10-15 Thread Donn
On Friday 16 October 2009 01:59:43 Stephen Hansen wrote: > Just to say, thanks for that post. I am an old ascii dog and this notion of encoding and decoding is taking such a lng time to penetrate my thick skull. Little snippets like your post are valuable insights. I have made a gnote of it!

Re: how to write a unicode string to a file ?

2009-10-16 Thread Donn
On Friday 16 October 2009 13:08:38 Niklas Norrthon wrote: > that made me think I understand > Lol, I know the feeling! :D I have read that page a few times, and I always emerge thinking 'now I've got it'. Then a week passes... \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python so sad?

2009-10-27 Thread Donn
> > def ...(...(: > > ... > > class ...(...(: > I disagree. It looks like one smiley is drooling into the other smiley's > mouth. Two smileys, one function? Yuk! That *def*initely has no *class* ... :P \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & Go

2009-11-17 Thread Donn
On Saturday 14 November 2009 22:23:40 Paul Rubin wrote: > they'll have to call it Go2 Lol. Or we could fork it and call it Gosub ... and never return! \d -- http://mail.python.org/mailman/listinfo/python-list

pyclutter anyone?

2010-02-05 Thread donn
Hi, this is a little bit of a cross-post. I posted to the clutter list, but there's little activity there. I am trying to make sense of pyClutter 1.0. Could anyone point me to an example (or post one) that shows clipping from a path applied to child objects? For example: A star shape that conta

Re: pyclutter anyone?

2010-02-05 Thread donn
No one uses pyClutter? I have some code, it does not work, but maybe this will start to help solve the problem: import clutter from clutter import cogl x,y=0,0 def boo(tl,frame,obj):#,evt): global x,y obj.set_position(x, y) def xy(obj,evt): global x,y x,y = ev

Re: Creating formatted output using picture strings

2010-02-10 Thread donn
On 10/02/2010 20:36, pyt...@bdurham.com wrote: def picture(s, pic, placeholder='@'): nextchar=iter(s).next return ''.join(nextchar() if i == placeholder else i for i in pic) Hell's teeth - even I understood that! Amazing solution. \d -- Fonty Python and Things! -- http://otherwise.re

Re: How to keep effects of image filters going for some seconds?

2010-03-21 Thread donn
On 21/03/2010 09:23, Ren Wenshan wrote: I have been learning Panda3D, an open source 3D engine, Ask on the Panda3D forums, you will get good help there. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Hello [How to run your code]

2010-07-10 Thread donn
On 10/07/2010 13:05, Dani Valverde wrote: It could be a solution. But I am used to work with gEdit using the R statistical programming language plugin, and I am able to send the code to console instead of typing it in. To run your code, save it to a file 'mycode.py' (or whatever), then open a co

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread donn
On 02/08/2010 17:35, Mark Lawrence wrote: aka the colon. :) Ha. This is a case of the colon being the appendix! \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-04 Thread donn
On 04/08/2010 20:09, Dotan Cohen wrote: Don't forget that the Euro symbol is outside the Greek character set. I could make some kind of economic joke here, but I'm also broke :D \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't I run this test class?

2009-09-11 Thread Donn
On Friday 11 September 2009 09:30:42 Kermit Mei wrote: Do this: class Test(object): > t1 = Test And this: t1 = Test() That makes an instance and runs the __init__ \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://

ImageFont family mojibake

2009-09-11 Thread Donn
Python 2.6 PIL Version: 1.1.6-3ubuntu1 libfreetype6 Version: 2.3.9-4ubuntu0.1 Hello, I have a feeling I've asked this in the distant past, but it's recently emerged as a bug in my app so can anyone point me in the right direction? In Fonty Python, when I draw the family name of a f

Re: ImageFont family mojibake

2009-09-12 Thread Donn
On Saturday 12 September 2009 07:55:14 Lie Ryan wrote: > > f=ImageFont.truetype("FGTshgyo.TTF",1,encoding="utf-8") > > print f.font.family > > '?s' > Are you sure that your terminal (Command Prompt/bash/IDLE/etc) supports > utf-8 and that it is properly set up to display utf-8? Fairly sure.

Re: ImageFont family mojibake

2009-09-12 Thread Donn
On Saturday 12 September 2009 17:30:19 garabik- news-2005...@kassiopeia.juls.savba.sk wrote: > apt-get install unicode > unicode 0100.. Nice tip, thanks. > if you see a lot of accented letters (and not squares or question marks), > you can be sure I see the accented chars -- so now I am more cert

Re: How to print without spaces?

2009-09-18 Thread Donn
print "a"+"b" \d -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-22 Thread Donn
On Monday 21 September 2009 22:49:50 daggerdvm wrote: > you brain needs error checking! try: return response() except Troll,e: raise dontFeed(anymore=True) \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://savann

Re: Getting return code for a Python script invoked from a Linux shell script

2009-09-23 Thread Donn
On Wednesday 23 September 2009 18:51:29 volcano wrote: > exit_code = !$ I think it's $? to get the code. \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://savannah.nongnu.org/projects/fontypython/ -- http://mail.py

Re: arrays in python

2009-09-23 Thread Donn
On Wednesday 23 September 2009 19:14:20 Rudolf wrote: > I want to allocate an array and then populate it > using a for loop. You don't need to allocate anything, just use the list or dictionary types. l=[] #empty list for x in range(1,500): l.append(x) \d -- http://mail.python.org/mailman/

Re: arrays in python

2009-09-23 Thread Donn
On Wednesday 23 September 2009 22:12:24 Ethan Furman wrote: > Works great if you want 4,999,999 elements. ;-) Omit the '1' if you > want all five million. Yes. Fenceposts always get me :) And I was just reminded that one can: l=range(500) \d -- home: http://otherwise.relics.co.za/ 2D vector

Re: how to truncate to get the 1st 5 chars from a string

2009-09-23 Thread Donn
On Thursday 24 September 2009 05:05:45 MacRules wrote: > s="1234abcd" print s[0:4] should do it. Not sure it's a function though. \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://savannah.nongnu.org/projects/fon

Re: Distributing Python-programs to Ubuntu users

2009-09-25 Thread Donn
On Friday 25 September 2009 08:15:18 Olof Bjarnason wrote: > Does anyone have any hint on a more economic way of creating > single-file distribution packages You could use distutils (setup.py) and include a readme that explains what apt-get commands to use to install pygame, etc. Generally it's be

Walking deeply nested lists

2010-08-27 Thread donn
This is all about walking trees, recursion and generators. None of which fit my brain at all! From an XML tree (an SVG file) I build a bunch of Tag objects. [I use lxml, but I am combining multiple svg files into a 'forest' of trees, so I can't use the lxml walking methods because they all sto

Re: Walking deeply nested lists

2010-08-28 Thread donn
On 28/08/2010 08:43, Peter Otten wrote: If you call functions within functions (or methods, it doesn't matter) they consume stack space Right, got it. Darn, but at least there's that setrecursionlimit call. Thanks, \e -- http://mail.python.org/mailman/listinfo/python-list

Re: Walking deeply nested lists

2010-08-28 Thread donn
On 28/08/2010 09:21, Arnaud Delobelle wrote: This flattens the list in the flatwalk method (which IMHO it should do given its name!): Heh, I often name things ahead of my actual capacity to implement them! el is child.flatwalk(): Ah, I see what you mean. I think 'is' is 'in', but I kind of g

Re: Walking deeply nested lists

2010-08-28 Thread donn
On 28/08/2010 11:17, Carl Banks wrote: It's simple. Copy the object to flatten onto your stack. Pop one item off the stack. If the item you popped is a list, push each item of that list onto the stack. Otherwise yield the value. Loop until stack is empty. Nice. The reversed thing was throwing me,

Re: Walking deeply nested lists

2010-08-28 Thread donn
On 28/08/2010 12:03, Peter Otten wrote: But be warned that if you set the limit too high instead of giving you a RuntimeError your program will segfault. Silly question: is there any way to tell the future in this case? I mean, ask for X recursion limit, and catch an error (or something) if tha

Re: Walking deeply nested lists

2010-08-28 Thread donn
On 28/08/2010 14:41, Peter Otten wrote: BTW, I didn't expect it but I get different results on different runs. Clever code. I will give it a go soonest. Elec off for the next 24 hours in my neck of the woods. Urgh. Python can't "import electricity" just yet :) \d -- http://mail.python.org/mail

Re: [RFC] Parametric Polymorphism

2005-09-26 Thread Donn Cave
ter may in fact be the more ideal usage? This isn't hypothetical either. Your example is a fine one, and some kind of table to resolve the function according to type of input argument is a good idea. I'm just saying that more general application of this idea is best left to languages li

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Donn Cave
ely enough to be very interesting. In the functional language approach I'm familiar with, you introduce a variable into a scope with a bind - let a = expr in ... do something with a and initialization is part of the package. Type is usually inferred. The kicker though is that the variab

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) wrote: > On Tue, 04 Oct 2005 10:18:24 -0700, Donn Cave <[EMAIL PROTECTED]> wrote: > [...] > >In the functional language approach I'm familiar with, you > >introduce a variable into a scope with

Re: new forum -- homework help/chit chat/easy communication

2005-10-08 Thread Donn Cave
_the_ definition. The word is used in such broad and vague ways that to use it is practically a sign of sloppy thinking. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: new forum -- homework help/chit chat/easy communication

2005-10-09 Thread Donn Cave
an be performed | automatically. I don't think the shell is any exception - I think it's reasonable to see it as a control+UI language embedded in the UNIX operating system. It wouldn't really be a very useful stand-alone application on a computer platform without the same basic prope

Re: Python's Performance

2005-10-09 Thread Donn Cave
hon runtime doesn't even look at the source code. Fair to say that byte code is interpreted? Seems to require an application we commonly call an interpreter. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Performance

2005-10-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Donn Cave wrote: > > > | > Except it is interpreted. > > | > > | except that it isn't. Python source code is compiled to byte code, which > > | is then exec

Re: subprocess and non-blocking IO (again)

2005-10-10 Thread Donn Cave
oesn't have pty functionality. It's hard to say for sure who said what in that page, after the incredible mess Google has made of their USENET archives, but I believe that's why you see dup2 there - the author is using a pty library, evidently pexpect. As far as I know, things have not moved on in this respect, not sure what kind of movement you expected to see in the intervening month. I don't think you need ptys, though, so I wouldn't worry about it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Performance

2005-10-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > Donn Cave <[EMAIL PROTECTED]> writes: > > I agree that there are many shades of grey here, but there's also a > > real black that's sharply distinct and easy to find -- real n

Re: tuple versus list

2005-10-17 Thread Donn Cave
re, as opposed to the way we are typically more interested in positional access to a tuple. Maybe a more computer literate reader will have a better word for this, that doesn't collide with Python terminology. My semi-formal operational definition is "a is similar to a[x:

Re: Writing an immutable object in python

2005-10-17 Thread Donn Cave
erve the same pattern with respect to object identities. Mutability doesn't really play any role here. > Is there a way to bypass it (or perhaps to write a self-defined > immutable object)? Bypass what? What do you need? Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Run process with timeout

2005-10-17 Thread Donn Cave
this. (Interesting that it's a function parameter, not a method to be overridden by a subclass.) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyboardInterrupt vs extension written in C

2005-10-20 Thread Donn Cave
peek into Python for this, I'm wondering if your module could set its own signal handler for SIGINT, which would set a library flag. Then call PyErr_SetInterrupt(), to emulate the normal signal handler. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Read/Write from/to a process

2005-10-25 Thread Donn Cave
e for all I know it may have evolved in this respect.) The pipe-like VMS device was called a "mailbox", and the interesting feature was that you could be notified when a read had been queued on the device. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: popen2

2005-10-29 Thread Donn Cave
open Hello, it seems fairly clear that the stdin/stdout in question belongs to another process, which cannot be instructed at this point to execute freopen(). If there's a way to do this, it will be peculiar to the platform and almost certainly not worth the effort. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich __repr__

2005-11-02 Thread Donn Cave
_name__, id(self), special) def __repr__(self): return self.make_repr(repr(self.my_favorite_things)) This omits the module qualifier for the class name, but arguably that's a bit of a nuisance anyway. If there's a best, common practice way to do it, I wouldn't care to pose as an expert in such things, so you have to decide for yourself. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Variable Access and Assignment

2005-11-03 Thread Donn Cave
2] > > I can understand that Guido was a bit reluctant to introduce > += etc into Python, and it's important to understand that they > typically behave differently for immutable and mutable objects. As far as I know, Guido has never added a feature reluctantly. He can take full

Re: O_DIRECT on stdin?

2005-11-07 Thread Donn Cave
din.read() or > os.read() to reliably use a buffer that fits the alignment restriction. Though of course os.read() would eliminate one layer of buffering altogether. Might be worth a try. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-09 Thread Donn Cave
, the ability to store some state. This is of course useful in situations where we want to propagate state changes, so it naturally comes up in this context, but language per se does not observe any distinction here so far as I know. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-10 Thread Donn Cave
vague or even wrong statement about its relationship to the issue. It has been going on for years, usually I believe from people who understand quite well how it really works. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: running functions

2005-11-17 Thread Donn Cave
ppened to me. As I said, I thought their design was good, but maybe they just didn't get the word out like they should have - that threads are scary. Donn Cave, [EMAIL PROTECTED] (posting this from a Python/BeOS API newsreader) -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding through recursion

2005-11-18 Thread Donn Cave
sure. State variables are analogous to goto in a way, similar sort of spaghetti potential. It may or may not help to have all the strands come out at the same spot, if the route to that spot could be complicated. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: ownership problem?

2005-11-21 Thread Donn Cave
for over a decade, wonder if it had any influence on your C++ zeitgeist? Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.4.2 on AIX 4.3 make fails on threading

2005-11-22 Thread Donn Cave
5 In earlier compilers, and I think this one too, "cc_r" (instead of "xlc") gives you the thread options and libraries. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: pipe related question

2005-11-23 Thread Donn Cave
cation on VMS?) The only thing I can think of is a select() with timeout, with some compromise value that will allow most outputs to complete without stalling longer than is really convenient. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: exception KeyboardInterrupt and os.system command

2005-11-28 Thread Donn Cave
m posed in the original post. But it might be just as well to watch the process status for any non-zero value, and then call the graceful exit procedure. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2005-11-30 Thread Donn Cave
still the most efficient library of functions for their purpose for use in supercomputing applications. Apparently hand-optimized assembler for specific processors. http://seattlepi.nwsource.com/business/250070_goto29.html (actually from the NY Times, apparently) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-30 Thread Donn Cave
two similar things interchangeable. So we're happy to see that tuple does not have the features it doesn't need, because it helps in a small way to make Python code better. If only by giving us a chance to have this little chat once in a while. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-12-01 Thread Donn Cave
with something a lot like StructSequence. Meanwhile losing a significant overhead. I wrote a quickie Python API to SequenceStruct and used it to make an (x, y) coord type, to compare with a Coord.x,y class. A list of a million coords used 1/5 space, and took 1/10 the time to create. Hm. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-12-01 Thread Donn Cave
thout necessarily supporting the effort. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-12-01 Thread Donn Cave
ity and purity. Maybe it's more like tuples have a primary intended purpose, and some support for other applications. Not white, but not pure black either. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-12-01 Thread Donn Cave
have some interesting historical perspectives there, but not much of a historical issue, I'd say, without much going on in the way of a user community. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Donn Cave
a #! or not. csh (the shell language that doesn't look anything like C, Bill Joy's attempt at language design before he started over with Java) does that only if the first line is "#"; otherwise it invokes the Bourne shell. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-12-02 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: | Donn Cave <[EMAIL PROTECTED]> writes: ... |> For me, conceptually, if an object can't be accessed |> sequentially, then it can't be mapped to a sequence. | | So you're saying that for should implicitly invoke list (or mayb

Re: spawnle & umask

2005-12-08 Thread Donn Cave
part of the published API for os.py, so it would be unseemly to complain if it were to change in later versions. So I guess the right thing to do is write your own spawn function from the ground up. But at least you have some ideas there about how it might work. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-01 Thread Donn Cave
ly where you actually have complete coverage from unit testing, which not everyone can claim and I'm sure even fewer really have. And like the man said, you're doing that work to find a lot of things that the compiler could have found for you. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   >