[ANN] SciPy India 2010 Call for Presentations

2010-09-21 Thread Jarrod Millman
== SciPy 2010 Call for Papers == The second `SciPy India Conference http://scipy.in`_ will be held from December 13th to 18th, 2010 at `IIIT-Hyderabad http://www.iiit.ac.in/`_. At this conference, novel applications and breakthroughs made in the

Re: Grouping pairs - suggested tools

2010-09-21 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 21.09.2010 01:09: * Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups. An item will only be associated with a

Re: Grouping pairs - suggested tools

2010-09-21 Thread Ian Kelly
On Tue, Sep 21, 2010 at 12:19 AM, Alf P. Steinbach /Usenet alf.p.steinbach+use...@gmail.com alf.p.steinbach%2buse...@gmail.comwrote: Uhm, thinking about it (it must have been my unconscious mind doing the work, it just popped into my head), if you first sort each individual equivalence

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-21 Thread rantingrick
On Sep 20, 12:25 pm, Tim Harig user...@ilthio.net wrote: On 2010-09-20, Brian Victor homeusen...@brianhv.org wrote: Usernet users also have the right to use the X-No-Archive header field. Does the fact that *you* happen to search usenet archives make using this field immoral?  Shouldn't the

Re: Customising Tk widgets

2010-09-21 Thread rantingrick
On Sep 20, 6:44 pm, Peter peter.milli...@gmail.com wrote: I am using Windoze, I suspect the appearance attributes I am asking about here are platform dependent? not really. Using Tkinter, I would like to generate a Checkbutton that is filled in with a solid colour rather than a tick mark

Re: Overriding dict constructor

2010-09-21 Thread Duncan Booth
Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Mon, 20 Sep 2010 11:53:48 +, Duncan Booth wrote: I was going to suggest overriding items() (or iteritems() for Python 2.x), but while that is another hole that your values leak out it isn't the hole used by the dict

Re: Syntax highlighting [was Re: Too much code - slicing]

2010-09-21 Thread rantingrick
On Sep 20, 1:29 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: To my eyes, the feature of syntax highlighting that alone makes it worthwhile, its killer feature, is that I can set comments and docstrings to grey. When I'm scanning code, being able to slide my eyes over

Re: Too much code - slicing

2010-09-21 Thread Duncan Booth
Steven D'Aprano st...@remove-this-cybersource.com.au wrote: That's sheer and unadulterated nonsense. The fact is that Guido changed his mind about ternary if after discovering that the work-around true-clause and condition or false-clause is buggy -- it gives the wrong answer if

Re: This Is International Don’t-Squawk-Like-A-Parrot Day

2010-09-21 Thread Lawrence D'Oliveiro
Next we need an International Surfin’ Bird day, a day to go around and tell everybody that the bird bird bird, the bird is the word. (Yes, *that* FG episode was just on earlier.) -- http://mail.python.org/mailman/listinfo/python-list

Re: develop for Windows on GNU/Linux, using Python

2010-09-21 Thread Lawrence D'Oliveiro
In message mailman.889.1284921376.29448.python-l...@python.org, Kev Dwyer wrote: To be confident that your code is good you need to test it on a Windows box (we all test, right?). Preferably more than one. Test with Seven as well as Vista (yes, there are still some Vista users out there).

Re: Customising Tk widgets

2010-09-21 Thread Arndt Roger Schneider
Peter schrieb: I am using Windoze, I suspect the appearance attributes I am asking about here are platform dependent? Using Tkinter, I would like to generate a Checkbutton that is filled in with a solid colour rather than a tick mark when selected. tk = Tk()

Re: Down with tinyurl! (was Re: importing excel data into a pythonmatrix?)

2010-09-21 Thread Lawrence D'Oliveiro
In message mailman.957.1285039581.29448.python-l...@python.org, geremy condra wrote: ... a shocking number of people don't seem to realize that lmgtfy is a joke. I had a person a few months ago seriously thank me for giving them a link that did the typing for them. Tell them to tell all

Re: Down with tinyurl!

2010-09-21 Thread Lawrence D'Oliveiro
In message 87r5gn3ino@castleamber.com, John Bokma wrote: Well, X-Archive: No is even shorter ;-). X-No-Bananas: Yes -- http://mail.python.org/mailman/listinfo/python-list

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-21 Thread Lawrence D'Oliveiro
In message d9d95488-410d-4b67-bb4d-ab2ed950f...@h25g2000vba.googlegroups.com, rantingrick wrote: X No Archive should have never been allowed and should be removed immediately and forever. What is the point of posting when your words will be gone form memory in a short time? My words are for

