Re: Addind imports to a class namespace

2009-07-10 Thread Peter Otten
Ryan K wrote: > In order to avoid circular imports, I have a class that I want to > improve upon: > > Class GenerateMenuXhtml(threading.Thread): > """ > Subclasses a threading.Thread class to generate a menu's XHTML in > a separate > thread. All Link objects that have this menu associ

Re: tough-to-explain Python

2009-07-10 Thread John O'Hagan
On Fri, 10 Jul 2009, Hendrik van Rooyen wrote: > "Steven D'Aprano" wrote: > >On Wed, 08 Jul 2009 22:05:57 -0700, Simon Forman wrote: [...] > >> Programming is not like any other human activity. > > > >In practice? In principle? Programming in principle is not the same as it > >is performed in pr

Re: Colour of output text

2009-07-10 Thread Nobody
On Fri, 10 Jul 2009 09:23:54 +, garabik-news-2005-05 wrote: >>> I would like to learn a way of changing the colour of a particular >>> part of the output text. I've tried the following > >> On Unix operating systems this would be done through the curses interface: >> >> http://docs.python.or

fedora 3.1 python install

2009-07-10 Thread oystercatcher
had installed python 3.0. on fc11 x64 the only anomalies were a couple of tests failed during the make test. make altinstall was fine and have been using it for a simple math exercise. attempting to install python 3.1 the make test hangs at test_httpservers and I had to kill the task after waitin

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Terry Reedy
Steven D'Aprano wrote: On Fri, 10 Jul 2009 12:27:25 -0400, Charles Yeomans wrote: (3) assert is absolutely unsuitable for enforcing pre-conditions and post- conditions, unless such conditions are mere "guidelines", because assert can be switched off at runtime. Unless, of course, you want to

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Steven D'Aprano
On Fri, 10 Jul 2009 12:27:25 -0400, Charles Yeomans wrote: >> (3) assert is absolutely unsuitable for enforcing pre-conditions and >> post- >> conditions, unless such conditions are mere "guidelines", because >> assert >> can be switched off at runtime. > > > Unless, of course, you want to switc

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread Musatov
Martin Musatov wrote: David Bernier wrote: > scribe...@yahoo.com wrote: > [...] > > > community. But perhaps he is trying to see things a bit differently > > and is just not getting the feedback he needs, so he is throwing > > tantrums apparently across USENET. > > > > Like I said before, I am just

Re: sys.exit() and PyRun_SimpleFileExFlags()

2009-07-10 Thread Aahz
In article , =?ISO-8859-1?Q?Xavier_B=E9nech?= wrote: > >There is a behaviour I do not understand of PyRun_SimpleFileExFlags(), >normally when it executes a python script containing a sys.exit(), it >results by ending the calling application. If nobody responds on c.l.py, I suggest trying capi-

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Ethan Furman
Steven D'Aprano wrote: On Mon, 06 Jul 2009 21:02:19 -0700, Aahz wrote: In article <006e795f$0$9711$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: On Mon, 06 Jul 2009 14:32:10 +0200, Jean-Michel Pichavant wrote: kj wrote: sense = cmp(func(hi), func(lo)) assert sense != 0, "fun

Re: language analysis to enforce code standards

2009-07-10 Thread greg
Aahz wrote: Much simpler and *way* more efficient with a set: if len(set(s)) < N: print "Must have at least %s different characters" % N Or you could do a dictionary lookup on the words. I can just see the error message: "Your comment must include at least one verb, one noun, one non

Addind imports to a class namespace

2009-07-10 Thread Ryan K
Greetings, In order to avoid circular imports, I have a class that I want to improve upon: Class GenerateMenuXhtml(threading.Thread): """ Subclasses a threading.Thread class to generate a menu's XHTML in a separate thread. All Link objects that have this menu associated with it are ga

windows explorer integration

2009-07-10 Thread Laurent Luce
Hello, Do you know if it is possible to write a plugin for windows explorer using win32 module ? The idea is to modify the way the folders/files are displayed in the explorer window and also to provide some controls. Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: main in Python

2009-07-10 Thread Benjamin Kaplan
On Fri, Jul 10, 2009 at 5:52 PM, Tim wrote: > > Hi, > I learned that a Python script is written in this way: > def main(): >    ... > if __name__ == "__main__": >    main() > > Today, when I read a script, I found it has a different way: > > def main(): >    ... > > main() > > It can run as well. C

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread Dave Angel
David Bernier wrote: Good day, Professor X This is what there is at the bottom of page 3: << Conclusion: Binary revisions are allowed given the above formulas. >> So I don't understand the proposed solution for the "P = NP" problem. David Bernier "Professor X" is yet another alias for

