Re: python3: accessing the result of 'if'

2005-01-08 Thread Carl Banks
Donn Cave wrote: > If Python 3 is going to get assignment-as-expression, it will be > because GvR accepts that as a reasonable idea. You won't bootleg it > in by trying to hide it behind this "where" notion, and you're not > doing "where" any good in trying to twist it this way either. I suspect

Re: python3: accessing the result of 'if'

2005-01-08 Thread Nick Coghlan
Carl Banks wrote: I'm sorry, I really can't agree that this helper function "solves" it. IMO, it's a workaround, not a solution. And, if I may be frank, it's a pretty ugly one. Heck, I thought it was ugly and I wrote it :) So in reality, I'd continue to use the nested-if approach that works right

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: >x = (sqrt(a) where (a=2.0)) + (sqrt(b) where (a=3.0)) Hmm, I like that too. -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-08 Thread Nick Coghlan
Paul Rubin wrote: Nick Coghlan <[EMAIL PROTECTED]> writes: I think having to keep the names unique within the statement you are currently writing is a reasonable request :) Um, you could say the same thing about the function, the module, etc. ;) And, indeed, that is what Python currently says. Whe

Re: Python Operating System???

2005-01-08 Thread Paul Rubin
"Roose" <[EMAIL PROTECTED]> writes: > But are you really going to write a virtual memory system in Python? Are > you going to write a file system, and a task scheduler in Python? Are you > going to have people write device drivers in Python? Do you know how virtual memory systems, file systems,

Re: Python Operating System???

2005-01-08 Thread Roose
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > "Roose" <[EMAIL PROTECTED]> writes: > > My point was that you can't do a lot of hardware interface programming in > > pure Python -- there would be so much non-trivial code in C that it would be > > hard to call it a

Re: Python Operating System???

2005-01-08 Thread Bengt Richter
On Sat, 8 Jan 2005 21:29:47 -0600, "John Roth" <[EMAIL PROTECTED]> wrote: > >"Bengt Richter" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> On Sat, 08 Jan 2005 12:47:52 -0500, Peter Hansen <[EMAIL PROTECTED]> >> wrote: >> >>>Paul Rubin wrote: When Unix was first written, pe

Re: time module precision

2005-01-08 Thread Tim Peters
[Jane Austine] > What is the precision (and accuracy) of time module on a Windows XP > machine? There are many functions in the time module. You shouldn't assume that any two have similar behavior (because, in fact, they may not). > threading module depends on time module so it's precision(and >

Re: python3: accessing the result of 'if'

2005-01-08 Thread Donn Cave
Quoth "Carl Banks" <[EMAIL PROTECTED]>: ... | As a compromise, howabout: | | . if m > 20 where m=something(): | . do_something_with(m) | | In this case, the m=something() is NOT an assignment statement, but | merely a syntax resembling it. The "where m=something()" is part of | the if-statemen

Re: python3: 'where' keyword

2005-01-08 Thread Nick Coghlan
Paul Rubin wrote: AdSR <[EMAIL PROTECTED]> writes: Killer app for this keyword: class C(object): x = property(get, set) where: def get(self): return "Silly property" def set(self, val): self.x = "Told you it was silly" Hey, this is super-elegant! Heh, even further: z = C() whe

Re: python3: accessing the result of 'if'

2005-01-08 Thread Carl Banks
Nick Coghlan wrote: > Carl Banks wrote: > > What if the condition you wanted to test wasn't the same as the thing > > you want to save? In other words, how would you convert this? > > > > . where: > > . m = something() > > . if m > 20: > > . do_something_with(m) > > Yeah, this problem even

Re: mysterious buggy behavior

2005-01-08 Thread Nick Coghlan
Sean McIlroy wrote: While fiddling with a little script I ran into a problem that baffles me completely. Maybe I'm missing something completely obvious, and somebody out there can diagnose the problem at a glance. Anyway, that's the hope. Here's the code (it plays tic tac toe): You need to be a lit

Re: Returning same type as self for arithmetic in subclasses

2005-01-08 Thread michele . simionato
Max. M.: > So I wondered if there was a simlpler way to coerce the result into my > desired types rather than overwriting the __add__, __sub__ etc. methods? Tim Peters: >> Generally speaking, no. But I'm sure someone will torture you with a >> framework that purports to make it easy . I will not

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > I think having to keep the names unique within the statement you are > currently writing is a reasonable request :) Um, you could say the same thing about the function, the module, etc. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: accessing the result of 'if'

