Re: SWIG problems with gcc and Cygwin?

2006-06-26 Thread Steve Holden
Michael Yanowitz wrote: > No response yet. The SWIG test works fine in Linux no problems. > However, I still have the problem in Cygwin. > Also, not sure if related but I do have a win32 Python 2.4.3 and > Cygwin Python 2.4.1. Not sure if there are any conflicts. Any advice > in making these tw

Re: TypeError: Cannot create a consistent method resolution order (MRO) for bases object

2006-06-26 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Maric Michaud wrote: > >>Le lundi 26 juin 2006 20:06, [EMAIL PROTECTED] a écrit : >> >>>What are the reason one would get this error: TypeError: Cannot create >>>a consistent method resolution order (MRO) for bases object ?? >>> >>>I can provide the code if needed >>

Re: Select in Python

2006-06-26 Thread Dio
K.S.Sreeram 写道: > Dio wrote: > > while 1: > > (rr, wr, er) = select([stdin], [], []) > > for fd in rr: > > print fd > > > > program block in the first select(), after I type something and "enter > > ", it never block in select() again,why? > > select blocks until there is some dat

Re: Select in Python

2006-06-26 Thread Gary Herron
Dio wrote: > #!/usr/bin/env python2 > > from sys import stdin > from select import select > > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again

Re: Select in Python

2006-06-26 Thread K.S.Sreeram
Dio wrote: > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again,why? select blocks until there is some data to read from stdin, but it does no

Re: Select in Python

2006-06-26 Thread Fredrik Lundh
Dio wrote: > from sys import stdin > from select import select > > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again,why? if there's data w

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > Yes, an important question (IMHO the *more* important question > than the terminology) is what *programs* do we give up if we > wish to use static typing? I have never been able to pin this > one down at all. You'd need to clarify what you mean by "use static

Select in Python

2006-06-26 Thread Dio
#!/usr/bin/env python2 from sys import stdin from select import select while 1: (rr, wr, er) = select([stdin], [], []) for fd in rr: print fd program block in the first select(), after I type something and "enter ", it never block in select() again,why? -- http://mail.python.or

Re: Replace Whole Object Through Object Method

2006-06-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'm working with a team that's doing social modeling, and for example, > I need to model workers that at some point in the program may or may > not also become employers. Now, I want the workers to take on all > behaviors and attributes of an employer in addition to thei

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Pascal Bourguignon
"Marshall" <[EMAIL PROTECTED]> writes: > Yes, an important question (IMHO the *more* important question > than the terminology) is what *programs* do we give up if we > wish to use static typing? I have never been able to pin this > one down at all. Well, given Turing Machine equivalence... I'd m

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris Smith
Chris F Clark <[EMAIL PROTECTED]> wrote: > And to me the question is what kinds of types apply to these dynamic > programs, where in fact you may have to solve the halting problem to > know exactly when some statement is executed. Yes, I believe (static) type systems will always end up approximati

Re: Traversing Inheritance Model

2006-06-26 Thread Ziga Seilnacht
[EMAIL PROTECTED] wrote: > What's the best way to traverse the web of inheritance? I want to take > a class and traverse its bases and then the bases' bases etc > looking for a particular class. What first came to mind was nested for > loops. However, I want to know if there's some pre-existing

Re: Execute Commands on Remote Computers over Network

2006-06-26 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "dylpkls91" <[EMAIL PROTECTED]> wrote: >I have been researching this topic and come up with some code to make >it work. It uses SSL and requires the 3rd party package Paramiko (which >requires PyCrypto). Why not just spawn an invocation of SSH? -- http://mail.pyt

Re: Having problems with strings in HTML

