Re: IndentationError: expected an indented block

2006-09-03 Thread Hendrik van Rooyen
"Georg Brandl" <[EMAIL PROTECTED]> Wrote: | [EMAIL PROTECTED] wrote: | > Hendrik van Rooyen wrote: | >> <[EMAIL PROTECTED]> Wrote: | >> | >> | >> | | >> | Haha. How can I fix this! | >> | | >> | | >> | | >> | >&

Re: Tkinter listbox:get

2006-09-08 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> Wrote: | Hi, | I need help about Tkinter.I want,when somebody click on some item in | listbox,then | in new entry widget must write that item | | Regards, | Vedran I have already covered the retrieval from the listbox in another thread. You can set the entry box contents lik

Re: pyserial problem: script stops reading

2006-09-09 Thread Hendrik van Rooyen
"Frederic Wenzel" <[EMAIL PROTECTED]> wrote: | I wrote a script on Linux that uses pyserial to read status messages | from a serial line using readlines(). For now, it just displays what | it gets on stdout: | | 17:42 | 0005 | 02 | | 5 |Rack Abs.| - | --210 | 17:42 | 0008 | 02 | | 5 |Ra

Re: Tkinter listbox:get

2006-09-09 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote in email: | Hi,and sorry I forget tell you what I want exactly. | | My problem is | | example: | | when I write like you tell me: | | >>> idx=lb.curselection() | >>> StringValue=lb.get(idx) <=== This | | THEN,ERROR IS: | | Traceback (most recent call last):

Is there a way to take a priori knowledge out of field definitions?

2006-09-10 Thread Hendrik van Rooyen
Hi, It is possible to build a system where the fields are "self defining" : - One way is to keep a dictionary of tags and descriptors, and to keep "the data" in a dictionary using the same tags as keys, with values - an oversimplified example: DefinitionDict = {1:'Quantity',2:'Price',3:'Value'}

Re: Pyserial problem. script stops reading.

2006-09-12 Thread Hendrik van Rooyen
"Frederic Wenzel" <[EMAIL PROTECTED]> Wrote:>On 9/9/06, Frederic Wenzel <[EMAIL PROTECTED]> wrote:>> On 9/9/06, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote:>> > | I wrote a script on Linux that uses pyserial to read status messages>> &g

Re: Is it just me, or is Sqlite3 goofy?

2006-09-13 Thread Hendrik van Rooyen
"Tim Chase" <[EMAIL PROTECTED]> wrote: To: "Steve Holden" <[EMAIL PROTECTED]> > >> "But honestly, boss, I didn't write this code! It was my > >> evil alter-ego that puts VARCHAR values containing Gilbert & > >> Sullivan lyrics into the Amount_Due CURRENCY fields!" > >> > > Hence the phrase "G

Re: Is it just me, or is Sqlite3 goofy?

2006-09-13 Thread Hendrik van Rooyen
From: "Steve Holden" <[EMAIL PROTECTED]> wrote: > These kids wi' their Oracle databases didn't know they were born. I can > remember 'avin' to optimise programs by making sure that the next > instruction were comin' under the heads of t' drum just as the last > instruction were finishing. > > But

Re: REQ: Java/J2EE Developer 10 Months

