Re: Need help parsing with pyparsing...

2007-10-23 Thread Hendrik van Rooyen
"Just Another Victim of the Ambient Morality" wrote: > FAHRENHEIT 451 2000 Copies Sold > 1984 Book Of The Year > > The last example is actually okay but the first one is honestly > ambiguous. hey - Fahrenheit 451 - if my memory serves me correctly, by Ray Bradbury, is a classic of SF. - f

Re: Iteration for Factorials

2007-10-23 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > > > Heh... the one saving grace of taking a CS major in a period where > the primary languages taught were FORTRAN (IV), COBOL (74), and > something close to K&K BASIC. Heck, even the assembler class followed > the FORTRAN parameter handling scheme

Re: Iteration for Factorials

2007-10-24 Thread Hendrik van Rooyen
"Jon Ribbens" wrote: > On 2007-10-23, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > Yuk. Reminds me of one of the Hitachi processors that > > has a single depth hardware "link register" that tells a > > subroutine where it was called from. &

Re: Going past the float size limits?

2007-10-27 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > On Oct 26, 6:56 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > What in the world are you trying to count? > > The calculation looks like this > > A = 0.35 > T = 0.30 > C = 0.25 > G = 0.10 > > and then I basically continually multiply those numbers together. I > ne

Re: transmit an array via socket

2007-10-27 Thread Hendrik van Rooyen
"Jeff Pang" wrote: I want to transmit an array via socket from a host to another. How to do it? thank you. pickle it and send it and unpickle it on the other side. See the cPickle module docs for loads and dumps. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Going past the float size limits?

2007-10-28 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > Calculating numbers like 10**52 or its reciprocal is also a very good > exercise in programming. Anyone can write a program to multiply two > floating point numbers together and get a moderately accurate answer: > > product = X*Y # yawn > > But multiplying 200,0

Re: Proposal: Decimal literals in Python.

2007-10-28 Thread Hendrik van Rooyen
"Paul Hankin" wrote: > Even clearer is not to allow octal literals :) Is there *any* use for > them? I tend to agree with this point of view - but I fear it will set up a howl of protest amongst the Brits who cut their teeth on 24 bit ICT/ICL equipment... - Hendrik -- http://mail.python.org

Re: Built-in functions and keyword arguments

2007-10-29 Thread Hendrik van Rooyen
"Tim Chase" <[EMAIL PROTECTED]> > > I think you are being a little bit unfair here: help(len) says: > > > > len(...) > > len(object) -> integer > > > > Return the number of items of a sequence or mapping. > > > > which implies that the argument to len has the name 'object' (although

Re: Built-in functions and keyword arguments

2007-10-29 Thread Hendrik van Rooyen
"Jean-Paul Calderone" <[EMAIL PROTECTED]> wrote: > On Mon, 29 Oct 2007 19:03:34 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > >Looks like a gotcha to me - its the difference between a keyword > >(master = 42) and an assignment (s='I am

Re: dynamically generating temporary files through python/cgi (ot)

2007-11-01 Thread Hendrik van Rooyen
Miss Pfeffe wrote: >How do you make a python out of a banana?! You kiss it just long enough - else it turns into a frog, so be careful! -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise expression

2007-01-10 Thread Hendrik van Rooyen
"Gigs_" <[EMAIL PROTECTED]> wrote: > Now is all clearer thanks to [EMAIL PROTECTED] and Hendrick van Rooyen Contrary to popular belief in the English speaking world - >>> "c" in "Hendrik" False >>> There is no "c" in "Hendrik" : - )- Hendrik -- http://mail.python.org/mailman/listinfo

Re: Colons, indentation and reformatting. (2)

2007-01-10 Thread Hendrik van Rooyen
"Jorgen Grahn" <[EMAIL PROTECTED]>wrote: > On 8 Jan 2007 23:57:29 -0800, Paddy <[EMAIL PROTECTED]> wrote: > > > > OK, whilst colons are not sufficient to re-format a completely > > mis-indented file. I'm thinking that they are sufficient for > > reformatting most pasted code blocks when refactor

Re: Why less emphasis on private data?

2007-01-10 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Tue, 09 Jan 2007 10:27:56 +0200, Hendrik van Rooyen wrote: > > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > > > > > >> On Mon, 08 Jan 2007 13:11:14 +0200, He

Is there a way to protect a piece of critical code?

2007-01-10 Thread Hendrik van Rooyen
Hi, I would like to do the following as one atomic operation: 1) Append an item to a list 2) Set a Boolean indicator It would be almost like getting and holding the GIL, to prevent a thread swap out between the two operations. - sort of the inverted function than for which the GIL seems to be us

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Hendrik van Rooyen
"robert" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > Hi, > > > > I would like to do the following as one atomic operation: > > > > 1) Append an item to a list > > 2) Set a Boolean indicator > > > I doubt you have to

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Hendrik van Rooyen
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > I would like to do the following as one atomic operation: > > > > 1) Append an item to a list > > 2) Set a Boolean indicator &g

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > Hi, > > > > I would like to do the following as one atomic operation: > > > > 1) Append an item to a list > > 2) Set a Boolean indicator > > > > It