2005-01-08 Thread Nick Coghlan
Carl Banks wrote: What if the condition you wanted to test wasn't the same as the thing you want to save? In other words, how would you convert this? . where: . m = something() . if m > 20: . do_something_with(m) Yeah, this problem eventually occurred to me as well. However, I think a litt

Re: The best way to do web apps with Python?

2005-01-08 Thread Joe Francia
worzel wrote: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a litt

Are there some resources about Python's VM and Python's implementation?

2005-01-08 Thread cr999
I am very interested in Python's VM and also Python's implementation. I want to read the Phton's source code but i think it is very helpful if there are some resources and docuemnts about this topic. Anybody knows about this?   Thanks :)   Robert -- http://mail.python.org/mailman/

Re: python3: 'where' keyword

2005-01-08 Thread Nick Coghlan
Paul Rubin wrote: What would be the advantage of that over this? . x = sqrt(a) + sqrt(b) where: . a = 2.0 . b = 3.0 The idea of "where" is to allow re-using variable names instead of having to keep track of which ones are in use. I just tried to give a very simple example of how you might

mysterious buggy behavior

2005-01-08 Thread Sean McIlroy
While fiddling with a little script I ran into a problem that baffles me completely. Maybe I'm missing something completely obvious, and somebody out there can diagnose the problem at a glance. Anyway, that's the hope. Here's the code (it plays tic tac toe): """ Something goes wrong with the "tim

Re: python3: 'where' keyword

2005-01-08 Thread Nick Coghlan
Bengt Richter wrote: On Sat, 08 Jan 2005 16:42:16 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: And, is the whole thing after the '=' an expression? E.g., x = ( foo(x) where: x = math.pi/4.0 ) where: def foo(x): print 'just for illustration', x or is this legal? for y i

Re: Python Operating System???

2005-01-08 Thread Paul Rubin
"Roose" <[EMAIL PROTECTED]> writes: > My point was that you can't do a lot of hardware interface programming in > pure Python -- there would be so much non-trivial code in C that it would be > hard to call it a Python OS. Why do you say that? Is the same thing not true of C, where you need some a

Re: Python Operating System???

2005-01-08 Thread Roose
OK I've heard of that. But the original poster didn't ask to make a Python machine and then a Python OS. My point was that you can't do a lot of hardware interface programming in pure Python -- there would be so much non-trivial code in C that it would be hard to call it a Python OS. So this bas

time module precision

2005-01-08 Thread Jane Austine
What is the precision (and accuracy) of time module on a Windows XP machine? threading module depends on time module so it's precision(and accuracy) is up to time module's. | for i in xrange(1000): |time.sleep(0.001) This sleeps for awhile, which means 0.001 sec is not ignored. On the other

Re: The Industry choice

2005-01-08 Thread Bulba!
On 6 Jan 2005 20:07:19 -0500, [EMAIL PROTECTED] (Aahz) wrote: >>Nope. That is not what I'm arguing. Really, I think you have >>jumped to conclusion about that: I merely pointed out that >>I don't like what I perceive as end effect of what GPL license >>writers are attempting to achieve: vendor loc

Re: Python Operating System???

2005-01-08 Thread John Roth
"jtauber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] My experiment, Cleese, was making progress before I got distracted by other things. The approach was a micro-kernel in C made up of the CPython bytecode interpreter with the file-related calls to libc ripped out and some bare-me

Re: Python Operating System???