Re: shutil.rmtree raises "OSError: [Errno 39] Directory not empty" exception

2009-07-10 Thread Maria Liukis
Thanks for pointing out the parameters for ignore_errors and an onerror callback function. I have been running this code for more than an year, and this is the very first time I see the problem. We switched to the NFS mounted storage though, but there is nothing unusual logged by the system

Re: shutil.rmtree raises "OSError: [Errno 39] Directory not empty" exception

2009-07-10 Thread Tim Chase
shutil.rmtree(filename) File "/usr/lib64/python2.5/shutil.py", line 178, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/usr/lib64/python2.5/shutil.py", line 176, in rmtree os.rmdir(path) OSError: [Errno 39] Directory not empty: /path/to/my/dir According to the docum

Re: tough-to-explain Python

2009-07-10 Thread John Nagle
Bearophile wrote: kj, as Piet van Oostrum as said, that's the difference between mutable an immutable. It comes from the procedural nature of Python, and probably an explanation of such topic can't be avoided if you want to learn/teach Python. The problem with Python's mutable/immutable dis

Announcing the 9th Pyweek game programming challenge!

2009-07-10 Thread Richard Jones
The date for the ninth PyWeek challenge has been set: Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC) The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the challeng

Email provider recommendations for those tired of mangled messages (was: subprocess + python-daemon - bug/problem?)

2009-07-10 Thread Ben Finney
Ben Finney writes: > Here it is without the unwanted extra line-wrapping that seems to > plague all Google Mail users (seriously, folks: get a real mail > provider that won't mangle your messages) I've been asked off-list whether I have any suggestions for those who want a better email provider.

Re: tough-to-explain Python

2009-07-10 Thread Terry Reedy
I V wrote: On Fri, 10 Jul 2009 16:27:12 -0400, Terry Reedy wrote: a bug, bug a limitation due to using limited-range numbers. If one uses residue classes instead of integers, and makes no adjustment, I consider it wrong to blame Bentley. But it was Bentley himself who used the C int type, so i

Re: 2.4 VS 3.1 for simple print

2009-07-10 Thread Ben Finney
"earthlink" writes: > Why does > > print "GarbageCollector: collected %d objects." % (gc.collect()) > > work in 2.4 but not in 3.1? For this and other differences introduced in the Python 3.x series, see http://www.python.org/dev/peps/pep-3100/>. -- \ “Please do not feed the animals. I

Re: Why not enforce four space indentations in version 3.x?

2009-07-10 Thread Ben Finney
walterbyrd writes: > I believe Guido himself has said that all indentions should be four > spaces - no tabs. Yes. That's a “should” and not a “must”, even though PEP 8 says it with a simple imperative:: Use 4 spaces per indentation level. it soon afterward takes a more nuanced tone::

shutil.rmtree raises "OSError: [Errno 39] Directory not empty" exception

2009-07-10 Thread Maria Liukis
Hello, Has anybody seen an exception "OSError: [Errno 39] Directory not empty" raised by shutil.rmtree? The code that raised an exception creates a lot of directories with files, and then removes them. I got an exception when one of such directories was removed. Here is the backtrace:

Re: Tkinter only: table widget with canvas...

2009-07-10 Thread John Posner
Hi -- a) Assume I would have some different widgets to add per row. How do I get the maximum row height? If you are placing widgets in a table like this: w.grid(row=a, column=b) ... where the *master* of widget "w" is a Tkinter.Frame named "table_frm", then you can determine the height

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread David Bernier
scribe...@yahoo.com wrote: [...] community. But perhaps he is trying to see things a bit differently and is just not getting the feedback he needs, so he is throwing tantrums apparently across USENET. Like I said before, I am just trying to do right by this person who contacted me, and seemed t

Re: main in Python

2009-07-10 Thread Tim Harig
On 2009-07-10, Tim wrote: [RE-ORDERED] > It can run as well. Can someone explain why and the rules that Python > scripts get run? Everything gets run by default. The def syntax defines functions but does not run them -- they are only run when they are called > Today, when I read a script, I fou

main in Python

2009-07-10 Thread Tim
Hi, I learned that a Python script is written in this way: def main(): ... if __name__ == "__main__": main() Today, when I read a script, I found it has a different way: def main(): ... main() It can run as well. Can someone explain why and the rules that Python scripts get run?

Re: Automate rsync w/ authentication