Re: Is there a way to protect a piece of critical code?

2007-01-11 Thread Hendrik van Rooyen
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > am aware of Queue module - the same app uses it for something else. > > I dont like too many try -- excepts in the code - I find they confuse &

Re: Is there a way to protect a piece of critical code?

2007-01-11 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > Paul Rubin writes: > > def get_from_queue(queue): > >try: > > return queue.get(block=False) > >except Queue.Empty: > > return QUEUE_IS_EMPTY > > Alternatively: > > def get_f

Re: Urgent Openings with the World's Leading Software Company !!!

2007-01-11 Thread Hendrik van Rooyen
"Software Hiring" <[EMAIL PROTECTED]> wrote: > If you're interested in relocating to India for such a good > opportunity and be a part of the World's Best Software Company and if > you have good skill sets in: > > C, C++, C#, Java (for .Net Platform or Visual Studio) > > OR > > C, C++, Java,

Re: Is there a way to protect a piece of critical code?

2007-01-11 Thread Hendrik van Rooyen
"robert" <[EMAIL PROTECTED]> wrote: > pushing data objects through an inter-thread queue is a major source for trouble - as this thread shows again. > Everybody builds up a new protocol and worries about Empty/Full, Exception-handling/passing, None-Elements, ... > I've noticed that those troubles

Re: Maths error

2007-01-11 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > Yes, but that wasn't their point. It was that in (say) iterative > algorithms, the error builds up by a factor of the base at every step. > If it wasn't for the fact that errors build up, almost all programs > could ignore numerical analysis and still

Re: maximum number of threads

2007-01-12 Thread Hendrik van Rooyen
"William Heymann" <[EMAIL PROTECTED]> wrote: > So you know I tried this on ubuntu edgy 64bit edition on a dual 2218 opteron > system with 8G of ram and I got > > > Exception raised: can't start new thread > Biggest number of threads: 32274 > This almost looks as if the number of threads is

Re: General Question About Python

2007-01-12 Thread Hendrik van Rooyen
"Torabisu" <[EMAIL PROTECTED]> wrote: > > billie wrote: > > Torabisu wrote: > > > > > Its quite weird, we're looking for Python skills but are battling to > > > find at the moment... Normally Python on its own will probably not > > > land you a job, but the last two companies I've worked for a

Re: Maths error

2007-01-12 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > |> > |> I would have thought that this sort of thing was a natural consequence > |> of roundi

Re: Rational Numbers

2007-01-13 Thread Hendrik van Rooyen
From: "Nick Maclaren" <[EMAIL PROTECTED]> wrote: > Financial calculations need decimal FIXED-point, with a precisely > specified precision. It is claimed that decimal FLOATING-point > helps with providing that, but that claim is extremely dubious. > I can explain the problem in as much detail as

Re: Is there a way to protect a piece of critical code?

2007-01-13 Thread Hendrik van Rooyen
"robert" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > So far I have only used dicts to pass functions around > > in a relatively unimaginative static jump table like way... > > > Probably one has just to see that one can a pass a functi

Re: Maths error

2007-01-13 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > {My 8th grade teacher was a bit worried at seeing me with a slipstick > ; and my HighSchool Trig/Geometry teacher only required 3 significant > digits for answers -- even though half the class had calculators by > then} LOL - I haven't seen the w

Re: Maths error

2007-01-13 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > The "cheap" means "cheap in hardware" - it needs very little logic, > which is why it was used on the old, discrete-logic, machines. > > I have been told by hardware people that implementing IEEE 754 rounding > and denormalised numbers needs a horrific

Re: General Question About Python