2005-01-08 Thread John Roth
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Sat, 08 Jan 2005 12:47:52 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: Paul Rubin wrote: When Unix was first written, people thought implementing an OS in C was ludicrous. Everyone knew OS's had to be written in as

Make predictions about Python in a New Google Game

2005-01-08 Thread Amir Michail
Hi, I have added over 50 Python related (Query, URL) pairs into the Speculative Search Game -- a new Google game. Just search for "python" to find them when making predictions: http://www.cse.unsw.edu.au/~amichail/spec/ The Speculative Search Game allows you to predict which web pages will rank

Re: python3: 'where' keyword

2005-01-08 Thread Bengt Richter
On 8 Jan 2005 16:13:39 -0800, "Carl Banks" <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: >> And, is the whole thing after the '=' an expression? E.g., >> >> x = ( foo(x) where: >> x = math.pi/4.0 >> ) where: >> def foo(x): print 'just for illustration', x > >How woul

Re: Python Operating System???

2005-01-08 Thread Bengt Richter
On Sat, 08 Jan 2005 12:47:52 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >Paul Rubin wrote: >> When Unix was first written, people thought implementing an OS in C >> was ludicrous. Everyone knew OS's had to be written in assembler. > >Actually, when Unix was first written that belief was entir

Re: tuples vs lists

2005-01-08 Thread Sean Dolan
worzel wrote: I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or tomato kind of thing) TIA I use the Festival Speech Synthesis System to learn pronunciatio

Re: Speed revisited

2005-01-08 Thread John Machin
Bulba! wrote: > On 4 Jan 2005 14:33:34 -0800, "John Machin" <[EMAIL PROTECTED]> > wrote: > > >(b) Fast forwarding 30+ years, let's look at the dictionary method, > >assuming you have enough memory to hold all your data at once: > > > >Step 1: read the "left" table; for each row, if english not in

Re: The best way to do web apps with Python?

2005-01-08 Thread worzel
Holy Moly - there's quite a few choices out there! I like the look of Karrigel for my immediate needs. Looking forward to the day there is a more 'j2ee' like standard in place for Python - looks like this is in the works. Thanks for all the feedback guys. "worzel" <[EMAIL PROTECTED]> wrote i

Re: tuples vs lists

2005-01-08 Thread worzel
yes, "tyoopl" - thats what I meant by 'choo-ple' (not v good at the phonetics) As a scouse git (though living in Australia), I would definitely say 'tyoopl'. "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > worzel wrote: > >> Cheers - thanks for the feedback guys -

Re: python3: accessing the result of 'if'

2005-01-08 Thread Carl Banks
Nick Coghlan wrote: > I have a different suggestion for this. > > 'as' is used for renaming in import statements. 'as' will be used for exception > naming in Python 3k. > > So let's use it for expression naming in 'if' statements, too. > > if someregexp.match(s) as m: ># blah using m > elif som

Re: Windows XP Installation

2005-01-08 Thread Smitsky
Thanks Folks. Yes, I did visit the Python site. I just wasn't sure what to try first. :O) Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows XP Installation

2005-01-08 Thread Bob Smith
Smitsky wrote: Hi. I am a newbie to Python. I am running Win XP and want to know what the best course is for installing Python on my system. Could someone kindly direct me to some related resources? Thanks in advance, Steve It's really easy on Windows. Just download the install package and cli

Re: windows mem leak

2005-01-08 Thread Bulba!
On Sat, 08 Jan 2005 15:00:05 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: >> Does the Win32 port of Python have a memory leak? I have some code that >> runs flawlessly on Linux, but bombs after a few hours on Windows. It's >> threaded and uses a lot of memory. >Yes, that's a well-known proble

Re: Python Operating System???

2005-01-08 Thread Andrew Dalke
Paul Rubin: > Lately there are people trying to program PC's to > simulate the Lisp hardware and to get the Lisp Machine software > released (now that the commercial market for it has long since dried > up). However, both of those projects have a ways to go. There's a video of someone demoing how

Re: Windows XP Installation

