Re: Microsoft Hatred FAQ

2005-10-15 Thread Mike Meyer
"Jeroen Wenting" writes: >>>Q: Microsoft's Operating System is used over 90% of PCs. If that's >>>not monopoly, i don't know what is. >> They got where they are by CHEATING. That is why they are evil, not >> because they have a large market share. > no, they got their by clever marketing and

Re: UI toolkits for Python

2005-10-16 Thread Mike Meyer
Malte Clasen <[EMAIL PROTECTED]> writes: > Claudio Grondi wrote: >> What is that complex, that it can't be solved using an Internet Browser as a >> GUI? > > Nothing, but session management isn't trivial with http > interfaces. You have to deal with the back button of the browsers, > bookmarks to p

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
"Peter T. Breuer" <[EMAIL PROTECTED]> writes: > In comp.os.linux.misc Jeroen Wenting > wrote: >> Without Microsoft 90% of us would never have seen a computer more powerful >> than a ZX-81 and 90% of the rest of us would never have used only dumb >> mainframe terminals. > Uh - when microsoft pro

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > I don't really know why and I don't particularly care. I think it has a > lot to do with support costs and may also have to do with the type of deals > Microsoft offers. It has nothing to do with support costs. It has everything to do with the t

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
Greymaus <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> You clearly weren't paying attention to what the rest >> of the microcomputer industry was doing while Gates was selling IBM >> non-existent software. While IBM was introducing 16-bit processors and >

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
"Jeroen Wenting" writes: >>> IBM's prediction that there would be 5 computers (not counting game >>> computers like the Comodores and Spectrums) by 2000 would likely have >>> come >>> true. >> I see. You're a troll. > nope, I'm just sick and tired of trolls like you calling everyone who > doesn'

Re: Jargons of Info Tech industry

2005-10-16 Thread Mike Meyer
Roedy Green <[EMAIL PROTECTED]> writes: > On Sat, 15 Oct 2005 23:24:21 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote or > quoted : >>How about pdf? > My complaint with it is it is Adobe proprietary. This make the tools > very expensive. No, it isn't. The standard is publicly available, so anyone c

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Which standards? Again: w3c is not an official standards organization. > Moreover, Netscape added LiveScript, oh wait, I mean JavaScript, and the > *cough* blink element. >> By contracting with sites to include non-standard IE features to >> deliberately br

Re: Microsoft Hatred FAQ

2005-10-16 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > As for it being illegal, it was illegal only because if was Microsoft > doing it. Actually, *any* company with a defacto monopoly pulling such a stunt would be found in violation of the law. Such companies operate under different legal rules than

Re: Microsoft Hatred FAQ

2005-10-17 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Mon, 17 Oct 2005 00:17:03 -0400, Mike Meyer wrote: >> Yup. When NS was the 800 lb gorilla > When was this? When did Netscape have a monopoly in any market? Starting with the release of Netscape 1.0, until MS decided to tak

Re: Microsoft Hatred FAQ

2005-10-17 Thread Mike Meyer
"Mike Schilling" <[EMAIL PROTECTED]> writes: > What matters in generating HTML is which browsers you want to support and > what they understand. Standards and recommendations are both irrelevant. Unless, of course, you want to support any compliant browser. In which case standards and recommend

Re: Microsoft Hatred FAQ

2005-10-17 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > It is not Microsoft's obligation to be "fair". It is Microsoft's > obligation to push their vision of the future of computing, one with > Microsoft's products at the center, using anything short of force or fraud. Wrong. The only obligation Micr

Re: Microsoft Hatred FAQ

2005-10-17 Thread Mike Meyer
"Mike Schilling" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Mike Schilling" <[EMAIL PROTECTED]> writes: >>> What matters in generating HTML is which brow

Re: UI toolkits for Python

2005-10-18 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Maybe that's the key difference between the mindset of a > mathematician and that of an engineer -- I consider reaching over > 95% of visitors to be _quite good indeed_, Oh? So you'd consider an SMTP/IMAP/POP/DNS/NFS/etc server that rejected 5% of the sy

Re: Microsoft Hatred FAQ