2007-01-13 Thread Hendrik van Rooyen
"Torabisu" <[EMAIL PROTECTED]> wrote: > > Hendrik van Rooyen wrote: > > What do you want done? - I am only a thousand miles away... > > > > If I can just get my Python teleporter sorted out, distance will be no > problem... A little buggy at the mo

Re: Maths error

2007-01-14 Thread Hendrik van Rooyen
ieve it only in VERY > >> artificial programs. But I did find that the errors built up faster > >> for higher bases, so that a reasonable rule of thumb is that 28 > >> digits with a decimal base was comparable to (say) 80 bits with a > >> binary base. > >

Re: Maths error

2007-01-14 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]>wrote: > On Sun, 14 Jan 2007 07:18:11 +0200, "Hendrik van Rooyen" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > I recall an SF character known as "Slipstick Libby&qu

Re: Maths error

2007-01-15 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: [Tim Roberts] > |> Actually, this is a very well studied part of computer science called > |> "interval arithmetic". As you say, you do every computation twice, once to > |> compute the minimum, once to compute the maximum. When you're done, you > |> ca

Re: Class data members in C

2007-01-17 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > > Hmm. The extensions documentation describes how to add instance > members to a class (PyMemberDef), but I want to add a class member. > Yes, this is constant for all instances of the class. > > Any pointers? When? - at time of defining base class

Re: asyncore/asynchat and terminator string

2007-01-17 Thread Hendrik van Rooyen
"David Hirschfield" <[EMAIL PROTECTED]> wrote: 8< --- problems on syncing up in serial comms - I have seen people address this with success by using stuff like: "XXHEADERXX" as a "here starts the lesson" identifier, with no trouble, on a high volume newsfeed. If yo

Re: Class data members in C

2007-01-17 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > |> > > |> > Hmm. The extensions documentation describes how to add instance > |> > memb

Re: Would a Dutch speaker please check this wiki page please?

2007-01-19 Thread Hendrik van Rooyen
"Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > Stef Mientki wrote: > > [EMAIL PROTECTED] wrote: > >> Got a note about a new page on the Python Wiki: > >> > >>> "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: > >> > >> http://wiki.python.org/moin/Selcuk_Altun > >> > >> I suspect it's

Re: How can I create a linked list in Python?

