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 =

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Mike Meyer
umber = turnnumber - 1 > > if row == 2 and column == 2: > if gameboard[4] != ('O' or 'X'): > gameboard[4] = ('X') > else: > print "This cell is already filled." > turnnumber = turnnumber - 1 > > if row == 3 and column == 2: > if gameboard[7] != ('O' or 'X'): > gameboard[7] = ('X') > > else: > print "This cell is already filled." > turnnumber = turnnumber - 1 > > if row == 1 and column == 3: > if gameboard[2] != ('O' or 'X'): > gameboard[2] = ('X') > > else: > print "This cell is already filled." > turnnumber = turnnumber - 1 > > if row == 2 and column == 3: > if gameboard[5] != ('O' or 'X'): > gameboard[5] = ('X') > else: > print "This cell is already filled." > turnnumber = turnnumber - 1 > > if row == 3 and column == 3: > if gameboard[8] != ('O' or 'X'): > gameboard[8] = ('X') > > else: > print "This cell is already filled." > turnnumber = turnnumber - 1 > > turnnumber = turnnumber + 1 > > if (((gameboard[0] and gameboard[1] and gameboard[2]) == > 'X') or ((gameboard[3] and gameboard[4] and gameboard[5]) == 'X') or > ((gameboard[6] and gameboard[7] and gameboard[8]) == 'X')\ > or ((gameboard[0] and gameboard[3] and gameboard[6]) == > 'X') or ((gameboard[1] and gameboard[4] and gameboard[7]) == 'X') or > ((gameboard[2] and gameboard[5] and gameboard[8]) == 'X')\ > or ((gameboard[0] and gameboard[4] and gameboard[8]) == > 'X') or ((gameboard[2] and gameboard[4] and gameboard[6]) == 'X')): > print "Player 2 wins!" > win = 1 > -- 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: Python's website does a great disservice to the language

2005-11-01 Thread Mike Meyer
"CppNewB" <[EMAIL PROTECTED]> writes: > My thoughts weren't to add a flash demo or develop some 500K logo or fixing > the font size. But the logos look like they were done in Paint and maybe a > readable default font is in order. So what's wrong with the fonts they use - where they didn't let yo

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Thank you. It seems I didn't understand logic statements as much as I > thought I did! > > The one remaining question I have deals with this: > > if gameboard[cell] not in 'OX': > gameboard[cell] = 'O' > else: > print "This cell is already filled."

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Nevermind my previous reply: I've been fixing up the code and > understand it. I'm at a nifty 80 lines where I am at now rather than > 209 lines in the previous version! The changes are immense! > > The only problem I have is whenever player two goes, it says the cell

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

2005-11-02 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Xah Leh is incompetent, but >> apparently well-intentioned. > In your view is that ("well-intentioned") an established fact at this > point? I was still waiting for conclusive evidence. No, i

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > The code's indentation was fine - I forgot to declare cell in player > two's section and not just in player one. > > The code (including the win check, for once!) is working. The last > obstacle is my tie checker; it doesn't seem to like what I have: > > if ((gameboard

Re: dictionary that have functions with arguments

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi > i have a dictionary defined as > > execfunc = { 'key1' : func1 } > > to call func1, i simply have to write execfunc[key1] . > but if i have several arguments to func1 , like > > execfunc = { 'key1' : func1(**args) } > > how can i execute func1 with variable args? >

Re: how to check for unix password

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > i created a login page that authenticate the user and his/her password > to the unix ssystem. what modules can i used to compare the unix > password with what the user typed in the cgi form? the password is > encrypted (shadowed) so i need to > decrypt it first before co

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Mike Meyer
"Tor Erik Sønvisen" <[EMAIL PROTECTED]> writes: > I need a time and space efficient way of storing up to 6 million bits. Time > efficency is more important then space efficency as I'm going to do searches > through the bit-set. Six megabytes is pretty much nothing on a modern computer. I'd store

Re: Getting a function name from string

2005-11-02 Thread Mike Meyer
"Paul McGuire" <[EMAIL PROTECTED]> writes: > "David Rasmussen" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> If I have a string that contains the name of a function, can I call it? >> As in: >> >> def someFunction(): >> print "Hello" >> >> s = "someFunction" >> s() # I know this