2005-01-08 Thread Irmen de Jong
Smitsky wrote: Hi. I am a newbie to Python. I am running Win XP and want to know what the best course is for installing Python on my system. Could someone kindly direct me to some related resources? Thanks in advance, Steve The Python beginners guide contains a lot of information for you: http:/

Re: Windows XP Installation

2005-01-08 Thread Kartic
Smitsky, Did you at least visit python.org, Python main website? Step 1: Visit www.python.org Step 2: Click on the download link Step 3: Located Windows Binary in the list of downloads (choose the first link - http://python.org/ftp/python/2.4/python-2.4.msi - if you dont know what Itanium is) Ste

Re: Python Installation

2005-01-08 Thread Simon John
brolewis wrote: > I need to install Python on a number of laptop computers (at least a > dozen). I am needing to install Python 2.4, pycrypto, win32all, > wxPython, and pyCurl. You could try the recently-announced MOVPY, or NSIS/InnoSetup as you say. Or simply put the five installers on a disk -

Re: Speed revisited

2005-01-08 Thread Steven Bethard
Bulba! wrote: Following advice of two posters here (thanks) I have written two versions of the same program, and both of them work, but the difference in speed is drastic, about 6 seconds vs 190 seconds for about 15000 of processed records, taken from 2 lists of dictionaries. I've read "Python Per

Windows XP Installation

2005-01-08 Thread Smitsky
Hi. I am a newbie to Python. I am running Win XP and want to know what the best course is for installing Python on my system. Could someone kindly direct me to some related resources? Thanks in advance, Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
"Carl Banks" <[EMAIL PROTECTED]> writes: > ># compute sqrt(2) + sqrt(3) > >x = (sqrt(a) where: > > a = 2.) \ > >+ sqrt (a) where: > >a = 3. > > > > Hmmm. > > What would be the advantage of that over this? > > . x = sqrt(a) + sqrt(b) where: > . a = 2.0 > .

Re: Python Operating System???

2005-01-08 Thread Bulba!
On Sat, 08 Jan 2005 08:28:12 GMT, "Roose" <[EMAIL PROTECTED]> wrote: >I am not trying to be insulting... but unless someone would like to educate >me otherwise, the idea of an OS written in Python is almost ludicrous. As I >said, I think you might mean an OS SHELL, which would be a reasonable >(a

Speed revisited

2005-01-08 Thread Bulba!
On 4 Jan 2005 14:33:34 -0800, "John Machin" <[EMAIL PROTECTED]> wrote: >(b) Fast forwarding 30+ years, let's look at the dictionary method, >assuming you have enough memory to hold all your data at once: > >Step 1: read the "left" table; for each row, if english not in mydict, >then do mydict[engl

Re: python3: 'where' keyword

2005-01-08 Thread Carl Banks
Paul Rubin wrote: > "Carl Banks" <[EMAIL PROTECTED]> writes: > > You misunderstand. BTW, Peter, I guess I should have said "I misunderstand, but it can be legal if you consider it part of the statements", since it appears the author did intend it to be part of an expression. > > There "where" i

Re: python3: 'where' keyword

2005-01-08 Thread Carl Banks
Bengt Richter wrote: > And, is the whole thing after the '=' an expression? E.g., > > x = ( foo(x) where: > x = math.pi/4.0 > ) where: > def foo(x): print 'just for illustration', x How would that be any improvement over this? . x = foo(x) where: . x = math.pi/4.0 .

pyparsing: how to negate a grammar

2005-01-08 Thread knguyen
Hi, I want to define a rule for a line that does NOT start with a given Literal. How do I do that? I try the following and my program just hang there: BodyLine = ~Literal("HTTP/1.1") + restOfLine Thanks, Khoa -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
"Carl Banks" <[EMAIL PROTECTED]> writes: > You misunderstand. There "where" is not part of the expression but the > statement. The above example would be a modified print statement, a > print...where statement, if you will. Under this suggestion, there > would be modified versions of various sim

Re: python3: 'where' keyword

2005-01-08 Thread Carl Banks
Peter Hansen wrote: > Andrey Tatarinov wrote: > > >>> print words[3], words[5] where: > > >>> words = input.split() > > > > - defining variables in "where" block would restrict their visibility to > > one expression > > Then your example above doesn't work... print takes a > sequence of expr

Re: Pre/Postconditions with decorators

2005-01-08 Thread Paul Rubin
Stephen Thorne <[EMAIL PROTECTED]> writes: > Unresolved Problems: > 1) How do you handle duck types, i.e. a method that accepts StringIO, > cStringIO or any other object that has a .readlines(), .seek() and > .read() method? That should really be done through having those classes inherit a file-op

Re: Pre/Postconditions with decorators

2005-01-08 Thread Stephen Thorne
On Fri, 7 Jan 2005 20:01:50 +0200, George Sakkis <[EMAIL PROTECTED]> wrote: > > Hi George, > > it would be nice to see how you have tackled > > the task. > > Maybe we will have a checker > > module in Python one day... ;-) > > I posted my module on http://rafb.net/paste/results/voZYTG78.html and i