2009-07-10 Thread Piet van Oostrum
> Bryan (B) wrote: >B> I tried removing the internal quotes, and splitting '-e' from the >B> other arguments. I still get the same ssh -h output however: >B> rshArg = '/usr/bin/ssh -i /home/bry/keys/brybackup.key' >B> args = [rsyncExec, '-a', '-v', '--dry-run', '-e', rshArg, source, >B> des

Re: How to check if any item from a list of strings is in a big string?

2009-07-10 Thread inkhorn
Thanks all!! I found the following to be most helpful: any(substr in long_string for substr in list_of_strings) This bang-for-your-buck is one of the many many reasons why I love Python programming :) Matt Dubins -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Pyjamas 0.6pre1 ALPHA release of Pyjamas Widget Set

2009-07-10 Thread Luke Kenneth Casson Leighton
http://pyjs.org - Pyjamas is a port of GWT to Python that can run applications both on the Desktop (like python-gtk2) and in all major Web Browsers (as javascript). This is an alpha release - 0.6pre1 - of the Pyjamas Web Widget Set. It is a significant upgrade, incorporating Pyjamas Desktop which

Re: 2.4 VS 3.1 for simple print

2009-07-10 Thread Martin v. Löwis
> Why does > print "GarbageCollector: collected %d objects." % (gc.collect()) > > work in 2.4 but not in 3.1? Because print is a function in 3.1, so you have to follow it with a parenthesis. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.4 VS 3.1 for simple print

2009-07-10 Thread Chris Rebert
On Fri, Jul 10, 2009 at 2:16 PM, earthlink wrote: > Why does > print "GarbageCollector: collected %d objects." % (gc.collect()) > > work in 2.4 but not in 3.1? Define "works". What error are you getting? Include the exact message and full error traceback. Or if no exception is being raised, explai

Re: hoe to build a patched socketmodule.c

2009-07-10 Thread Scott David Daniels
jacopo mondi wrote: Roger Binns wrote: jacopo mondi wrote: Hi all, I need to patch socketmodule.c (the _socket module) in order to add support to an experimental socket family. You may find it considerably easier to use ctypes since that will avoid the need for any patching. You'll also be ab

2.4 VS 3.1 for simple print

2009-07-10 Thread earthlink
Why does print "GarbageCollector: collected %d objects." % (gc.collect()) work in 2.4 but not in 3.1? -- http://mail.python.org/mailman/listinfo/python-list

Sorry about that, the Counter class is there.

2009-07-10 Thread Scott David Daniels
Scott David Daniels wrote: Raymond Hettinger wrote: [Scott David Daniels] def most_frequent(arr, N): ... In Py2.4 and later, see heapq.nlargest(). I should have remembered this one In Py3.1, see collections.Counter(data).most_common(n) This one is from Py3.2, I think. Oops -- egg all ove

Re: tough-to-explain Python

2009-07-10 Thread I V
On Fri, 10 Jul 2009 16:27:12 -0400, Terry Reedy wrote: > a bug, bug a limitation due to using limited-range numbers. If one uses > residue classes instead of integers, and makes no adjustment, I consider > it wrong to blame Bentley. But it was Bentley himself who used the C int type, so it hardly

Re: problem with keys combination!

2009-07-10 Thread Terry Reedy
Alex wrote: Hi at all, I made a simple program that make a screenshot of Desktop and use it as fullscreen background and then a ball erase image making illusion that erase Desktop. The program working fine and I succesfully blocked all keys but I have a problem with hotkey combination Ctrl-Alt-

Re: Query regarding set([])?

2009-07-10 Thread Terry Reedy
vox wrote: Hi, I'm contsructing a simple compare-script and thought I would use set ([]) to generate the difference output. But I'm obviosly doing something wrong. file1 contains 410 rows. file2 contains 386 rows. I want to know what rows are in file1 but not in file2. This is my script: s1 = s

Re: finding most common elements between thousands of multiple arrays.

2009-07-10 Thread Scott David Daniels
Raymond Hettinger wrote: [Scott David Daniels] def most_frequent(arr, N): ... In Py2.4 and later, see heapq.nlargest(). I should have remembered this one In Py3.1, see collections.Counter(data).most_common(n) This one is from Py3.2, I think. --Scott David Daniels scott.dani...@acm.org --

Re: ANN: Leo 4.6 rc1 released

2009-07-10 Thread Ville M. Vainio
On Jul 10, 9:54 pm, "Edward K Ream" wrote: > The highlights of Leo 4.6: > -- > - Leo now features a modern Qt interface by default. >   Leo's legacy Tk interface can also be used. And to drive home this point (Qt ui), some screenshots for the visually oriented: http://i