Re: Grouping pairs - suggested tools

2010-09-21 Thread Arnaud Delobelle
On Sep 20, 10:42 pm, Astley Le Jasper astley.lejas...@gmail.com wrote: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups.  An item will only be associated with a single cluster.

Re: Down with tinyurl!

2010-09-21 Thread Lawrence D'Oliveiro
In message mailman.962.1285049888.29448.python-l...@python.org, Dennis Lee Bieber wrote: On Mon, 20 Sep 2010 20:12:01 -0500, John Bokma j...@castleamber.com declaimed the following in gmane.comp.python.general: I never saw the point of the whole X-No-Archive: Yes thing. What happens if I

Re: Down with tinyurl!

2010-09-21 Thread Lawrence D'Oliveiro
In message 87aanbx5lq@castleamber.com, John Bokma wrote: I never saw the point of the whole X-No-Archive: Yes thing. What happens if I quote such a message? It's archived, right? Where did they come from? Posting fragments, followed up-- Originals? No more. --

Newbie: plist control characters?

2010-09-21 Thread BobAalsma
I'm trying to modify a plist file. The modification works properly, but I'm having difficulties in finding the proper way to restore. The file contains HTML strings like $#226; and either this gets replaced by â (which I don't want) but the programme completes or the program fails when I try to

utf-8 coding sometimes it works, most of the time it don't work.

2010-09-21 Thread Stef Mientki
hello, I've a pyjamas application (python to javascript translator), that can be run (as pure python) in MSHTML (IE Com interface) . When running this python application from the command line ( or launched from another Python program), the wrong character encoding (probably windows-1252) is

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
Thanks for the feedback both. I'll have a look at these. One of the frustrating things I find about python is that there are so many modules. There have been times when I've spend ages doing something and then some has said, Oh yeah, there is a module for that. Anyway. Nearly finished. Cheers

Re: Grouping pairs - suggested tools

2010-09-21 Thread Arnaud Delobelle
On Sep 21, 7:19 am, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: * Alf P. Steinbach /Usenet, on 21.09.2010 01:09: * Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I

Re: Grouping pairs - suggested tools

2010-09-21 Thread Alf P. Steinbach /Usenet
* Arnaud Delobelle, on 21.09.2010 11:13: On Sep 21, 7:19 am, Alf P. Steinbach /Usenetalf.p.steinbach +use...@gmail.com wrote: * Alf P. Steinbach /Usenet, on 21.09.2010 01:09: * Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related

Re: Grouping pairs - suggested tools

2010-09-21 Thread Peter Otten
Astley Le Jasper wrote: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups. An item will only be associated with a single cluster. Before I started, I wondered if there was any

basic 2 player wordgame

2010-09-21 Thread Baba
Hi I am working on a simple wordgame exercise: 2 players form a word by alternating turns saying a letter, which is added on to the end of the word fragment. I am familiar with loops, iterations etc but i need a hint as to how to approach alternating turns when writing this code? exercise

Re: visual studio 2010 question

2010-09-21 Thread David Cournapeau
On Tue, Sep 21, 2010 at 5:54 AM, Diez B. Roggisch de...@web.de wrote: David Cournapeau courn...@gmail.com writes: On Mon, Sep 20, 2010 at 3:08 PM, Ralf Haring har...@preypacer.com wrote: After running into the error Setup script exited with error: Unable to find vcvarsall.bat when trying to

Re: socket.error: [Errno 98] Address already in use

2010-09-21 Thread Nobody
On Mon, 20 Sep 2010 12:00:41 +1200, Lawrence D'Oliveiro wrote: However, some clients choose their own source ports. E.g. rlogin/rsh use privileged (low-numbered) ports, and you can't get the kernel to choose a random privileged port for you. But nobody uses rlogin/rsh any more, They did

Re: os.path.normcase rationale?

2010-09-21 Thread Nobody
On Tue, 21 Sep 2010 10:12:27 +1000, Ben Finney wrote: Another is that filesystems don't have a standard way of determining whether they are case-sensitive. The operating system's driver for that particular filesystem knows, I'm not even sure that's true; with a networked filesytem, some parts

Re: Arrays and CTYPE