Re: printing line numbers for debugging purpose

2005-01-08 Thread Michael Fuhr
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > All of the methods from my program return None on error (i.e; I do not > want to assert and have the program exit). > > Is it possible to print the current source file name/line number ? Someone else posted an example using an exception handler.

Re: windows mem leak

2005-01-08 Thread Bob Smith
Steve Holden wrote: Bob Smith wrote: Does the Win32 port of Python have a memory leak? I have some code that runs flawlessly on Linux, but bombs after a few hours on Windows. It's threaded and uses a lot of memory. Thanks! Yes, that's a well-known problem. Code that runs with a few errors will

Re: Python Operating System???

2005-01-08 Thread Paul Rubin
"Roose" <[EMAIL PROTECTED]> writes: > > Is an OS written in Lisp also ludicrous? Because it's been done. > > Can you point me to this? I'd like to see how "truly" Lisp it is. http://en.wikipedia.org/wiki/Lisp_machine > My first guess would be -- not very. And I'd like to install it on my PC.

Re: Embedding a restricted python interpreter

2005-01-08 Thread Paul Rubin
Dieter Maurer <[EMAIL PROTECTED]> writes: > It uses a specialized compiler that prevents dangerous bytecode operations > to be generated and enforces a restricted builtin environment. Does it stop the user from generating his own bytecode strings and demarshalling them? -- http://mail.python.

Re: printing line numbers for debugging purpose

2005-01-08 Thread Mark McEahern
Philippe C. Martin wrote: Hi, All of the methods from my program return None on error (i.e; I do not want to assert and have the program exit). Is it possible to print the current source file name/line number ? ex: in C/C++ I would use the macros __FILE__ and __LINE__. Consider something like this:

Re: EOF for binary?

2005-01-08 Thread flamesrock
ahh..that does make sense. But maybe getsize() should have a way of inferring what file is specified. I might actually submit a request.. -- http://mail.python.org/mailman/listinfo/python-list

printing line numbers for debugging purpose

2005-01-08 Thread Philippe C. Martin
Hi, All of the methods from my program return None on error (i.e; I do not want to assert and have the program exit). Is it possible to print the current source file name/line number ? ex: in C/C++ I would use the macros __FILE__ and __LINE__. Regards, Philippe -- *

Re: Another look at language comparisons

2005-01-08 Thread Rick Parsons
On Sat, 08 Jan 2005 14:18:15 +0100, Jan Dries wrote: > > The bottom line of the article is that languages authored by men with > beards are more successful than those authored by people without beards. > At least the anecdotical evidence to that is overwhelming :-) > > And there is hope for Py

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread Carlos Ribeiro
On Sat, 08 Jan 2005 11:52:03 -0800, aurora <[EMAIL PROTECTED]> wrote: > One of the author's idea is many of today's main stream technology (like > OO) did not come about suddenly but has cumulated years of research before > becoming widely used. A lot of these ideas may not work or does not seems >

Re: Ranting about the state of Python IDEs for Windows