Re: can i write a assemly language programs in python

2009-07-10 Thread Terry Reedy
Dave Angel wrote: Terry Reedy wrote: If you mean dis.dis() that only gives you byte code. No, dis is a disassembler and it gives readable assembly code, not the raw numerical bytes. Its purpose is to make byte code + other parts of the code object humanly readable. As far as I know, ther

Re: tough-to-explain Python

2009-07-10 Thread Terry Reedy
Steven D'Aprano wrote: On Thu, 09 Jul 2009 23:07:34 -0400, Terry Reedy wrote: The is *not* a bug is Bentley program. This is *not* a bug in Bentley's program. Wow. That's an impressive set of typos :) 3. Way beneath my usual standards ;-) It is a bug in bad, buggy, insane integer arit

Re: Automate rsync w/ authentication

2009-07-10 Thread Bryan
On Jul 10, 12:43 pm, Piet van Oostrum wrote: > > Chris Rebert (CR) wrote: > >CR> On Fri, Jul 10, 2009 at 9:13 AM, Bryan wrote: > >>> I am trying to automate rsync to backup server A from server B.  I > >>> have set up a private/public key between the two servers so I don't > >>> have to enter

Re: Nested Classes and Instances

2009-07-10 Thread J. Cliff Dyer
On Fri, 2009-07-10 at 19:00 +0200, Manuel Graune wrote: > Hello, > > as an example of what I would like to achieve, think of a street > where each house has a door and a sign with a unique (per house) > number on it. I tried to model this like this: > > class House(object): > class Door(objec

Re: Automate rsync w/ authentication

2009-07-10 Thread Chris Rebert
On Fri, Jul 10, 2009 at 12:43 PM, Piet van Oostrum wrote: >> Chris Rebert (CR) wrote: > >>CR> On Fri, Jul 10, 2009 at 9:13 AM, Bryan wrote: I am trying to automate rsync to backup server A from server B.  I have set up a private/public key between the two servers so I don't have

Re: Automate rsync w/ authentication

2009-07-10 Thread Piet van Oostrum
> Chris Rebert (CR) wrote: >CR> On Fri, Jul 10, 2009 at 9:13 AM, Bryan wrote: >>> I am trying to automate rsync to backup server A from server B.  I >>> have set up a private/public key between the two servers so I don't >>> have to enter a password when using rsync.  Running rsync manually >

Re: help me to find the error

2009-07-10 Thread Terry Reedy
jhinak sen wrote: hi, i am a beginner in python language, Welcome to Python. i am trying with this programme : to find the addition and mean from a data set in a file and writing the mean and sum in some other file : This is three things: input data from, perform calculation, output data

Re: Why not enforce four space indentations in version 3.x?

2009-07-10 Thread Aahz
In article <260f0f1f-1115-4db8-a955-74c9f459e...@h30g2000vbr.googlegroups.com>, walterbyrd wrote: > >I believe Guido himself has said that all indentions should be four >spaces - no tabs. > >Since backward compatibility is being thrown away anyway, why not >enforce the four space rule? Probably

Re: Why not enforce four space indentations in version 3.x?

2009-07-10 Thread Chris Rebert
On Fri, Jul 10, 2009 at 12:22 PM, walterbyrd wrote: > I believe Guido himself has said that all indentions should be four > spaces - no tabs. That's a (very good) recommendation at most. http://www.python.org/dev/peps/pep-0666/ Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org

Re: Why not enforce four space indentations in version 3.x?

2009-07-10 Thread Kurt Smith
On Fri, Jul 10, 2009 at 2:22 PM, walterbyrd wrote: > I believe Guido himself has said that all indentions should be four > spaces - no tabs. > > Since backward compatibility is being thrown away anyway, why not > enforce the four space rule? > > At least that way, when I get python code from somebo

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread Musatov
François Grondin wrote: > "David Bernier" a �crit dans le message de news: > h36ki102...@news5.newsguy.com... > > Musatov wrote: > >> On Jul 9, 7:54 pm, David Bernier wrote: > >>> Musatov wrote: > Los Angeles (AP) --MeAmI.org now has users in 50 countries following > its adopted us

Why not enforce four space indentations in version 3.x?

2009-07-10 Thread walterbyrd
I believe Guido himself has said that all indentions should be four spaces - no tabs. Since backward compatibility is being thrown away anyway, why not enforce the four space rule? At least that way, when I get python code from somebody else, I would know what I am looking at, without having to d

Re: Colour of output text

2009-07-10 Thread Chris Rebert
On Fri, Jul 10, 2009 at 2:23 AM, wrote: > Tim Harig wrote: >> On 2009-07-09, Alex Rosslyn wrote: >>> I would like to learn a way of changing the colour of a particular >>> part of the output text. I've tried the following > >> On Unix operating systems this would be done through the curses inter

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Robert Kern
On 2009-07-10 13:56, J. Cliff Dyer wrote: On Fri, 2009-07-10 at 11:57 -0500, Robert Kern wrote: On 2009-07-10 11:50, J. Cliff Dyer wrote: On Fri, 2009-07-10 at 02:57 +, Steven D'Aprano wrote: On Fri, 10 Jul 2009 03:28:04 +0100, Nobody wrote: On Thu, 09 Jul 2009 04:57:15 -0300, Gabriel Ge

ANN: Leo 4.6 rc1 released

2009-07-10 Thread Edward K Ream
Leo 4.6 rc1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.6: -- - Cached e

Re: gett error message: "TypeError: 'int' object is not callable"

2009-07-10 Thread J. Cliff Dyer
On Thu, 2009-07-09 at 13:53 +, Friðrik Már Jónsson wrote: > Look at: > >len = len(text) > > You're overriding `len` (a built-in method), with an integer > (`len(text)`). You then call: > >for i in range(len(fields)): > > But `len` is no longer a callable, but merely an integer. >

Re: Clarity vs. code reuse/generality

2009-07-10 Thread J. Cliff Dyer
On Fri, 2009-07-10 at 11:57 -0500, Robert Kern wrote: > On 2009-07-10 11:50, J. Cliff Dyer wrote: > > On Fri, 2009-07-10 at 02:57 +, Steven D'Aprano wrote: > >> On Fri, 10 Jul 2009 03:28:04 +0100, Nobody wrote: > >> > >>> On Thu, 09 Jul 2009 04:57:15 -0300, Gabriel Genellina wrote: > >>> >

Re: tough-to-explain Python

2009-07-10 Thread Scott David Daniels
Steven D'Aprano wrote: On Fri, 10 Jul 2009 08:28:29 -0700, Scott David Daniels wrote: Steven D'Aprano wrote: Even *soup stock* fits the same profile as what Hendrik claims is almost unique to programming. On its own, soup stock is totally useless. But you make it, now, so you can you feed it in

Re: Automate rsync w/ authentication

2009-07-10 Thread Chris Rebert
On Fri, Jul 10, 2009 at 9:13 AM, Bryan wrote: > I am trying to automate rsync to backup server A from server B.  I > have set up a private/public key between the two servers so I don't > have to enter a password when using rsync.  Running rsync manually > with the following command works fine: > rs

Re: language analysis to enforce code standards

2009-07-10 Thread Tim Rowe
2009/7/10 Peter Otten <__pete...@web.de>: > Don't be a fool. Have someone other than the author read the comment. That's the winning answer as far as I'm concerned. Automated tools are good for picking up some types of accidental mistakes, but for checking that comments are meaningful (and variab

python make dies :libtk8.5.so: cannot open shared object file: No such file or directory

2009-07-10 Thread Lay, Tony
Trying to build python-2.6.2 ./configure --prefix=/usr/local --exec-prefix=/usr/local LDFLAGS="-L/usr/local" (runs through happily, had to make some libs local) make runs most of the way until. building '_tkinter' extension gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -

Re: Running a script to build docs from setup.py

2009-07-10 Thread Tony Houghton
On Fri, 10 Jul 2009 11:06:34 +1000 Ben Finney wrote: > Tony Houghton writes: > > > I've looked through the manual but I can't find any hooks in distutils > > for generating files at install time other than extension modules and > > .pyc files. Should I just run the script from somewhere in my s

Re: tough-to-explain Python

2009-07-10 Thread Wesley Chun
On Jul 7, 1:04 pm, kj wrote: > I'm having a hard time coming up with a reasonable way to explain > certain things to programming novices. > : > How do I explain to rank beginners (no programming experience at > all) why x and y remain unchanged above, but not z? > : > What do you say to th

Re: Nested Classes and Instances

2009-07-10 Thread Peter Otten
Manuel Graune wrote: > as an example of what I would like to achieve, think of a street > where each house has a door and a sign with a unique (per house) > number on it. I tried to model this like this: > > class House(object): > class Door(object): > def __init__(self,color): >

Re: gett error message: "TypeError: 'int' object is not callable"

2009-07-10 Thread Nick
On Jul 9, 8:22 pm, Paul Rubin wrote: > Nick writes: > > text = file.readlines() > > len = len(text) > > fields = text[1].split() > > Is that intended to split the first line of the file? Remember > that arrays in python begin at index 0. no the '1st line' is garble

Re: can i write a assemly language programs in python

2009-07-10 Thread member thudfoo
On Fri, Jul 10, 2009 at 5:37 AM, Tim Chase wrote: > m.reddy prasad reddy wrote: >> >> can any one tell me how to write assembly language programs in python...if >> no is there any other way to write the programs in python > > Bah, writing assembly language is easy in Python: > >  print("MOV EAX, [E

Re: problem with subprocess

2009-07-10 Thread Christian Heimes
gabrielmonnerat wrote: >> I am using subprocess because I need store the pid. Any suggestions? > Sorry, I was forgot the parameter shell=True. > i.e > In [20]: subprocess.call('DISPLAY=:99 > /opt/ooo-dev3/program/soffice.bin',shell=True) You should avoid using the shell=True parameter. It may resu

Nested Classes and Instances

2009-07-10 Thread Manuel Graune
Hello, as an example of what I would like to achieve, think of a street where each house has a door and a sign with a unique (per house) number on it. I tried to model this like this: class House(object): class Door(object): def __init__(self,color): self.color=color

Re: Where does setuptools live?

2009-07-10 Thread Inky 788
On Jul 10, 10:26 am, Chris Withers wrote: > Inky 788 wrote: > > Currently, distutils itself is being actively developed. More info > > about this here:http://tarekziade.wordpress.com/ > > > My (albeit anonymous) advice is: use distutils. Manually download > > packages as-needed from PyPI and insta

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Robert Kern
On 2009-07-10 11:50, J. Cliff Dyer wrote: On Fri, 2009-07-10 at 02:57 +, Steven D'Aprano wrote: On Fri, 10 Jul 2009 03:28:04 +0100, Nobody wrote: On Thu, 09 Jul 2009 04:57:15 -0300, Gabriel Genellina wrote: Nobody says you shouldn't check your data. Only that "assert" is not the right wa

Re: problem with subprocess

2009-07-10 Thread gabrielmonnerat
gabrielmonnerat wrote: Hi all, I need start a openoffice in Xvfb, but when I call with the DISPLAY occurs this error: [r...@localhost oood]# Xvfb :99 -screen 0 1024x768x24 & In [9]: subprocess.call('/opt/ooo-dev3/program/soffice.bin') Out[9]: 0 In [10]: subprocess.call('DISPLAY=:99 /opt/ooo

Re: problem with keys combination!

2009-07-10 Thread Alex
Hi Steven, > As I understand it, you can't block, modify, or otherwise access Ctrl-Alt- > Del while running under Windows: it is the "Secure Attention Key", and is > designed to be virtually impossible to interfere with. It's not *quite* > impossible, but it is the deepest, darkest black magic. Mi

Re: Clarity vs. code reuse/generality

2009-07-10 Thread J. Cliff Dyer
On Fri, 2009-07-10 at 02:57 +, Steven D'Aprano wrote: > On Fri, 10 Jul 2009 03:28:04 +0100, Nobody wrote: > > > On Thu, 09 Jul 2009 04:57:15 -0300, Gabriel Genellina wrote: > > > >> Nobody says you shouldn't check your data. Only that "assert" is not > >> the right way to do that. > > > > "a

Re: tkinter problem

2009-07-10 Thread Paul Simon
"David Smith" wrote in message news:h35f78$pt...@ruby.cit.cornell.edu... > Paul Simon wrote: >> "Peter Otten" <__pete...@web.de> wrote in message >> news:h3481q$d95$0...@news.t-online.com... >>> Paul Simon wrote: >>> "Chris Rebert" wrote in message news:mailman.2863.1247095339.8015.py

Re: Where does setuptools live?

2009-07-10 Thread Inky 788
On Jul 10, 10:26 am, Chris Withers wrote: > Inky 788 wrote: > > Currently, distutils itself is being actively developed. More info > > about this here:http://tarekziade.wordpress.com/ > > > My (albeit anonymous) advice is: use distutils. Manually download > > packages as-needed from PyPI and insta

problem with subprocess

2009-07-10 Thread gabrielmonnerat
Hi all, I need start a openoffice in Xvfb, but when I call with the DISPLAY occurs this error: [r...@localhost oood]# Xvfb :99 -screen 0 1024x768x24 & In [9]: subprocess.call('/opt/ooo-dev3/program/soffice.bin') Out[9]: 0 In [10]: subprocess.call('DISPLAY=:99 /opt/ooo-dev3/program/soffice.bi

BayPIGgies at OSCON: 7/23 8-9:30pm

2009-07-10 Thread Aahz
NOTE: time change AND location change The July BayPIGgies meeting will be held at OSCON in the San Jose Convention Center as one of the BoF (Birds of a Feather) sessions from 8pm to 9:30pm Thursday July 23. Everyone is welcome: you do NOT need to be an OSCON member to attend a BoF. Wesley Chun w

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Charles Yeomans
On Jul 9, 2009, at 10:57 PM, Steven D'Aprano wrote: On Fri, 10 Jul 2009 03:28:04 +0100, Nobody wrote: On Thu, 09 Jul 2009 04:57:15 -0300, Gabriel Genellina wrote: Nobody says you shouldn't check your data. Only that "assert" is not the right way to do that. "assert" is not the right way t

Re: tough-to-explain Python

2009-07-10 Thread pdpi
On Jul 10, 2:11 pm, Steven D'Aprano wrote: > On Fri, 10 Jul 2009 12:54:21 +0200, Hendrik van Rooyen wrote: > > "Steven D'Aprano" wrote: > > >>On Wed, 08 Jul 2009 22:05:57 -0700, Simon Forman wrote: > > persistent idea "out there" that programming is a very accessible > skill, like cooki

Re: help me to find the error

2009-07-10 Thread Steven D'Aprano
On Fri, 10 Jul 2009 11:57:21 -0400, Dave Angel wrote: [...] > Please don' t top-post. Putting your reply out of order makes it harder > for others to see the sequences of things. Some people top-post > everything, but on this mailing list (and maybe most), the standard is > to add to bottom, or

Re: Remoting over SSH

2009-07-10 Thread M.-A. Lemburg
Lucas Carvalho wrote: > Hussein B wrote: >> Hey, >> I want to perform commands on a remote server over SSH. >> What do I need? >> Thanks. >> > Hi, > If you want to use the SSH2 protocol into a python code, you should > take a look at this module: paramiko [1]. > > [1] http://www.lag.net/paramik

Re: DBI module deprecated at Python 2.5--what to use in its place?

2009-07-10 Thread M.-A. Lemburg
dana wrote: > I have a variety of Python 2.4 scripts that utilitize the DBI and ODBC > modules together. Although I don't have Python 2.5, I've been informed > the DBI module has been deprecated at 2.5. A few questions: > > 1) Although deprecated, will it work at all in 2.5? Does the fact that > i

Re: problem with keys combination!

2009-07-10 Thread Steven D'Aprano
On Fri, 10 Jul 2009 08:33:18 -0700, Alex wrote: > Hi at all, > I made a simple program that make a screenshot of Desktop and use it > as fullscreen background and then a ball erase image making illusion > that erase Desktop. The program working fine and I succesfully blocked > all keys but I hav

Automate rsync w/ authentication

2009-07-10 Thread Bryan
I am trying to automate rsync to backup server A from server B. I have set up a private/public key between the two servers so I don't have to enter a password when using rsync. Running rsync manually with the following command works fine: rsync -av --dry-run -e "/usr/bin/ssh -i /home/bry/keys/bry

Re: tough-to-explain Python

2009-07-10 Thread D'Arcy J.M. Cain
On 10 Jul 2009 15:48:47 GMT Steven D'Aprano wrote: > I meant the instant coffee powder is prepared in advance. It's useless on > it's own, but later on you feed it into boiling water, add sugar and > milk, and it's slightly less useless. I don't know about that. I find instant coffee pretty us

Re: help me to find the error

2009-07-10 Thread Dave Angel
jhinak sen wrote: hey, thanx a lot :) i got ur points .. and it really helps.. and please also tell me ... where i can get more basic and detail knowledge of python.. as i am beginners in this , i need more examples of python programmes so that i can understand better. also if you know of any g