2006-06-26 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Kiana Toufighi <[EMAIL PROTECTED]> wrote: >print ''' >href="http://bbc.botany.utoronto.ca/ntools/cgi-bin/ntools_treeview_word.cgi?inp >ut=&max=2&values_off=no&remove_bracket=no&show_line_nr=yes&show_link_out=yes&de >cimal_places=10&show_classification=y

Re: Python taught in schools?

2006-06-26 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Gary Duzan) wrote: > I understand that the school switched [from C++] to Java a short > time later, which is some improvement, but still has a good bit of > baggage. Java started out trying to avoid most of the complexities of C++, but ended

Re: HTTP server

2006-06-26 Thread placid
Simon Forman wrote: > ... > > > > Awesome! Glad to hear it. > > ... > > > > Thanks for the help. I got it to work now. > > > > You're welcome. I'm glad I could help you. :-D > Im having trouble with the following code for handling GET requests from a client to my HTTP server. What i want to do

Re: Python taught in schools?

2006-06-26 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Mirco Wahab <[EMAIL PROTECTED]> wrote: >Thus spoke Lawrence D'Oliveiro (on 2006-06-26 09:21): > >> In article <[EMAIL PROTECTED]>, >> Mirco Wahab <[EMAIL PROTECTED]> wrote: >> >>>C++ programming requires you to massively invest your thinking >>>first into the set

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Marshall
Chris F Clark wrote: > > And to me the question is what kinds of types apply to these dynamic > programs, where in fact you may have to solve the halting problem to > know exactly when some statement is executed. I expect that some > programs have type signatures that exceed the expressibility of

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris F Clark
"Greg Buchholz" <[EMAIL PROTECTED]> writes: > Chris F Clark wrote: > > Thus, as we traverse a list, the first element might be an integer, > > the second a floating point value, the third a sub-list, the fourth > > and fifth, two more integers, and so on. If you look statically at > > the head of

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris F Clark
I wrote: > The important thing is the dynamicism of lisp allowed one to write > polymorphic programs, before most of us knew the term. Chris Smith <[EMAIL PROTECTED]> writes: > Sure. In exchange for giving up the proofs of the type checker, you > could write all kinds of programs. To this day,

Re: nested dictionary assignment goes too far

2006-06-26 Thread Jake Emerson
Thanks a lot Serge and Ben. Your posts were right on. I hope the weather is good wherever you are. Jake -- http://mail.python.org/mailman/listinfo/python-list

Traversing Inheritance Model

2006-06-26 Thread digitalorganics
What's the best way to traverse the web of inheritance? I want to take a class and traverse its bases and then the bases' bases etc looking for a particular class. What first came to mind was nested for loops. However, I want to know if there's some pre-existing method for doing this or if this

Re: Replace Whole Object Through Object Method

2006-06-26 Thread digitalorganics
Bruno Desthuilliers wrote: (snip) > > > > It is very important that both should maintain attribute values, > > regardless of whether they take on new "roles". > > Seems obvious. But just a question, BTW: do workers and employers share > the same attributes ? And if not, how do you intend to initia

Execute Commands on Remote Computers over Network

2006-06-26 Thread dylpkls91
I have been researching this topic and come up with some code to make it work. It uses SSL and requires the 3rd party package Paramiko (which requires PyCrypto). However, at this moment I have no network to test the code on! Trying to connect to localhost (127.0.0.1) fails. Before I buy network com

Re: TypeError: Cannot create a consistent method resolution order (MRO) for bases object

2006-06-26 Thread digitalorganics
Maric Michaud wrote: > Le lundi 26 juin 2006 20:06, [EMAIL PROTECTED] a écrit : > > What are the reason one would get this error: TypeError: Cannot create > > a consistent method resolution order (MRO) for bases object ?? > > > > I can provide the code if needed > This is the python solution t

Re: Replace Whole Object Through Object Method

2006-06-26 Thread digitalorganics
Maric Michaud wrote: > Le lundi 26 juin 2006 22:37, [EMAIL PROTECTED] a écrit : > > Won't work because there will be employers that aren't workers. > > And yes, only some workers will become employers, but also only some > > employers will also be workers (at some point in program). Let me be > >

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Marshall
George Neuner wrote: > > I can know that my conversion of floating point to integer is going to > produce a value within a certain range ... but, in general, the > compiler can't determine what that range will be. All it knows is > that a floating point value is being truncated and the stupid > pr

Re: What is a type error?

2006-06-26 Thread Marshall
Pascal Costanza wrote: > > Consider division by zero: appropriate arguments for division are > numbers, including the zero. A bold assertion! The general question is, what do we do about partial functions? > The dynamic type check will typically not > check whether the second argument is zero,

Re: Beginner question: use function to read text file

2006-06-26 Thread Luke
Thanks to both of you for the help, much appreciated! Luke -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting 3-byte integers

2006-06-26 Thread John Machin
On 27/06/2006 9:59 AM, John Machin wrote: > On 27/06/2006 9:36 AM, Bob Greschke wrote: >> I have some binary data read from a file that is arranged like >> >><3-byte int> <3-byte int> <3-byte int> etc. >> >> The "ints" are big-endian and there are 169 of them. Is there any >> clever way to co

Re: Beginner question: use function to read text file

2006-06-26 Thread Gary Herron
Luke wrote: > I'm pretty stuck at the moment and wondering if anyone can spot the problem. > Trying to create a function that will read a text file into a list and > return that list. > > I wrote the following function and saved it as 'fileloader.py' > > def fileload(fname): > infile=open(fna

Re: Beginner question: use function to read text file

2006-06-26 Thread James Stroud
Luke wrote: > I'm pretty stuck at the moment and wondering if anyone can spot the problem. > Trying to create a function that will read a text file into a list and > return that list. > > I wrote the following function and saved it as 'fileloader.py' > > def fileload(fname): > infile=open(f

Re: replace a method in class: how?

2006-06-26 Thread Maric Michaud
Le mardi 27 juin 2006 06:21, Bruno Desthuilliers a écrit : > Maric Michaud a écrit : > (snip) > > > In OOP Methods are defined in *classes* not in any arbitrary object > > Chapter and verse, please ? AFAIK, the first O in OOP stands for > "object", not for "class" !-) > Hard to find it, indeed. >

Beginner question: use function to read text file

2006-06-26 Thread Luke
I'm pretty stuck at the moment and wondering if anyone can spot the problem. Trying to create a function that will read a text file into a list and return that list. I wrote the following function and saved it as 'fileloader.py' def fileload(fname): infile=open(fname) dates =[] time

Re: Replace Whole Object Through Object Method

2006-06-26 Thread Maric Michaud
Le lundi 26 juin 2006 22:37, [EMAIL PROTECTED] a écrit : > Won't work because there will be employers that aren't workers. > And yes, only some workers will become employers, but also only some > employers will also be workers (at some point in program). Let me be > more clear: > > workers > --> su

Re: 'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread Andrew McNamara
>> On a semi-related note, I have a database on Linux that imports from a >> Macintosh CSV file. The 'csv' module says to always open files in >> binary mode, but this didn't work in my case: I had to open it as 'rU' >> (text with universal newlines) or 'csv' misparsed it. I'd like the >> program

Re: Extracting 3-byte integers

2006-06-26 Thread Scott David Daniels
Bob Greschke wrote: > I have some binary data read from a file that is arranged like ><3-byte int> <3-byte int> <3-byte int> etc. > The "ints" are big-endian and there are 169 of them. Is there any clever > way to convert these to regular Python ints other than (struct) unpack'ing > them one

Re: replace a method in class: how?

2006-06-26 Thread Bruno Desthuilliers
Maric Michaud a écrit : (snip) > In OOP Methods are defined in *classes* not in any arbitrary object Chapter and verse, please ? AFAIK, the first O in OOP stands for "object", not for "class" !-) Classes are just an implementation convenience, and the fact that the class-based model is the mos

Re: replace a method in class: how?

2006-06-26 Thread Bruno Desthuilliers
Maric Michaud a écrit : > Le mardi 27 juin 2006 05:05, Bruno Desthuilliers a écrit : > >>import types >>t.update = types.MethodType(another_update) > > > This works with : > > t.update = types.MethodType(another_update, t) oops ! too fast on the send button :( And thanks for the correction. -

Re: TypeError: Cannot create a consistent method resolution order (MRO) for bases object

2006-06-26 Thread Maric Michaud
Le lundi 26 juin 2006 20:06, [EMAIL PROTECTED] a écrit : > What are the reason one would get this error: TypeError: Cannot create > a consistent method resolution order (MRO) for bases object ?? > > I can provide the code if needed This is the python solution to the diamond problem (cf. wikiped

Re: nested dictionary assignment goes too far

2006-06-26 Thread Ben Cartwright
Jake Emerson wrote: > However, when > the process goes to insert the unique 'char_freq' into a nested > dictionary the value gets put into ALL of the sub-keys The way you're currently defining your dict: rain_raw_dict = dict.fromkeys(distinctID,{'N':-6999,'char_freq':-6999,...}) Is shorthand fo

Re: Replace Whole Object Through Object Method

2006-06-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Bruno Desthuilliers wrote: > >>[EMAIL PROTECTED] a écrit : >> >>>Bruno Desthuilliers wrote: >> >>(snip) >> Instead of exposing problems with your solution, you may want to expose the real use case ? >>> >>> >>>I'm working with a team that's doing social modeli

Parsing Digits in Strings, using RE

2006-06-26 Thread William Cellich
Hello, all. I am using a regular _expression_   XXX_re = re.compile( ' \ d { 12 } ' )  # spaces added for clarity   that returns the value below from a string similar to this one:   XX() X[("XXX_XXX=123456789000","XX_XXX=1","Xxx=ABCDE01","Xxxx

Re: 'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread John Machin
On 27/06/2006 6:39 AM, Mike Orr wrote: > Tim Peters wrote: >> [EP <[EMAIL PROTECTED]>] >>> This inquiry may either turn out to be about the suitability of the >>> SHA-1 (160 bit digest) for file identification, the sha function in >>> Python ... or about some error in my script >> It's your script.

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Greg Buchholz
Chris F Clark wrote: > Thus, as we traverse a list, the first element might be an integer, > the second a floating point value, the third a sub-list, the fourth > and fifth, two more integers, and so on. If you look statically at > the head of the list, we have a very wide union of types going by.

Re: nested dictionary assignment goes too far

2006-06-26 Thread Serge Orlov
On 26 Jun 2006 16:56:22 -0700, Jake Emerson <[EMAIL PROTECTED]> wrote: > I'm attempting to build a process that helps me to evaluate the > performance of weather stations. The script below operates on an MS > Access database, brings back some data, and then loops through to pull > out statistics. O

How do I limit access to objects in Python?

2006-06-26 Thread Tommytrojan
Hi, I have an application that embeds the Python interpreter. My users have access to the interpreter through a console like window and they can run Python scripts. For my application I use some Python modules (say module Restricted) that I don't want to give my users access to. However, the m

Re: replace a method in class: how?

2006-06-26 Thread Maric Michaud
Le mardi 27 juin 2006 05:05, Bruno Desthuilliers a écrit : > import types > t.update = types.MethodType(another_update) This works with : t.update = types.MethodType(another_update, t) Oh, this *really* misleading what the intent of the programmer is, and In [29]: t.update Out[29]: of <__mai

Re: Extracting 3-byte integers

2006-06-26 Thread John Machin
On 27/06/2006 9:36 AM, Bob Greschke wrote: > I have some binary data read from a file that is arranged like > ><3-byte int> <3-byte int> <3-byte int> etc. > > The "ints" are big-endian and there are 169 of them. Is there any clever > way to convert these to regular Python ints other than (s

nested dictionary assignment goes too far

2006-06-26 Thread Jake Emerson
I'm attempting to build a process that helps me to evaluate the performance of weather stations. The script below operates on an MS Access database, brings back some data, and then loops through to pull out statistics. One such stat is the frequency of reports from the stations ('char_freq'). I hav

OSDC 2006 -- CFP closes in 2.5 weeks!

2006-06-26 Thread Richard Jones
http://www.osdc.com.au/papers/cfp06.html There are two and a half weeks to go to get your paper in for one of the best Australian conferences this year! The deadline for proposals is 12th July 2006. The Open Source Developers' Conference is an Australian conference designed for

Re: What is a type error?

2006-06-26 Thread Chris Smith
Pascal Costanza <[EMAIL PROTECTED]> wrote: > > Clearly, in this example, the program > > is invoking an operation (division) on values that are not appropriate > > (zero for the second argument). Hence, if your definition really is a > > definition, then this must qualify. > > Here, you are as

Re: replace a method in class: how?

2006-06-26 Thread nate
I don't know a ton about this, but it seems to work if you use: This.update = another_update (instead of t.update = another_update) after saying This.update = another_update, if you enter This.update, it says , (it's unbound) but if you call t.update(5) it will print: another 5 -- http://mail.pyt

Re: replace a method in class: how?

2006-06-26 Thread Maric Michaud
Le mardi 27 juin 2006 01:14, Brian Blais a écrit : > t=This() > t.update(5) > t.update=another_update > t.update(5)  # this one doesn't work, gives > # TypeError: another_update() takes exactly 2 arguments (1 given) > > > clearly it isn't seeing it as a method, just an attribute which happens to >

Re: replace a method in class: how?

2006-06-26 Thread Bruno Desthuilliers
Brian Blais a écrit : > Hello, > > I want to replace a method in a class during run-time with another > function. I tried the obvious, but it didn't work: > > class This(object): > def update(self,val): > print val > > def another_update(obj,val): > print "another",val > > t=T

Re: replace a method in class: how?

2006-06-26 Thread John Machin
On 27/06/2006 9:14 AM, Brian Blais wrote: > Hello, > > I want to replace a method in a class during run-time with another > function. I tried the obvious, but it didn't work: > > class This(object): > def update(self,val): > print val > > def another_update(obj,val): > print "a

Extracting 3-byte integers

2006-06-26 Thread Bob Greschke
I have some binary data read from a file that is arranged like <3-byte int> <3-byte int> <3-byte int> etc. The "ints" are big-endian and there are 169 of them. Is there any clever way to convert these to regular Python ints other than (struct) unpack'ing them one at a time and doing the mat

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris Smith
Chris F Clark <[EMAIL PROTECTED]> wrote: > Ok, we'll get there. First, we need to step back in time, to when there > was roughly algol, cobol, fortran, and lisp. Back then, at least as I > understood things, there were only a few types that generally people > understood integer, real, and (perhap

Arrghh... Problems building Python from source on OS X --

2006-06-26 Thread J. Jeffrey Close
Hi all, I have been trying for some time to build Python 2.4.x from source on OS X 10.4.6. I've found *numerous* postings on various mailing lists and web pages documenting the apparently well-known problems of doing so. Various problems arise either in the ./configure step, with configure argu

Re: What is a type error?

2006-06-26 Thread Pascal Costanza
Chris Smith wrote: > Pascal Costanza <[EMAIL PROTECTED]> wrote: >> Chris Smith wrote: >>> Of course zero is not appropriate as a second argument to the division >>> operator! I can't possibly see how you could claim that it is. The >>> only reasonable statement worth making is that there doesn'

Re: Having problems with strings in HTML

2006-06-26 Thread John Machin
On 27/06/2006 7:51 AM, Kiana Toufighi wrote: > Hi, > > I get a very odd error: > ValueError: unsupported format character 't' (0x74) at index 237 > > Here's my code: > HI_LITE_FILE_NAME = '/var/tmp/out.txt' > > print ''' > href="http://bbc.botany.utoronto.ca/ntools/cgi-bin/ntools_tre

