Re: Why less emphasis on private data?

2007-01-09 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Mon, 08 Jan 2007 13:11:14 +0200, Hendrik van Rooyen wrote: > > > When you hear a programmer use the word "probability" - > > then its time to fire him, as in programming even the lowest > >

Re: code formatter?

2007-01-09 Thread Hendrik van Rooyen
"siggi" <[EMAIL PROTECTED]> wrote: > Is there a simple code formatter that first removes all indentations and > then refomats correctly? tabnanny ? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise expression

2007-01-09 Thread Hendrik van Rooyen
"Gigs_" <[EMAIL PROTECTED]> wrote: > Can someone explain me bitwise expression? > few examples for every expression will be nice > > x << y Left shift > x >> y Right shift > x & y Bitwise AND > x | y Bitwise OR > x ^ y Bitwise XOR (exclusive OR) > ~x Bitwise negation The short, and possibly weir

Re: recursive function

2007-01-09 Thread Hendrik van Rooyen
"cesco" <[EMAIL PROTECTED]> wrote: > > Neil Cerutti wrote: > > On 2007-01-08, cesco <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I have a dictionary of lists of tuples like in the following example: > > > dict = {1: [(3, 4), (5, 8)], > > > 2: [(5, 4), (21, 3), (19, 2)], > > >

Re: Execute binary code

2007-01-09 Thread Hendrik van Rooyen
"Chris Mellon" <[EMAIL PROTECTED]> wrote: > Repost. Is there any chance at all that ML could set the > reply-to to the list instead of the sender? +1 - I regularly hit "reply all", delete the OP, and then I get : "Message has a suspicious header" - Hendrik -- http://mail.python.org/mai

Re: Why less emphasis on private data?

2007-01-08 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > If you want to write bug-free code, pessimism is the name of the game. A healthy touch of paranoia does not come amiss either... And even then things foul up in strange ways because your head is never quite literal enough. When you hear a program

Re: where is python on linux?

2007-01-08 Thread Hendrik van Rooyen
"rzed" <[EMAIL PROTECTED]> wrote: >mmm... sloppy joes > >-- >rzed > >"A sandwich is a sandwich, but a Manwich is a meal." You eat people? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

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: 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 hol

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 practis

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 execu

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'[,

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

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 loop

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 ca

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

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? > >

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 oth

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 -- http://mail.python.o

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 cl

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

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 'a

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 r

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

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 successfu

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 prove

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. > Wh

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 >

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 main

Re: How to replace a comma

2006-12-18 Thread Hendrik van Rooyen
"Lad" <[EMAIL PROTECTED]> top posted: > > 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 >

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

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 re

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 - thin

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 s

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

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 m

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: 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 anyon

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, erlan

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 -- http://mail.python.org/mailman/l

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 RELIABLE and not just "at least

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... >

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, nobod

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: 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, s

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 subpro

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 > Pet

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

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: 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: 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

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 >

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

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()

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 tip

Re: Is there a reason not to do this?

2006-11-30 Thread Hendrik van Rooyen
"Ron Garret" <[EMAIL PROTECTED]> wrote: > > One of the things I find annoying about Python is that when you make a > change to a method definition that change is not reflected in existing > instances of a class (because you're really defining a new class when > you reload a class definition, not

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 a

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

Re: Tkinter, main loop question.

2006-11-22 Thread Hendrik van Rooyen
"Exod" <[EMAIL PROTECTED]> wrote: > Don't know if its possible in this light-weight GUI toolset, but can i > somehow hook up into the mainloop in it, for example if i were to > create an internet application, i would need to keep recieving data > from within it? Its possible - use the call back

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: 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: > >

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

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 st

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.py

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 eva

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 eva

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 eva

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 eva

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 eva

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 com

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 I

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, >

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 shoul

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 t

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 -- http://mail.p

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"

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

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 <>. > > Does anyone have any comments on that statement from personal > experience? > How

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" mean

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

Re: explicit self revisited

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

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" > &

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 wea

Re: Multithreaded C API Python questions

2006-11-09 Thread Hendrik van Rooyen
"Svein Seldal" <"svein at seldal dot com">wrote: 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 giv

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. >

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

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 wid

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

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 > &g

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-uni

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,

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

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://ww

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

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 know

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

2006-11-02 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: 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 a lot of space to waste between columns, an

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 "goto"s. > > looked at the assembler output from your C compiler lately? > > LOL! - is it even possible to c

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

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

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 progra

<    3   4   5   6   7   8   9   >