2007-01-19 Thread Hendrik van Rooyen
"Jorgen Grahn" <[EMAIL PROTECTED]> wrote: > > FWIW, I oppose the idea (paraphrased from further up the thread) that linked > lists and other data structures are obsolete and dying concepts, obsoleted > by Python and other modern languages. > > 99% of the time. a Python list is the right tool for

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > Or perhaps I should say: > > .snoitnevnoc > hsilgnE tpada )ylbissop revenehw( dluohs ew os dna ,naitraM ton ,puorgswen > egaugnal hsilgnE na no er'ew ,segaugnal hcus era ereht fi neve tuB First I thought it was Welsh or Cornish or something. Then i

Re: The reliability of python threads

2007-01-25 Thread Hendrik van Rooyen
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > Right, I wasn't coming here to get someone to debug my app, I'm just > looking for ideas. I constantly am trying to find new ways to improve > my software and new ways to reduce bugs, and when i get really stuck, > new ways to track bugs down

Re: The reliability of python threads

2007-01-27 Thread Hendrik van Rooyen
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: 8< --- > > > Yea, I do some of that too. I use that wi

Re: Calling J from Python

2007-02-08 Thread Hendrik van Rooyen
"Tina I" <[EMAIL PROTECTED]> wrote: Gosi wrote: > On Feb 7, 3:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, Gosi wrote: >>> I like to use J for many things and I think that combining Python and >>> J is a hell of a good mixture. >> I was able to follow this

Re: Simple Interpolation in Numpy?

2007-02-08 Thread Hendrik van Rooyen
LAPI, VINCENT J, ATTLABS wrote: >Hi, >Please bear with me as I am new to Python and have not done any programming in about 20 years. I am >attempting to do a simple interpolation of a line's intermediate points given the x,y coordinates of the line's two >endpoints within an Active State Pytho

Re: Calling J from Python

2007-02-09 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Thu, 8 Feb 2007 10:55:17 +0200, "Hendrik van Rooyen" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > I am under the impression that Loki had a daughter called Hel ... &

Re: pygame and python 2.5

2007-02-09 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: "Ben Sizer" <[EMAIL PROTECTED]> wrote: > Ben> Python extensions written in C require recompilation for each new > Ben> version of Python, due to Python limitations. > > Can you propose a means to eliminate this limitation? > Yes. - Instead of calling someth

Re: pygame and python 2.5

2007-02-10 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> > Hendrik van Rooyen wrote: > > <[EMAIL PROTECTED]> wrote: > > "Ben Sizer" <[EMAIL PROTECTED]> wrote: > > > > > >> Ben> Python extensions written in C require recompil

Re: pygame and python 2.5

2007-02-10 Thread Hendrik van Rooyen
"Ben Sizer" <[EMAIL PROTECTED]> wrote: > On Feb 10, 8:42 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > Hendrik van Rooyen wrote: > > > <[EMAIL PROTECTED]> wrote: > > > "Ben Sizer" <[EMAIL PROTECTED]> wrote: > > >

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: > Now for the algorithm: all of that testing to see if you are about to > sail off the end of the world is a bit ugly and slow. You can use bit- > bashing, as Paul suggested, even though it's on Steven D'Aprano's list > of 6 deadly sins :-) Thou shallt n

Re: Tkinter and Tile

2007-02-13 Thread Hendrik van Rooyen
"Eric Brunel" <[EMAIL PROTECTED]> wrote: FYI, changes done in tcl/tk are usually quite rapidly integrated in Tkinter. For example, for the "panedwindow" widget, introduced in tk8.4 (first version out in the end of 2002), a Tkinter wrapper was available in Python 2.3 (first version out mid-2003). S

Re: Help with Optimization of Python software: real-time audiocontroller

2007-02-13 Thread Hendrik van Rooyen
"Jean-Paul Calderone" <[EMAIL PROTECTED]> wrote: > Yep. There are even some existing Python applications which deal with > sound and manage to work with ~20ms samples. I agree. Python is not *that* slow... I have written serial port communications that send and catch one character at a time (ra

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 13, 4:57 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > "John Machin" <[EMAIL PROTECTED]> wrote: > > > > > Now for the algorithm: all of that testing to see if you

Re: Segmentation faults using threads

2007-02-13 Thread Hendrik van Rooyen
"Mathias" <[EMAIL PROTECTED]> wrote: > Does someone have experience with threading in python - are there > non-threadsafe functions I should know about? how do your threads communicate with one another - are there any globals that are accessed from different threads? strange this - you should

Re: Enter Enter... troubles

2007-02-15 Thread Hendrik van Rooyen
Sorin Schwimmer wrote: 8<- > def handler(self,event): >self.aButton.unbind('') >self.aButton.unbind('') 8<- > >The idea is to prevent a fast user (like my boss) to press repeatedly the "enter" >key and create havoc with self.property and

Re: how do "real" python programmers work?

2007-02-15 Thread Hendrik van Rooyen
"Tim Golden" <[EMAIL PROTECTED]> wrote: > Tyrrell, Wendy wrote: > > (Well, nothing) > 8<-- > Your organisation seems to deal with partnerships between > business and education; are you looking to promote the use > of programming in schools? Or is there something else you

Re: builtin set literal

2007-02-17 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > > Yes, a lot of people liked this approach, but it was rejected due to > > gratuitous breakage. While Python 3.0 is not afraid to break backwards > > compatibility, it tries to do so only when there's

Re: builtin set literal

2007-02-17 Thread Hendrik van Rooyen
"Schüle Daniel" <[EMAIL PROTECTED]> wrote: > > > {:} for empty dict and {} for empty set don't look too much atrocious > > to me. > > this looks consistent to me I disagree. What would be consistent would be to follow the pattern, and use a different set of delimiters. Python uses () for tuple

Re: Pep 3105: the end of print?

2007-02-17 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone wrote: > > > > I think some people are confused that the language "Python 3.x" has "Python" > > in its name, since there is already a language with "Python" in its name, > > with which it is not compatible. > > > Right. Let's call Py

Re: Approaches of interprocess communication

2007-02-17 Thread Hendrik van Rooyen
"exhuma.twn" <[EMAIL PROTECTED]> wrote: > Hi all, > > Supposing you have two separate processes running on the same box, > what approach would you suggest to communicate between those two > processes. 8< -- sockets,webservices,CORBA,shared memory --- > Supposing both processes

Re: Help Required for Choosing Programming Language

2007-02-18 Thread Hendrik van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: >Stef Mientki a écrit : >(snip) >> I've been using Python for just 2 months, and didn't try any graphical >> design, > >So how can you comment on GUI programming with Python ? I think we have a language problem here (no pun intended) When Stef s

Re: How to test if one dict is subset of another?

2007-02-19 Thread Hendrik van Rooyen
"Jay Tee" <[EMAIL PROTECTED]> wrote: > Hi, > > I have some code that does, essentially, the following: > > - gather information on tens of thousands of items (in this case, jobs > running on a > compute cluster) > - store the information as a list (one per job) of Job items > (essentially

Re: f---ing typechecking

2007-02-20 Thread Hendrik van Rooyen
"Nick Craig-Wood" <[EMAIL PROTECTED]> wrote: > > Ie > > x += a > > does not equal > > x = x + a > > which it really should for all types of x and a One would hope so , yes. However, I think that the first form is supposed to update in place, while the second is free to bind a new

Re: Weird result returned from adding floats depending on order I add them

2007-02-20 Thread Hendrik van Rooyen
"joanne matthews (RRes-Roth)" <[EMAIL PROTECTED]> wrote: 8< > Can anyone tell me whats going on > and how I can avoid the problem. Thanks Don't know about the first question. Would avoid it by using ints and asking for percentages... - Hendrik -- htt

Re: Convert to binary and convert back to strings

2007-02-21 Thread Hendrik van Rooyen
"Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor. I'd also like t

Re: is it possible to remove the ':' symbol in the end of linesstarting with 'if', 'while' etc?

2007-02-22 Thread Hendrik van Rooyen
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: 8< request to remove colon -- > Won't happen. There have been plenty of discussions about this, and while > technically not necessary, the colon is usually considered "optically > pleas

Re: Convert to binary and convert back to strings

2007-02-22 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 22 Feb 2007 08:18:07 +0200, Hendrik van Rooyen wrote: > > > I would xor each char in it with 'U' as a mild form of obfuscation... > > I've often wished this would work. > >

Re: Convert to binary and convert back to strings

2007-02-24 Thread Hendrik van Rooyen
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > s = 'some string that needs a bcc appended' > > ar = array.array('B',s) > > bcc = 0 > > for x in ar[:]: >

Re: Help on Dict

2007-02-25 Thread Hendrik van Rooyen
"James Stroud" <[EMAIL PROTECTED]> wrote: > Clement wrote: > > Can any body tell how Dict is implemented in python... plz tell what > > datastructure that uses > > > > I think it uses a dict. "Groan!" - this answer is like Microsoft documentation - while technically correct,

Re: Help on object scope?

2007-02-25 Thread Hendrik van Rooyen
"hg" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Hello everybody, > > > > I have a (hopefully) simple question about scoping in python. I have a > > program written as a package, with two files of interest. The two > > files are /p.py and /lib/q.py Make a third file for all th

Re: Nested Parameter Definitions

2007-02-25 Thread Hendrik van Rooyen
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > On Feb 25, 6:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > > I blogged on finding a new-to-me feature of Python, in that you are > > allowed to nnest parameter definitions: > > > > >>> def x ((p0, p1), p2): > > > > ... return p0,p1,p2 > > ...>>> x

Re: Running Python scripts from BASH

2007-02-28 Thread Hendrik van Rooyen
"Ishpeck" <[EMAIL PROTECTED]> wrote: 8<--- a bash problem - If it were Python, the advice would have been to use the print statement to figure out what the content of the variables were. As it is Bash, you may have to stoop to something like echo to see what is

Re: Dialog with a process via subprocess.Popen blocks forever

2007-02-28 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > Is it possible to read to and write to the std streams of a > subprocess? What am I doing wrong? I think this problem lies deeper - there has been a lot of complaints about blocking and data getting stuck in pipes and sockets... I have noticed that the Python file o

Re: Writing an interpreter for language similar to python!!

2007-02-28 Thread Hendrik van Rooyen
"luvsat" <[EMAIL PROTECTED]> wrote: > Hello all, > > I am new to python and working on a project that involves designing a > new language. The grammar of the language is very much inspired from > python as in is supports nearly all the statements and expressions > that are supported by python. 8

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-01 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for your answer. I had a look into the fcntl module and tried > to unlock the output-file, but > > >>> fcntl.lockf(x.stdout, fcntl.LOCK_UN) > Traceback (most recent call last): > File "", line 1, in > IOError: [Errno 9] Bad file descriptor > > I

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-01 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: 8<-- > The C programm gets its "commands" from its stdin and sends its state > to stdout. Thus I have some kind of dialog over stdin. > > So, once I start the C Program from the shell, I immediately get its > output in my terminal. If I start it from a

Re: How to Read Bytes from a file

2007-03-02 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > Thanks Bart. That's perfect. The other suggestion was to precompute > count1 for all possible bytes, I guess that's 0-256, right? 0 to 255 inclusive, actually - that is 256 numbers... The largest number representable in a byte is 255 eight bits, of value 128,64,32

Re: python newbie

2007-11-02 Thread Hendrik van Rooyen
"Bruno Desthuilliers" wrote: >functions are *not* methods of their module. Now I am confused - if I write: result = foo.bar(param) Then if foo is a class, we probably all agree that bar is a method of foo. But the same syntax would work if I had imported some module as foo. So what's the dif

Re: count increment...

2007-11-02 Thread Hendrik van Rooyen
Beema shafreen wrote: 8< --- file >my script: > >#!/usr/bin/env python > > >fh = open('complete_span','r') >line = fh.readline().split('#') >old_probe = line[0].strip() >old_value = line[1].strip() >print old_probe, old_value >count = 1 Better to start the c

Re: Python good for data mining?

2007-11-06 Thread Hendrik van Rooyen
"D.Hering" wrote: > > [1] Anything/everything that is physical/virtual, or can be conceived > is hierarchical... if the system itself is not random/chaotic. Thats a > lovely revelation I've had... EVERYTHING is hierarchical. If it has > context it has hierarchy. Do I hear Echoes of What Was Said

Re: pyserial: loose connection after inactivity

2007-11-08 Thread Hendrik van Rooyen
"Frank Aune" wrote: > Hello, > > I configure the serial connection using: > > self.port = serial.Serial(baudrate=57600, > timeout=0.06, > parity=serial.PARITY_EVEN, > stopbits=serial.STO

Re: What is python?????

2007-11-16 Thread Hendrik van Rooyen
: "Thorsten Kampe" wrote: > * Cope (Fri, 16 Nov 2007 06:09:31 -0800 (PST)) > > please tell me what is python.This group is so crowded. > > A Python is dangerous snake[1]. This group here mainly consists of > misguided snake worshippers. You'd better run before they come to your > place... >

Re: What is python?????

2007-11-16 Thread Hendrik van Rooyen
(Mike) wrote: > On Nov 16, 1:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > On Nov 16, 8:14 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > > > * Cope (Fri, 16 Nov 2007 06:09:31 -0800 (PST)) > > > > > > please tell me what is python.This group is so crowded. > > > > > A Python is da

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-17 Thread Hendrik van Rooyen
"Michael Bacarella" wrote: > I am so sorry to have ruined the decorum. Oh dear! I confidently predict that this thread will now degenerate to include such things as dignitas and gravitas. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Troubleshooting garbage collection issues

2007-11-18 Thread Hendrik van Rooyen
(Dave) wrote: 8<- description of horrible problem -- Faced with this, I would: 1 - identify the modules that import gc to separate the sheep from the goats. 2 - do my best to change gc importing goats back to sheep. 3 - amongst the remaining goats, identify the ones

Re: which Python ? asks beginner

2007-11-18 Thread Hendrik van Rooyen
"Donn Ingle" wrote: > > plans are afoot > You know, I've always wanted ask; if plans are afoot, what are hands? > > :D > > Sorry, it's late. The answer, seeing as it's late, is that whisky is at hand. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-22 Thread Hendrik van Rooyen
"braver" <[EMAIL PROTECTED]> wrote: > Well folks compare scripting languages all the time, and surely Ruby > is closer to Python than C++. Since Ruby can do f.eof, which is > easily found in its references, and Python can't, or its EOF can't > easily be found -- the one *equivalent* to a semanti

Re: Next float?

2007-11-23 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > Damn, I don't remember writing that! It is caused by drinking too much Alzheimer's Light. : - ) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Clean way to get one's network IP address?

2007-11-23 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > On Sat, 24 Nov 2007 00:05:13 +, Steven D'Aprano wrote: > > > ... you're absolutely write ... > > Okay, I now officially have no more credibility left. Time for me to get > a Hotmail email address and open a MySpace page and spend all my time > writing "OMG LOL

Re: How to Teach Python "Variables"

2007-11-29 Thread Hendrik van Rooyen
"J. Clifford Dyer" wrote: > This thread is bleedin' demised. No, you have stunned it. Delicate threads stun easily. To get back to the original question, namely how to teach the concept of a python variable, I would probably take a harder look at the "wandering names" analogy. I think it wa

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Hendrik van Rooyen
"John Machin" wrote: > Pythons are good snakes; they hypnotise the meaninglessly chattering > bandarlog and eat them. Beware! What is a bandarlog - I know the bandersnatch and the boojum, but bandarlog? If it is something you can knit - If I get you the wool, will you make me one? - Hendrik

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: > On Dec 1, 5:14 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > "John Machin" wrote: > > > > > Pythons are good snakes; they hypnotise the meaninglessly chattering > > &g

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Hendrik van Rooyen
"Russ P." wrote: > I am surprised to see that Newton is not taken. I urge > Guido to take it while it is still available. Sir Isaac > certainly deserves the honor. Does he? Are you aware of how he treated Hooke? He was a great technician, but as a person, you would not have had him marry your

Re: "Python" is not a good name, should rename to "Athon"

2007-12-03 Thread Hendrik van Rooyen
"Dotan Cohen" wrote: > Newton was the bridge between science and superstition. Without him, > we would not have science. For that he is notable. He is both magician > and scientist. It was Newton's belief in the occult that led to his > discovery of gravity: the fact that distant objects could i

Re: "Python" is not a good name, should rename to "Athon"

2007-12-05 Thread Hendrik van Rooyen
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >En Tue, 04 Dec 2007 14:49:36 -0300, Dennis Lee Bieber ><[EMAIL PROTECTED]> escribió: >> How about the cognate: Kulkukan? >You meant Kukulkan. If you got it wrong from "Apocalypto" (Mel Gibson), >well, it's just one of many errors in the film... Ei

Re: "Python" is not a good name, should rename to "Athon"

2007-12-05 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > Euler? (most non-tech types would probably think that's a reference > to someone who squirts lubricants into the workings of a steam engine) You have just destroyed a long held image in my mind with this horrible homophone - I used to conjure up i

Re: how to convert 3 byte to float

2007-12-08 Thread Hendrik van Rooyen
"Tommy Nordgren" <[EMAIL PROTECTED]> wrote: > > On 8 dec 2007, at 12.52, Mario M. Mueller wrote: > > > Bjoern Schliessmann wrote: > > > > [...] > >> BTW, who in his mind designs three byte floats? Memory isn't that > >> expensive anymore. Even C bool is four bytes long. > > > > It's output of a di

Re: how to convert 3 byte to float

2007-12-09 Thread Hendrik van Rooyen
"Mario M. Mueller" <[EMAIL PROTECTED]> wrote: > I uploaded a short sample data file under > http://www.FastShare.org/download/test.bin - maybe one can give me another > hint... In a full data example max value is 1179760 (in case one looks only > at the eye-cathing "65535"+- values). I clicked

Finite State Machine GUI editor in python?

2007-12-15 Thread Hendrik van Rooyen
I have spent some time googling and on wiki and came up with pyFSA in python. It may end up being useful, but it is not directly what I am looking for, as there is no GUI that I can see. I know about SMC, but it is not Python, and I can't find the gui. This looks good, but it seems to be in a La

Re: Finite State Machine GUI editor in python?

2007-12-16 Thread Hendrik van Rooyen
"kib" <[EMAIL PROTECTED]> wrote: >Hi Hendrik, > >I've bookmarked these ones : > >http://www.univ-paris12.fr/lacl/pommereau/tlf/index.html [in French] >http://www.ncc.up.pt/~nam/ [look at the FAdo project] >http://www.cs.usfca.edu/~jbovet/vas.html [written in Java] > Thanks I will check them out -

Re: Finite State Machine GUI editor in python?

2007-12-17 Thread Hendrik van Rooyen
"Alexander Schliep" wrote: > > In case nothing better comes up and you want to code it yourself: Our > Hidden Markov Model library GHMM (http://ghmm.org) has a graphical > editor with XML output. > > Maybe http://networkx.lanl.gov/ or other general Python graph packages > have what you want.

Re: int vs long

2007-12-17 Thread Hendrik van Rooyen
"Nick Craig-Wood" wrote: > So you might see longs returned when you expected ints if the result > was >= 0x800. did you mean 0x8000 ? ;-) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   >