Re: DOS, UNIX and tabs

2007-01-03 Thread Hendrik van Rooyen
Steven D'Aprano [EMAIL PROTECTED] wrote: I've spent a lot of time reading both sides of the tabs versus spaces argument, and I haven't found anything yet that explains why tabs are, in and of themselves, bad. +1 for QOTW Searching for the badness of tabs is like searching for the holy grail.

Re: Writing more efficient code

2007-01-03 Thread Hendrik van Rooyen
Jon Harrop [EMAIL PROTECTED] wrote: I think that is an excellent idea. Who will pay me? ;-) The same fellow who is paying you to post to this newsgroup... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: list/dictionary as case statement ?

2007-01-02 Thread Hendrik van Rooyen
Stef Mientki [EMAIL PROTECTED] wrote: If I'm not mistaken, I read somewhere that you can use function-names/references in lists and/or dictionaries, but now I can't find it anymore. The idea is to build a simulator for some kind of micro controller (just as a general practise, I

Re: (PyGTK) Disabling ToolButton when no TreeView item is selected?

2006-12-28 Thread Hendrik van Rooyen
cypher543 [EMAIL PROTECTED] wrote: I have a TreeView and a ToolButton. The ToolButton should only be active if the user has selected an item in the TreeView. What signal should I use to achieve this? you can try using the configure method on the toolbutton in the command that is executed

Re: Use a Thread to reload a Module?

2006-12-25 Thread Hendrik van Rooyen
Gregory Piñero [EMAIL PROTECTED] wrote: To: Hendrik van Rooyen [EMAIL PROTECTED] On 12/24/06, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Gregory Piñero [EMAIL PROTECTED] wrote: ... open( filename[,flag='c'[,protocol=None[,writeback=False[,binary=None) Open a persistent dictionary

Re: Fall of Roman Empire

2006-12-23 Thread Hendrik van Rooyen
Thomas Ploch [EMAIL PROTECTED] wrote: Delaney, Timothy (Tim) wrote: Hendrik van Rooyen wrote: naaah - you don't have to worry - for real control He uses assembler. with jump statements. so the loops are closed. Unfortunately its not open source. Yet. People are working hard

Re: Use a Thread to reload a Module?

2006-12-23 Thread Hendrik van Rooyen
Gregory Piñero [EMAIL PROTECTED] wrote: On 12/23/06, Hendrik van Rooyen [EMAIL PROTECTED] wrote: have you looked at putting the data into a persistent dict? - Hendrik What is that exactly? -Greg from the docs: 3.17 shelve -- Python object persistence A ``shelf'' is a persistent

Re: Question about Tkinter windows

2006-12-22 Thread Hendrik van Rooyen
Manuel Malo de Molina wrote in an email: Hi, thanks for answering. The problem is that the window can be closed in many ways (including some not controlled by the program, as the X on the top right), is there a way to capture the window closing event? Please keep it on the list so that other

Re: How a script can know if it has been called with the -i commandlineoption?

2006-12-22 Thread Hendrik van Rooyen
Michele Simionato [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Michele Simionato [EMAIL PROTECTED] wrote: but I don't see a way to retrieve the command line flags, where should I look? sys.argv() ? - Hendrik No, read what Carsten said: That doesn't answer

Re: Retrieve Tkinter listbox item by string, not by index

2006-12-22 Thread Hendrik van Rooyen
Kevin Walzer [EMAIL PROTECTED] wrote: I'm trying to set the active item in a Tkinter listbox to my application's currently-defined default font. not sure if you can mix fonts in a listbox - the font option when you create the listbox instance seems to apply globally to all the lines in the

Re: Use a Thread to reload a Module?

2006-12-22 Thread Hendrik van Rooyen
Gregory Piñero [EMAIL PROTECTED] wrote: Hi Python Experts, I hope I can explain this right. I'll try. Background: I have a module that I leave running in a server role. It has a module which has data in it that can change. So every nth time a function in the server gets called, I

Re: SQLALCHEMY - Method to have the last word, by Michael Bayer

2006-12-21 Thread Hendrik van Rooyen
Diez B. Roggisch [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Wearing skull socks makes you mean. Ahh, I guess you're right - that twitching in my feet I should get rid of them, wear cherubim socks instead and take a more relaxed stance towards Ilias and his kind. If only I

Re: tuple.index()

2006-12-21 Thread Hendrik van Rooyen
Nick Maclaren [EMAIL PROTECTED] wrote: Hendrik van Rooyen [EMAIL PROTECTED] writes: | When I looked at the above, I went tilt - Yes, you are confused :-) Neither the agents nor strings take the other as 'arguments', but are effectively methods of the I/O object. Let's consider a modern

Re: How a script can know if it has been called with the -i command lineoption?

2006-12-21 Thread Hendrik van Rooyen
Michele Simionato [EMAIL PROTECTED] wrote: The subject says it all, I would like a script to act differently when called as $ python script.py and when called as $ python -i script.py. I looked at the sys module but I don't see a way to retrieve the command line flags, where should I look?

Re: Question about Tkinter windows

2006-12-21 Thread Hendrik van Rooyen
Manuel Malo de Molina wrote: Hi everyone, this is the first time I use Python. I'm working on an application using Tkinter and I would like that the windows could only be opened once, is there any option to get that? I don't know if I've explained myself: what I want is that if the user clicks

Re: Problem in using Pulp

2006-12-21 Thread Hendrik van Rooyen
[EMAIL PROTECTED] wrote: GLPK(C:\Documents and Settings\Amit\Desktop\glpk-4.9\glpk-4.9\examples\).solve(prob) ^* * This is a no no - the backslash escapes the last quote... - Hendrik --

Re: SQLALCHEMY - Method to have the last word, by Michael Bayer

2006-12-20 Thread Hendrik van Rooyen
Diez B. Roggisch [EMAIL PROTECTED] wrote: So - stop it, go away, and please, pretty please with sugar on top: don't come back. Python doesn't need you, this NG doesn't need you, no FOSS project needs you. Buy a dog. That needs you. Until it runs away from being evaluated. This proves it.

Re: Fall of Roman Empire

2006-12-20 Thread Hendrik van Rooyen
Thomas Ploch [EMAIL PROTECTED] wrote: Ben Finney schrieb: John Machin [EMAIL PROTECTED] writes: Ben Finney wrote: \ ...one of the main causes of the fall of the Roman Empire was | `\that, lacking zero, they had no way to indicate successful | _o__)

Re: tuple.index()

2006-12-20 Thread Hendrik van Rooyen
Nick Maclaren [EMAIL PROTECTED] wrote: Not at all. I didn't say that they came in pairs. Consider: [str1, str2, agent1, str3, agent2, agent3, agent4, str4, ...] See Algol 68 for an example of this. When I looked at the above, I went tilt - If you had no a priori knowledge about how

Re: Can a Tkinter GUI check for abort script:

2006-12-19 Thread Hendrik van Rooyen
Michael Yanowitz top posted (again): No. test3.py (for example) is just plain Python code that sends and receives socket data from another machine. It does (or could) contain loops that last a long time, repeating the read or write operations to and from the socket. This grabs the CPU. What

Re: How to replace a comma

2006-12-18 Thread Hendrik van Rooyen
From: Lad [EMAIL PROTECTED] wrote: In a text I need to add a blank(space) after a comma but only if there was no blank(space) after the comman If there was a blank(space), no change is made. I think it could be a task for regular expression but can not figure out the correct regular

Re: Can a Tkinter GUI check for abort script:

2006-12-18 Thread Hendrik van Rooyen
Michael Yanowitz [EMAIL PROTECTED] Wrote: Hello: I have successfully implemented a Tkinter GUI which has this (simplified here for explanation): +-+ | filename: [./test3.py] | | | | [Run Script]

Re: How to replace a comma

2006-12-18 Thread Hendrik van Rooyen
Lad [EMAIL PROTECTED] top posted: top posting fixed re's are a pain. Do this instead: s = hello, goodbye,boo s.replace(', ',',') 'hello,goodbye,boo' _.replace(',',', ') 'hello, goodbye, boo' Thank you for ALL for help. Hendrik, your solution works great but what is `_`

Re: Can a Tkinter GUI check for abort script:

2006-12-18 Thread Hendrik van Rooyen
Michael Yanowitz top posted: Presently what happens is that the script takes over and all the buttons on the GUI disappear as the GUI is not given any cpu time to refresh or check if any activity in the dialog. Yuk! you may have to run the script in a thread then, to preserve the GUI

Re: Python-URL! - weekly Python news and links (Dec 18)

2006-12-18 Thread Hendrik van Rooyen
Kay Schluehr [EMAIL PROTECTED] wrote: Paul Boddie wrote: Meanwhile, the EuroPython planners get ahead of themselves, thinking about conference venues as far in the future as 2010, if not 20010! Python 20010. It was a nice conference although a bit lame on the first day. My

Re: merits of Lisp vs Python

2006-12-16 Thread Hendrik van Rooyen
greg [EMAIL PROTECTED] I once heard mention of a system of units in use at one time with the odd feature that capacitance came out in units of length. Picture the scene: Hobbyist walks into Dick Smith store and says I'd like a 5cm capacitor, please. This is correct - think of it as

Re: beginner, thread else

2006-12-15 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: Gigs_ wrote: -- import thread the thread module should not be used directly by application programs; use the threading module instead. Ooops! - I am doing this, for long running stuff. I was aware of threading,

Re: tuple.index()

2006-12-15 Thread Hendrik van Rooyen
Christoph Zwerschke [EMAIL PROTECTED] wrote: I don't think it's a problem of false logic but the problem that homogenous data is not defined. We probably agree that it usually makes perfect sense to use tuples for coordinates. But in certain mathematical algorithms it also makes sense to

Re: Snake references just as ok as Monty Python jokes/references inpython community? :)

2006-12-14 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: Ah yes, exposure to Blackadder helps enormously ... after some hours spent trying to understand things like metaclasses, it's helpful to know what to do: put a pencil or chopstick up each nostril, wear your underpants on your head, and sit there

Re: Is anyone using Python for embedded applications?

2006-12-13 Thread Hendrik van Rooyen
Paul Boddie [EMAIL PROTECTED] wrote: Interesting! Any links, or is it related to the Telit hardware already discussed? telit it was... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: alternate language

2006-12-12 Thread Hendrik van Rooyen
Bryan [EMAIL PROTECTED] wrote: what is a good alternate language to learn? i just want something to expand my mind and hopefully reduce or delay any chance of alzheimer's. i would especially like to hear from those of you who learned python _before_ these languages. haskell, erlang, ocaml,

Re: Is anyone using Python for embedded applications?

2006-12-12 Thread Hendrik van Rooyen
Carl J. Van Arsdall [EMAIL PROTECTED] wrote: I'm aware of a couple python projects for embedded systems. I am currently considering using Python on an embedded platform to develop a simple application as a personal project, mostly to see if it will work. I was wondering if anyone here

Re: Subprocess with a Python Session?

2006-12-09 Thread Hendrik van Rooyen
Paul Boddie [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Paul Boddie wrote: This is one of the more reliable methods since upon receiving a packet delimiter the receiver knows that the data is complete. and for people who want strongRELIABLE/strong and not just at least not

Re: Snake references just as ok as Monty Python jokes/references inpython community? :)

2006-12-09 Thread Hendrik van Rooyen
[EMAIL PROTECTED] wrote: Problem is I don't know that anyone born after Elvis died gets any of these Monty Python jokes. But hey - Elvis is not dead! - that is just a conspiracy theory that was originated by the Cliff Richard's fan club... - Hendrik --

Re: dict.has_key(x) versus 'x in dict'

2006-12-08 Thread Hendrik van Rooyen
Roel Schroeven [EMAIL PROTECTED] wrote: Hendrik van Rooyen schreef: [EMAIL PROTECTED] wrote: Hendrik - as long as it works, and is fast enough, its not broken, so Hendrik don't fix it... That's the rub. It wasn't fast enough. I only realized that had been a problem once

Re: Mirror imaging binary numbers

2006-12-07 Thread Hendrik van Rooyen
Craig [EMAIL PROTECTED] wrote: Hi there, I'm trying to switch binary numbers around so that the MSB becomes the LSB etc. Is there an easy way of doing this as I can't seem to find anything. If you could help that would be great. Thanks and good luck. Are these Python ints, or are they

Re: dict.has_key(x) versus 'x in dict'

2006-12-07 Thread Hendrik van Rooyen
[EMAIL PROTECTED] wrote: Peter Bjoern Schliessmann wrote: Wouldn't be if k in d.keys() be the exact replacement? Peter No, 'k in d' is equivalent to 'd.has_key(k)', only with less Peter (constant) overhead for the function call. 'k in d.keys()' on the Peter other hand

Re: Subprocess with a Python Session?

2006-12-07 Thread Hendrik van Rooyen
Giovanni Bajo [EMAIL PROTECTED] Fredrik Lundh wrote: No matter what I do I cant get the following code to do what I expect. I hadn't used subprocess t o read and write to pipes of a still-running app, and I just can't seem to get it right. What gives? import subprocess p =

Re: Best way to split up lines - RE: About the 79 characterlinerecommendation

2006-12-07 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: 8--- data = struct.unpack(!H4BH20BHI, strMessage) (top, ip1, ip2, ip3, ip4, messageCounter, ackRequired, dataType, utc1, utc2, utc3, utc4, utc5, utc6, utc7, utc8, utc9, utc10, utc11, utc12, st1, st2, st3, st4, st5,

Re: Why not just show the out-of-range index?

2006-12-07 Thread Hendrik van Rooyen
\ Istvan Albert [EMAIL PROTECTED] wrote: what should happen if by accident one uses a 50Mb string as an index? Should it be displayed? It is my opinion that yes, the first 40Mb or so should be displayed, as a lesson to the perpetrator, and to help him find the error. Displaying 50 Mb is

Re: dict.has_key(x) versus 'x in dict'

2006-12-07 Thread Hendrik van Rooyen
[EMAIL PROTECTED] wrote: Hendrik - as long as it works, and is fast enough, its not broken, so Hendrik don't fix it... That's the rub. It wasn't fast enough. I only realized that had been a problem once I fixed it though. LOL - this is kind of weird - it was working, nobody

Re: Python spam?

2006-12-04 Thread Hendrik van Rooyen
Gabriel Genellina [EMAIL PROTECTED] wrote: 8-- So if a friend of yours has played the role of UserA above, that's how some spammers got your email address. + 1 for euphemism of the month... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not just show the out-of-range index?

2006-12-04 Thread Hendrik van Rooyen
Carsten Haese [EMAIL PROTECTED] wrote: 8- My sarcasm meter just exploded. -Carsten Will you miss it a lot? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: problem formatting dates from text fields.

2006-12-03 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: Dennis Lee Bieber wrote: 8-- Simplest is probably to do what many web-sites use for credit card expiration dates... Ignore any pre-built date-time modules... Create three integer fields, make the first

Fw: Is there a reason not to do this?

2006-12-02 Thread Hendrik van Rooyen
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Ron Garret [EMAIL PROTECTED] wrote: I don't want to get into a philosophical debate. Actually, I changed my mind. Consider: so did I - I think the chair analogy is not quite clear, so let me elucidate: def g(): print 'G' def h

Re: Parsing data from pyserial

2006-12-02 Thread Hendrik van Rooyen
Lone Wolf [EMAIL PROTECTED] wrote: I'm trying to get data through my serial port from a CMUcam. This gizmo tracks a color and returns a packet of data. The packet has nine data points (well, really eight since the first point is just a packet header) separated by spaces as follows: M xxx xxx

Re: Is there a reason not to do this?

2006-12-01 Thread Hendrik van Rooyen
Ron Garret [EMAIL PROTECTED] wrote: I don't want to get into a philosophical debate. Actually, I changed my mind. Consider: def g(): print 'G' def h(): print 'H' def f(): g() class C1: def m1(self): f() class C2: def m1(self): g() c1 = C1() c2 = C2() def f(): h() class

Re: Python Worship

2006-11-30 Thread Hendrik van Rooyen
Thomas Ploch [EMAIL PROTECTED] wrote: Nick schrieb: http://www.sciencedaily.com/releases/2006/11/061130081347.htm World's Oldest Ritual Discovered -- Worshipped The Python 70,000 Years Ago Nick That's really interesting since there is an indio tribe in the amazonas jungle

Re: Python spam?

2006-11-30 Thread Hendrik van Rooyen
Aahz [EMAIL PROTECTED] wrote: Anyone else getting Python-related spam? So far, I've seen messages from Barry Warsaw and Skip Montanaro (although of course header analysis proves they didn't send it). -- not like that - just the normal crud from people giving me get rich quick tips on the

Re: Is time.time() time.time() always true?

2006-11-24 Thread Hendrik van Rooyen
Tim Roberts [EMAIL PROTECTED] wrote: Hendrik van Rooyen [EMAIL PROTECTED] wrote: flamesrock [EMAIL PROTECTED] wrote: 8-- since the statement itself occurs at one time instant.. nothing, but nothing, can occur at one time instant Well

Re: rpncalc-2.5 RPN Calculator for Python

2006-11-21 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: John Machin [EMAIL PROTECTED] WROTE: Hendrik van Rooyen wrote: Raymond L. Buvel [EMAIL PROTECTED] wrote: The rpncalc package adds an interactive Reverse Polish Notation (RPN) Can anyone remember who

Re: Is time.time() time.time() always true?

2006-11-21 Thread Hendrik van Rooyen
flamesrock [EMAIL PROTECTED] wrote: 8-- since the statement itself occurs at one time instant.. nothing, but nothing, can occur at one time instant - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: MAKE GOOD MONEY BY INTERNET

2006-11-18 Thread Hendrik van Rooyen
Paul McGuire [EMAIL PROTECTED] wrote: Is there no way to filter this kind of junk, short of going to a moderated list? I don't think its an easy thing to do - short of forcing all new threads to go through some sort of portal, that is moderated, or having members with the privilege of

Re: basic python questions

2006-11-18 Thread Hendrik van Rooyen
[EMAIL PROTECTED] wrote: I am currently going to school at Utah Valley State College, the course that I am taking is analysis of programming languages. It's an upper division course but our teacher wanted to teach us python as part of what does upper division mean in this context ? I am

Re: Py3K idea: why not drop the colon?

2006-11-17 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: have anyone counted the number of colons used in this way by the OP, in his first few posts ? (if there isn't a name for the law that states that the number for a let's remove the colons proposal is always greater than zero, someone should come up with

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Stephan Kuhagen [EMAIL PROTECTED] wrote: The problem with linux kernel limits are, that they won't work really good on MacOSX and Windows... OTOH the idea is the right one, but the effect can be achieved inside of Python. Since Python does byte compile the code and the interpreter evaluates

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Stephan Kuhagen [EMAIL PROTECTED] wrote: The problem with linux kernel limits are, that they won't work really good on MacOSX and Windows... OTOH the idea is the right one, but the effect can be achieved inside of Python. Since Python does byte compile the code and the interpreter evaluates

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Stephan Kuhagen [EMAIL PROTECTED] wrote: The problem with linux kernel limits are, that they won't work really good on MacOSX and Windows... OTOH the idea is the right one, but the effect can be achieved inside of Python. Since Python does byte compile the code and the interpreter evaluates

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Stephan Kuhagen [EMAIL PROTECTED] wrote: The problem with linux kernel limits are, that they won't work really good on MacOSX and Windows... OTOH the idea is the right one, but the effect can be achieved inside of Python. Since Python does byte compile the code and the interpreter evaluates

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Stephan Kuhagen [EMAIL PROTECTED] wrote: The problem with linux kernel limits are, that they won't work really good on MacOSX and Windows... OTOH the idea is the right one, but the effect can be achieved inside of Python. Since Python does byte compile the code and the interpreter evaluates

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
Hendrik van Rooyen [EMAIL PROTECTED] wrote - 5 times - must be record for stupidity... sorry about this - the message was stuck in my outbox for some reason, and I hit the send key multiple times, not noticing that it was in fact being sent... - Hendrik -- http://mail.python.org/mailman

Re: Secure Python

2006-11-15 Thread Hendrik van Rooyen
Fredrik Tolf [EMAIL PROTECTED] wrote: I was thinking that maybe it could be possible to load and run untrusted Python code, simply by loading it in a module with a modified version of __builtins__. Without any reachable function that do unsafe operations, code running from there shouldn't be

Re: Decimal() instead of float?

2006-11-15 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: .. and seriously, under- standing the various aspects of floats and decimals is utterly trivial compared to all the nearly-magical things you need to understand to be able to do geographical calculations at a sub-millimeter scale. heck, even

Re: Decimal() instead of float?

2006-11-15 Thread Hendrik van Rooyen
John Salerno [EMAIL PROTECTED] wrote: John Machin wrote: Here in Austraila, (I expect this is common to most countries), there are people who are utterly clueless about elementary data model rules, like identification numbers should be kept as strings. Do you mean that ID numbers that

Re: Data structure for ordered sequence

2006-11-14 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: unless this is homework because the pil people will not let you distribute pils. I'm not sure I can parse this sentence fragment. What do you mean? oh come on! - you of all people should know that pils means mushroom...

Re: Python development time is faster.

2006-11-14 Thread Hendrik van Rooyen
Chris Brat [EMAIL PROTECTED] wrote: I've seen a few posts, columns and articles which state that one of the advantages of Python is that code can be developed x times faster than languages such as Insert popular language name here. Does anyone have any comments on that statement from

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
Simon Brunning [EMAIL PROTECTED] Wrote: On 11/11/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: blue is red or green or yellow *grin* - this can be construed as a weakness in Python - it's boolean logic, and it's incompatible with human use of the same

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
Robert Kern [EMAIL PROTECTED] wrote: Michael Hobbs wrote: True enough. Although, I have to ask how many times you define a new function only to have Python spit a syntax error out at you saying that you forgot a colon. It happens to me all the time. (Usually after an else) If you'd

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
Dan Lenski [EMAIL PROTECTED] wrote: I think part of learning to think like a computer is learning to stop associating computer logic too strongly with the natural language meanings of and, or, and not. This is true - and you have left out but - Hendrik --

Re: Python v PHP: fair comparison?

2006-11-14 Thread Hendrik van Rooyen
Olexandr Melnyk wrote: PHP has a lower barrier to entry I don't think so. Python has more intuitive syntax for beginners and is one of the best choices for the first programming language to pick up. I second this - before discovering Python (in a GSM module's guts) - I was being steered in

Re: explicit self revisited

2006-11-13 Thread Hendrik van Rooyen
Dennis Lee Bieber [EMAIL PROTECTED] wrote: Especially since there is a comefrom G *breaks into song* : Oh Susannah, now don't you cry for me... -- http://mail.python.org/mailman/listinfo/python-list

Re: Random image text generation?

2006-11-13 Thread Hendrik van Rooyen
From: Leif K-Brooks [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: For a text only solution, consider putting up a natural language question such as: What is the third letter of 'national'? What is four plus two? How many eggs in a dozen? Fill in the blank: Mary had a little

Re: Py3K idea: why not drop the colon?

2006-11-12 Thread Hendrik van Rooyen
Dan Lenski [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Fredrik Lundh [EMAIL PROTECTED] wrote: 8--- color = blue if color == red or green or yellow: ... print color, is red or green or yellow ... blue is red

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: 8--- color = blue if color == red or green or yellow: ... print color, is red or green or yellow ... blue is red or green or yellow *grin* - this can be construed as a weakness in Python - Even

Re: substring search without using built in utils

2006-11-09 Thread Hendrik van Rooyen
Steven D'Aprano [EMAIL PROTECTED] wrote: 8-- Given a source list, find the offset of a target sub-list within the source list, in other words, find for lists. i.e. search(source, target) returns n if source[n:n+len(target)] == target for any sequence type. Yes, I

Re: Multithreaded C API Python questions

2006-11-09 Thread Hendrik van Rooyen
Svein Seldal svein at seldal dot comwrote: 8--- I am dependent upon the ability to have to threads executing in python land at the same time. How can this be done? call time.sleep(0.001) in each, as well as the main thread, to politely give the

Re: [DLC] ChiPy Monthly Meeting, Thursday 7:00 pm.

2006-11-08 Thread Hendrik van Rooyen
Steve Holden [EMAIL PROTECTED] Hendrik van Rooyen wrote: Steve Holden [EMAIL PROTECTED] wrote: I don't suppose there's any chance that someone might be passing Schaumberg on their way to this meeting? I'm teaching there, and a ride would avoid me having to rent a car (and hence

Re: [DLC] ChiPy Monthly Meeting, Thursday 7:00 pm.

2006-11-07 Thread Hendrik van Rooyen
Steve Holden [EMAIL PROTECTED] wrote: I don't suppose there's any chance that someone might be passing Schaumberg on their way to this meeting? I'm teaching there, and a ride would avoid me having to rent a car (and hence increase the probability I'd make it). Where in the whole wide world

Re: Unicode/ascii encoding nightmare

2006-11-06 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: 8--- I strongly suggest that you read the docs *FIRST*, and don't tinker at all. HTH, John This is *good* advice - its unlikely to be followed though, as the OP is prolly just like most of us - you unpack the stuff

Re: Programming Language that is Spreadsheet/Table Based

2006-11-05 Thread Hendrik van Rooyen
James Stroud [EMAIL PROTECTED] wrote: Gerard Flanagan wrote: 8-- Thank you, this is very good stuff to think about. James I can't really add to the above train of thought... And I don't know if this will help - but if you want to think, here is

Re: tips requested for a log-processing script

2006-11-05 Thread Hendrik van Rooyen
Jaap [EMAIL PROTECTED] wrote: Python ers, As a relatively new user of Python I would like to ask your advice on the following script I want to create. I have a logfile which contains records. All records have the same layout, and are stored in a CSV-format. Each record is (non-uniquely)

Re: Is there a way to define a true global across modules?

2006-11-05 Thread Hendrik van Rooyen
alex23 [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: robert [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm Or worse style - if you are too lazy to create a extra global variables module (ab)use

Is there a way to define a true global across modules?

2006-11-03 Thread Hendrik van Rooyen
I am struggling with this - I want to define a system-wide flag for use as a semaphore. It looks to me as if the only way to do it is to import all the modules that need to access it into the main namespace using the from whatever import * form. Is there a way to have one global object known

Re: Is there a way to define a true global across modules?

2006-11-03 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: I am struggling with this - I want to define a system-wide flag for use as a semaphore. http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm /F Thanks - just like COBOL's data division *grin

Re: Is there a way to define a true global across modules?

2006-11-03 Thread Hendrik van Rooyen
robert [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Hendrik van Rooyen wrote: I am struggling with this - I want to define a system-wide flag for use as a semaphore. http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm Or worse style - if you are too

Re: Having trouble with file modes

2006-11-03 Thread Hendrik van Rooyen
erikcw [EMAIL PROTECTED] wrote: 8 #loop through patterns list and find/replace data for o, r in patterns: data = data.replace(o, r) print Replaced %s with %s % (o, r) f.write(data) f.close() This results in an empty file. All of the modes I've

Re: report progress from C function

2006-11-02 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: Michael S wrote: I downloaded Pyrex and ran it through their own example. The code looks quite messy, and I even saw a few gotos. looked at the assembler output from your C compiler lately? /F LOL! - is it even possible to code an if else

Re: Tkinter Listbox string formatting question - how to kill a dancingsnake ?

2006-11-02 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: lots of stuff to for me to download and read up In the meantime, I have produced this evil hack, that takes advantage of the difference in pixel widths between the space, and either the fullstop or the single quote... It will only work if you have quite

Re: Tkinter Listbox string formatting question - how to kill a dancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: instead of trying to force the listbox to behave like a multicolumn widget, maybe you could switch to another widget? some alternatives include a Text widget (you have to roll your own selection logic) I _really_ don't feel strong enough for

Re: Tkinter Listbox string formatting question - how to kill adancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Fredrik Lundh [EMAIL PROTECTED] wrote: instead of trying to force the listbox to behave like a multicolumn widget, maybe you could switch to another widget? some alternatives include a Text widget (you have to roll your own selection

Tkinter Listbox string formatting question - how to kill a dancing snake ?

2006-10-30 Thread Hendrik van Rooyen
I am populating a listbox from a directory that looks like this: variable_dict = {funny_long_or_short_variable_name_as_key: (2,45),.. the tuple represents a card, line pair. medf is a font object and a forward reference here. I write: for x in variable_dict: txt = x while

Re: Python windows interactive.

2006-10-30 Thread Hendrik van Rooyen
notejam [EMAIL PROTECTED] Top posted: Thanks everyone for the help. I got a simple two line program to work from a text file. Can not figure out how to write more than one line in interpreter mode. Is that all interpreter is good for, testing one liners? I have it run the program

Re: ANN: wxPython 2.7.1.3

2006-10-28 Thread Hendrik van Rooyen
Johann C. Rocholl [EMAIL PROTECTED]wrote: 8-- Oh, it's fun to be a speling fanatic! :-) six munce ago I could not even spell 'fatanic' - and now I are one... I wander what a speling fanatic is? - Hendrik --

Re: displaying \n-less prompts in a pythonic way

2006-10-27 Thread Hendrik van Rooyen
Steve Holden [EMAIL PROTECTED] wrote: 8--- mystr = raw_input(Who is this? ) Who is this? Steve how did you know how to answer that? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-26 Thread Hendrik van Rooyen
Robert Kern [EMAIL PROTECTED] wrote: 8-- It's a bit of an abuse on the English language, but what isn't in software? jumps used not to be - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: basic questions on cmp, and sort

2006-10-26 Thread Hendrik van Rooyen
Ben Finney [EMAIL PROTECTED] wrote: To: python-list@python.org Sent: Thursday, October 26, 2006 4:44 AM Subject: Re: basic questions on cmp, and sort Schüle Daniel [EMAIL PROTECTED] writes: 8--- third question sort([[1,2,3],[ABC],['Z','A'], X(), 4)

Re: cleaner way to write this?

2006-10-26 Thread Hendrik van Rooyen
John Salerno [EMAIL PROTECTED] wrote: 8- LOL. Guess I'm doing things right, then? ;) you can NEVER be sure - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter question

2006-10-25 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: Eric Brunel wrote: But Hendrik's solution is better, since it avoids the use of lambda, which is often difficult to understand. storing the button reference in a variable doesn't help if you want to use the same callback for multiple buttons,

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Hendrik van Rooyen
Fredrik Lundh [EMAIL PROTECTED] wrote: Méta-MCI wrote: For the professional developments, it is a major risk. some days, I ask myself why I shouldn't just use GPL for everything I do, and ship it as source code only. /F because then you would deny your work to thousands of ungrateful,

Re: Rabbit Modules - Dynamic C - Python

2006-10-24 Thread Hendrik van Rooyen
Picio [EMAIL PROTECTED] wrote: Hello, I would wonder if anyone knows something about programming with Python, Rabbit Core Modules, that normally were programmed with Dynamic C. I mean either: - something like using python to create code in dynamic suitable for the rabbit core - writing

<    3   4   5   6   7   8   9   >