2010-09-21 Thread Nobody
On Mon, 20 Sep 2010 15:47:32 -0700, Glenn Pringle wrote: Ok. I ran into a problem here. I have been dabbling with Python and I thought that this would be a good exercise but I got stuck. I have a DLL and one of the functions(getState) in that DLL returns an array. If the DLL was written in

Python in Linux - barrier to Python 3.x

2010-09-21 Thread Ant
Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home computers, and find it far too much hassle to try to

Re: basic 2 player wordgame

2010-09-21 Thread Mel
Baba wrote: I am working on a simple wordgame exercise: 2 players form a word by alternating turns saying a letter, which is added on to the end of the word fragment. I am familiar with loops, iterations etc but i need a hint as to how to approach alternating turns when writing this code?

creating python daemon ?

2010-09-21 Thread vineet daniel
Hi I have succesfully created daemon with python script and as next step I am trying to give input to that python script daemon from Apache Logshere I have got stuck and I have even checked IRC python channel for solution. Apache is able to call the file but fails to execute it properly and I

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Peter Otten
Ant wrote: I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home computers, and find it far too much hassle to

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Philip Semanchuk
On Sep 21, 2010, at 8:29 AM, Ant wrote: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Philip Semanchuk
On Sep 21, 2010, at 8:29 AM, Ant wrote: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Ant ant...@gmail.com writes: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home computers, and find

Re: basic 2 player wordgame

2010-09-21 Thread bobicanprogram
On Sep 21, 6:25 am, Baba raoul...@gmail.com wrote: Hi I am working on a simple wordgame exercise: 2 players form a word by alternating turns saying a letter, which is added on to the end of the word fragment. I am familiar with loops, iterations etc but i need a hint as to how to approach

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Michele Simionato
On Sep 21, 2:29 pm, Ant ant...@gmail.com wrote: Hi all, I've just seen this:http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home

Re: Too much code - slicing

2010-09-21 Thread Antoon Pardon
On Tue, Sep 21, 2010 at 12:07:07AM +, Steven D'Aprano wrote: On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote: Not necessarily. Some of us have the impression that Guido deliberatly chose an ugly format for the ternary operator. If he did, then he must have changed his mind,

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread D'Arcy J.M. Cain
On Tue, 21 Sep 2010 15:23:42 +0200 de...@web.de (Diez B. Roggisch) wrote: So, in summary, I think if anything, Python should liberate itself from the reigns of distro package management, and fix whatever issues there are with setuptools (or distutils or pip or distribute or whatever the cool

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
Thanks all. I was playing around with this and came up with another solution using dictionaries (... comfort zone ...!!) Code from operator import itemgetter def group_stuff(data): group_dic = {} group_id = 0 for line in data: i = 0 for ref in line:

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread David Cournapeau
On Tue, Sep 21, 2010 at 10:23 PM, Diez B. Roggisch de...@web.de wrote: Ant ant...@gmail.com writes: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Neal Becker
Ant wrote: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and relatively recent Python convert), he has a very good point in this. I run Fedora 12 on my home computers, and find it far too much

Re: Grouping pairs - suggested tools