2005-10-18 Thread Mike Meyer
"Mike Schilling" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Mike Schilling" <[EMAIL PROTECTED]> writes: >>> "Mike Meyer" <[EMAIL PROTECTED]>

Re: Jargons of Info Tech industry

2005-10-18 Thread Mike Meyer
Tim Tyler <[EMAIL PROTECTED]> writes: > In comp.lang.java.programmer Ross Bamford <[EMAIL PROTECTED]> wrote or quoted: > About all email has going for it these days is an open format and a > large existing user base. Yeah, and all that Windows has going for it is being on 9X% of the desktops. Noth

Re: UI toolkits for Python

2005-10-18 Thread Mike Meyer
Mark Roseman <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] (Alex Martelli) writes: >> > Maybe that's the key difference between the mindset of a >> > mathematician and that of an engineer -- I consider reaching

Re: UI toolkits for Python

2005-10-18 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> What surprises me is that marketing types will accept turning away - >> what's the current internet user base? 200 million? - 10 million >> potential customers without a complai

Re: Microsoft Hatred FAQ

2005-10-18 Thread Mike Meyer
"Mike Schilling" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Mike Schilling" <[EMAIL PROTECTED]> writes: >>> "Mike Meyer" <[EMAIL PROTECTED]>

Re: Microsoft Hatred FAQ

2005-10-18 Thread Mike Meyer
"Mike Schilling" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> One alternative, as I've said, is to write to the standards, and then >> work around bugs in the popular browse

Re: Microsoft Hatred FAQ

2005-10-18 Thread Mike Meyer
On Tue, 18 Oct 2005 11:53:29 -0700, David Schwartz wrote: >>> Wrong. The only obligation Microsoft has is to their shareholders. >> If you genuinely believe that, you are a psychopath. If you genuinely believe that, you are delusional. http://www.mired.org/home/mwm/ Independe

Re: UI toolkits for Python

2005-10-19 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] (Alex Martelli) writes: >> > Mike Meyer <[EMAIL PROTECTED]> wrote: >> >> What surprises me is that marketing types will accept turning away - >&g

Re: Sequence and/or pattern matching

2005-10-19 Thread Mike Meyer
"Séb" <[EMAIL PROTECTED]> writes: >> Essentially, if I understand correctly, you want to detect LOOPS given a >> sequence of directed connections A->B. "loop detection" and "graph" >> would then be the keywords to search for, in this case. > > Exactly, but the sequence has to be discovered by the

Re: Having trouble deleting objects from a list...

2005-10-19 Thread Mike Meyer
Jason Stitt <[EMAIL PROTECTED]> writes: > On Oct 19, 2005, at 8:16 PM, KraftDiner wrote: > 'for obj in self.objList' will keep right on iterating through the > list even if you don't increment i. And if you modify self.objList while you're iterating over it, the results are undefined. > A direct

Re: destroy your self????

2005-10-19 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > Well I guess what I'm trying to achive is the invalidate the instance > of the object. > I have been using None to denote an invalide or uninitialized instance > of an object. > > There is a degenerate case in my code where a polygon has less than 3 > poi

Re: Some more odd behaviour from the Regexp library

2005-10-19 Thread Mike Meyer
"David Veerasingam" <[EMAIL PROTECTED]> writes: > Can anyone explain why it won't give me my captured group? > > In [1]: a = 'exit: gkdfjgfjdfsgdjglkghdfgkd' > In [2]: import re > In [3]: b = re.search(r'exit: (.*?)', a) > In [4]: b.group(0) > Out[4]: 'exit: ' > > In [5]: b.group(1) > Out[5]: '' >

Re: How to extract a part of html file

2005-10-20 Thread Mike Meyer
Ben Finney <[EMAIL PROTECTED]> writes: > Joe <[EMAIL PROTECTED]> wrote: >> I'm trying to extract part of html code from a tag to a tag > For tag soup, use BeautifulSoup: > http://www.crummy.com/software/BeautifulSoup/> Except he's trying to extract an apparently random part of the file. Beaut

Re: Sequence and/or pattern matching