replace a method in class: how?

2006-06-26 Thread Brian Blais
Hello, I want to replace a method in a class during run-time with another function. I tried the obvious, but it didn't work: class This(object): def update(self,val): print val def another_update(obj,val): print "another",val t=This() t.update(5) t.update=another_update t.

Re: list problem 4 newbie

2006-06-26 Thread manstey
Thanks very much. Deepcopy works fine, as does reversed(b). I thought I needed the index number but I didn't. Duncan Booth wrote: > manstey wrote: > > > for index in reversed(range(0,len(a)-1)): > >if '75' in b[index][1]: > > b[index][1].remove('75') > > b[index][1].append('99')

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Darren New
Joachim Durchholz wrote: > That's actually not a design choice It's certainly a choice you can get wrong, as you say. ;-) I mean, if "without runtime safety" is a choice, I expect picking the wrong choice here can be. :-) -- Darren New / San Diego, CA, USA (PST) Native Americans used e

Re: What is a type error?

2006-06-26 Thread David Hopwood
Pascal Costanza wrote: > David Hopwood wrote: >> Pascal Costanza wrote: >>> Chris Smith wrote: >>> While this effort to salvage the term "type error" in dynamic languages is interesting, I fear it will fail. Either we'll all have to admit that "type" in the dynamic sense is a psycho

