Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Bob Martin
in 121708 20090720 072858 Frank Buss wrote: >Bob Martin wrote: > >> I think the OP means "major PC operating systems". Those with a wider >> knowledge of the computer world would consider IBM's mainframe operating >> systems to be deserving of the description "major". > >Maybe you are right, if y

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Frank Buss
Bob Martin wrote: > I think the OP means "major PC operating systems". Those with a wider > knowledge of the computer world would consider IBM's mainframe operating > systems to be deserving of the description "major". Maybe you are right, if you mean big machines. I know mainframes a bit and t

Re: Managing non-ascii filenames in python

2009-07-19 Thread Martin v. Löwis
> I thought the correct way to do this in python would be to scan the > dir > files=os.listdir(os.path.dirname( os.path.realpath( __file__ ) )) > > then print the filenames > for filename in files: > print filename > > but as expected teh filename is not correct - so correct it using the > file

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Paul Rubin
Steven D'Aprano writes: > Besides, one can legitimately disagree that 2/3 => 0 is the wrong thing > to do. It's the right thing to do if you're doing integer maths. I wonder whether 2/3 => ValueError is preferable. -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Bob Martin
in 121683 20090719 210126 Terry Reedy wrote: >Roy Smith wrote: >> In article <1cethsrrw8h6k$.9ty7j7u7zovn@40tude.net>, >> Frank Buss wrote: >> >>> there is one free unique implementation on the 3 major platforms Linux, >>> Windows and MacOS X &

Re: file write IOError Invalid argument

2009-07-19 Thread Gabriel Genellina
En Thu, 16 Jul 2009 17:41:39 -0300, Robert Robert escribió: I am trying to write a binary string to file on a windows network share. I get an IOError. I've read that it is because the file size is too large. I did a type( binaryString) and saw that it was type "str". So I loop through it

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Tim Daneliuk
Carl Banks wrote: > On Jul 19, 4:29 pm, Tim Daneliuk wrote: >> Carl Banks wrote: >>> On Jul 19, 10:33 am, fft1976 wrote: On Jul 19, 9:55 am, Frank Buss wrote: > E.g. the number system: In many Lisp > implementations (/ 2 3) results in the fractional object 2/3. In Python > 2.6

Re: Final Project

2009-07-19 Thread Frank Buss
Fred Atkinson wrote: > I'm looking for some ideas here. > > I think I've mentioned I am taking a course in Python and PHP. > The professor wants each of us to pick a project to write in both > languages. It has to be something fairly complex and I'd like for it > to be something th

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Steven D'Aprano
On Sun, 19 Jul 2009 10:33:39 -0700, fft1976 wrote: > On Jul 19, 9:55 am, Frank Buss wrote: > >> E.g. the number system: In many Lisp >> implementations (/ 2 3) results in the fractional object 2/3. In Python >> 2.6 "2 / 3" results in "0". Looks like with Python 3.1 they have fixed >> it, now it

Re: ANN: GMPY 1.10 alpha with support for Python 3

2009-07-19 Thread Mensanator
On Jul 19, 5:05 pm, casevh wrote: > GMPY 1.10 beta is now available. This version fixes an issue where > very large objects would be cached for reuse instead of being freed. Excellent! That explains the funny memory usage graph. > > Source code and Windows installers may be found > athttp://cod

Managing non-ascii filenames in python

2009-07-19 Thread pdenize
I created the following filename in windows just as a test - “Dönåld’s™ Néphêws” deg°.txt The quotes are non -ascii, many non english characters, long hyphen etc. Now in DOS I can do a directory and it translates them all to something close. "Dönåld'sT Néphêws" deg°.txt I thought the correct way

Re: question on input function

2009-07-19 Thread John O'Hagan
On Mon, 20 Jul 2009, Richel Satumbaga wrote: > I am just learning python then I encountered an certain point in terms of > using the input function of python. the source code: >eq = input("enter an equation:"); >print " the result is : "; > > > the ou

Re: question on input function

2009-07-19 Thread Chris Rebert
On Sun, Jul 19, 2009 at 7:07 PM, Richel Satumbaga wrote: > I am just learning python then I encountered an certain point in terms of > using the input function of python. > the source code: >    eq = input("enter an equation:"); >    print " the result is : "

question on input function