2005-10-20 Thread Mike Meyer
"Séb" <[EMAIL PROTECTED]> writes: > Hi everybody, > > Thanks for the time taken to answer my question. Unfortunatly, it seems > that there's a little confusion about what I want to do. > > In fact, I don't want to search for a particular path between > computers. What I really want is to detect se

Re: Set an environment variable

2005-10-20 Thread Mike Meyer
"Eric Brunel" <[EMAIL PROTECTED]> writes: > -myScript.py-- > print 'export MY_VARIABLE=value' > -- > > -myScript.sh-- > python myScript.py > /tmp/chgvars.sh > . /tmp/chgvars.sh I

Re: best way to replace first word in string?

2005-10-20 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I am looking for the best and efficient way to replace the first word > in a str, like this: > "aa to become" -> "/aa/ to become" > I know I can use spilt and than join them > but I can also use regular expressions > and I sure there is a lot ways,

Re: Searching for txt file and importing to ms access

2005-10-20 Thread Mike Meyer
"Mark Line" <[EMAIL PROTECTED]> writes: > I'm managed to get some code to download a message from the email account > and save it to a text file, does any one have a link to some sample code to > search though a file until a string of characters is matched? Or could > point me to some functions

Re: Python vs Ruby

2005-10-20 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I am not sure your intention but I think there isn't a one language > fits all situation here. Very true. > C/C++ - for linux kernel hacking etc., many library out there still use > it > python - generic stuff > SQL - nothing beats it for many bus

Re: fun with lambdas

2005-10-20 Thread Mike Meyer
Robert Kern <[EMAIL PROTECTED]> writes: > Juan Pablo Romero wrote: >> Hello! >> >> given the definition >> >> def f(a,b): return a+b >> >> With this code: >> >> fs = [ lambda x: f(x,o) for o in [0,1,2]] >> >> or this >> >> fs = [] >> for o in [0,1,2]: >> fs.append( lambda x: f(x,o) ) >>

Re: Set an environment variable

2005-10-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-10-21, Christian <[EMAIL PROTECTED]> wrote: >>> >>> The closest thing you can do is that: >>> >>> -myScript.py-- >>> print 'export MY_VARIABLE=value' >>> -- >>>

Re: Binding a variable?

2005-10-21 Thread Mike Meyer
Paul Dale <[EMAIL PROTECTED]> writes: > Hi everyone, > > Is it possible to bind a list member or variable to a variable such that > > temp = 5 > > list = [ temp ] > > temp == 6 > > list > > would show > > list = [ 6 ] No. You need to either put a mutable in the list, or subclass list so that inde

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
rm) >> >> except: >> logging.exception("\nEXCEPTION 1") >> try: >> >> form['tosrv'].value = "TEST" >> except: >> logging.exception("\nEXCEPTION 2") >> pass >> >> >>

Re: Set an environment variable

2005-10-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > My point: the OP wanted to know how to export an environment > variable to a child process. Either of the lines of code above > will do that, so what's with all the shellular shenanigans? Actually, the OP didn't say he wanted to export a variable to a c

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Mike, > > Here is what I am trying to do: > > WHAT > -) a client opens his/her browser and click on some button which triggers my > plugin > -) the plugin starts to communicate with a server on some URL. > -) the communication between th

Re: A question about searching with multiple strings