2010-09-21 Thread Peter Otten
Astley Le Jasper wrote: Thanks all. I was playing around with this and came up with another solution using dictionaries (... comfort zone ...!!) from operator import itemgetter def group_stuff(data): group_dic = {} group_id = 0 for line in data: i = 0

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
David Cournapeau courn...@gmail.com writes: On Tue, Sep 21, 2010 at 10:23 PM, Diez B. Roggisch de...@web.de wrote: Ant ant...@gmail.com writes: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html Whatever you think of Zed Shaw (author of the Mongrel Ruby server and

Python 2.6 bsddb

2010-09-21 Thread garyr
I recently installed ActivePython 2.6.6 and my programs that use anydbm or shelve generate import errors because bsddb is missing. I installed bsddb3 (bsddb3-5.0.0.win32-py2.6.exe) but that didn't change anything. What more do I need to do? --

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Antoine Pitrou
On Tue, 21 Sep 2010 17:59:27 +0200 de...@web.de (Diez B. Roggisch) wrote: The problems explained are simply outdated and crippled python versions. And to me, a python version installed that has not the distutils module is *crippled*. You can rationalize that as much as you want through

weird error with python 2.7 installer under windows 7

2010-09-21 Thread Robin Becker
A colleague gets this error while testing a bdist wininst installer under windows 7 professional. This is on the page where the Post install script output appears. In the upper part I see Postinstall script finished. Click the Finish button to exit the setup wizard. In the bottom panel

Re: Too much code - slicing

2010-09-21 Thread Andreas Waldenburger
On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks pavlovevide...@gmail.com wrote: On Sep 17, 1:01 pm, Andreas Waldenburger use...@geekmail.invalid wrote: On Thu, 16 Sep 2010 16:20:33 -0400 AK andrei@gmail.com wrote: I also like this construct that works, I think, since 2.6:

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread David Cournapeau
On Wed, Sep 22, 2010 at 12:59 AM, Diez B. Roggisch de...@web.de wrote: David Cournapeau courn...@gmail.com writes: On Tue, Sep 21, 2010 at 10:23 PM, Diez B. Roggisch de...@web.de wrote: Ant ant...@gmail.com writes: Hi all, I've just seen this: http://sheddingbikes.com/posts/1285063820.html

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Antoine Pitrou solip...@pitrou.net writes: On Tue, 21 Sep 2010 17:59:27 +0200 de...@web.de (Diez B. Roggisch) wrote: The problems explained are simply outdated and crippled python versions. And to me, a python version installed that has not the distutils module is *crippled*. You can

Re: creating python daemon ?

2010-09-21 Thread Diez B. Roggisch
vineet daniel vineetdan...@gmail.com writes: Hi I have succesfully created daemon with python script and as next step I am trying to give input to that python script daemon from Apache Logshere I have got stuck and I have even checked IRC python channel for solution. Apache is able to

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
David Cournapeau courn...@gmail.com writes: I don't deny them their experience. Do you deny the experience of other people with *other* needs? As I already said: I don't propose to ditch the package management. I'm all fine with a distro that carefully selects it's packages and dependencies.

Re: Python 2.6 bsddb

2010-09-21 Thread Sridhar Ratnakumar
On 2010-09-21, at 9:04 AM, garyr wrote: I recently installed ActivePython 2.6.6 and my programs that use anydbm or shelve generate import errors because bsddb is missing. I installed bsddb3 (bsddb3-5.0.0.win32-py2.6.exe) but that didn't change anything. What more do I need to do? You may

naming the main module in embedded Python

2010-09-21 Thread Tomasz Koziara
Hi I am embedding Python as an interpret in my code. Now, whenever my code or Python itself issues an error/warning message I am getting something like: File string, line 1, in module or __main__:46: RuntimeWarning: My warning message I am using PyRun_SimpleString to load part of the

Re: Down with tinyurl!

2010-09-21 Thread John Bokma
geremy condra debat...@gmail.com writes: It's a joke. Admittedly it's a bit pointed, but it's a joke nonetheless, and it does at least provide what I consider to be two valuable pieces of information: that you should have googled this before asking, and what you should have googled for. If I

Re: Down with tinyurl!

2010-09-21 Thread John Bokma
Steven D'Aprano steve-remove-t...@cybersource.com.au writes: I prefer the old fashioned version: Google Is Your Friend followed by a URL to the appropriate google's search results page. Or even more to the point: Did you bother to google for the answer first? Because the very first

Re: Down with tinyurl!

2010-09-21 Thread John Bokma
Dennis Lee Bieber wlfr...@ix.netcom.com writes: On 21 Sep 2010 05:01:45 GMT, Steven D'Aprano steve-remove-t...@cybersource.com.au declaimed the following in gmane.comp.python.general: Hey, that would be an *awesome* google bombing project... to get lmgtfy to come up as the first link for

Re: Down with tinyurl!

2010-09-21 Thread John Bokma
Dennis Lee Bieber wlfr...@ix.netcom.com writes: On Mon, 20 Sep 2010 20:12:01 -0500, John Bokma j...@castleamber.com declaimed the following in gmane.comp.python.general: I never saw the point of the whole X-No-Archive: Yes thing. What happens if I quote such a message? It's archived, right?

Re: Down with tinyurl!

2010-09-21 Thread John Bokma
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: In message 87aanbx5lq@castleamber.com, John Bokma wrote: I never saw the point of the whole X-No-Archive: Yes thing. What happens if I quote such a message? It's archived, right? Where did they come from? Posting fragments,

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Emile van Sebille
On 9/21/2010 5:29 AM Ant said... Is there a solution to this that anyone knows of? Has Zed jumped to conclusions? Have I? I'd say the error was in selecting something other that the lowest common subset of python functions when designing and writing a python version dependent Mongrel2.

Re: Down with tinyurl!

2010-09-21 Thread geremy condra
On Tue, Sep 21, 2010 at 10:53 AM, John Bokma j...@castleamber.com wrote: geremy condra debat...@gmail.com writes: It's a joke. Admittedly it's a bit pointed, but it's a joke nonetheless, and it does at least provide what I consider to be two valuable pieces of information: that you should

Re: creating python daemon ?

2010-09-21 Thread vineet daniel
On Sep 21, 9:47 pm, de...@web.de (Diez B. Roggisch) wrote: vineet daniel vineetdan...@gmail.com writes: Hi I have succesfully created daemon with python script and as next step I am trying to give input to that python script daemon from Apache Logshere I have got stuck and I have

Re: Down with tinyurl! (was Re: importing excel data into a pythonmatrix?)

2010-09-21 Thread Emile van Sebille
On 9/20/2010 7:55 PM Lawrence D'Oliveiro said... In messagemailman.955.1285036507.29448.python-l...@python.org, geremy condra wrote: Usually here that just means its a letmegooglethatforyou.com link, which I find more amusing than is probably healthy. Why hold back, I also use

polymorphic function question

2010-09-21 Thread joblack
Let's say I've got a function with def doesSomething(A='bla'): ... and I try to call it with a non existent variable with doesSomething(DoesNotExist) What will happen? Will it throw an exception or will it take the defautl value? -- http://mail.python.org/mailman/listinfo/python-list

Re: polymorphic function question

2010-09-21 Thread Gregor Horvath
Am Tue, 21 Sep 2010 11:35:14 -0700 (PDT) schrieb joblack tobias.ko...@gmail.com: Let's say I've got a function with def doesSomething(A='bla'): ... and I try to call it with a non existent variable with doesSomething(DoesNotExist) What will happen? Will it throw an exception or will

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Ned Deily
In article 87zkvbytnk@web.de, de...@web.de (Diez B. Roggisch) wrote: The point is that the distro doesn't care about the python eco system. Which is what I care about, and a lot of people who want to ship software. I don't think that is totally accurate or fair. There is regular

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
I think you have the same bug as Alf's code, you never merge existing groups. Have you tried Arnaud's counterexample? By the way, are ('a', 'b') and ('b', 'a') to be considered equivalent for your problem? Peter Hi Peter, Yes. I realise that this doesn't take into account existing

Re: develop for Windows on GNU/Linux, using Python

2010-09-21 Thread Brian Curtin
On Tue, Sep 21, 2010 at 03:36, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.889.1284921376.29448.python-l...@python.org, Kev Dwyer wrote: To be confident that your code is good you need to test it on a Windows box (we all test, right?). Preferably more

Re: Grouping pairs - suggested tools

2010-09-21 Thread Arnaud Delobelle
On 21 Sep, 11:13, Peter Otten __pete...@web.de wrote: [...] A straightforward implementation: $ cat group_edges.py def find_groups(edges):     lookup = {} # node -- group     groups = {} # id(group) -- group     for a, b in edges:                       if a in lookup:                    

Re: Combinations or Permutations

2010-09-21 Thread Raymond Hettinger
On Sep 20, 1:54 pm, Seth Leija fazzit...@gmail.com wrote: I need to know how to generate a list of combinations/permutations (can't remember which it is). Say I have a list of variables: [a,b,c,d,...,x,y,z] I am curious if there is an optimized way to generate this:

Re: basic 2 player wordgame

2010-09-21 Thread Baba
On Sep 21, 1:39 pm, Mel mwil...@the-wire.com wrote: Baba wrote: I am working on a simple wordgame exercise: 2 players form a word by alternating turns saying a letter, which is added on to the end of the word fragment. I am familiar with loops, iterations etc but i need a hint as to how

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Ant
On Sep 21, 2:04 pm, Philip Semanchuk phi...@semanchuk.com wrote: On Sep 21, 2010, at 8:29 AM, Ant wrote: Don't know about Python 3 on Fedora (I use a Mac), but distrowatch.org reports that Fedora has been using Python = 2.6 since Fedora 11 which was released in June of 2009. Yes you are

ncurses pad question

2010-09-21 Thread Mag Gam
I am having some trouble understanding how padding/windowing works for Python curses. According to this example on http://docs.python.org/howto/curses.html I see: pad = curses.newpad(100, 100) # These loops fill the pad with letters; this is # explained in the next section for y in range(0,

Subprocess does not return for longer-running process

2010-09-21 Thread Jason Friedman
Hello, The Popen call does not return if the underlying OS call runs longish, as the example below shows. Although, if the underlying OS call is merely sleep N it will return even after quite a long time. wikiu...@dvprwiki1:~ python --version Python 2.6.4 wikiu...@dvprwiki1:~ time

Re: naming the main module in embedded Python

2010-09-21 Thread Burton Samograd
Tomasz Koziara t.kozi...@civil.gla.ac.uk writes: I am embedding Python as an interpret in my code. Now, whenever my code or Python itself issues an error/warning message I am getting something like: File string, line 1, in module or __main__:46: RuntimeWarning: My warning message I am

how to get partition information of a hard disk with python

2010-09-21 Thread Hellmut Weber
Hi list, I'm looking for a possibility to access the partiton inforamtion of a hard disk of my computer from within a python program. Googling I found the module 'parted' but didn't see any possibility to get the desired information. Is there any reasonable documentation for the parted module?

lists and list item matches (ghost wodgame)

2010-09-21 Thread Baba
Hi query level: beginner as part of a learning exercise i have written code that: a) asks for a single letter input (assumption: only 1 letter wil be entered) b) adds that letter to list1 and then goes through list2 and checks: 1) if any item in list2 starts with list1 if False: break