2005-01-08 Thread AkioIto
Carlos Ribeiro wrote: > Oh well. A mailing list is not the most appropriate place for rants (a > blog is better), but it's still better than keeping it for myself. > > I'm frustrated. My search for a good IDE to support my activities -- > doing development for Python in the Windows environment -- a

Re: python3: 'where' keyword

2005-01-08 Thread Carlos Ribeiro
On Sat, 08 Jan 2005 12:53:05 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Andrey Tatarinov wrote: > > >>> print words[3], words[5] where: > > >>> words = input.split() > > > > - defining variables in "where" block would restrict their visibility to > > one expression > > Then your exampl

Re: Documenting data members

2005-01-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Frans Englich wrote: > I have a custom module which among others contains a dictionary, acting as a > "constant". I want to document it, but no matter what I do, it doesn't show > up in `pydoc`. For example, the following doesn't work: I'm using epydoc_ for my documentat

Re: Python Installation

2005-01-08 Thread brolewis
For what its worth, I am running Windows XP Pro on all of these machines. -- http://mail.python.org/mailman/listinfo/python-list

Python Installation

2005-01-08 Thread brolewis
I need to install Python on a number of laptop computers (at least a dozen). I am needing to install Python 2.4, pycrypto, win32all, wxPython, and pyCurl. Can anyone tell me an easy way to install these onto the laptops? Ideally I would like to have a single executable to handle everything for me.

Re: Python Operating System???

2005-01-08 Thread jtauber
My experiment, Cleese, was making progress before I got distracted by other things. The approach was a micro-kernel in C made up of the CPython bytecode interpreter with the file-related calls to libc ripped out and some bare-metal port read/writes and memory operations exposed to Python as built-

Re: escape string for command line

2005-01-08 Thread Ksenia Marasanova
> > > > I was wondering, is there a general way to escape the string entered > > by the user, to prevent code injection into command line? > > Take a look at the "string-escape" encoding: > > >>> evil = "'; rm -rf /;" > >>> command = "echo '%s'" > >>> print command % evil.encode('string-escape')

Documenting data members