2005-10-21 Thread Mike Meyer
"googleboy" <[EMAIL PROTECTED]> writes: > for item in all_items: > > strItem = str(item) > > m = re.search(p[i], strItem, flags = re.I) > if m: > height = getattr(item, "height") > length = getattr(item, "length") > function = getattr(item

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: >> You've got lots of stuff going on here. I count at least five programs >> and three network connections. How much is working, and which parts >> are you trying to do in Python? > > I am starting from existing applications (cross-platform - and in

Re: Python cgi

2005-10-21 Thread Mike Meyer
"jbrewer" <[EMAIL PROTECTED]> writes: > Also, I need to run an external program with my CGI script using > something like os.system with flags from input forms, which is a major > security risk. Is it simply enough to test for flag.isalnum() or > should I do more to prevent random programs from be

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > I feel fairly stupid ... but to my defense in the past 17 years of coding, > i've only spent 3 days looking at web stuff: > > I now can understand how "writing" to an existing form field from a cgi > script might not work: how would the browser kn

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> I don't know much about plugins. I believe they get started when the >> page loads, which gives you a chance to do the authentication when you >> want it done. > Well not in thi

Re: best way to replace first word in string?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > py> def tester(n): > ... s1 = "" > ... s2 = "%s" * n > ... bytes = tuple([chr(i % 256) for i in range(n)]) > ... t1 = time.time() > ... for i in range(n): > ... s1 = s1 + chr(i % 256) > ... t1 = time.time() - t1 > ...

Re: Question about inheritance...

2005-10-22 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > I have a base class called Shape > And then classes like Circle, Square, Triangle etc, that inherit from > Shape: > > My quesiton is can a method of the Shape class call a method in Circle, > or Square etc...? Yup: >>> class Shape(object): ... def comm

Re: High Order Messages in Python

2005-10-22 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I'm reading about "high order messages" in Ruby by Nat Pryce, and > thinking if it could be util and if so, if it could be done in Python. > Someone already tried? Yes, I'm pretty sure it could be done in Python. All it really needs is the abilit

Re: Microsoft Hatred FAQ

2005-10-22 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Fri, 21 Oct 2005 21:47:27 -0700, David Schwartz wrote: That's basic economics. Something which can be allowed or ignored or even encouraged when done

Re: Python vs Ruby

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 21 Oct 2005 13:03:29 +0100, Alex Stapleton wrote: >> Perl is more like a CISC CPU. There are a million different commands. >> Python is more RISC like. >> Line count comparisons = pointless. > > Not so. > > Every line = more labour for the devel

Re: Binding a variable?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 21 Oct 2005 13:33:18 -0400, Mike Meyer wrote: > >> Paul Dale <[EMAIL PROTECTED]> writes: >> >>> Hi everyone, >>> >>> Is it possible to bind a list member or variable to a variabl

Re: Microsoft Hatred FAQ

2005-10-22 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>>> Neither I, nor you, nor the government of any nation, should care a >>>> monkey's toss specifically f

Re: Python vs Ruby

2005-10-22 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> > Every line = more labour for the developer = more cost and time. >> > Every line = more places for bugs to exist = more cost and time. >> There were studies done in the

Re: best way to replace first word in string?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 22 Oct 2005 14:54:24 -0400, Mike Meyer wrote: >>> The string formatting is two orders of magnitude faster than the >>> concatenation. The speed difference becomes even more obvious when you >>> increase

Re: Microsoft Hatred FAQ

2005-10-23 Thread Mike Meyer
entropy <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote... >> [EMAIL PROTECTED] wrote... >> > In comp.lang.perl.misc David Schwartz <[EMAIL PROTECTED]> wrote: >> > > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message >> >

Re: Microsoft Hatred FAQ

2005-10-23 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: >> Instead, you outline a class of actions and tag them >> all as illegal. That's why we have laws against assault and battery >> and unsafe driving. And laws against exercising monopoly power in an >> unfair manner. > Interesting how you, again, equ

Re: how to count and extract images

2005-10-23 Thread Mike Meyer
Joe <[EMAIL PROTECTED]> writes: > start = s.find(' stop = s.find('">Save File', > start) fileName = s[start:stop] > and then construct the url with the filename to download the image > which works fine as cause every image has the Save File link and I can > count number of images easy the problem

Re: Syntax across languages

2005-10-23 Thread Mike Meyer
Tom Anderson <[EMAIL PROTECTED]> writes: > On Sun, 23 Oct 2005, Fredrik Lundh wrote: >> [EMAIL PROTECTED] wrote: >>> - ~== for approximate FP equality >> str(a) == str(b) > This is taken from the AI 754 standard, i take it? :) > > Seriously, that's horrible. Fredrik, you are a bad man, and

Re: output from external commands

2005-10-23 Thread Mike Meyer
James Colannino <[EMAIL PROTECTED]> writes: > Hey everyone. First off, I'm new to the list. I had had a little bit > of experience with Perl before discovering Python. The more Python I > learn, the more I love it :) I just have a quick question to ask. I > know that this is probably a simple

Re: Syntax across languages

2005-10-23 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Sun, 23 Oct 2005 20:59:46 -0400, Mike Meyer <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> Hopefully user defined. Rexx has a global control that lets you set >> the number of digits to b

Re: output from external commands

2005-10-24 Thread Mike Meyer
darren kirby <[EMAIL PROTECTED]> writes: > If all you want is filenames this will work: import glob files = ["%s" % f for f in glob.glob("*")] What's the point of doing "%s" % f? How is this different from just file = [f for f in glob.glob("*")]? http://www.mired.

Re: Importing at runtime

2005-10-24 Thread Mike Meyer
"David Poundall" <[EMAIL PROTECTED]> writes: > I have several .py files in a directory that I would like to import at > run time. Each file contains a state machine that requires to be run > in its own thread. Imports happen at run time. Beware starting threads in the code run at import time in e

Re: Read/Write from/to a process

2005-10-25 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > Followed by the Amiga... The Amiga IPC used "message ports" (linked > lists owned by the creating process to which, if "public" [named], other > processes could send message packets). The Amiga port of REXX made use > of message ports as its nat

Re: security

2005-10-25 Thread Mike Meyer
"Mattia Adami" <[EMAIL PROTECTED]> writes: > Hi to all. > I'm intristing in write a plugin for browsers that can execute python > code. > I know the main problem is security. Many thread were opened about this > in the ng. > I would know if fork python rewriting some library could avoid > problems

Re: [OT] Re: output from external commands

2005-10-25 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > I think Mr. Lundh's point was only that the output from glob.glob is already > guaranteed to be strings, so using either '%s'%f or str(f) is superfluous. Just for the record - this was why I asked what the point was in the first place.

Re: Newbie question: string replace

2005-10-25 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > So how to overwrite the config file directly in script.py instead of > running script.py with two params? Don't overwrite the file directly. Save a copy, then rename it. That way, you don't replace the new version until you know the old version is

Re: Microsoft Hatred FAQ

2005-10-25 Thread Mike Meyer
Not Bill Gates <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote... >> On Tue, 25 Oct 2005 15:35:47 +, Not Bill Gates wrote: >> > Heck, I dunno. Like you, I don't even really care all that much. >> You don't care that innovation in desktop software has been crippled by >> the actions of

Re: Top-quoting defined [was: namespace dictionaries ok?]

2005-10-25 Thread Mike Meyer
> On Tuesday 25 October 2005 00:31, Duncan Booth wrote: >> P.S. James, *please* could you avoid top-quoting > James Stroud <[EMAIL PROTECTED]> writes: > I'm sorry if I can't find a dumb terminal for a "VAX" with which to read my > email. Perhaps, if i could, I would understand your frustration a l

Re: Microsoft Hatred FAQ

2005-10-25 Thread Mike Meyer
Not Bill Gates <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote... >> Not Bill Gates <[EMAIL PROTECTED]> writes: >> > [EMAIL PROTECTED] wrote... >> >> On Tue, 25 Oct 2005 15:35:47 +, Not Bill Gates wrote: >> >> > Heck, I dunno. Like you, I don't even really care all that much. >> >> Yo

Re: a Haskell a Day

2005-10-26 Thread Mike Meyer
Erik Max Francis <[EMAIL PROTECTED]> writes: > Xah Lee wrote: >> This is my learning notes on Haskell. I call it a-Haskell-a-day. Interesting. Xah Lee's orginals don't show up in the Python newsgroup. No big loss. In any case, please help google find Xah Lee under the proper search terms. Add a l

Re: Double replace or single re.sub?

2005-10-26 Thread Mike Meyer
"Iain King" <[EMAIL PROTECTED]> writes: > I have some code that converts html into xhtml. For example, convert > all tags into . Right now I need to do to string.replace calls > for every tag: > > html = html.replace('','') > html = html.replace('','') > > I can change this to a single call to

Re: Set an environment variable

2005-10-26 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > On Wed, 26 Oct 2005 07:42:19 -0700, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Grant Edwards <[EMAIL PROTECTED]> wrote: >>> On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote: >>> >> The only think you can export an environment variable to is a >>> >> c

Re: how do i run another script from my python script

2005-10-27 Thread Mike Meyer
Daniel Schüle <[EMAIL PROTECTED]> writes: > Steve already answeared to your question, regaring PHP script > if this would be python script, you could run it by import'ing it That's not very pythonic. Better is to provide a function in the script to run it (say run), then run that in the script iff

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-27 Thread Mike Meyer
"dcrespo" <[EMAIL PROTECTED]> writes: > Hi all, > > How can I replace all None values with the string 'Null' in a > dictionary? Iterate over everything in the dictionary: for key, item in mydict.items(): if item is None: mydict[key] = 'Null' http://www.mired.

Re: Microsoft Hatred FAQ

2005-10-27 Thread Mike Meyer
Paul Rubin writes: >> Sorry to be pedantic, but I think it's an important point that no court >> ever found that Microsoft illegally acquired a monopoly. So to characterize >> the monopoly itself as "illegal" is simply erroneous. > > Who is paying you to tell these

Re: Microsoft Hatred FAQ

2005-10-27 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I've noticed something strange that makes me wonder the same >> thing. Everytime someone compares MS's behavior

Re: specify arbitrary library directory directly in code?

2005-10-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > ### Initial Findings > After searching around a bit, it appears that python does not have a > built-in mechanism for specifying arbitrary directories as the first > place to look for module code. There are options that allow one to > specify alternate directories, but a

Re: Microsoft Hatred FAQ

2005-10-27 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>> "Ironically, while no one else has so much as compared MS to criminals >>> with >>> guns&q

Re: Scanning a file

2005-10-28 Thread Mike Meyer
Andrew McCarthy <[EMAIL PROTECTED]> writes: > On 2005-10-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I'm now down to: >> >> f = open("filename", "rb") >> s = f.read() >> sub = "\x00\x00\x01\x00" >> count = s.count(sub) >> print count >> >> Which is quite fast. The only problems is that the

Re: Typing tutor help script needed, please

2005-10-28 Thread Mike Meyer
"Throw" <[EMAIL PROTECTED]> writes: > G'day everyone! > > I would like to design typing tutor exercises for Afrikaans (and other > languages possibly). This is for a GPL project. For this, I need a > script that can extract words from a long list of words, based on which > letters those words co

Re: Opaque documentation

2005-10-28 Thread Mike Meyer
"Ben Sizer" <[EMAIL PROTECTED]> writes: > Documentation is often a problem with Python and its libraries, sadly. > The same almost certainly goes for most open source projects. You over-specified the last clause. It should say "most software projects." http://www.mired.

Re: Newbie question: string replace

2005-10-28 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Now it works: > rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)') > for line in fileinput.input(FILE, inplace=1): > m = rex.match(line) > if m is not None: > line = "%s%s%s\n" % (m.group(1), new_name, m.group(3)) > pr