Re: Having problems with strings in HTML

2006-06-26 Thread James Stroud
Kiana Toufighi wrote: > Hi, > > I get a very odd error: > ValueError: unsupported format character 't' (0x74) at index 237 > > Here's my code: > HI_LITE_FILE_NAME = '/var/tmp/out.txt' > > print ''' > href="http://bbc.botany.utoronto.ca/ntools/cgi-bin/ntools_treeview_word.cgi?input=&m

Re: Termination and type systems

2006-06-26 Thread David Hopwood
Dirk Thierbach wrote: > David Hopwood <[EMAIL PROTECTED]> wrote: >>Marshall wrote: >>>David Hopwood wrote: > A type system that required an annotation on all subprograms that do not provably terminate, OTOH, would not impact expressiveness at all, and would be very useful. > >>>Intere

Can I load and run modules inside threads....

2006-06-26 Thread [EMAIL PROTECTED]
and is it a good idea??? I am thinking of writing a controlling module - call it a postmaster if you will - that will start submodules and pass them work via queues - one input queue per module. The modules will send their results back to the postmaster via its queue. The postmaster will the

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris F Clark
I wrote: > These informal systems, which may not prove what they claim to prove > are my concept of a "type system". Chris Smith <[EMAIL PROTECTED]> replied: > Okay, that works. I'm not sure where it gets us, though Ok, we'll get there. First, we need to step back in time, to when there was