Re: tough-to-explain Python

2009-07-10 Thread Steven D'Aprano
On Fri, 10 Jul 2009 08:28:29 -0700, Scott David Daniels wrote: > Steven D'Aprano wrote: >> Even *soup stock* fits the same profile as what Hendrik claims is >> almost unique to programming. On its own, soup stock is totally >> useless. But you make it, now, so you can you feed it into something >>

Threading.Condition problem

2009-07-10 Thread Gabriel Rossetti
Sorry if this appears twice, I sent it once with an attachment and it never arrived so maybe the attachment is posing problems. I inlined the code this time (at the bottom), thank you, Gabriel ## Original message Hello everyone, I wrote a

Re: Threading.Condition problem

2009-07-10 Thread Gabriel Rossetti
The previous msg w/ attached code is the wrong code, please use the code attached to this msg, thank you and sorry for this. Gabriel Gabriel Rossetti wrote: Hello everyone, I wrote a small example that listens for xmpp msgs in a thread. The main program calls a function that blocks (using C

Threading.Condition problem

2009-07-10 Thread Gabriel Rossetti
Hello everyone, I wrote a small example that listens for xmpp msgs in a thread. The main program calls a function that blocks (using Condition.wait) until a msg has been received and then returns the msg. When a msg arrives, it is put in a variable in the thread's object, it then calls the not

problem with keys combination!

2009-07-10 Thread Alex
Hi at all, I made a simple program that make a screenshot of Desktop and use it as fullscreen background and then a ball erase image making illusion that erase Desktop. The program working fine and I succesfully blocked all keys but I have a problem with hotkey combination Ctrl-Alt- Del...that by

Re: language analysis to enforce code standards

2009-07-10 Thread Aahz
In article , Jean-Michel Pichavant wrote: > >You could also verify there are at least N different characters used in >the sentence: > >N = 5 # must contains at least 5 different characters >record = [] >for c in s: >if c not in record: >record += [c] >if len(record) >= N: >print

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread Fran�ois Grondin
"David Bernier" a écrit dans le message de news: h36ki102...@news5.newsguy.com... > Musatov wrote: >> On Jul 9, 7:54 pm, David Bernier wrote: >>> Musatov wrote: Los Angeles (AP) --MeAmI.org now has users in 50 countries following its adopted use in Pakistan. The search engine has gr

Re: PyGtk Depends on Numeric

2009-07-10 Thread Aahz
In article <1ebe9314-9434-459a-bd3e-2b2386a35...@n11g2000yqb.googlegroups.com>, dieter wrote: > >Get with the times people and port to numpy. :P >Don't you think its about time? Are you trying to get something to happen or just posting a random drive-by? -- Aahz (a...@pythoncraft.com)

Re: Query regarding set([])?

2009-07-10 Thread Peter Otten
vox wrote: > On Jul 10, 4:17 pm, Dave Angel wrote: >> vox wrote: >> > On Jul 10, 2:04 pm, Peter Otten <__pete...@web.de> wrote: >> >> >> You are probably misinterpreting len(s3). s3 contains lines occuring >> >> in "file1" but not in "file2". Duplicate lines are only counted once, >> >> and the o

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Tim Rowe
2009/7/9 kj : > Thanks for the encouragement. [snip] > into code.  And by this I mean not only assumptions about the > correctness of their code (the typical scope of assertions), but > also, more broadly, assumptions about the data that they are dealing > with (which often comes from external s

Re: Query regarding set([])?

2009-07-10 Thread vox
On Jul 10, 4:17 pm, Dave Angel wrote: > vox wrote: > > On Jul 10, 2:04 pm, Peter Otten <__pete...@web.de> wrote: > > >> You are probably misinterpreting len(s3). s3 contains lines occuring in > >> "file1" but not in "file2". Duplicate lines are only counted once, and the > >> order doesn't matter.

Re: Where does setuptools live?

2009-07-10 Thread Chris Withers
Inky 788 wrote: Currently, distutils itself is being actively developed. More info about this here: http://tarekziade.wordpress.com/ My (albeit anonymous) advice is: use distutils. Manually download packages as-needed from PyPI and install manually using standard distutils. No thanks. I'm a bi

Re: Implementing a cache

2009-07-10 Thread Steven D'Aprano
On Fri, 10 Jul 2009 09:22:29 -0400, Nikolaus Rath wrote: > Hello, > > I want to implement a caching data structure in Python that allows me > to: > > 1. Quickly look up objects using a key 2. Keep track of the order in > which the objects are accessed (most > recently and least recently ac

Re: Query regarding set([])?

2009-07-10 Thread Dave Angel
vox wrote: On Jul 10, 2:04 pm, Peter Otten <__pete...@web.de> wrote: You are probably misinterpreting len(s3). s3 contains lines occuring in "file1" but not in "file2". Duplicate lines are only counted once, and the order doesn't matter. So there are 119 lines that occur at least once in "fi

  1   2   >