Iterate through a single iterator from multiple places in a loop

2010-09-21 Thread python
Is there a pythonic way to loop through a single iterator from multiple places in a loop? Here's pseudo code for what I would like to do: for char in some_long_string: if char == some_char: for char in some_long_string: --- using same iterator as above # continue to pull

Re: how to get partition information of a hard disk with python

2010-09-21 Thread MRAB
On 21/09/2010 23:31, Hellmut Weber wrote: Hi list, I'm looking for a possibility to access the partiton inforamtion of a hard disk of my computer from within a python program. Googling I found the module 'parted' but didn't see any possibility to get the desired information. Is there any

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Ned Deily n...@acm.org writes: In article 87zkvbytnk@web.de, de...@web.de (Diez B. Roggisch) wrote: The point is that the distro doesn't care about the python eco system. Which is what I care about, and a lot of people who want to ship software. I don't think that is totally accurate

Re: creating python daemon ?

2010-09-21 Thread Ben Finney
vineet daniel vineetdan...@gmail.com writes: I'd appreciate if anybody could share the code that they used for daemon or used with Apache CustomLog directive. I don't know about using Apache's CustomLog, but the ‘python-daemon’ library is specifically intended for creating a well-behaved Unix

Re: Iterate through a single iterator from multiple places in a loop