2005-01-08 Thread Frans Englich
Hello, I have a custom module which among others contains a dictionary, acting as a "constant". I want to document it, but no matter what I do, it doesn't show up in `pydoc`. For example, the following doesn't work: """ A dictionary of the namespaces. """ xmlns = { ... } or xmlns = { """ A d

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread John Roth
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: I have yet to write a multi-thread program for performance reasons. If we include in the set of things covered by the term "performance" not only throughput, but also latency, then I suspect you actually ha

Re: Installing IPython on win2k

2005-01-08 Thread Dave Merrill
Fernando replied to a similar post of mine on the IPython list, and had a suggestion that for some unknown reason, worked. Or rather, what's unknown is why normal setup failed. For the benefit of anyone else who has this issue, I unzipped the files into C:\Program Files\ipython-0.6.6 ...then o

Re: escape string for command line

2005-01-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Ksenia Marasanova wrote: > I have a simple ecard creation script on a website, where user can add > text to a graphic. I use ImageMagick for it: > > # template_file => path to image template file > # new_file => path to generated file > # text => user input > command = '''

Re: EOF for binary?

2005-01-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, flamesrock wrote: > os.path.getsize(infile) <= infile.tell() > > Because that returns the error: > # File "/usr/lib/python2.3/posixpath.py", line 142, in getsize > #return os.stat(filename).st_size > #TypeError: coercing to Unicode: need string or buffer, file found >

Re: Python Operating System???

2005-01-08 Thread Roose
Well can you describe what kind of things you want to do exactly? My guess is you are not out to develop a new algorithm for virtual memory or task scheduling. There are many parts to an OS shell. An example is the command line, i.e. bash and the like in Unix, and cmd.exe in Windows. In Windows

Re: Python Operating System???

2005-01-08 Thread Roose
> Is an OS written in Lisp also ludicrous? Because it's been done. Can you point me to this? I'd like to see how "truly" Lisp it is. My first guess would be -- not very. And I'd like to install it on my PC. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing IPython on win2k

2005-01-08 Thread Dave Merrill
"Tim G" wrote in message news:[EMAIL PROTECTED] > Dave Merrill wrote: > > Hi, I'm new to python, and ipython, but not to programming, having > trouble > > getting ipython installed on windows 2000, python 233. Any help would > be > > much appreciated; I'm sure I'm being some basic flavor of dense

losing CGI variables in os.environ in Python 2.4

2005-01-08 Thread jtauber
Did something change between 2.3 and 2.4 that would affect os.environ being populated with CGI variables when using the BaseHTTPServer/CGIHTTPServer? I received a bug report from someone trying to run my wiki/blog software, Leonardo[1] under Python 2.4 on Windows 2000. I was able to reproduce the

Re: windows mem leak

2005-01-08 Thread Steve Holden
Bob Smith wrote: Does the Win32 port of Python have a memory leak? I have some code that runs flawlessly on Linux, but bombs after a few hours on Windows. It's threaded and uses a lot of memory. Thanks! Yes, that's a well-known problem. Code that runs with a few errors will port without any tro

Re: tuples vs lists

2005-01-08 Thread Irmen de Jong
Steve Holden wrote: Well, it might be "Two-Pull" in American, but in English it's "tyoopl" -- NOT "choopl" (blearch!). I've also heard people say "tuppl". Probably the same ones who attend Tuppl-ware parties. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: there's a socket.sendall(), so why no socket.recvall()?

2005-01-08 Thread Irmen de Jong
Robert Brewer wrote: Irmen de Jong wrote: Subject says it all; there's a socket.sendall(), so why no socket.recvall()? [...] If you call .makefile() and then .read() the _fileobject, you get the same behavior (only better). Adding recvall would just duplicate that, I think. But that's desirable IM

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread aurora
Of course there are many performance bottleneck, CPU, memory, I/O, network all the way up to the software design and implementation. As a software guy myself I would say by far better software design would lead to the greatest performance gain. But that doesn't mean hardware engineer can sit

Re: Embedding a restricted python interpreter

2005-01-08 Thread Dieter Maurer
Doug Holton <[EMAIL PROTECTED]> writes on Thu, 06 Jan 2005 20:34:31 -0600: > ... > Hi, there is a page on this topic here: > http://www.python.org/moin/SandboxedPython > > The short answer is that it is not possible to do this with the > CPython, but you can run sandboxed code on other virtual mac

Re: Installing IPython on win2k

2005-01-08 Thread Tim G
Dave Merrill wrote: > Hi, I'm new to python, and ipython, but not to programming, having trouble > getting ipython installed on windows 2000, python 233. Any help would be > much appreciated; I'm sure I'm being some basic flavor of dense... First of all, rest assured that it does work (and quite e

Re: Working with recordsets

2005-01-08 Thread Steve Holden
AdSR wrote: [EMAIL PROTECTED] wrote: Hi. I have one recorset that I would like to pass to 2 functions, one is for create an CSV file and the other one is to create a HTML file. The problem is that the recordset is totally read in the first function, and then when I pass it to the second funtion the

interpreter Py_Initialize/Py_Finalize mem leak?

2005-01-08 Thread Roman Suzi
In pure curiosity I tried to compile loop.c from Demo/embed and started it with 'print 2+2'. It seems, that both 2.3 and 2.4 pythons have memory leaks in Py_Initialize/Py_Finalize calls. (That is, interpreter doesn't clean up well after itself). This is my setup: gcc -fpic loop.c -DHAVE_CONFIG_H

Re: Weekly Python Patch/Bug Summary

2005-01-08 Thread Max M
Kurt B. Kaiser wrote: Remove witty comment in pydoc.py (2005-01-01) CLOSED http://python.org/sf/1094007 opened by Reinhold Birkenfeld This is not a joke? :-) -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: Recent infoworld column

2005-01-08 Thread Carlos Ribeiro
On Sat, 08 Jan 2005 13:14:17 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Dwarf Electrician wrote: > > from a long time listener... > > > > http://www.infoworld.com/article/04/12/30/01OPstrategic_1.html > > Kudos for Roger Binns! >From Mr. Udell himself: """ When people talk about the heroes

Re: The best way to do web apps with Python?

2005-01-08 Thread Steve Holden
worzel wrote: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a

Weekly Python Patch/Bug Summary

2005-01-08 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 267 open ( +6) / 2727 closed ( +9) / 2994 total (+15) Bugs: 798 open ( -3) / 4748 closed (+15) / 5546 total (+12) RFE : 165 open ( +0) / 140 closed ( +1) / 305 total ( +1) New / Reopened Patches __ Remove wi

Re: Returning same type as self for arithmetic in subclasses

2005-01-08 Thread Steve Holden
Tim Peters wrote: [Max M] """ I subclass datetime and timedelta [...] Generally speaking, no. But I'm sure someone will torture you with a framework that purports to make it easy . Clearly the easy way is to have the type declaration introspect on the definitions of datetime and timedelta and the

Re: tuples vs lists

2005-01-08 Thread Steve Holden
worzel wrote: Cheers - thanks for the feedback guys - pretty much answers the question for me. 'Two-Pull' it is then, thanks. Well, it might be "Two-Pull" in American, but in English it's "tyoopl" -- NOT "choopl" (blearch!). I've also heard people say "tuppl". So, basically, say whatever you wa

RE: there's a socket.sendall(), so why no socket.recvall()?

2005-01-08 Thread Robert Brewer
Irmen de Jong wrote: > Subject says it all; > there's a socket.sendall(), so why no socket.recvall()? Good question! Something like: # Receive reply. data = [] while True: try: chunk = conn.recv(8192) except Exception, x:

Re: The limitation of the Photon Hypothesis

2005-01-08 Thread Steve Holden
Steve Horsley wrote: bill wrote: Please reply to [EMAIL PROTECTED], thank you ! No - I'll reply to the newsgroup, if you don't mind. The limitation of the Photon Hypothesis THE UNCERTAINTY PRINCIPLE IS UNTENABLE You cannot use classical theory to disprove quantum theory that easily. The uncertai

Re: DOS problem (simple fix??)

2005-01-08 Thread Steve Holden
Gavin Bauer wrote: My DOS window (running in windows ME) closes the second it finishes running my programs. As you can imagine, this makes it hard to see the results. I've gotten in the habit of putting raw_input("Press enter to exit") at the end of every program, and in addition to being pain in t

Re: Python Operating System???

2005-01-08 Thread Arich Chanachai
Peter Hansen wrote: Paul Rubin wrote: When Unix was first written, people thought implementing an OS in C was ludicrous. Everyone knew OS's had to be written in assembler. Actually, when Unix was first written that belief was entirely correct, and OSes *did* have to be written in assembler. *nods

Re: windows mem leak

2005-01-08 Thread Peter Hansen
Bob Smith wrote: Does the Win32 port of Python have a memory leak? I have some code that runs flawlessly on Linux, but bombs after a few hours on Windows. It's threaded and uses a lot of memory. Let's see what you're missing: 1. platform specifics 2. versions of things involved 3. any sort of det

Re: Recent infoworld column

2005-01-08 Thread Peter Hansen
Dwarf Electrician wrote: from a long time listener... http://www.infoworld.com/article/04/12/30/01OPstrategic_1.html Kudos for Roger Binns! -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread Peter Hansen
John Roth wrote: I have yet to write a multi-thread program for performance reasons. If we include in the set of things covered by the term "performance" not only throughput, but also latency, then I suspect you actually have written some multithreaded programs for "performance" reasons. *I* certai

Re: OT: google groups bug, or worse?

2005-01-08 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm concerned that google groups is not correctly reflecting the python lists. A month ago I announced the xsdbXML framework to the python list and the python-announce list. As you can see from the links below the python announce submission was approved by the moderators

  1   2   >