Re: BASIC vs Python

2004-12-21 Thread Mike Meyer
Doug Holton <[EMAIL PROTECTED]> writes: > This is comp.lang.python, not comp.lang.logo. Please refrain from > discussing topics not related to CPython. Doug, please quit trolling this newsgroup. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consult

Re: BASIC vs Python

2004-12-21 Thread Mike Meyer
Leif K-Brooks <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> They do have a first-class function-like object called an agent. But >> to use a standard method as an agent, you have to wrap it. > > Just curious, but how does a method get wrapped in an agent if m

Re: expression form of one-to-many dict?

2004-12-21 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] (Bengt Richter) writes: >> >> > On Sun, 19 Dec 2004 21:29:27 +0100, "Fredrik Lundh" > <[EMAIL PROTECTED]> wrote: >> > (or maybe a

Re: Tabnanny really useful?

2004-12-21 Thread Mike Meyer
"Yet Another Mike" <[EMAIL PROTECTED]> writes: > I'm told Tabnanny was inspired by lint, the Unix utiltity to check C sources > (and probably others). Lint was primarily useful in days long ago when CPUs > were slow and a compile used a significant amount o

Re: How about "pure virtual methods"?

2004-12-21 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: > The answer is that a subclass is guaranteed to have the same > *interface* as the base class. And that's what matters. This is false. For instance: class A(object): def method(self, a): print a class B(A): def method(self, a, b): print a, b B

Re: A rational proposal

2004-12-22 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > Actually, I was misremembering how Decimal worked - it follows the rule you > suggest: > > float() + Decimal() fails with a TypeError > float() + float(Decimal()) works fine > > And I believe Decimal's __float__ operation is a 'best effort' kind of > thi

Re: Reading and Writing

2004-12-24 Thread Mike Meyer
Sir Galahad the chaste <[EMAIL PROTECTED]> writes: > Hi, > > [EMAIL PROTECTED] wrote: >> How should I: Open a Text file, read from it, modify it, print to >> another .txt? >> For instance: Read a string, sort it, write the sorted string. > > What do you mean by "sorting"? If you want to sort the l

Re: list Integer indexing dies??

2004-12-24 Thread Mike Meyer
Ishwor <[EMAIL PROTECTED]> writes: > On 23 Dec 2004 14:28:37 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > My experience as a learner here is that there should be some > automagics & say like "okay you want to do indexing on integers ( > context dependent); i'll give you the index of 0th positio

Re: How about "pure virtual methods"?

2004-12-24 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: >> Noam Raphael <[EMAIL PROTECTED]> writes: > Of course, even in statically typed languages, you can't enforce > an implementation to do what it should (too bad - it would have made > debugging so much easier...) That's what DbC languages are for. You writ

Re: Optional Static Typing

2004-12-24 Thread Mike Meyer
"John Roth" <[EMAIL PROTECTED]> writes: > <[EMAIL PROTECTED]> wrote in message > This may sound a bit > cynical, but most real uber-programmers have either > Lisp or Smalltalk in their backgrounds, and > frequently both one. Neither of those languages > have static typing, and they simply don't ne

Re: Execute code after death of all child processes

2004-12-24 Thread Mike Meyer
[EMAIL PROTECTED] (Markus Franz) writes: > Hallo! > > > I have a problem with this little script written in Python: > > > import sys, os, time > texts = ['this is text1', 'this is text 2'] > for current_text in env_sources[0:]: > pid = os.fork() > if pid == 0: > time.slee

Re: Lambda going out of fashion

2004-12-24 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > jfj wrote: > Python 3.0 will be a case of "OK, let's take the things we learned > were good and keep them, and throw away the things we realised were > bad" > > Undoubtedly, the two languages will co-exist for quite some time. Perl 6.0 is going to includ

Re: list Integer indexing dies??

2004-12-24 Thread Mike Meyer
Ishwor <[EMAIL PROTECTED]> writes: > On Fri, 24 Dec 2004 05:44:50 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >> Ishwor <[EMAIL PROTECTED]> writes: >> >> > On 23 Dec 2004 14:28:37 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> > My

Re: Optional Static Typing - Haskell?

2004-12-25 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mind you, I personally _like_ the concept of describing > an interface separately, even in a different language (Corba's IDL, say) > that's specialized for the task. But it doesn't seem to be all that > popular... without such separation, modularity plu

Re: Features for a Python package manager?

2004-12-25 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > I don't know enough about Portage to answer that question. I do know > any package manager which made it into the standard distribution would > need to work for at least the big three platforms (Windows/Mac/*nix) :) Being written in python - and hopefull

Re: How about "pure virtual methods"?

2004-12-25 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> That's what DbC languages are for. You write the contracts first, >> then >> the code to fullfill them. And get exceptions when the implementation >> doesn't do what the contract claims it

Re: How about "pure virtual methods"?

2004-12-25 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: > The current Python doesn't really support this concept. You can write > in the __new__ of such a class something like "if cls == > MyAbstractClass: raise TypeError", but I consider this as a patch - > for example, if you have a subclass of this class whic

Re: Complementary language?

2004-12-25 Thread Mike Meyer
HackingYodel <[EMAIL PROTECTED]> writes: > Hello all! I'm learning to program at home. I can't imagine a better > language than Python for this. The ideal situation, for me, would be > to study two languages at the same time. Probably sounds crazy, but > it works out better for me. Being a ne

A Revised Rational Proposal

2004-12-25 Thread Mike Meyer
aced in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted Non-Admin Installation

2004-12-25 Thread Mike Meyer
"Kartic" <[EMAIL PROTECTED]> writes: > Hello, > > I downloaded the Win32 installer for Twisted 1.3.0, Python 2.3. > > The installer, when executed under my login, fails as it requires > administrator rights to install (why they have it as a requirement, I > don't understand). > > So I started the

Re: Twisted Non-Admin Installation

2004-12-25 Thread Mike Meyer
"Kartic" <[EMAIL PROTECTED]> writes: > Thanks. Does this mean I have to upgrade python 2.3.3 to python 2.4 in > order to get this working? Whoops. Yeah, the instruction are for using MSVC 7.1, which is what 2.4 is build with. 2.3.x is built with MSVC 6.x. That's no longer even commercially availa

Re: Configuration Files

2004-12-25 Thread Mike Meyer
Aaron <[EMAIL PROTECTED]> writes: > Hi, > > I'm interested in creating a large number of configuration files which I > have no experience doing in python. The fields will be static for the most > part. But design changes and I might want to add new fields in the future.. > > My question is - whats

Re: Complementary language?

2004-12-26 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Objective-C is cool... on the Mac; I'm not sure how well-supported it is > elsewhere, though. In addition to C's advantages, it would let you make > Cocoa GUIs on the Mac easily (with PyObjC &c). But then, the right way > to study Obj-C from scratch is

Re: Optional Static Typing - Haskell?

2004-12-26 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] (Alex Martelli) writes: >> > Mind you, I personally _like_ the concept of describing >> > an interface separately, even in a different language (Corba's IDL

Re: A Revised Rational Proposal

2004-12-26 Thread Mike Meyer
"Dan Bishop" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> This version includes the input from various and sundry people. > Thanks >> to everyone who contributed. >> >>> >> PEP: XXX >> Title: A rational number module for Py

Re: A Revised Rational Proposal

2004-12-26 Thread Mike Meyer
"John Roth" <[EMAIL PROTECTED]> writes: > I'd suggest making them public rather than either protected or > private. There's a precident with the complex module, where > the real and imaginary parts are exposed as .real and .imag. This isn't addressed in the PEP, and is an oversight on my part. I'

Re: A Revised Rational Proposal

2004-12-26 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Regarding str() and repr() behaviour, Ka-Ping Yee proposes that repr() have >> the same behaviour as str() and Tim Peters proposes that str() behave like >> the >> to-scientific-string operation fro

Re: Improving Python (was: Lambda going out of fashion)

2004-12-26 Thread Mike Meyer
[EMAIL PROTECTED] (Aahz) writes: > While I'm in complete agreement about the "".join() construct on the > basis of looks, I have come to appreciate the fact that I *never* mess up > the order of arguments any more. Yeah. When I needed joinable arrays of strings in Eiffel, I added them to the ARRA

Re: program in interactive mode

2004-12-26 Thread Mike Meyer
"B.G.R." <[EMAIL PROTECTED]> writes: > Hi all, > > I'm working on an interpreter for a university subject, which is programmed > in python under linux. > I got most of the work done and I'm just trying to settle some problems I've > found on my way. > Right now, the most important is reading the u

Re: Detecting if a program is currently running.

2004-12-26 Thread Mike Meyer
Brian <[EMAIL PROTECTED]> writes: > On a Slackware 9.1 box, I'm trying to detect if mpg123 is currently > running/playing a song so that when the song is done, it'll play the next > in the list. The problem is that popen'ing ps doesn't always give a > correct return. My function is below and

Re: A Revised Rational Proposal

2004-12-27 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Yup. Thank you. This now reads: >> Regarding str() and repr() behaviour, repr() will be either >> ''rational(num)'' if the denominator is one, or ''rational(num, >> den

Re: A Revised Rational Proposal

2004-12-27 Thread Mike Meyer
Skip Montanaro <[EMAIL PROTECTED]> writes: > Mike> ... or making them old-style classes, which is discouraged. > > Since when is use of old-style classes discouraged? I was under the imperssion that old-style classes were going away, and hence discouraged for new library mo

Re: program in interactive mode

2004-12-27 Thread Mike Meyer
"John Machin" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> >> I've discovered a truly elegant trick with python programs that >> interpret other data. > Q0. Other than what? Other than Python code. >> You make them ignore lines that

Re: Optional Static Typing - Haskell?

2004-12-27 Thread Mike Meyer
"Donn Cave" <[EMAIL PROTECTED]> writes: > Quoth Mike Meyer <[EMAIL PROTECTED]>: > | [EMAIL PROTECTED] (Alex Martelli) writes: > ... > |> But then, the above criticism applies: if interface and implementation > |> of a module are tightly coupled, you can

Re: A Revised Rational Proposal

2004-12-28 Thread Mike Meyer
"John Roth" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Nick Coghlan <[EMAIL PROTECTED]> writes: >> >>> Mike Meyer wrote: >>>> Yup. Thank you. Thi

Re: pyUnitPerf

2004-12-28 Thread Mike Thompson
-tool As far as I can see, the defining feature of py.test is the simplicity of the API. Its impressively absent. -- Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Other notes

2004-12-29 Thread Mike Meyer
[EMAIL PROTECTED] writes: > @infix > def interval(x, y): return range(x, y+1) # 2 parameters needed > > This may allow: > assert 5 interval 9 == interval(5,9) I don't like the idea of turning words into operators. I'd much rather see something like: @infix('..') def interval(x, y): return ra

Re: Other notes

2004-12-29 Thread Mike Meyer
Jp Calderone <[EMAIL PROTECTED]> writes: > On Wed, 29 Dec 2004 11:42:00 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >>[EMAIL PROTECTED] writes: >> >> > @infix >> > def interval(x, y): return range(x, y+1) # 2 parameters needed >> > >>

Re: Other notes

2004-12-29 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> [EMAIL PROTECTED] writes: >> >>>@infix >>>def interval(x, y): return range(x, y+1) # 2 parameters needed >>> >>>This may allow: >>>assert 5 interval 9 == interv

Re: Problem in threading

2004-12-29 Thread Mike Meyer
Duncan Booth <[EMAIL PROTECTED]> writes: > That leaves the former case: if your task has to stop and wait for > something else to happen (e.g. data to be read from a network, or to > be read from a disc file), then splitting it into multiple threads > may allow the waits to be overlapped with usef

standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-29 Thread mike kreiner
se discussed this? does anyone know the BDFL's stance? thanks. ~mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Other notes

2004-12-30 Thread Mike Meyer
Jp Calderone <[EMAIL PROTECTED]> writes: > On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >>Jp Calderone <[EMAIL PROTECTED]> writes: >> > This aside, not even Python 3.0 will be flexible enough to let you define >> > an

Re: Other notes

2004-12-30 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Steve Holden <[EMAIL PROTECTED]> writes: >> > [...] >>> >>>Well, perhaps you can explain how a change that's made at run time >>>(calling the decorator) can affect

Re: Other notes

2004-12-30 Thread Mike Meyer
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Steve Holden <[EMAIL PROTECTED]> writes: >>> Well, perhaps you can explain how a change that's made at run

Re: Features for a Python package manager?

2004-12-30 Thread Mike Meyer
Bulba! <[EMAIL PROTECTED]> writes: > On Sat, 25 Dec 2004 11:37:42 +0100, Georg Brandl <[EMAIL PROTECTED]> > wrote: > >>what features would you expect of a Python package manager, similar to >>CPAN or rubygems? > > IMVHO it would be nice if it had a feature for "upload package/module > I have just

Re: Problem in threading

2004-12-30 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Python's threading models is pretty primitive. You get the C >> model (which is error-prone), the Java model (in 2.4, and also >> error-prone), or Queues. > Can you please expand on your words ab

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread mike kreiner
Thanks for all of your comments. I didn't intend for this to turn into a "which IDE should I use?" posting, but everyone's comments gave me food for thought all the same, and convinced me to try Eclipse and WingIDE. Please forgive me for this lengthy explanation of my view. Much of my original que

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread mike kreiner
he main keys to 3000's success is the default IDE. in other words, why aren't more resources put into IDLE, instead of some of the more specifc language tweaks? ~mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter (OOP?) help

2004-12-30 Thread Mike Meyer
"3c273" <[EMAIL PROTECTED]> writes: > Hello, > I am trying to expand on a tutorial I am working through and I am not > understanding something. In the following example if you click on the "New > window" button, a new window appears with a "Close me" button in it and if > you click on it's "Close

Re: Variable Variable

2005-03-20 Thread Mike Gould
Premshree Pillai wrote: On Sat, 19 Mar 2005 04:35:47 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: Tanteauguri wrote: Hi List, is there in python a variable variable like in PHP ($$var)? What I want to do is something like that: pc=["a","b","c"] for i in pc: i = anyclass() a.shutdown() b.updat

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Mike Rovner
Reinhold Birkenfeld wrote: I don't quite understand that. Which dict item are you extending? Don't you need something like dl[key].append("word") Rigth. It was just a typo on my part. Thanks for fixing. Mike -- http://mail.python.org/mailman/listinfo/python-list

Shell re-direction

2005-03-20 Thread Mike Gould
: import os print '1' os.system('echo 2') print '3' $ python test.py 1 2 3 $ python test.py | cat 2 1 3 Can anyone explain what's going on here? Thanks Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: comparison puzzle? bug?

2005-03-22 Thread Mike Rovner
Charles Hixson wrote: I hesitate to call this a bug, as at my level of expertise that seems ... unlikely. But I can't think of any other explanation: Call it 'typo' ;) print"item[0] > lvl = %d > %d = " %(item[0], lvl), bool(item[0] == lvl) use bool(i

multi-threaded list update

2005-03-22 Thread Mike Rovner
__name__=='__main__': main() I rely on GIL and believe that .append is atomic operation. It that legal? What are the drawbacks? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Read from the last line of a file?

2005-03-22 Thread Mike Rovner
file and read chunks, then extract lines from them and process them. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/120686 for implementation details. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-threaded list update

2005-03-22 Thread Mike Rovner
hanks, Peter. I googled groups on 'python dis.dis atomic' and it was all on target and quite interesting. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: tree data structure

2005-03-25 Thread Mike Rovner
vivek khurana wrote: i am a new member on this list. I have to implement tree data structure using python. How it can be done in python. Is there an existing data structure which can be used as tree? I have searched archives and manuals but no luck. You can start with Guido's essay http://python

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Mike Meyer
James Stroud <[EMAIL PROTECTED]> writes: > On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote: > Why do we need : at the end of our if and for loops? I spend approximately 6 > minutes/100 lines of code going back and finding all of the times I missed :. > Is it for cheating? Because new

Re: character-filtering and Word (& company)

2005-03-26 Thread Mike Meyer
Charles Hartman <[EMAIL PROTECTED]> writes: > I'm working on text-handling programs that want plain-text files as > input. It's fine to tell users to feed the programs with plain-text > only, but not all users know what this means, even after you explain > it, or they forget. So it would be nice t

Re: String Splitter Brain Teaser

2005-03-27 Thread Mike Rovner
Jp Calderone wrote: On Sun, 27 Mar 2005 14:39:06 -0800, James Stroud <[EMAIL PROTECTED]> wrote: "ATT/GATA/G" gets split to [['A'], ['T'], ['T', 'G'], ['A'], ['T'], ['A', 'G']] I have written a very ugly function to do this (listed below for the curious), but intuitively I think this should only ta

Re: truncating a file from the top down

2005-03-29 Thread Mike Rovner
rbt wrote: if os.stat says the file is too big: read the file trim = only keep the last 2008 bytes (This is where I get stuck) write trim back out to the original file Would someone demonstrate the *best* most efficient way of doing this? if os.stat says the_file is too big: fh = open

Re: truncating a file from the top down

2005-03-29 Thread Mike Rovner
Right. Thanks for the correction. Fredrik Lundh wrote: Mike Rovner wrote: if os.stat says the_file is too big: fh = open(the_file, 'rb') fh.seek(2008, 2) should be fh.seek(-2008, 2) right? data = fh.read() fh.close() assert len(data)==2008 # you may want some error processin

Installing Python on a Windows 2000 Server

2005-04-01 Thread Mike Moum
d poked about on python.org, but haven't really been able to find anything. Normally I'd be happy to just try it out and see what happens, but we're breaking new ground here (this is an amazingly big step for our hide-bound IS department!), so I'd like everything to go as sm

Re: redundant imports

2005-04-02 Thread Mike Meyer
"max(01)*" <[EMAIL PROTECTED]> writes: > Peter Hansen wrote: >> max(01)* wrote: >> >>> hi everybody. >>> >>> suppose that code-1.py imports code-2.py and code-3.py (because it >>> uses names from both), and that code-2.py imports code-3.py. >>> >>> if python were c, code-1.c should only *include*

Re: string goes away

2005-04-02 Thread Mike Meyer
Andreas Beyer <[EMAIL PROTECTED]> writes: > OK, you won. I read in an (regretably old) guidline for improving > Python's performance that you should prefer map() compared to list > comprehensions. Apparently the performance of list comprehensions has > improved a lot, which is great. (Or the overh

Re: os.path query functions behavior incorrect?

2005-04-05 Thread Mike Rovner
Beman Dawes wrote: So are these os.path functions specified and implemented incorrectly? Should they instead throw exceptions for the above examples? Works for me. (Win XP SP2, Py 2.4, only have c and d drives) >>> os.path.exists('d:\\') True >>> os.path.exists('e:\\') False >>> os.path.exists('a:

Re: Does IronPython indicate MS interest in dynamic languages?

2005-04-05 Thread Mike Rovner
Thomas Gagne wrote: Assuming (I don't know for certain) that MS's PR approves all messages that leave the building, I'm wondering if this foray into dynamic languages doesn't signal something greater on MS' part. While Sun and Java (and C# for the most part) have remained statically-typed, do y

Re: Best editor?

2005-04-05 Thread Mike L.G.
y seem awkward at first, but the payoff was amazing for me. This is comparable to my first experiences with python. Now, one of my greatest joys is writing python code using emacs. -- Mike L.G. http://www.mahalosoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Mike Rovner
[EMAIL PROTECTED] wrote: ... SHOULD toggle On and Off four times with one-second pauses. When I run this, the loop pauses the full eight seconds then prints the Ons and Offs all at once. What's up with that? Run your script as: python -u script.py for unbuffered output. -- http://mail.python.org/ma

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Mike Rovner
[EMAIL PROTECTED] wrote: Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This is actually test code for a larger project... # flash the selected wx.TextControl for flasher in range(4): self.textField.SetBackgroundColour(255, 0, 0) self.textField.Update() time.slee

Re: checkbook manager -> cross platform printing

2005-04-09 Thread Mike Meyer
"David Isaac" <[EMAIL PROTECTED]> writes: > "Alan Isaac" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I'd like to try personal financial management using Python. >> I just found PyCheckbook, but it does not support check printing. >> Is there a Python check printing application

Re: Best editor?

2005-04-09 Thread Mike Meyer
[EMAIL PROTECTED] (Aahz) writes: > Use vim. 80% of the power of emacs at 20% of the learning curve. Hmm. Can I read mail/news/web pages in vim? I can in emacs. Emacs is a computing environment. I read mail and news in it, so I don't have to worry about learning some applications custom editor (

Re: email and smtplib modules

2005-04-09 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi, > > I'm writing a small script that generates email and I've noticed that: > > 1) one should add the 'To' and 'CC' headers to the email message > 2) one needs to specify the recipients in the smtplib sendmail() method > > Can someone explain ho

Re: visibility between modules

2005-04-09 Thread Mike Meyer
"max(01)*" <[EMAIL PROTECTED]> writes: > hi. > > if i have a single program file, different class instances can share > information in (at least) two fashions: > > 1. using instance variables: > > class AClass: >def __init__(self): > self.att_1 = 42 > self.att_2 = "Hello!" > > class

Re: Best editor?

2005-04-11 Thread Mike Meyer
[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >>[EMAIL PROTECTED] (Aahz) writes: >>> >>> Use vim. 80% of the power of emacs at 20% of the learning curve. >> >>Hmm. Can I read mail/news/

Re: Checking for the status of a device (before connection)... -- (John McCormick)

2005-04-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hello, ... I am John McCormick (Systems Programmer ) and I am currently > working on a python program which will connect (user) specified inputs > and connect them to (user) selected outputs (like screen or > video/audio-recording devices) and would like to know if ther

Re: exporting imports to reduce exe size?

2005-04-13 Thread Mike Meyer
Ron_Adam <[EMAIL PROTECTED]> writes: > In looking at ways to reduce the size of exe's created with py2exe, > I've noticed that it will include a whole library or module even if I > only need one function or value from it. > > What I would like to do is to import individual functions and then > e

Re: permission

2005-04-13 Thread Mike Meyer
Skip Montanaro <[EMAIL PROTECTED]> writes: > James> Is it possible to check if you have permission to access and or > James> change a directory or file? > > Yes, but it's generally much easier to try, then recover from any errors: Especially since the answer to the question may change bet

Re: Using a python web client behind a proxy (urllib and twisted.web)

2005-04-13 Thread Mike Meyer
Matthijs <[EMAIL PROTECTED]> writes: > I have been trying to make a script that will download several rss > feeds to my computer. The only problem I have is that I have to go > through a proxy. > > First I tried using urllib (python 2.4, win32) but I found that the > http_proxy and no_proxy code w

Re: A little request about spam

2005-04-16 Thread Mike Meyer
Ivan Van Laningham <[EMAIL PROTECTED]> writes: > Of course I wouldn't base decisions _only_ on whether or not [PYTHON] > appears in the subject. But I ordinarily do base decisions on the whole > subject line, and I think that's perfectly reasonable. There's nothing > else to go on without opening

Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven wh

2005-04-18 Thread Mike brown
In article <[EMAIL PROTECTED]>, "thesonoftruth" <[EMAIL PROTECTED]> wrote: > I wonder if anyone yells VISHNU !! VISHNU ! when making > out, I might have. It's been so long that I've forgotten. MJRB -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-20 Thread Mike Meyer
Ron_Adam <[EMAIL PROTECTED]> writes: > Here's yet another way to do it, but it has some limitations as well. > > import pickle > def pickle_it(filename, obj, commands): > try: > f = open(filename, 'r') > obj = pickle.load(f) > f.close() > except IOError: >

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-04-20, Torsten Bronger schreef <[EMAIL PROTECTED]>: >> Hallöchen! >> >> [EMAIL PROTECTED] (Nick Efford) writes: >> >>> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Many people I know ask why Python does slicing the way it does. >>>

Re: Embedding & Extending Python &other scripting languages

2005-04-20 Thread Mike Meyer
Tommy Nordgren <[EMAIL PROTECTED]> writes: > I'm interested in doing a rather ambitious project concerning compiler > construction tools. > My tools will parse specification files containing for example lalr > parser specifications. > The specifications will contain embedded semantic actions whic

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > Greg Ewing <[EMAIL PROTECTED]> wrote: >> Also, everyone, please keep in mind that you always have >> the option of using a *dictionary*, in which case your >> indices can start wherever you want. >> >> You can't slice them, true, but you can't have everythi

Re: python LEX

2005-04-21 Thread Mike Meyer
Miki Tebeka <[EMAIL PROTECTED]> writes: > Hello jozo, > >> I have to work on python lexical definition in Lex. I spent lots of my >> time to find regular expresions written for Lex of Python language but >> nothing. >> Can somebody help me? > http://www.antlr.org/grammar/list (search for Python) >

Re: goto statement

2005-04-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Roy Smith <[EMAIL PROTECTED]> wrote: >> Grant Edwards <[EMAIL PROTECTED]> wrote: >>>Sure, but what about the case where his program is on paper >>>tape and all he has for an editor is an ice pick? >> >> Can't you emulate that in emacs wit

Re: regarding system function

2005-04-21 Thread Mike Meyer
praba kar <[EMAIL PROTECTED]> writes: > Dear All, > > In Php If I send a command to system function > then It will return 1 on success and 0 on failure. So > based upon that value I can to further work. > > But In Python If I send a command to system > function then It will return 0 onl

Re: trying to read from dying disk

2005-04-22 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have a python file that is trying to read raw data from a raw > partition on a dying dist, eg > > f = file('/dev/sda') > f.seek(SOMEWHERE) > s = f.read(SOMEBYTES) > > On some blocks, the read succeeds, on others it fails and an IOError is > thrown, and on others

Re: PDF Printing support from Python

2005-04-23 Thread Mike Meyer
"dcrespo" <[EMAIL PROTECTED]> writes: > Hi Grant Edwards... > > Your solution requires a previous installation of Acrobat. Internally, > the OS is sending the pdf file to the Acrobat PDF Driver and then it is > sent to the printer. So you have to have Acrobat installed. Don't you? No, you don't.

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
"Simon John" <[EMAIL PROTECTED]> writes: > I still love Perl, it's a bit of an art form, as "there's more than one > way to do it", whereas Python usually only allows one way to do it, > which may or may not be a better mantra The Python mantra leads to 1) less programmer overhead, and 2) fas

Re: PDF Printing support from Python

2005-04-23 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Fri, 22 Apr 2005 17:41:22 -0500, Mike Meyer <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> No, you don't. My print system does that, and I don't have acrobat >> installed. I

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> "Simon John" <[EMAIL PROTECTED]> writes: >> >>> I still love Perl, it's a bit of an art form, as "there's more than >>> one way to do it", whereas Pyt

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: >> >>> Mike Meyer wrote: >>> >>>> "Simon John" <[EMAIL PROTECTED]> writes: >>>> >>>>&g

Re: Variables

2005-04-23 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > Robert Kern wrote: >> Richard Blackwood wrote: >>> To All: >>> >>>Folks, I need your help. I have a friend who claims that if I write: >>> >>> foo = 5 >>> >>> then foo is NOT a variable, necessarily. If you guys can define for >>> me what a varia

Re: Variables

2005-04-24 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>First, new disciplines often redefine words to mean something >>different than the disciplines they were derived from. Variable is a >>good example of that. In math, a variable is a placeholder in an

Re: Variables

2005-04-24 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > In any event, he would likely (passionately) > disagree considering his notion that programming is an off-shoot of > math and thus at the fundamental level has identical concepts and > rules. My formal training is as a mathematician, but my professio

Re: Variables

2005-04-24 Thread Mike Meyer
Robert Kern <[EMAIL PROTECTED]> writes: >> Could I honestly argue this to him? From what basis do I argue that >> it is not an equation? > > It's his responsibility to show that it *is* an equation. > > x = x + 1 > > Equation? I think not. I think it is. One equation in one unknown. The solution s

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Depends on the problem. If it's one of the things for which Python has >> an obvious solution (sort a list; split a string on whitespace; pull >> select list elements based on a criteria of some kind; s

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Mike Meyer
Miguel Manso <[EMAIL PROTECTED]> writes: > I've tryed to use python some times but I get frustrated very quick. I > get myself many times needing to figure out how to loop through a > list, declare an associative array, checking how to pass named > parameters to functions, and simple things like t

<    8   9   10   11   12   13   14   15   16   17   >