2006-09-16 Thread Hendrik van Rooyen
"Tim Chase" <[EMAIL PROTECTED]> wrote: 8< > Or, perhaps they just have their terminology off. "Corba" is a > lot like "cobra" which is also a snake, like a Python. ("We've > got Corba, right here in River City. That starts with 'C' and > that rhymes wi

Re: Need compile python code

2006-09-25 Thread Piet van Oostrum
sing $0 (which is the shell script itself) to python is sure to >M> break. Try this: I guess this is a trick to use a python script as a shell script that executes itself. In other words it is both a shell script and a python script and when executed as a shell script then it passes itself to the p

Contender for QOTW - Was : Re: AN Intorduction to Tkinter

2006-09-26 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: > In that case, don't burn bandwith by banal banter, post the examples! +1 here - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: ruby %w equivalent

2006-09-27 Thread Piet van Oostrum
ot;c" in ruby... >>> >>> Thanks a lot >>> Regards, >>> antoine >A> Why would they want to make such an obscure API ? ... didn't they have >A> Python to learn from (I am truly amazed - nothing cynical ...just ... >A> why ?) I think

Re: does anybody earn a living programming in python?

2006-09-27 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> Wrote: > On Tue, 26 Sep 2006 22:00:55 +1000, Anthony Baxter wrote: > > > This seems to be a very, very silly original post. I know of plenty of > > people who make a living programming Python. It's been the vast > > majority of the programming (for money) I

Re: License / Registration key enabled software

2006-09-29 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> Wrote: > Sybren Stuvel wrote: > > Mike Playle enlightened us with: > > > >>Imagine you're an IT manager for a medium-to-large company who wants > >>to use some expensive piece of software. You talk to the vendor and > >>buy a licence to use the software on up to

Re: Escapeism

2006-10-01 Thread Hendrik van Rooyen
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > Sybren Stuvel wrote: > > Kay Schluehr enlightened us with: > > > Usually I struggle a short while with \ and either succeed or give up. > > > Today I'm in a different mood and don't give up. So here is my > > > question: > > > > > > You have an unknown c

Re: storing variable names in a list before they are used?

2006-10-01 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Sat, 30 Sep 2006 14:33:35 -0400, John Salerno > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Ok, I'm sure you all get the idea by now, but here's a simpler way to > > look at it: > > > > Instead of > > > > first_name

Python/Tkinter crash.

2006-10-04 Thread Hendrik van Rooyen
Hi, I get the following: [EMAIL PROTECTED]:~/Controller/lib> python display.py UpdateStringProc should not be invoked for type font Aborted and I am back at the bash prompt - this is most frustrating, as there is no friendly traceback to help me guess where its coming from. And what is worse, t

Re: Python/Tkinter crash.

2006-10-04 Thread Hendrik van Rooyen
Not talking to myself - Added results of strace run at bottom "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Hi, > > I get the following: > > [EMAIL PROTECTED]:~/Controller/lib> python display.py > UpdateStringProc should not be invoked for type fo

Re: Python/Tkinter crash.

2006-10-04 Thread Hendrik van Rooyen
"James Stroud" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > Hi, > > > > I get the following: > > > > [EMAIL PROTECTED]:~/Controller/lib> python display.py > > UpdateStringProc should not be invoked for type font > >

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: About alternatives to Matlab

2006-11-17 Thread Maarten van Reeuwijk
all MY batteries included :-). BTW, I have the impression that MATLAB and SciPy have about the same performance. Cheers, Maarten -- === Maarten van Reeuwijkdept. of Multiscale Physics Phd s

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: 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: 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: 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: 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: 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-24 Thread Hendrik van Rooyen
"Tim Roberts" <[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > >"flamesrock" <[EMAIL PROTECTED]> wrote: > > > >8<-- > > > >> since the

Re: How good is CORBA?

2006-11-24 Thread Piet van Oostrum
to Qt. >CM> I like Ice a lot, it's got hardly any of the ramp up time and learning >CM> curve that CORBA does, and it's extremely efficent. If GPL or cash are >CM> acceptable licensing options to you, then I encourage you to use it >CM> before you head to CORBA. O

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

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

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

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

Re: Tarfile .bz2

2006-12-13 Thread Piet van Oostrum
pression library. The underlying compression algorithm >MvL> is LZW. No, it uses a compression algorithm based on LZ77 (called DEFLATE). Therefore gzip was not encumbered by the the LZW patent. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE1

Re: namespace question

2006-12-13 Thread Piet van Oostrum
it__(self): a = 1 b = 2 self.c = a+b x = Test() print x.c -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

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

Crash in PyImport_Import()

2006-12-18 Thread Geert Van Muylem
Hi, The following script works fine when I call it from the python interpreter but not when I call it from a c application (embedded python) It crashes in the PyImport_Import() import ldap import distutils.sysconfig def TestInit(): l = ldap.open("192.168.1.2") l.simple_bind_s("","

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

FW: Crash in PyImport_Import()

2006-12-19 Thread Geert Van Muylem
? Regards, Geert _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geert Van Muylem Sent: maandag 18 december 2006 22:51 To: python-list@python.org Subject: Crash in PyImport_Import() Hi, The following script works fine when I call it from the python interpreter but

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: 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: 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: 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: 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-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: 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: 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: 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-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: 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: 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: 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: 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-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: 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: Elliptic Curve Library

2006-12-25 Thread Piet van Oostrum
urve stuff (donated by SUN). M2Crypto is a Python interface to SSL. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: persistant gloabl vars (very newbie) ?

2006-12-27 Thread Piet van Oostrum
m init import X,Y explicitely is probably safer. And, by the way, from init import * can only be used at module level, not in inner namespaces. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup bug when ">>>" found in attribute value

2006-12-28 Thread Anne van Kesteren
ed param tag. The param element doesn't have a closing tag. http://www.w3.org/TR/html401/struct/objects.html#h-13.3.2 > Mind you, the sentence before that says 'should' for quoting < characters > which is just plain silly. For quoted attribute values it isn&#

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: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Piet van Oostrum
>>>>> Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> (SW) wrote: >SW> Linux seems to ignore SUID bit on scripts: The reason is that obeying SUID bits on scripts would be a security risk. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl

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: 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: 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: How do I add users using Python scripts on a Linux machine

2007-01-04 Thread Piet van Oostrum
It can only be made safe if interpreters can be passed inodes or opened files by the kernel, but that is not how most interpreters work. At least not python. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I add users using Python scripts on a Linux machine

2007-01-06 Thread Piet van Oostrum
>>>>> Lawrence D'Oliveiro <[EMAIL PROTECTED]> (LD) wrote: >LD> No it wouldn't. This security hole was fixed years ago. How? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED]

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

Mining strings from a HTML document.

2006-01-25 Thread Derick van Niekerk
Hi, I am new to Python and have been doing most of my work with PHP until now. I find Python to be *much* nicer for the development of local apps (running on my machine) but I am very new to the Python way of thinking and I don't realy know where to start other than just by doing it...so far I'm j

Re: Mining strings from a HTML document.

2006-01-25 Thread Derick van Niekerk
Thanks, Jay! I'll try this out today. Trying to write my own parser is such a pain. This BeatifullSoup script is very nice! I'll give it a try. If you can help me out with an example of how to do what I explained, I would appreciate it. I actually finished doing an import last night, but there is

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
I'm battling to understand this. I am switching to python while in a production environment so I am tossed into the deep end. Python seems easier to learn than other languages, but some of the conventions still trip me up. Thanks for the link - I'll have to go through all the previous chapters to u

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
Runsun Pan helped me out with the following: You can also try the following very primitive solution that I sometimes use to extract simple information in a quick and dirty way: def extract(text,s1,s2): ''' Extract strings wrapped between s1 and s2. >>> t="""this is a

<    5   6   7   8   9   10   11   12   13   14   >