RE: queue deadlock possibility

2006-06-26 Thread Delaney, Timothy (Tim)
Michael Bayer wrote: > i was just going through this thread: http://mail.python.org/ > pipermail/python-list/2006-April/336948.html , where it is suggested > that the Lock instance used by Queue.Queue should be publically > configurable. I have identified another situation where a Queue can > be

Re: break the loop in one object and then return

2006-06-26 Thread Alex Pavluck
Peter, Why do you make such claims without any reason to do so? This is my own thing. So, I guess I am a student but just a student of my own accord. So, please don't reply if you don't have anything to contribute. As for the - mynum I guess that could happen but I am just doing this so that t

Having problems with strings in HTML

2006-06-26 Thread Kiana Toufighi
Hi, I get a very odd error: ValueError: unsupported format character 't' (0x74) at index 237 Here's my code: HI_LITE_FILE_NAME = '/var/tmp/out.txt' print ''' http://bbc.botany.utoronto.ca/ntools/cgi-bin/ntools_treeview_word.cgi?input=&max=2&values_off=no&remove_bracket=no&show_line_n

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Joachim Durchholz
Anton van Straaten schrieb: > Joachim Durchholz wrote: >> Anton van Straaten schrieb: >>> There's a close connection between latent types in the sense I've >>> described, and the "tagged values" present at runtime. However, as >>> type theorists will tell you, the tags used to tag values at run