2009-07-19 Thread Richel Satumbaga
I am just learning python then I encountered an certain point in terms of using the input function of python. the source code:    eq = input("enter an equation:");    print " the result is : "; the output seen in the command window: >>> enter an equation:[

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Roy Smith
In article <20090720025149.326f0...@halmanfloyd.lan.local>, Marek Kubica wrote: > > > there is one free unique implementation on the 3 major platforms > > > Linux, Windows and MacOS X > > > > Most people would still consider Solaris to be a "major platform". > > Depends on who you ask. On the

Final Project

2009-07-19 Thread Fred Atkinson
I'm looking for some ideas here. I think I've mentioned I am taking a course in Python and PHP. The professor wants each of us to pick a project to write in both languages. It has to be something fairly complex and I'd like for it to be something that would be useful on my Web s

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Marek Kubica
On Sun, 19 Jul 2009 11:22:30 -0700 (PDT) Elena wrote: > On Jul 19, 7:33 pm, fft1976 wrote: > > How do you explain that something as inferior as Python beat Lisp in > > the market place despite starting 40 years later. > > To be mainstream a language has to fit in most programmers' minds. Somet

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Marek Kubica
On Sun, 19 Jul 2009 15:09:28 -0400 Roy Smith wrote: > In article <1cethsrrw8h6k$.9ty7j7u7zovn@40tude.net>, > Frank Buss wrote: > > > there is one free unique implementation on the 3 major platforms > > Linux, Windows and MacOS X > > Most people would still consider Solaris to be a "major

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Carl Banks
On Jul 19, 4:29 pm, Tim Daneliuk wrote: > Carl Banks wrote: > > On Jul 19, 10:33 am, fft1976 wrote: > >> On Jul 19, 9:55 am, Frank Buss wrote: > > >>> E.g. the number system: In many Lisp > >>> implementations (/ 2 3) results in the fractional object 2/3. In Python > >>> 2.6 > >>> "2 / 3" resul

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Paul Rubin
Emile van Sebille writes: > >> Most people would still consider Solaris to be a "major platform". > > ?? I do not, but I have no idea what comes in 4th after the other > > three by whatever metric. > one metric calls fourth as the iPhone OS... > http://marketshare.hitslink.com/report.aspx?qprid=8.

Re: any suggestions to synchronize typed text and speech ?

2009-07-19 Thread Marcus Wanner
On 7/19/2009 4:15 PM, Stef Mientki wrote: hello, I'm using Scintilla as a wxPython widget with great pleasure. I now have an application where I want to make notes during a conversation, but also want to record the speech during that conversation. I'm using Scintilla as a wxPython widget for edi

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Tim Daneliuk
Carl Banks wrote: > On Jul 19, 10:33 am, fft1976 wrote: >> On Jul 19, 9:55 am, Frank Buss wrote: >> >>> E.g. the number system: In many Lisp >>> implementations (/ 2 3) results in the fractional object 2/3. In Python 2.6 >>> "2 / 3" results in "0". Looks like with Python 3.1 they have fixed it, n

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread vippstar
On Jul 19, 9:31 pm, Frank Buss wrote: > fft1976 wrote: > > How do you explain that something as inferior as Python beat Lisp in > > the market place despite starting 40 years later. > But maybe the most important point: The syntax looks simple compared to > Common Lisp (much less parentheses) hah

Re: ANN: GMPY 1.10 alpha with support for Python 3

2009-07-19 Thread casevh
GMPY 1.10 beta is now available. This version fixes an issue where very large objects would be cached for reuse instead of being freed. Source code and Windows installers may be found at http://code.google.com/p/gmpy/downloads/list casevh -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Carl Banks
On Jul 19, 10:33 am, fft1976 wrote: > On Jul 19, 9:55 am, Frank Buss wrote: > > > E.g. the number system: In many Lisp > > implementations (/ 2 3) results in the fractional object 2/3. In Python 2.6 > > "2 / 3" results in "0". Looks like with Python 3.1 they have fixed it, now > > it returns "0.6

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Emile van Sebille
On 7/19/2009 1:01 PM Terry Reedy said... Roy Smith wrote: In article <1cethsrrw8h6k$.9ty7j7u7zovn@40tude.net>, Frank Buss wrote: there is one free unique implementation on the 3 major platforms Linux, Windows and MacOS X Most people would still consider Solaris to be a "major platform

any suggestions to synchronize typed text and speech ?

2009-07-19 Thread Stef Mientki
hello, I'm using Scintilla as a wxPython widget with great pleasure. I now have an application where I want to make notes during a conversation, but also want to record the speech during that conversation. I'm using Scintilla as a wxPython widget for editing and PyAudio for the speech recording,

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Terry Reedy
Roy Smith wrote: In article <1cethsrrw8h6k$.9ty7j7u7zovn@40tude.net>, Frank Buss wrote: there is one free unique implementation on the 3 major platforms Linux, Windows and MacOS X Most people would still consider Solaris to be a "major platform". ?? I do not, but I have no idea what

Re: uniicode and executing a process with subprocess.call, or os.system

2009-07-19 Thread Rick King
Thanks. I looked around for alternatives but didn't find this one. Rick Chris Rebert wrote: On Sat, Jul 18, 2009 at 3:30 PM, Rick King wrote: Hello, I want to copy files using subprocess.call or os.system where the file names are non-ascii, e.g. Serbian(latin), c's and s's with hacheks,etc.

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Roy Smith
In article <1cethsrrw8h6k$.9ty7j7u7zovn@40tude.net>, Frank Buss wrote: > there is one free unique implementation on the 3 major platforms Linux, > Windows and MacOS X Most people would still consider Solaris to be a "major platform". -- http://mail.python.org/mailman/listinfo/python-list

Re: tough-to-explain Python

2009-07-19 Thread Paul Rubin
Calroc writes: > I'm engaged presently in starting a school to teach programming from > the ground up, based roughly on the curriculum outlined in the article > I mentioned. ... > I'm excited about formal methods because one, I just heard about them, Formal methods are a big and complicated subje

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Frank Buss
fft1976 wrote: > How do you explain that something as inferior as Python beat Lisp in > the market place despite starting 40 years later. Python is not that bad. Unlike Lisp, there is much less undefined behavior, there is one free unique implementation on the 3 major platforms Linux, Windows and

Trouble With a Form

2009-07-19 Thread Victor Subervi
Hi: When the form comes up the first time, there is the default value for num. When I fill in a number in the form and press send, even though the form sends to itself (same page name), I would think it would read the number sent. Here again is the code: from primeNumbers import primeNumbers try:

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Elena
On Jul 19, 7:33 pm, fft1976 wrote: > How do you explain that something as inferior as Python beat Lisp in > the market place despite starting 40 years later. To be mainstream a language has to fit in most programmers' minds. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a Form To Work

2009-07-19 Thread MRAB
Victor Subervi wrote: When the form comes up the first time, there is the default value for num. When I fill in a number in the form and press send, even though the form sends to itself (same page name), I would think it would read the number sent. Here again is the code: from primeNumbers im

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread MRAB
fft1976 wrote: On Jul 19, 9:55 am, Frank Buss wrote: E.g. the number system: In many Lisp implementations (/ 2 3) results in the fractional object 2/3. In Python 2.6 "2 / 3" results in "0". Looks like with Python 3.1 they have fixed it, now it returns "0.66", which will result in lots

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread fft1976
On Jul 19, 9:55 am, Frank Buss wrote: > E.g. the number system: In many Lisp > implementations (/ 2 3) results in the fractional object 2/3. In Python 2.6 > "2 / 3" results in "0". Looks like with Python 3.1 they have fixed it, now > it returns "0.66", which will result in lots of fun for

Re: A little help with pexpect

2009-07-19 Thread Piet van Oostrum
> Piet van Oostrum (PvO) wrote: [snip] >PvO> You can also consider using paramiko instead of pexpect. [snip] > chan = t.open_session() > chan.exec_command('cat') > chan.send('abcdefghijklmn\n') In a real program it is better to use sendall here, as send may decide to send only pa

Re: How to receive a data file of unknown length using a python socket?

2009-07-19 Thread python
>> I am interested in seeing your code and would be grateful if you shared it >> with this list. > All right here it is. Hope it helps. Hendrik, Thank you very much!! (I'm not the OP, but found this thread interesting) Best regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-li

Re: How to receive a data file of unknown length using a python socket?

2009-07-19 Thread Hendrik van Rooyen
On Sunday 19 July 2009 15:18:21 pyt...@bdurham.com wrote: > Hi Hendrik, > > If anybody is interested I will attach the code here. It is not a big > > module. > > I am interested in seeing your code and would be grateful if you shared > it with this list. All right here it is. Hope it helps - He

Re: Getting a Form To Work

2009-07-19 Thread MRAB
Victor Subervi wrote: Hi; I have the following in a *.py page for the Web: from primeNumbers import primeNumbers try: num = form.getfirst('num') except: num = '' msg = "Oops" print "Content-Type: text/html" print print """ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd";> http://w

Re: Python code for testing well parenthesized expression

2009-07-19 Thread Simon Forman
On Jul 14, 1:10 pm, Duncan Booth wrote: > John Machin wrote: > > Try an iterative version of checking that () [] and {} > > are balanced and nested appropriately. > > Here's how I might approach the more general case: > > def balanced(s, parens=("()",)): >     ''' >     Example: >     >>> balance

Re: On out-of-date Python Applications

2009-07-19 Thread John Machin
On 20/07/2009 12:24 AM, Virgil Stokes wrote: John Machin wrote: On Jul 19, 6:04 pm, Virgil Stokes wrote: I am not a heavy user of Python; but, I do work with it and some of its application packages (e.g. PyODE), in an academic setting. Many of these applications packages have a Windows inst

Re: are user defined classes hashable?

2009-07-19 Thread Nicolas Dandrimont
* Alan G Isaac [2009-07-19 14:46:12 +]: > Again, my question is about the class not its instances, > but still, checking as you suggest gives the same answer. That's what I get for answering before my coffee! Cheers, -- Nicolas Dandrimont "Linux poses a real challenge for those with a ta

Getting a Form To Work

2009-07-19 Thread Victor Subervi
Hi; I have the following in a *.py page for the Web: from primeNumbers import primeNumbers try: num = form.getfirst('num') except: num = '' msg = "Oops" print "Content-Type: text/html" print print """ http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd";> http://www.w3.org/1999/xhtml";> "

Re: tough-to-explain Python

2009-07-19 Thread Calroc
On Jul 9, 1:20 pm, Steven D'Aprano wrote: [...] > You'll excuse my skepticism about all these claims about how anyone can > program, how easy it is to teach the fundamentals of Turing Machines and > functional programming to anybody at all. Prove it. Where are your peer- > reviewed studies demonst

Re: python, ctypes, callbacks -- access violation when calling callback

2009-07-19 Thread resurtm
On 19 июл, 21:09, Christian Heimes wrote: > resurtm wrote: > > Can anybody explain my errors when trying to pass callback to DLL > > function? > > > Thanks for advices and solutions! > > You have to keep a reference to the callback alive yourself. ctypes > doesn't increase the refernece counter of

Re: python, ctypes, callbacks -- access violation when calling callback

2009-07-19 Thread Christian Heimes
resurtm wrote: > Can anybody explain my errors when trying to pass callback to DLL > function? > > Thanks for advices and solutions! You have to keep a reference to the callback alive yourself. ctypes doesn't increase the refernece counter of the function when you define a callback. As soon as th

python, ctypes, callbacks -- access violation when calling callback

2009-07-19 Thread resurtm
Hello. I'm trying to pass to the C function pointer to callback function from python. But when i'm trying to do this i get access violation within the DLL file when calling python callback. Here is the python side code: from ctypes import * # ... class NewtonBody(Structure): def __init__(sel

Re: A little help with pexpect

2009-07-19 Thread Piet van Oostrum
> Hussein B (HB) wrote: >HB> Hey, >HB> I'm trying to execute a command over a remore server using pexpect >HB> + >HB> url = 'ssh internalserver' >HB> res = pexpect.spawn(url) >HB> print '1' >HB> res.expect('.*ssword:') >HB> print '2' >HB> res.sendline('mypasswd') >HB> print '3

Re: are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
> * Alan G Isaac [2009-07-19 13:48:16 +]: >> Are user defined classes hashable? >> (The classes; *not* the instances!) >> I'm inclined to guess it will be hashed by id and this is >> OK. On 7/19/2009 10:07 AM Nicolas Dandrimont apparently wrote: > You can check for yourself: > In [1]: c

ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-19 Thread Mark Dufour
Hi all, I have just released version 0.2 of Shed Skin, an experimental (restricted) Python-to-C++ compiler (http://shedskin.googlecode.com). It comes with 7 new example programs (for a total of 40 example programs, at over 12,000 lines) and several important improvements/bug fixes. See http://code

Re: are user defined classes hashable?

2009-07-19 Thread Nicolas Dandrimont
* Alan G Isaac [2009-07-19 13:48:16 +]: > Are user defined classes hashable? > (The classes; *not* the instances!) > > I want to use some classes as dictionary keys. > Python is not objecting, > but I'm not sure how to think about > whether this could be dangerous. > I'm inclined to guess it

are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
Are user defined classes hashable? (The classes; *not* the instances!) I want to use some classes as dictionary keys. Python is not objecting, but I'm not sure how to think about whether this could be dangerous. I'm inclined to guess it will be hashed by id and this is OK. Thanks for any insights

Re: invoke method on many instances

2009-07-19 Thread Piet van Oostrum
> Rainer Grimm (RG) a écrit: >RG> Hallo Alan, >>> def apply2(itr, methodname, *args, **kwargs): >>>     f = operator.methodcaller(methodname, *args, **kwargs) >>>     for item in itr: >>>         f(item) >RG> you can do it in a functional way. > class A(object): >RG> ... def hello(self

Re: Auto Send URL

2009-07-19 Thread Victor Subervi
Ah. How easy! Thank you. On Sat, Jul 18, 2009 at 7:32 PM, Chris Rebert wrote: > On Fri, Jul 17, 2009 at 6:02 AM, Victor Subervi > wrote: > > Hi; > > I am trying to script code that automatically sends a Web site visitor to > an > > URL. Specifically, when they enter a value in a search box, I ha

Re: How to receive a data file of unknown length using a python socket?

2009-07-19 Thread python
Hi Hendrik, > I have ended up writing a netstring thingy, that addresses the string > transfer problem by having a start sentinel, a four byte ASCII length (so you > can see it with a packet sniffer/displayer) and the rest of the data escaped > to take out the start sentinel and the escape char

A little help with pexpect

2009-07-19 Thread Hussein B
Hey, I'm trying to execute a command over a remore server using pexpect + url = 'ssh internalserver' res = pexpect.spawn(url) print '1' res.expect('.*ssword:') print '2' res.sendline('mypasswd') print '3' res.sendline('ls -aslh') + What I want to do is to send a coup

Re: invoke method on many instances

2009-07-19 Thread Rainer Grimm
Hallo Alan, > def apply2(itr, methodname, *args, **kwargs): >     f = operator.methodcaller(methodname, *args, **kwargs) >     for item in itr: >         f(item) you can do it in a functional way. >>> class A(object): ... def hello(self): return "hello: " + str ( self.__class__.__name__ ) ... >>

Re: On out-of-date Python Applications

2009-07-19 Thread John Machin
On Jul 19, 6:04 pm, Virgil Stokes wrote: > I am not a heavy user of Python; but, I do work with it and some of its > application packages (e.g. PyODE), in an academic setting. > Many of these applications packages have a Windows installer which > usually works fine. However, I also try to keep up

Re: How to receive a data file of unknown length using a python socket?

2009-07-19 Thread Hendrik van Rooyen
On Sunday 19 July 2009 02:12:32 John Machin wrote: > > Apologies in advance for my ignorance -- the last time I dipped my toe > in that kind of water, protocols like zmodem and Kermit were all the > rage -- but I would have thought there would have been an off-the- > shelf library for peer-to-peer

Re: On out-of-date Python Applications

2009-07-19 Thread Michiel Overtoom
Virgil Stokes wrote: > some of these applications will not install on the latest version of Python. Which version of Python precisely? -- "The ability of the OSS process to collect and harness the collective IQ of thousands of individuals across the Internet is simply amazing." - Vinod Vall

On out-of-date Python Applications

2009-07-19 Thread Virgil Stokes
I am not a heavy user of Python; but, I do work with it and some of its application packages (e.g. PyODE), in an academic setting. Many of these applications packages have a Windows installer which usually works fine. However, I also try to keep up with the latest release of Python, and this is

Re: how two join and arrange two files together

2009-07-19 Thread Peter Otten
amr...@iisermohali.ac.in wrote: [please keep the correspondence on the mailing list/newsgroup] > It is working sir, but my datas are on file when i replaced StringIO("") > with open("filename.txt") then it is not printing the result properly, > like in one file i have data like:--- > 33 ALA H = 7

Import hashlib fails, embedded

2009-07-19 Thread Jeremy Cowles
I'm working on an embeddded Python interpreter (using the c-api) where we are loading a custom, zipped copy of the standard Python library (./lib/python25.zip). Everything is working fine, but when I try to "import hashlib", i get the following error: Traceback (most recent call last): File "tr

Re: How to receive a data file of unknown length using a python socket?

2009-07-19 Thread Piet van Oostrum
> John Machin (JM) wrote: >JM> On Jul 19, 7:43 am, Irmen de Jong wrote: >>> twgray wrote: >>> > I am attempting to send a jpeg image file created on an embedded >>> > device over a wifi socket to a Python client running on a Linux pc >>> > (Ubuntu).  All works well, except I don't know, on t