2010-09-21 Thread MRAB
On 22/09/2010 00:10, pyt...@bdurham.com wrote: Is there a pythonic way to loop through a single iterator from multiple places in a loop? Here's pseudo code for what I would like to do: for char in some_long_string: if char == some_char: for char in some_long_string: --- using

Thank-you (Re: Iterate through a single iterator from multiple places in a loop)

2010-09-21 Thread python
MRAB, it = iter(some_long_string) embarrassed Well, that was easy! :) /embarrassed Thanks for your help. Malcolm - Original message - From: MRAB pyt...@mrabarnett.plus.com To: python-list@python.org Date: Wed, 22 Sep 2010 00:27:25 +0100 Subject: Re: Iterate through a single iterator

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Ned Deily
In article m28w2uvgal@web.de, de...@web.de (Diez B. Roggisch) wrote: Ned Deily n...@acm.org writes: In article 87zkvbytnk@web.de, de...@web.de (Diez B. Roggisch) wrote: The point is that the distro doesn't care about the python eco system. Which is what I care about, and a lot

Re: Subprocess does not return for longer-running process

2010-09-21 Thread Chris Rebert
On Tue, Sep 21, 2010 at 3:06 PM, Jason Friedman jsf80...@gmail.com wrote: Hello, The Popen call does not return if the underlying OS call runs longish, as the example below shows. snip wikiu...@dvprwiki1:~ time $HOME/scripts/subprocess_test.py /opt/confluence-cli-1.5.0/confluence.sh --action