Re: Looking for Python code to obsfucate mailto links on web site

2006-06-26 Thread James Stroud
Dan Sommers wrote: > On Sun, 25 Jun 2006 21:10:31 +0100, > Andrew McLean <[EMAIL PROTECTED]> wrote: > > >>I'm looking at putting some e-mail contact addresses on a web site, >>and wanted to make it difficult for spammers to harvest them. > > > [ ... ] > > >>Searching the web it looks like the

Re: psyco+webpy

2006-06-26 Thread Amaury Forgeot d'Arc
a a écrit : >> psyco.cannotcompile(??.GET) this gives an error message > invalid syntax Oh, I assumed that you would replace the ?? by the correct expression. You need to specify the GET function of the class you've written in the file "codepsyco.py" (I don't know the class name. It does not appe

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Joachim Durchholz
Darren New schrieb: > Marshall wrote: >> Also: has subtyping polymorphism or not, has parametric polymorphism or >> not. > > And covariant or contravariant. That's actually not a design choice - if you wish to have a sound type system, all input parameters *must* be contravariant, all output pa

getting POST vars from BaseHTTPRequestHandler

2006-06-26 Thread Christopher J. Bottaro
Hi, I can't for the life of me figure out how to get the post vars when using basehttpserver. Here's my code: class MyHandler(BaseHTTPRequestHandler): def do_POST(self): print self.path, self.command if self.rfile: print self.rfile.read() else: print 'no