Re: Microsoft Hatred FAQ

2005-10-28 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> The quote about the mafia doesn't compare MS's actions to "actual use >> of force". > I&#

Re: Automatic binding of **kwargs to variables

2005-10-28 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I have a very long list of parameters coming from a web form to my > method foo(self, **kwargs) > > I would like to avoid manually binding the variables to the values > coming through the **kwargs dictionary, just to keep the code cleaner, > I'd lik

Re: Microsoft Hatred FAQ

2005-10-28 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "David Schwartz" <[EMAIL PROTECTED]> writes: >>> "Mike Meyer" <[EMAIL PROTECTED]>

Re: Scanning a file

2005-10-28 Thread Mike Meyer
"Paul Watson" <[EMAIL PROTECTED]> writes: > Here is a better one that counts, and not just detects, the substring. This > is -much- faster than using mmap; especially for a large file that may cause > paging to start. Using mmap can be -very- slow. > > #!/usr/bin/env python > import sys > > fn

Re: Expanding Python as a macro language

2005-10-29 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: >... >> But the problem is that in Linux you can't even send a keystroke to >> a running GUI application! > Actually, if the app is running under X11 you may try to fake out a > keystroke event (with low level calls, but ctypes might let you use it > f

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > [snip] >>for name, value in kwargs.items(): >>if name in ('a', 'list', 'of', 'valid', 'keywords'): >> exec &quo