Best way for rotating a matrix of data?

2010-09-21 Thread Raphaël Plasson
Hello, after some computations, I obtain a 2D matrix of data, in a numpy array. I can easily plot them using pyplot, and can easily extract either vertical or horizontal slices by plotting a row or a column of this matrix. I would like to be able to plot slices form this data array, but with an

Expanding a vector by replicating elements individually

2010-09-21 Thread gburde...@gmail.com
Given m=numpy.array([[1, 2, 3]]) I want to obtain array([[1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]]) One way I've found to do this is: numpy.reshape(numpy.tile(m,(4,1)),(12,1),'f').T Another way is: numpy.reshape(numpy.tile(m,(4,1)).flatten(1),(1,12)) Is there a simpler way to do this, without

[OT] apache customlog (was Re: creating python daemon ?)

2010-09-21 Thread Kushal Kumaran
On 9/21/10, vineet daniel vineetdan...@gmail.com wrote: Hi I have succesfully created daemon with python script and as next step I am trying to give input to that python script daemon from Apache Logshere I have got stuck and I have even checked IRC python channel for solution. Apache is

Re: Overriding dict constructor

2010-09-21 Thread Raymond Hettinger
[Steven D'Aprano] But if I try to create a regular dict from this, dict() doesn't call my __getitem__ method: dict(d) {0: ('a', 'extra_data'), 1: ('b', 'extra_data')} instead of {0: 'a', 1: 'b'} as I expected. How can I fix this? Try using dict(d.items()). Raymond --

[issue9910] Add Py_SetPath API for embeddint python

2010-09-21 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: When calling Py_Initialize() from an embedding application, there is currently no way for the application to override Python's initial settin g of sys.path. An elaborate mechanism in getpathp.c kicks in, guessing the path based

[issue9862] PIPE_BUF is invalid on AIX

2010-09-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Removing select.PIPE_BUF does not seem a good idea to me because this breaks compatibility. I suggest to simply set it to 512 on AIX. (An ideal solution would be to really determine the actual buffer size in ./configure; this is

[issue9887] distutil's build_scripts doesn't read utf-8 in all locales

2010-09-21 Thread Hagen Fürstenau
Hagen Fürstenau hfuerste...@gmx.net added the comment: Why does this matter? PEP 3120 specifies UTF-8 as the default source encoding. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9887

[issue2200] find_executable fails to find .bat files on win32

2010-09-21 Thread Lev Shamardin
Lev Shamardin shamar...@gmail.com added the comment: My use case was compiling PyQt4 resources and Qt Designer .ui files from setup script using pyrcc4 and pyuic4 commands. On windows pyrcc4 is actually a pyrcc4.bat file (at least it was at the time of the original bug submission - haven't

[issue8998] add crypto routines to stdlib

2010-09-21 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: If that text is deemed to be advertising by Eric Young and a court of law The license of a software product cannot affect software that is not even aware of that said product. (A patent, or a trademark can.) It governs the use of that

[issue8998] add crypto routines to stdlib

2010-09-21 Thread lorph
lorph lor...@gmail.com added the comment: The license of a software product cannot affect software that is not even aware of that said product. I never claimed that the clause triggered for all software in existence. We are talking about OpenSSL being bundled with Python where Python is

[issue9908] os.stat() fails on bytes paths under Windows 7

2010-09-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Has the patch been tested on WinXP to be sure it does not introduce a bug for this? No. Can you? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9908

[issue2200] find_executable fails to find .bat files on win32

2010-09-21 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: I believe I had problems with SCons and other .py scripts that are installed as executable .bat files on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2200

[issue2200] find_executable fails to find .bat files on win32

2010-09-21 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: Another use case for .bat files is adddin extra params for executable files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2200

[issue8998] add crypto routines to stdlib

2010-09-21 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I never claimed that the clause triggered for all software in existence. We are talking about OpenSSL being bundled with Python where Python is very much aware of OpenSSL. Provided the following 3 circumstances are met, the advertisement

[issue9862] PIPE_BUF is invalid on AIX

2010-09-21 Thread Sébastien Sablé
Sébastien Sablé sa...@users.sourceforge.net added the comment: OK for me. Here is a new patch that defines PIPE_BUF to 512 instead of removing select.PIPE_BUF. -- Added file: http://bugs.python.org/file18944/patch_broken_pipe_buf_updated.diff ___

  1   2   3   >