Re: How to print random strings

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Im at the end of chapter 3 of "Python Programming For The Absolute > Beginner, Michael Dawson " and he asks to make a fortune program that > displays a fortune each time its ran, and to have 5 unique fortunes. > > Whats confusing is that, he never discussed how to do th

Re: reading internet data to generate random numbers.

2005-11-02 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-11-02, Neil Schemenauer <[EMAIL PROTECTED]> wrote: >> Grant Edwards <[EMAIL PROTECTED]> wrote: >> Using data from the Internet is just a bad idea. > I think that the timing of certain network events is one of the > Linux kernel's entropy sources.

Re: another beginner sort of question

2005-11-02 Thread Mike Meyer
John Salerno <[EMAIL PROTECTED]> writes: [Wants to learn C# and Python simultaneously.] > So my question is, is this feasible? Should be. It might be faster to do them sequentually. > Or does learning Python require (or entail) learning all the details > behind it? Not really. There are some tra

Re: Pychecker Re: Nested List Question

2005-11-02 Thread Mike Meyer
Roman Suzi <[EMAIL PROTECTED]> writes: > On Thu, 3 Nov 2005, Chris McCoy wrote: >>> gridSystemId = [[None]*columns]*rows >> You've made gridSystemID a list of `rows` references to the SAME "inner" >> list, so the behavior you observe is the only possible one. >> If you want copies instead, ASK for

Re: Getting a function name from string

2005-11-03 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: >>For a lot of uses, it'd be better to build the dictionary by hand >>rather than relying on one of the tools that turns a namespace into a >>dictionary. > IMO it would be nice if name lookup were as cleanly > controllable and defined as attribute/method lo

Re: Class Variable Access and Assignment

2005-11-03 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >> What would you expect to get if you wrote b.a = b.a + 2? > I would expect a result consistent with the fact that both times > b.a would refer to the same object. Except they *don't*. This happens in any language that resolves references at run time. Cha

Re: Can Anyone Help me on this

2005-11-03 Thread Mike Meyer
for you: list2 = list(list1) or list2 = list1[:] >>> list2.reverse() >>>> list1 > ['1', '2', '3', '4', '5', '6', '7', '8', '9'] >>>> list2 > ['9', '

Re: Class Variable Access and Assignment

2005-11-03 Thread Mike Meyer
"Graham" <[EMAIL PROTECTED]> writes: > I just seems to me that . shouldn't defer to the class > variable if > an instance variable of the same name does not exists, it should, at > least how i > understand it raise an exception. > > Is my thinking way off here? Yes. This behavior is how you get in

Re: Class Variable Access and Assignment

2005-11-03 Thread Mike Meyer
"Graham" <[EMAIL PROTECTED]> writes: > Many thanks your explaination cleared up many of the questions I had. > I know think i can understand the purpose, regardless of my opinion, i > do however think that one should be able to assign the value in the > same way it is accessed. That's not true in

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-11-03, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>>> What would you expect to get if you wrote b.a = b.a + 2? >>> I would expect a result consistent with

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
> Would it be too much to ask that in a line like. > > x = x + 1. > > both x's would resolve to the same namespace? Yes. That's to much bondage for programmers who've become accustomed to freedom. Explain why this should be illegal: >>> class C: ... def __getattr__(self, name): ... x = 1

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> I've already argued that the kludges suggested to "solve" this problem >> create worse problems than this. > The most obvious solution is to permit (or even r

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-11-04, Mike Meyer schreef <[EMAIL PROTECTED]>: >> >>> Would it be too much to ask that in a line like. >>> >>> x = x + 1. >>> >>> both x's would resolve to the same nam

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-11-04, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Op 2005-11-03, Mike Meyer schreef <[EMAIL PROTECTED]>: >>>> Antoon Pardon <[EMAIL PROTECTED]&

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > equal? Some things are a matter of objective fact: should CPython use a > byte-code compiler and virtual machine, or a 1970s style interpreter that > interprets the source code directly? For the record, I've only seen one interpreter that actually inte

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On Thu, 03 Nov 2005 13:37:08 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > [...] >>> I think it even less sane, if the same occurce of b.a refers to two >>> different objects, like in b.a += 2 >> >>That's

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On 04 Nov 2005 17:53:34 -0800, Paul Rubin wrote: >>[EMAIL PROTECTED] (Bengt Richter) writes: >>> Hm, "the" fix? Why wouldn't e.g. treating augassign as shorthand for >>> a source transformation (i.e., asstgt = expr becomes by si

Re: Class Variable Access and Assignment

2005-11-04 Thread Mike Meyer
Paul Rubin writes: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> It also allows you to do something like this: >> class ExpertGame(Game): >> current_level = 100 > >> and then use ExpertGame anywhere you would have used Game with no problems. > Well, let's say you s

Re: re sub help

2005-11-04 Thread Mike Meyer
tartdelim] and [enddelim] to ''. I only want to get rid of the > '\n' everywhere else. Well, I'm not an expert on re's - I've only been using them for three decades - but I'm not sure this can be done with a single re, as the pattern you'r

Re: re sub help

2005-11-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi > > i have a string : > a = > "this\nis\na\nsentence[startdelim]this\nis\nanother[enddelim]this\nis\n" > > inside the string, there are "\n". I don't want to substitute the '\n' > in between > the [startdelim] and [enddelim] to ''. I only want to get rid of the > '\n

Re: re sub help

2005-11-05 Thread Mike Meyer
[EMAIL PROTECTED] writes: > i am still interested about using re, i find it useful. am still > learning it's uses. > so i did something like this for a start, trying to get everything in > between [startdelim] and [enddelim] > > a = > "this\nis\na\nsentence[startdelim]this\nis\nanother[enddelim]thi

Re: Using Which Version of Linux

2005-11-05 Thread Mike Meyer
blahman ([EMAIL PROTECTED]) writes: > ok, i m going to use Linux for my Python Programs, mainly because i > need to see what will these fork() and exec() do. So, can anyone tell > me which flavour of linux i should use, some say that Debian is more > programmer friendly, or shold i use fedora, o

Re: Using Which Version of Linux

2005-11-05 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-11-05, Mike Meyer <[EMAIL PROTECTED]> wrote: >> "Programmer-friendly" is pretty vague. Gentoo is the only Linux distro >> I've run into (which excludes a *lot* of Unix distros) that I'd >> c

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Mike Meyer
"Andrea Gavana" <[EMAIL PROTECTED]> writes: > I tend to agree with you, Rick. I usually don't like Xah's "posting > behavior", but this time he has done, in my opinion, a "constructive" > criticism (and he didn't even say *fuck* once in the whole post!!!). I am > quite a newbie in Python, I usuall

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> The thing is, the library documentation that Xah Lee is complaining >> about is a *reference document*. It says so right in the title: >> "Python Library Refere

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Mike Meyer
Paul Rubin writes: >> To my knowledge the PSF isn't doing anything about including the >> documentation with their distribution, so they shouldn't care about >> the licenses. Wanting to bundle a good tutorial for everything in >> the library might be on the list, but the

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > It's only -because- of those licenses that there's any reason not to >> > bundle. >> Actually, there are other reasons, just as there are reasons besides

Re: Using Which Version of Linux

2005-11-06 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > Similarly, I see RPMs by ones and twos all over the place, > and only a few places with DEBs. But the DEB repositories > are HUGE. Try rpmfind.net. It's not clear where the rpms reside, but it's not really important - it's a huge collection of RPMs.

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Mike Meyer
"vinjvinj" <[EMAIL PROTECTED]> writes: > 1. restrict the user from doing any file io, exec, import, eval, etc. I > was thinking of writing a plugin for pylint to do all the checks? Is > this is a good way given that there is no restricted python. What are > the things I should serach for in python

Re: Web automation

2005-11-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > but I supposed the everyone knew that web automation (and in general > "automation") is only a problem in Linux. I don't know it. I don't believe it, either. I automate web tasks on Unix systems (I don't use many Linux systems, but it's the same tool set) on a regular b

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Mike Meyer
"vinjvinj" <[EMAIL PROTECTED]> writes: > While I understand 2 is very hard (if not impossible) to do in single > unix process. I'm not sure why 1 would be hard to do. Since I have > complete control to what code I can allow or not allow on my grid. Can > i not just search for certain strings and d

Re: Application monitor

2005-11-07 Thread Mike Meyer
"dcrespo" <[EMAIL PROTECTED]> writes: > Main application starts > This one starts the App Monitor of itself. (This means that if Main > Application closes, the App Monitor restart it) > > And viceversa means that if App Monitor closes, the Main application > restart it. > > How can I accomplish thi

Re: Map of email origins to Python list

2005-11-07 Thread Mike Meyer
Claire McLister <[EMAIL PROTECTED]> writes: > Thanks, Alan. You are absolutely right, we are not using the > NNTP-Posting-Host header for obtaining the IP address. Yes, but what are you using? > The Python list is unique among the lists that we have handled so far, > in that it has a cross-postin

Re: [OT] Map of email origins to Python list

2005-11-07 Thread Mike Meyer
Claire McLister <[EMAIL PROTECTED]> writes: > An interesting perspective. Not to increase your sense of 'creepy', > but a lot of big corporations now have access to this kind of > information and more. You mean my creditors are going to be looking for me in San Francisco, even though I'm in Virgin

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-07 Thread Mike Meyer
"python" <[EMAIL PROTECTED]> writes: > i am a long time windows user and have had a great way to learn new api. There's a better way. See below. > to write some code and then run it. > if there is an error, the debugger will load. > then i can figure out what the eror is, just touch up the ocde a

Re: Web automation

2005-11-07 Thread Mike Meyer
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> > but I supposed the everyone knew that web automation (and in general >> > "automation") is only a problem in Linux. >> I don't know

Re: problem generating rows in table

2005-11-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi > i wish to generate a table using cgi > toprint = [('nickname', 'justme', 'someplace')] > print ''' > > User > Name > Address > > > ''' > > for i in range(0,len(toprint)-1

Re: which feature of python do you like most?

2005-11-08 Thread Mike Meyer
"James" <[EMAIL PROTECTED]> writes: > Most of the responses are of the "Why Python is more pleasant than C++" > variety, but the original poster specifically said he had experience > with Perl. As such, arguments like "automatic memory management" don't > carry any weight. > >>From my experience

Re: Web automation

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > answering to Mike Meyer who replied to the following > assertion on my part: > >> but I supposed the everyone knew that web automation > >> (and in general "automation") is only a problem in Linux. > with...: >> I don't

Re: Web automation

2005-11-08 Thread Mike Meyer
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> "Paul Boddie" <[EMAIL PROTECTED]> writes: >> > The problem on non-Windows systems is the lack of a common (or >> > enforced) technology for exposing application object mod

Re: Python doc problem example: gzip module (reprise)

2005-11-08 Thread Mike Meyer
"Xah Lee" <[EMAIL PROTECTED]> writes: > Newsgroups: comp.lang.perl.misc > PS: I won't cross-post as I'm not subscribed to the Python group. Very wisely done. Then from Xah Lee, we get; > I have cross posted it for you. Proving once again that he's stupider than spam. Please help google find him

Re: Application monitor

2005-11-08 Thread Mike Meyer
"dcrespo" <[EMAIL PROTECTED]> writes: >> Personally, I use init as an app monitor. It doesn't need monitoring > What's "init"? Sorry about my ignorance. init is the first Unix process, and all other processes are descended from it. It is the alpha and the omega of Unix processes. Uh, wait a second

Re: user account logon from python

2005-11-08 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Jeff, > > 1- I cannot find getpwent in the documentation getpwent is a Unix library call. For python, you want the pwd module. The docs are http://docs.python.org/lib/module-pwd.html >. > 2- crypt will not work if the system does not have shadow

Re: Invoking Python from Python

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, > Thomas Guettler <[EMAIL PROTECTED]> wrote: >>creating source code with a script, is no good solution. >>Once I had to maintain lisp code which stored its data in lisp code, too >>(incl. conditions and loops). It was a n

Re: user account logon from python

2005-11-08 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Hi Mike, > Mike Meyer wrote: >>> 1- I cannot find getpwent in the documentation >> getpwent is a Unix library call. For python, you want the pwd >> module. The docs are http://docs.python.org/lib/module

Re: Goto XY

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Is there some command in python so that I can read a key's input and > then use a gotoxy() function to move the cursor on screen? e.g.: > (psuedo-code) > > When the right arrow is pushed, cursor gotoxy(x+1,y) You want curses. A version is included in the standard libr

Re: append to non-existing list

2005-11-09 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Fredrik Lundh wrote: >> x = "10" + 20 # should this be 30 or 1020 or "1020" or ...? >> > I think Perl handles this case pretty well and sane. > > In fact, this strict but dynamic type checking is quite painful to work > with, especially the new

Re: Invoking Python from Python

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > I'll rein myself in and suggest an even easier introduction > to this subject: configuration files. RARELY is the correct > answer to create a new syntax, although many development > organizations give the impression that's their first choice. > ".ini"-

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-09 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: >> On Tue, 08 Nov 2005 13:38:28 -0500, python wrote: > [...] >>>as i mentioned even micro$soft can do this using statically type languages >>>like visual basic and csharp. >>> also, both visualbasic and csharp have goto statements,

Re: Web automation

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hi Mike, > thank you very much for your reply. > I know that mine could be considered >> a "very" silly way to define automation. > but I'm not a purist nor a professional > programmer. Yes, but you still need to communicate with other people. Using words to mean someth

Re: append to non-existing list

2005-11-09 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Float doesn't handle implicit conversion to anything but but builtin types. >> In particular, it doesn't check to see if the object beinng added has a >> __float__ metho

Re: Python obfuscation

2005-11-09 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > How effective can it be when python is designed to make writing this > kind of code hard(hopefully impossible) ? The most effective would be > renaming function and may be variables but if the functions are kept > short, they would at most looks lik

Re: how to identify a particular directory / file on remote machine

2005-11-09 Thread Mike Meyer
"Swarna" <[EMAIL PROTECTED]> writes: > Hi all, > > I am trying to find out whether a particular directory is present on a > remote machine or not from my local Python script in Linux . Can anyone > help me with the command that i need to issue to os.system in my python > script to acheive this? L

ANN: P(x) 0.2 applet builder

2005-11-09 Thread Mike Meyer
P(x) is hard to describe. It might be called a "Framework", but that's a grandiose word for a couple of hundred lines of code. It might be called a programmable calculator, but it has none of the things one associates with calculators. It might be called a programming language, but it's just Python

Re: ANN: P(x) 0.2 applet builder

2005-11-10 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > LB wrote: >>>The tarball can be found at >>http://www.mired.org/downloads/P(x)-0.2.tar.gz >. >> Something doesn't work with the link. >> LB >> > Copy the whole string up to and including the ".gz" at the end and > paste that into your browser's location wi

Re: Addressing the last element of a list

2005-11-10 Thread Mike Meyer
[Context recovered from top posting.] "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Daniel Crespo wrote: >> Well, I hope that newcomers to Python don't confuse himselves :) > This mutable/immutable object and name/variable is confusing. Only if you have to overcome a conviction that variables

Re: append to non-existing list

2005-11-10 Thread Mike Meyer
Yves Glodt <[EMAIL PROTECTED]> writes: > Which raises another question... :-) > > Is there a possibility to bring together apache and python in a way > that I can embed python into html? Lots of ways. Most of them aren't really Python, but look a lot like it. PSP is most like PHP/ASP/etc., and I

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-10 Thread Mike Meyer
Magnus Lycka <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> In that case, you're using the wrong IDE. I run the Python interpeter >> inside of Emacs. I edit my code in another buffer. In the source code >> buffer, I hit M-C-x, and the current version of the f

Re: Python obfuscation

2005-11-10 Thread Mike Meyer
"petantik" <[EMAIL PROTECTED]> writes: > Perhaps a comprehensive protection for interpreted languages can never > be built because of their high level nature? Nah. Compiling/interpreting is an implementation detail, and orthogonal to the issue of "high level". There are compilers for high level la

Re: Python obfuscation

2005-11-10 Thread Mike Meyer
"Ben Sizer" <[EMAIL PROTECTED]> writes: > For example, I'd like to write a game in Python. I'd like to give the > game away free and charge for extra content. In C++ I can make it > difficult for users to share content with others who haven't paid for > it, with cryptographic hashes and the like. N

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