Re: Is there *any* real documentation to PyWin32?
[EMAIL PROTECTED] schreef: <...snip...> > Personally I consider Python-win32 to be docware -- software that is > sufficiently difficult to use with the included free documentation > that many people will just buy the $$$ documentation. Numpy is > another prominent example of docware. A misappropriation of the good- > will value of legitimate open source software. > <...snip...> As others have pointed out Python-Win32 provides access to an extremely wide range of services and programs. The main purpose is to do this in a Pythonic was: simplifying matters, where the original interfaces are very awkward and complicated. Unfortunately many of these services and programs that can be accessed in this way are themselves very poorly documented, or require indeed expensive books. Blaming Python-Win32 is hitting the wrong group of people entirely! You cannot expect them to document huge monsters such as Windows XP or Vista, or the other monsters that can be automated through COM, such as Powerpoint, Word and Excel. I am myself automating some trivial MS-office stuff, but I am flabbergasted by the fragmentary nature of on-line documentation in MS-office. The real problem is that these kinds of programs are not described at a reasonable conceptual level, making it difficult to automate trivial tasks. In your term MS-office is docware, certainly not Python-Win32. My experiences with Python-Win32 itself are very good. Gerrit -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I know the name of "caller"
On Jun 19, 10:50 pm, Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> wrote: > billiejoex schrieb: > > ...(if it is possible) how can I get, from method "called", the name > > of function/method that called it (in this case "caller")? > inspect.stack is your friend ;-) If you start doing such things on a regular basis, it will sooner or later become your enemy. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Replacement for HTMLGen?
> > That said, can someone recommend a good replacement for > HTMLGen? <...snip...> > Granted, I know HTML doesn't change (much) but it's at least > nice to know something you're going to be using is maintained. <...snip...> Joshua, I am happily using HTMLgen. I do think that maintenance has not been required, since HTML didn't change. It is pure Python, so it doesn't require any recompilation for Python updates. If you need HTMLgen send me an e-mail and I will send you a zipfile. kind regards, Gerrit Muller -- Gaudi systems architecting: http://www.gaudisite.nl/ > > That said, can someone recommend a good replacement for HTMLGen? I've found > good words about it (http://www.linuxjournal.com/article/2986), but every > reference to it I find points to a non-existant page > (http://starship.python.net/lib.html is 404, > http://www.python2.net/lib.html is not responding, > http://starship.python.net/crew/friedrich/HTMLgen/html/main.html is 404) > Found http://www.python.org/ftp/python/contrib-09-Dec-1999/Network/, but > that seems a bit old. > > I found http://dustman.net/andy/python/HyperText, but it's not listed in > Cheeseshop, and its latest release is over seven years ago. Granted, I > know HTML doesn't change (much) but it's at least nice to know something > you're going to be using is maintained. > > Any suggestions or pointers? > > j > -- http://mail.python.org/mailman/listinfo/python-list
Re: Mocking OpenOffice in python?
Méta-MCI schreef: > Hi! > > > Under windows, I drive OOo, from Python, via COM/OLE-automation. > > It's run OK, but some bugs, in the OOo-COM-Python, had stop my > devloppements... > > However, this way is usable (only on Win, ok?) > Do you have some (small) example program of using OOo from Python via COM/OLE? Can you give any indication of the kind of bugs that you hit? kind regards, Gerrit Muller Gaudi Systems Architecting -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a way to get utf-8 out of a Unicode string?
Hei, On 2006-10-30 08:25:41 +0100, thebjorn wrote: > def unfk(s): > return eval(repr(s)[1:]).decode('utf-8') > > i.e. chopping off the u in the repr of a unicode string, and relying on > eval to interpret the \xHH sequences. > > Is there a less hack'ish way to do this? Slightly lack hackish: return ''.join(chr(ord(c)) for c in s) Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Comparison Of Dynamic and Static Languiges
On 2006-10-21 20:41:42 +0200, Scott M. wrote: > Also, widely posting your real (unaltered) email address in forums like this > is a sure way to get noticed by spammers. This newsgroup is mirrored by a mailing-list, so many people use their real address. The solution to spam is spamfiltering (spambayes), not hiding ones address on the internet. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: matrix Multiplication
On 2006-10-18 14:15:17 +0200, Sssasss wrote: > Fredrik Lundh wrote: > > "Sssasss" wrote: > > > > > I wan't to multiply two square matrixes, and i don't understand why it > > > doesn't work. > > > > > > def multmat(A,B): > > >"A*B" > > >if len(A)!=len(B): return "error" > > >D=[] > > >C=[] > > >for i in range(len(A)): D.append(0) > > >for i in range(len(A)): C.append(D) > > > > append doesn't copy data, so you're basically adding len(A) references to > > the same D list to C. for more on this, see: > > > > http://pyfaq.infogami.com/how-do-i-create-a-multidimensional-list > > > > > > Ok!! Tank you very much, i understand now. You might also want to look at numpy/numarray. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Best IDE?
On 2006-10-13 16:31:37 +0200, Ahmer wrote: > Subject: Best IDE? cat > foo.py > How much does it cost? 0 -- http://mail.python.org/mailman/listinfo/python-list
Re: Motions.
On 2006-10-11 00:26:38 +0200, Dr. Pastor wrote: > I would like to track the motions of > small birds in short (20-30sec) .avi films. > What tool-set/programs would be wise to use? > Thanks for any guidance. I'd use PIL with numpy and subtract a birdless background picture from each picture. Make that binary (choose a suitable treshhold, 100 or so) and you'll get a matrix for each frame with value 1 for the position of the bird. Been there, done that, though my problem was slightly easier: I had a few dozen of equal balls flying around and all I needed was the average total position, not tracking each individually. How to do that if birds pass each other (projecting 3D on 2D) I don't know, but I'm sure it's been done before (not necessarily in Python though). Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Gnutar to remove a list of files
On 2006-10-10 14:35:30 +0200, [EMAIL PROTECTED] wrote: > Hi folks, I've got a question for yas. I'm trying to write code that > will open up a gzipped tar file using gnutar, and copy the list of > files(including their directories) to a list variable in python. From > there, I want to go through the list and delete those files from my > system. That part is easy, but what I'm stuck on is getting the list > of files in an archive into a list variable. If I use the -t parameter > in gnutar, it prints a list of the files in a seperate cmd screen, but > only returns 0. Is there any way to make it return a list, or to copy > the information over? Thanks in advance! Use the commands module. Or tarfile of course. http://docs.python.org/lib/module-commands.html http://docs.python.org/lib/module-tarfile.html Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: file system iteration
On 2006-10-09 14:45:35 +0200, rick wrote: > import os.path > > paths = [] > > if os.path.isdir('A:/'): > paths.append('A:/') > > if os.path.isdir('B:/'): > paths.append('B:/') > > ... > > That's a kludge, but it works OK. I'm sure WMI may have a function that > returns mounted volumes, but under the circumstances currently, I can > only use the standard Python library. Any ideas on how to do this better? The very least you can try: import string string.ascii_uppercase for c in string.ascii_uppercase: if os.path.isdir('%s:/' % c): ... etc. But I suppose there should be a better way. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: printing variables
On 2006-10-06 04:50:33 +0200, [EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... > eg print var* ?? > i don't want to do : > > print var1, var2, var3, var4 ..etc... Don't do this: >>> import fnmatch >>> var1, var2, var3 = "foo", "bar", "baz" >>> for k in fnmatch.filter(locals(), "var*"): ... print locals()[k] ... foo baz bar This is evil. It's unpythonic. This is yet another way to do it - QED. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: PEP 358 and operations on bytes
On 2006-10-04 05:10:32 +0200, John Machin wrote: > > - str methods endswith, find, partition, replace, split(lines), > > startswith, > > - Regular expressions > > > > I think those can be useful on a bytes type. Perhaps bytes and str could > > share a common parent class? They certainly share a lot of properties > > and possible operations one might want to perform. > > > > I look at it this way:: > Processing text? Use unicode. > Binary structures and file I/O, interfacing to 8-bit-wide channels? Use > bytes. But can I use regular expressions on bytes? Regular expressions are not limited to text. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
PEP 358 and operations on bytes
Hi, In Python 3, reading from a file gives bytes rather than characters. Some operations currently performed on strings also make sense when performed on bytes, either if it's binary data or if it's text of unknown or mixed encoding. Those include of course slicing and other operators that exist in lists, but also other operations that aren't currently defined in PEP 358, like: - str methods endswith, find, partition, replace, split(lines), startswith, - Regular expressions I think those can be useful on a bytes type. Perhaps bytes and str could share a common parent class? They certainly share a lot of properties and possible operations one might want to perform. kind regards, Gerrit Holl. -- My first English-language post ever was made to this newsgroup: http://groups.google.com/group/comp.lang.python/msg/f957acf785ddfb71 :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Get CPU usage of a single process in Windows
[Tim Golden] now I only have to find some time to play around... thanks, Gerrit -- Gaudi systems architecting: <http://www.gaudisite.nl/> -- http://mail.python.org/mailman/listinfo/python-list
Re: Get CPU usage of a single process in Windows
Tim Golden wrote: <...snip...> >>This should be possible as Taskmanager tracks CPU usage for every >>process... Anyone know how this can be done? >> > > WMI can probably do the trick. If you can find something on Google > for wmi cpu usage (or something similar) then translation to Python's > usually quite easy. I'm fairly sure I've got an example somewhere, but > I can't lay my hands on it at the mo. > > TJG > Tim Golden's general documentation/examples about WMI are at: <http://tgolden.sc.sabren.com/python/wmi.html>. If you have a working example of CPU usage could you post the result? I would be interested. kind regards, Gerrit Muller -- Gaudi systems architecting: <http://www.gaudisite.nl/> -- http://mail.python.org/mailman/listinfo/python-list
Re: hello, I want to change n bytes of a binary file
could ildg wrote: > > b = encrypt(a) > > Thank you~~,but where is the encrypt defined? > I suppose it's left as an exercise for the reader. Gerrit. -- Temperature in Kiruna, Lappland, Sweden: Tue Nov 1 15:35:25 2005 [UT] 2.6°C -- http://mail.python.org/mailman/listinfo/python-list
Re: your mail
Finn Waldrip wrote: > X-Spambayes-Classification: unsure; 0.242 > > > 404 Not Found > > Not Found > The requested URL was not found on this server. > > Apache/1.3.31 > How can my poor Spambayes ever make sense of this? Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-17 22:29:599.6 degrees Celsius ( 49.2F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Problems with properties
Michael Schneider wrote: > Could someone please point out my error, I have dents in my forehead > for this one. > -- > > from unittest import TestCase > import unittest Here you need to add: __metaclass__ = type this will make your classes new-style. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-14 17:59:487.9 degrees Celsius ( 46.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Well written open source Python apps
Ben wrote: > Could anyone suggest an open source project that has particularly well > written Python? I am especially looking for code that people would > describe as "very Python-ic". (Not trying to start any kind of war - > just wanted some good examples of a well written Python app to read.) Mailman - http://www.list.org/ Spambayes - http://www.spambayes.org Those are written by experienced Python programmers, some of them Python developers. It looks like well written code to me. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-14 10:19:498.3 degrees Celsius ( 47.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Class methods
Laszlo Zsolt Nagy wrote: > >Oh man, it has been a long time I have read such an disturbing question. > > > >RTMF here: http://docs.python.org/lib/built-in-funcs.html#l2h-14 > > > > > I feel I was a bit harsh. Of course, those posts do keep the Google count for the famous four-letter-abbreviation down (-; Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-05 21:59:48 10.7 degrees Celsius ( 51.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
Tony Meyer wrote: > X-Spambayes-Classification: ham; 0.008 > > On 30/09/2005, at 10:56 PM, Gerrit Holl wrote: > > Tony Meyer wrote: > >> X-Spambayes-Classification: ham; 0.048 > > Unless I'm misreading things, that's *my* message that scored 0.048 > (the "from:addr:ihug.co.nz", "from:name:tony meyer", and "spambayes" > tokens make it seem that way)... It is, and that's very surprising, but apparantly it was not really hammy enough. But don't worry, by ham_cutoff is 0.2, and out of the 10 'unsure' messages per week, 2 are spam, 2 are ham, and 6 are, well, unsure. Note that with all my mailinglists, the number of messages handled is more than 2500 per week, so I'm very, very happy with spambayes... Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-01 09:49:529.7 degrees Celsius ( 49.5F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
Tony Meyer wrote: > X-Spambayes-Classification: ham; 0.048 > X-Spambayes-Evidence: '*H*': 0.90; '*S*': 0.00; 'bug.': 0.07; 'flagged': > 0.07; > "i'd": 0.08; 'bayes': 0.09; 'from:addr:ihug.co.nz': 0.09; > 'really,': 0.09; 'cc:no real name:2**0': 0.14; > 'from:addr:t-meyer': 0.16; 'from:name:tony meyer': 0.16; > 'obvious,': 0.16; 'spambayes': 0.16; 'subject:Guido': 0.16; > 'trolling,': 0.16; 'regret': 0.82; 'lee,': 0.91; 'viagra': 0.91; > 'mailings': 0.93; 'probability': 0.93 > This is a feature, not a bug. It's the same feature that means that > messages talking about spam on the spambayes mailing list, or the > legitimate mail I get about viagra , get through to me. True. However, most mail to this mailinglist has less than 0.001 spam probability. As you can see, this one had 0.048 - a vast score, almost enough to put it in my unsure box. It seems to be just not hammy enough. It's interesting to see that no none of the foul language words used by Xah Lee ever occurs in any spam I receive - spam is not that stupid. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-30 12:49:54 11.1 degrees Celsius ( 51.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
Xah Lee wrote: > ...What the fuck is the former? > ...What the fuck would anyone to > ...]”, is rather inane, as you can now see. > > ...What the fuck does it mean... > ...you begin to write things like Java... Can you please alter the tone of your voice? Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-29 18:19:556.8 degrees Celsius ( 44.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Documenting properties
Paul McNett wrote: > > Whatever is preferred, what's the upside/downsides of the two beyond > > what I just explained? > > Nothing really, but something handy to keep in mind is that the string > literal ("""x""") can be used to block out huge sections of code during > testing, where you'd have to put a # in front of every line otherwise. Except, of course, code that contains string literals with triple quotes. And with a good editor, it's not too difficult to insert a # in front of hundreds of lines (:%s/^/#/g). Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-27 20:19:549.8 degrees Celsius ( 49.7F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: New-style classes questions
Diez B. Roggisch wrote: > > What is the reason for allowing both styles? (backwards compatibility??) > > yes. Note that there is another way to create new-style classes: __metaclass__ = type before the first class definition: >>> class Foo: pass ... >>> type(Foo) >>> __metaclass__ = type >>> class Bar: pass ... >>> type(Bar) I like this. However, perhaps other people reading my source code won't like it, because when they see 'class Foo:', they might expect an old-style class. But it's so much better to type and to read, that I prefer this. Does the Python style guide have any severe penalty for using this? regards, Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-25 15:19:47 11.0 degrees Celsius ( 51.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Programming languages "national brotherhood week"
Hi, I have once seen a variant of "national brotherhood week" with programming languages; 'all the python folk hate alle the perl folk and all the ... hate all the ... and everybody hates Java', or something like that, but I can't find it anymore. Does anyone remember it and is anyone able to find it? It was quite funny, I think it was more than five years ago though. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-24 15:59:53 12.1 degrees Celsius ( 53.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Free seminar on domain-specific modeling
Martijn Iseger wrote: > Domain-specific modeling makes software development 5-10 times faster than > approaches based on UML or MDA. > It accelerates development and reduces complexity by automatically generating > full code from higher-abstraction design models. > Learn from speakers Juha-Pekka Tolvanen, Jack Greenfield, Steven Kelly and > Krzysztof Czarnecki about DSM and how to implement it. > > Time: Friday, October 21, 2005. 8:00am - 12:00noon. Right after > OOPSLA. > Place:Town & Country Resort & Convention Center, San Diego. Will the trip there be free as well? Gerrit. (sorry, couldn't resist) -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-19 19:09:599.5 degrees Celsius ( 49.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: defining __repr__
sven wrote: > i'd like to define __repr__ in a class to return the standardrepr > a la "<__main__.A instance at 0x015B3DA0>" > plus additional information. > how would i have to do that? > how to get the standardrepr after i've defined __repr__? >>> object.__repr__(4) '' Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-15 19:19:587.8 degrees Celsius ( 46.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: pre-PEP: Object-oriented file module
Kenneth McDonald wrote: > Subject: pre-PEP: Object-oriented file module Please have a look at http://topjaklont.student.utwente.nl/creaties/path/pep-.html if you haven't done so already. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-08-27 22:20:00 11.8 degrees Celsius ( 53.3F) | -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: whois like functionality on Windows?
Peter Hansen wrote: > If the address doesn't get mapped to a name by a DNS server, I strongly > suspect you will get nowhere with whois, or much else. Not all IP > addresses have corresponding domain names: many are dynamic addresses > assigned on the fly to arbitrary customers of (for example) cable modem > service providers, and they're often not interested in providing any > reverse mapping for them. Some do (for example, mine is > pc-136-15.scpe.powergate.ca right now), but many don't... > > I'm sure there's a way to identify the domain of the owner of a block of > addresses in which a given IP resides. I don't know what it is. > > -Peter In 5 years of logging I did get about 23000 different domains that accessed my site. For about 1000 IP address ranges I obtained the domain name manually via whois, mostly via Geektools. Sometimes via more specific whois servers, such as krnic. These 1000 domain names are a mix of "real" domain names, for instance from companies, universities or government, and service providers. It would be nice to automate this action, although the manual approach is workable. regards, Gerrit -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
ANN: PyGaim released - Gaim Python plugin
PyGaim has been released. Summary: Gaim Python plug-in. The product provides developers with the capability to develop python plugins for Gaim This release is just a get it out there release and a lot of polishing still needs to be done. However, it does enable a python developer to develop gaim plugins using python as the programming language. The current packages is available from http://sourceforge.net/projects/pygaim ToDo: Web page CVS Instructions on installing and using More examples A interface to the gaim gui using pygtk Lots of other stuff. The mailing list should be up in the next 24 hours -- http://mail.python.org/mailman/listinfo/python-list
Re: whois like functionality on Windows?
Peter, Thomas, thanks for your suggestion. I did indeed look broader than whois, and reverse DNS maybe a better description. Unfortunately I did try the socket.gethostbyaddr("194.109.137.226"), but the result was a disappointing "host not found", both at home on an XP machine as well as at work on a NT machine. Your comments stimulated me too experiment with this apporach, and I discovered that unresolved IP addresses in my old logfiles return "host not found". However many IP addresses in my new logfile can be translated successfully! Apparantly there are IP addresses that cannot be reversely resolved by the DNS servers. I did translate these addresses manually so far via the whois service. So you definitely helped me a lot, but I keep interested in a complementary whois solution. kind regards, Gerrit > Gerrit Muller wrote: > >> I am migrating a website from a UNIX based machine to an Windows >> machine. In the logfiles I got from the old machine I mostly got >> domain names and sometimes only IP addresses. The Windows machine >> seems to produce only IP addresses. >> >> Somehow I cannot find a windows solution to translate an IP address >> back into a domain-name. Searching with Google shows that more people >> have been wrestling with this problem. >> >> I did find working whois scripts, but unfortunately: > > [snip] > > Part of your problem is looking for the wrong thing. You are looking > for the capability provided by "domain name servers" (DNSes), not > "whois" servers. But Thomas has just given you the solution... > > -Peter -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
whois like functionality on Windows?
I am migrating a website from a UNIX based machine to an Windows machine. In the logfiles I got from the old machine I mostly got domain names and sometimes only IP addresses. The Windows machine seems to produce only IP addresses. Somehow I cannot find a windows solution to translate an IP address back into a domain-name. Searching with Google shows that more people have been wrestling with this problem. I did find working whois scripts, but unfortunately: - the verbose whois registrar information often forbids automated access - the information is rather distributed, so you have to somehow access sufficient servers - you still have to find the domain name in the sea of details returned I also found socket based solutions, but these solutions crash with the message "host not found" :-( Anyone suggestions? kind regards, Gerrit -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
Re: eric3 question
Alexander Zatvornitskiy wrote: > Hello All! > > I'am using eric3 IDE under win32 (snapshot 2005-04-10), and have a trouble. I > use this code: > print "enter q to quit, or smthing else to continue" > while not sys.stdin.readline()=="q": > smthing(else) > Try using raw_input() instead of the sys.stdin.readline(). raw_input() is the preferred way of getting console input. Like this: print "enter q to quit, or smthing else to continue" while not raw_input() == 'q': smthing(else) Or you can do it this way: while not raw_input("enter q to quit, or smthing else to continue: ") smthing(else) Gerrit van Dyk -- http://mail.python.org/mailman/listinfo/python-list
Re: python-dev Summary for 2005-04-01 through 2005-04-15
Tim Lesher wrote: --- New python-dev summary team --- This summary marks the first by the team of Steve Bethard, Tim Lesher, and Tony Meyer. We're trying a collaborative approach to the summaries: each fortnight, we'll be getting together in a virtual smoke-filled back room to divide up the interesting threads. Then we'll stitch together the summaries in roughly the same form as you've seen in the past. We'll mark each editor's entries with his initials. +1 This first summary is a good start! Thanks. Thanks to Brett Cannon for sixty-one excellent python-dev summaries. Also, thanks for providing scripts to help get the new summaries off the ground! We're looking forward to the contributions you'll make to the Python core, now that the summaries aren't taking up all your time. +1 Brett, thanks a lot! regards, Gerrit -- Praktijk voor Psychosociale therapie Lia Charité http://www.liacharite.nl/ -- http://mail.python.org/mailman/listinfo/python-list
ANN: Python Training In South Africa
AgileWorks (Pty) Ltd will be presenting an "Introduction to Python" training course at "The Innovation Hub" from the 4-6th of May 2005. For more detail visit our website: (http://www.agileworks.net/AgileWorks/Training/Python/) -- http://mail.python.org/mailman/listinfo/python-list
Re: [perl-python] Python documentation moronicities (continued)
Ivan Van Laningham wrote: > Richie Hindle wrote: > > > > [Xah] > > > motherfucking ... fucking ... fucking ... fucking ... fuck ... fucking > > > fucking ... fucking ... mother fucking ... fucking ... piece of shit ... > > > motherfucking ... fucking ... fucking ... big asshole ... masturbation ... > > > Fucking morons ... fucking stupid ... fuckhead coders ... fuckheads ... > > > you fucking asses. > > > > > paypal me a hundred dollars and i'll rewrite the whole re doc in a few > > > hours. > > > > Can we paypal you a hundred dollars to leave us alone? I'll pledge $10. > > Are there another nine people here who'll do the same? > > Why don't we pay him $100 to re-write the PERL docs? Interestingly, Richard Hindle's message was classified as ham by my spambayes, whereas your message was unsure. Could it be the second-to-last word doing it? (-; Gerrit. -- Weather in Twenthe, Netherlands 12/04 19:55: 13.0ÂC wind 2.2 m/s NNW (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: help with getting selection from wxChoice with out after it has changed
'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])]) wrote: > From: "'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])])" > <[EMAIL PROTECTED]> This is a SyntaxError. You want to enclose the dots with '' marks as well, like this: '@'.join(['.'.join(['fred', 'dixon']), '.'.join(['gmail', 'com'])]) regards, Gerrit Holl. -- Weather in Twenthe, Netherlands 29/03 10:55: 10.0ÂC mist overcast wind 0.9 m/s None (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: 2005 International Obfuscated Ruby Code Contest (IORCC)
[EMAIL PROTECTED] wrote: > IMMEDIATE RELEASE: Fri Mar 18 16:34:52 CST 2005 > LOCATION: http://iorcc.dyndns.org/2005/press/031805.html > ANNOUNCEMENT: International Obfuscated Ruby Code Contest (IORCC) >Entry Deadline, Midnight on March 31st, 2005 > > > Dear Rubyists, Perlists, Shellists, Cists and Hackers, What is this doing on comp.lang.python? regards, Gerrit Holl. -- Weather in Twenthe, Netherlands 20/03 16:55: 9.0ÂC wind 4.0 m/s ENE (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] Re: Hi Guys. First Time Poster
Jeff Schwab wrote: > sheldon279 wrote: > Wow, you sold me. > > Does this kinda scam really still work? This kind of replies works to confuse spambayes. Gerrit. -- Weather in Twenthe, Netherlands 20/03 16:55: 9.0ÂC wind 4.0 m/s ENE (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: Possible to import a module whose name is contained in a variable?
Ed Leafe wrote: > On Mar 7, 2005, at 5:23 AM, Michael Hoffman wrote: > >Avoiding exec (which is a statement, not a function) is much more > >important. Since it executes arbitrary code, you can get unpredictable > >results from it. > > Is there any way to use __import__ to replace the following: > > exec("from %s import *" % modulename) No. Gerrit. -- Weather in Twenthe, Netherlands 07/03 13:25: 4.0ÂC Few clouds mostly cloudy wind 5.4 m/s NW (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: python-dev Summary for 2005-01-16 through 2005-01-31
Brett, <...snip...> -- New format -- I have done a thorough restructuring of the boilerplate and the Summary Announcements section for the Summaries. The purpose of this is to make finding information in the boilerplate much easier. It also keeps consistency by sectioning off everything as in the Summary section. The other reason is for the ``contents`` directive in reST_. This will provide a more thorough table of contents for the web version of the summary at the very top of the summaries. This will allow people to jump directly to the section of the Summary they care about the most. Obviously this perk only exists in the HTML version. Lastly, the typical boilerplate for each Summary has now been moved to the bottom. This was at the request of a regular reader who I would like to keep happy. =) It also seems reasonable since once you have read through it once chances are you are not going to read it again so might as well move it out of the way. Then again I could be totally wrong about all of this and manage to alienate every person who reads the summaries regularly. =) <...snip...> as always I do appreciate your summaries. This new format, with the boilerplate at the end certainly is an improvement. However, I always use your news announcement as a trigger to read the version at <http://www.python.org/dev/summary/.html>. I used to do this by clicking on the "archive" link at the beginning of your message and then clicking on the latest summary. For my type of reading I would strongly prefer to have the link to the actual version at the top of the message, rather than at the end. I hope you keep summarizing as long as no other volunteer takes over. thanks, Gerrit -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
"Architecture of Python" restored! [was Re: "Architecture of Python" was removed ?]
Jim Jackson's UIUC email address is/was [EMAIL PROTECTED] Jim, if you're out there, is it okay to reconstruct your old C427 assignment somewhere else? The original pages at <http://wiki.cs.uiuc.edu/cs427/PYTHON> appear to be restored completely, including the nice visualizations! thanks, Gerrit -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Allocation?
Chris S. wrote: > Is it possible to determine how much memory is allocated by an arbitrary > Python object? There doesn't seem to be anything in the docs about this, > but considering that Python manages memory allocation, why would such a > module be more difficult to design than say, the GC? Why do you want it? regards, Gerrit. -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: "Architecture of Python" was removed ?
Nick Coghlan wrote: cr999 wrote: I found the "Architecture of Python" ( http://wiki.cs.uiuc.edu/cs427/PYTHON By Jim Jackson, Kar-Han Tan )is very useful for my understanding of the Python's architecture. But I found the link is not link to that document today. It seems that the document was removed. Who knows what happened? Does anyone here have a copy of that document? Or who can tell me what is the email address of Jim Jackson or Kar-Han Tan. http://web.archive.org/web/2003101953/http://wiki.cs.uiuc.edu/cs427/PYTHON Cheers, Nick. This is again a nice document, and an example of a document that presumably has been removed because of maintenance reasons. Shouldn't we have a collection (archive) of these documents at python.org? kind regards, Gerrit -- Gaudi systems architecting: <http://www.extra.research.philips.com/natlab/sysarch/> -- http://mail.python.org/mailman/listinfo/python-list
Re: tuples vs lists
Steve Holden wrote: > worzel wrote: > >'Two-Pull' it is then, thanks. > > > Well, it might be "Two-Pull" in American, but in English it's "tyoopl" > -- NOT "choopl" (blearch!). I've also heard people say "tuppl". > > So, basically, say whatever you want. Language is about communication :-) Or just write it down and don't say the word at all (-: regards, Gerrit, who actually says tÃpel. -- Weather in Lulea / Kallax, Sweden 10/01 10:20: -12.0ÂC wind 0.0 m/s None (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: type method-wrapper?
Alan Kennedy wrote: > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> l = [] > >>> type(l.__delattr__) > > >>> import types > >>> for t in dir(types): > ... if t[-4:] == 'Type' and isinstance(l.__delattr__, getattr(types, t)): > ... print "It's a '%s'" % str(t) > ... > It's a 'ObjectType' > >>> Everything is: >>> for d in dir(types): ... print getattr(types, d), isinstance(getattr(types, d), types.ObjectType) ... True True True True True True True True ... you get the general idea. yours, Gerrit. -- Weather in Lulea / Kallax, Sweden 20/12 16:50: -3.0ÂC Scattered clouds partly cloudy wind 8.0 m/s NW (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: lies about OOP
binL9yPfo4Fv5.bin Description: application/pgp-encrypted msg.asc Description: Binary data -- http://mail.python.org/mailman/listinfo/python-list
Re: Why are tuples immutable?
Fredrik Lundh wrote: > > I could imagine that anything accepting numerical values for __getitem__ > > (foo[0], foo[1], ...) or that is iterable (foo.next(), foo.next()) could > > be sensibly used as a formatting rhs. Of course, it is not compatible > > because "foo %s" % [2, 4] is correct and "foo %s" % (2, 4) is not, but > > are there other reasons that it has been chosen like this? > > so what should > > "foo %s bar %s" % "24" > > do? Hmm. Good question (-: Not possible before Python 3.0, but could __rmod__ play a role here? str.__mod__ would be something like: try: # use other.__rmod__(...) result except AttributeError: try: # use it as an array except TypeError: # use string representation Hm, something else I don't understand in current behaviour: >>> "foo".__rmod__("testing %s") 'testing foo' >>> (55).__rmod__("testing %s") NotImplemented >>> print (55).__rmod__.__doc__ x.__rmod__(y) <==> y%x ...apparantly not? How should I interpret this? To answer your question: "foo %s bar %s" % "24" would do "24".__rmod__("foo %s bar %s") resulting in: >>> "24".__rmod__("foo %s bar %s") Traceback (most recent call last): File "", line 1, in ? TypeError: not enough arguments for format string Would it be possible to use something like this? regards, Gerrit. -- Weather in Lulea / Kallax, Sweden 14/12 16:20: 2.0ÂC Broken clouds mostly cloudy wind 7.6 m/s S (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: Why are tuples immutable?
Another tuple/list question. Fredrik Lundh wrote: > http://www.python.org/doc/faq/general.html#why-are-there-separate-tuple-and-list-data-types Apart from historical, compatibility reasons, why is "foo %s bar %s" % [2, 4] illegal? I could imagine that anything accepting numerical values for __getitem__ (foo[0], foo[1], ...) or that is iterable (foo.next(), foo.next()) could be sensibly used as a formatting rhs. Of course, it is not compatible because "foo %s" % [2, 4] is correct and "foo %s" % (2, 4) is not, but are there other reasons that it has been chosen like this? Or is it possible that this behaviour will change in Python 3000? let's-do-Duck-Typing!-ly - y'rs - Gerrit -- Weather in Lulea / Kallax, Sweden 14/12 12:50: 2.0ÂC mist mostly cloudy wind 8.9 m/s S (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: what module can do html encoder??
richard wrote: > Leon wrote: > > example: > > s = ' ' ---> > > That's technically not HTML encoding, that's replacing a perfectly valid > space character with a *non-breaking* space character. How can you tell? s = 'Â' # non-breaking space s = ' ' # normal space s = 'á' # em-space But you might want to do something like: def escapechar(s): import htmlentitydefs n = ord(s) if n < 128: return s.encode('ascii') elif n in htmlentitydefs.codepoint2name: return '&%s;' % htmlentitydefs.codepoint2name[n] else: return '&#%d;' % ord(s) This requires unicode strings, because unicode encodings have multi-byte characters. Demonstration: >>> f(u'Ã') 'ò' >>> f(u'Å') 'ş' >>> f(u's') 's' yours, Gerrit Holl. -- Weather in Lulea / Kallax, Sweden 13/12 10:20: -15.0ÂC wind 0.9 m/s NNW (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)
Cameron Laird wrote: > Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) What is the frequency of the weekly Python-URL? (-; regards, Gerrit Holl. -- Weather in Lulea / Kallax, Sweden 02/12 19:20: -8.0ÂC Scattered clouds mostly cloudy wind 0.9 m/s None (34 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list