Re: psyco+webpy

2006-06-26 Thread a
> psyco.cannotcompile(??.GET) this gives an error message invalid syntax Amaury Forgeot d'Arc wrote: > a a écrit : > > hi i tried psyco+webpy > > > > here is the error that i got > > please let me know if any of you has success run psyco+webpy > > thanks > > > > import web, psyco > > urls = ( > >

Re: psyco+webpy

2006-06-26 Thread Amaury Forgeot d'Arc
a a écrit : > hi i tried psyco+webpy > > here is the error that i got > please let me know if any of you has success run psyco+webpy > thanks > > import web, psyco > urls = ( > '/', 'view', > '/add','add' > ) > psyco.full() > psyco.log() > psyco.profile() > > Launching server: http://0.0.0.0

Re: Having problems with reading file in Python CGI

2006-06-26 Thread MooMaster
I haven't tried to use the CGI class for any CGI scripting, so I'm no expert...but I am familiar with file objects. You want to return the next line in the file object? Your loop will run until it hits the EOF, at which point it'll break...once you hit that, there is *no* next line. But it looks t

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Joachim Durchholz
Andrew McDonagh schrieb: > Joachim Durchholz wrote: >> Chris Smith schrieb: >>> Joachim Durchholz <[EMAIL PROTECTED]> wrote: Sorry, I have to insist that it's not me who's stretching terms here. All textbook definitions that I have seen define a type as the set/operations/axiom

Re: break the loop in one object and then return

2006-06-26 Thread Petr Jakes
It smells like many student are trying to do their homework last few days here ... Can we now the name of your school? :) AFAIK this group does not solve homeworks here :) Just few points: at the beginning try to test the input value you can use "in range" or using "0 < yournum < 101" you shou

'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread Mike Orr
Tim Peters wrote: > [EP <[EMAIL PROTECTED]>] > > This inquiry may either turn out to be about the suitability of the > > SHA-1 (160 bit digest) for file identification, the sha function in > > Python ... or about some error in my script > > It's your script. Always open binary files in binary mode

Re: Replace Whole Object Through Object Method

2006-06-26 Thread digitalorganics
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > Bruno Desthuilliers wrote: > (snip) > >> > >>Instead of exposing problems with your solution, you may want to expose > >>the real use case ? > > > > > > I'm working with a team that's doing social modeling, and for example, > > I need to

Re: Find the context of importer

2006-06-26 Thread [EMAIL PROTECTED]
I find the answer to my own question. The inspect module have what I need. Here is the sample code: a.py import b print 'hello world from module a' b

Re: Questions on Threading

2006-06-26 Thread Tim Peters
[j.c.sackett] > I'm using the threading module to accomplish some distributed processing on > a project, and have a basic (I hope) question that I can't find an answer to > elsewhere. > > I've noted that there's a lot of documentation saying that there is no > external way to stop a thread, True.

Re: Replace Whole Object Through Object Method

2006-06-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Bruno Desthuilliers wrote: (snip) >> >>Instead of exposing problems with your solution, you may want to expose >>the real use case ? > > > I'm working with a team that's doing social modeling, and for example, > I need to model workers that at some point in the progr

Re: PEP thought experiment: Unix style exec for function/method calls