Re: Scanning a file

2005-10-29 Thread Mike Meyer
"Paul Watson" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Paul Watson" <[EMAIL PROTECTED]> writes: > ... >> Did you do timings on it vs. mmap? Having to copy th

Re: Recursive generators and backtracking search

2005-10-29 Thread Mike Meyer
"Talin" <[EMAIL PROTECTED]> writes: > As an alternative, I'd like to present the following implementation. If > you compare this one with the one in lib/test/test_generator.py you > will agree (I hope) that by using recursive generators to implement > backtracking, the resulting code is a little mo

Re: Expanding Python as a macro language

2005-10-29 Thread Mike Meyer
is very good at dealing with the web, doesn't help too much > in this case... > In any case a macro language like AutoIt is a general purpose > application. > > At last I must thank Mike Meyer for his suggestion to use python-xlib > to avoid low level programming... Just

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Peter Hansen wrote: >> Do you mean this instead? >> >> elif name in expected_form1_kwargs and name not in kwargs: >> >> What you wrote doesn't do what you think it does... it actually tests >> for whether True or False is a key in kwargs, dep

Re: Controlling output using print with format string

2005-10-30 Thread Mike Meyer
Paul Watson <[EMAIL PROTECTED]> writes: > It is clear that just using 'print' with variable names is relatively > uncontrollable. However, I thought that using a format string would > reign the problem in and give the desired output. > > Must I resort to sys.stdout.write() to control output? No.

Re: need start point for getting html info from web

2005-10-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > i have a small app that i am going to need to get information from a > few tables on different websites. i have looked at urllib and httplib. > the sites i need to get data from mostly have this data in tables. So > that, i think would make it easier. Anyone suggest a go

Re: Arguments for button command via Tkinter?

2005-10-31 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Recently, I have been needing to do this alot and I can never find a > way around it, the main reason I want to do this is because for example > in the application I am making right now, it creates a grid of buttons > in a loop and they all have the

Re: Expanding Python as a macro language

2005-10-31 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > On 29 Oct 2005 17:25:58 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ... >> Michel wrote: > ... >> > Linux can run perfectly happily without any form of windowing >> > environment. >> >> I know, but nowadays almost any relevant application has a

Re: Microsoft Hatred FAQ

2005-10-31 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>> Microsoft's behavior consisted of arguments, that is, did not >>> involve force, the threat of force, frau

Re: Microsoft Hatred FAQ

2005-10-31 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Of course, you've dropped the real point, which is your own inabillity >> to distinguish between, as you put it, &quo

Re: Microsoft Hatred FAQ

2005-10-31 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: >> I'm trying to find out why you regularly ignore that difference for >> everyone but MS. > To substantiate that claim, you'd have to point to some cases where I > talk about something other than MS. You do that *every time* someone compares MS wi

Re: Microsoft Hatred FAQ

2005-10-31 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "David Schwartz" <[EMAIL PROTECTED]> writes: >>>> I'm trying to find out why you regularly

Re: Xah's edu corner: the Journey of Foreign Characters thru Internet

2005-11-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Interesting opinions this man has, I must say. A Sith of Computing he > may be? No. Sith are competent but evil. Xah Leh is incompetent, but apparently well-intentioned. Some of his opinions are correct, but that appears to be more by accident than anything else, and t

Re: extracting numbers from a file, excluding words

2005-11-01 Thread Mike Meyer
Kristina Kudriaðova <[EMAIL PROTECTED]> writes: > 1 Nov 2005 09:19:45 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: >> Hi, I have a file with this content: >> >> z zzz z >> ... >> xxx xx x 34.215 >> zzz zz >> ... >> > > Hi, > > I'd suggest doing this: > > f =

<    1   2   3   4   5   6   7   8   9   10   >