2006-06-26 Thread Jeethu Rao
This reminds me of an silly little optimization I used to use all the times when coding in assembler on PIC MCUs. A call followed by a return can be turned into jump. Saves one instruction and one level on the call stack. I think most optimizing compilers already do something of this sort, at l

Re: Pycrypto

2006-06-26 Thread luca72
Hello again You know if is possible save all the encryption process in a text file and not only the result? This will be wery helpful for compare the pycrypto step by step operation, with the hand made operation and see where hand made make a mistake -- http://mail.python.org/mailman/listinfo/p

Re: Freezing Python with jythonc

2006-06-26 Thread tac-tics
> What am I doing wrong? Nevermind, I figured it out. -classpath overwrites the classpath not augments. I needed to use -classpath ".;jython.jar" and it works fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: Cannot create a consistent method resolution order (MRO)for bases object

2006-06-26 Thread digitalorganics
Oh, I forgot the line that bombed, sorry: line 52, in __main__ Bat.__bases__ += (Dog,) TypeError: Cannot create a consistent method resolution order (MRO) for bases object, Mixin, Dog See my other post for the complete code and my relevant note about new-style classes, thanks... Terry Reedy

Re: break the loop in one object and then return

2006-06-26 Thread Juho Schultz
Alex Pavluck wrote: > I am trying to write the following code to block up evaluation and > prompting for entering new information. However, when I break the loop > in one object and then return it does not start at the beginning again > but rather at the point where it exited. Can someone look at

Re: TypeError: Cannot create a consistent method resolution order (MRO) for bases object

2006-06-26 Thread digitalorganics
Hint: If I change Dog and Bat to old-style classes, there's no problem, everything works fine. Okay, here's the code dump from my playground:: -- #!/usr/bin/env python class Mixin: def mixin(object, *classes): NewClass = type('Mixin', (object._

Re: break the loop in one object and then return

2006-06-26 Thread Simon Forman
Alex Pavluck wrote: > I am trying to write the following code to block up evaluation and > prompting for entering new information. However, when I break the loop > in one object and then return it does not start at the beginning again > but rather at the point where it exited. Can someone look at

Re: TypeError: Cannot create a consistent method resolution order (MRO)for bases object

2006-06-26 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What are the reason one would get this error: TypeError: Cannot create > a consistent method resolution order (MRO) for bases object ?? Because the interpreter cannot ;-) > I can provide the code if needed Details beget details

Re: Beginner Programmer Question

2006-06-26 Thread I V
On Mon, 26 Jun 2006 10:47:58 -0700, [EMAIL PROTECTED] wrote: > whats the difference between raw input and input? 'input' is used to ask the user to input a python expression, which is then run, and 'input' returns the result of executing that expression. For example: (define a function which pri

PythonWin 207: How to change caret color?

2006-06-26 Thread rodrigostrauss
I already changed some colors hacking registry (prompt color is among them), but I was not able to change the caret color. I've changed the backgroud color to black, now I need to change the caret color from black to something else. I don't mind if the solution includes sending messages to Scintil

Re: Beginner Programmer Question

2006-06-26 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > whats the difference between raw input and input? *That* you should look up in the builtin functions section of chapter 1? of the library reference manual. Chapter 2 of the same on builtin types is also important to skim and be a

Re: TypeError: Cannot create a consistent method resolution order (MRO) for bases object

2006-06-26 Thread Simon Forman
[EMAIL PROTECTED] wrote: > What are the reason one would get this error: TypeError: Cannot create > a consistent method resolution order (MRO) for bases object ?? > > I can provide the code if needed Yes, do that. That's an amazing error. ~Simon -- http://mail.python.org/mailman/listinfo/p

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris Smith
George Neuner wrote: > On Sun, 25 Jun 2006 14:28:22 -0600, Chris Smith <[EMAIL PROTECTED]> > wrote: > > >George Neuner wrote: > >> >Undecidability can always be avoided by adding annotations, but of > >> >course that would be gross overkill in the case of index type widening. > >> > >> Just wh

  1   2   3   >