Re: Python 3

2009-11-04 Thread Alf P. Steinbach
* Steven D'Aprano: On Thu, 05 Nov 2009 13:27:09 +1100, Ben Finney wrote: Steven D'Aprano writes: On Wed, 04 Nov 2009 23:08:54 +1100, Ben Finney wrote: Steven D'Aprano writes: Why would I want to use an already existing library that is fast, well- written and well-supported, when I can to

Re: Pyfora, a place for python

2009-11-04 Thread alex23
Daniel Fetchinson wrote: > Yes, this is about the right kind of response I think everybody > deserves who puts energy/enthusiasm/effort/time into putting together > a python-related forum. So what's the right kind of response deserved by those who put energy/ enthusiasm/effort/time into sustainin

Re: Python 3

2009-11-04 Thread Steven D'Aprano
On Thu, 05 Nov 2009 13:27:09 +1100, Ben Finney wrote: > Steven D'Aprano writes: > >> On Wed, 04 Nov 2009 23:08:54 +1100, Ben Finney wrote: >> >> > Steven D'Aprano writes: >> >> Why would I want to use an already existing library that is fast, >> >> well- written and well-supported, when I can t

Re: Tkinter callback arguments

2009-11-04 Thread Alf P. Steinbach
* Alf P. Steinbach: * Steven D'Aprano: On Wed, 04 Nov 2009 08:50:42 +0100, Alf P. Steinbach wrote: * Gabriel Genellina: I don't understand either. R1 and R2 have *different* semantics. Assume that they have the very exact same semantics Why would we assume that when you have explicitly t

Re: Python 3

2009-11-04 Thread Ben Finney
Steven D'Aprano writes: > On Wed, 04 Nov 2009 23:08:54 +1100, Ben Finney wrote: > > > Steven D'Aprano writes: > >> Why would I want to use an already existing library that is fast, > >> well- written and well-supported, when I can toss together a nasty > >> kludge myself? > > > > Because using

Re: Pyfora, a place for python

2009-11-04 Thread Ben Finney
Alan Franzoni writes: > That's right... forums, although more "accessible" to all the people > who can't/doesn't want to use specific email or nntp clients, are > quite slow to use. > > But I think Ubuntu forums support threads and are kind of "channeled" > between ML and webinterface... somethin

Re: Pyfora, a place for python

2009-11-04 Thread Ned Deily
In article , Alan Franzoni wrote: > On 11/2/09 3:44 PM, Diez B. Roggisch wrote: > > Being from germany, I can say that we *have* this fragmentation, and > > frankly: I don't like it. I prefer my communication via NNTP/ML, and not > > with those visually rather noisy and IMHO suboptimal forums. E

Re: multicast

2009-11-04 Thread Seb
Forgot the code... doh! :) #! /usr/bin/env python import socket import time class MulticastSender(object): def __init__(self, MCAST_ADDR = "224.168.2.9", MCAST_PORT = 1600): self.MCAST_ADDR = MCAST_ADDR self.MCAST_PORT = MCAST_PORT ANY = "0

Re: Tkinter callback arguments

2009-11-04 Thread Alf P. Steinbach
* Steven D'Aprano: On Wed, 04 Nov 2009 08:50:42 +0100, Alf P. Steinbach wrote: * Gabriel Genellina: I don't understand either. R1 and R2 have *different* semantics. Assume that they have the very exact same semantics Why would we assume that when you have explicitly told us that they don'

Re: set pdb break condition based upon number of hits?

2009-11-04 Thread Diez B. Roggisch
Reckoner schrieb: Is it possible to set pdb break condition based upon number of hits? I mean something like (Pdb) break line_number (number_of_hits_for_this_breakpoint >10) any help appreciated. MY_GLOBAL_COUNTER = 0 MY_GLOBAL_COUNTER += 1 if MY_GLOBAL_COUNTER >= 10: import pdb; pdb.set

Re: module imports and st_mtime

2009-11-04 Thread Carl Banks
On Nov 4, 4:08 pm, tow wrote: > Does anyone have any ideas what might be going on, or where further to > look? I'm at a bit of a loss. Does Mac OS have a concept of process-local filesystem modification? I.e. when loading the library does it create a process-local copy of the file with an updated

Re: Tkinter callback arguments

2009-11-04 Thread Steven D'Aprano
On Wed, 04 Nov 2009 08:50:42 +0100, Alf P. Steinbach wrote: > * Gabriel Genellina: >> >> I don't understand either. R1 and R2 have *different* semantics. > > Assume that they have the very exact same semantics Why would we assume that when you have explicitly told us that they don't? You st

module imports and st_mtime

2009-11-04 Thread tow
I'm seeing a very strange effect which is confusing me - in brief, one python process appears to temporarily affect the os.stat results of another - perhaps someone can enlighten me. This is on Mac OS X Leopard, using the system python (2.5) The issue arises using Django. The default Django http

Re: How to test urllib|urllib2-using code?

2009-11-04 Thread Steven D'Aprano
On Wed, 04 Nov 2009 15:06:45 +0100, Lutz Horn wrote: > Hi, > > kj wrote: >> I want to write some tests for code that uses both urllib and urllib2. > > Take a look at the discussion under the title "How can one mock/stub > python module like urllib" at stackoverflow: > > http://stackoverflow.com

Python 3 [was Re: substituting list comprehensions for map()]

2009-11-04 Thread Steven D'Aprano
On Wed, 04 Nov 2009 23:08:54 +1100, Ben Finney wrote: > Steven D'Aprano writes: > >> On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: >> > from numpy import dot >> > >> > scalar = dot(vec1, vec2) >> >> Why would I want to use an already existing library that is fast, well- >> written and

Re: Using logging module for conditional nested logs

2009-11-04 Thread Reckoner
On Nov 4, 1:30 pm, Vinay Sajip wrote: > On Nov 4, 7:40 pm, Reckoner wrote: > > > > > I hope that made some sense. > > Not especially :-( > > Sorry I don't understand exactly what you mean, because I find your > terminology confusing. For example, "logger that is attached to foo2" > - loggers are

Re: restricted mode???

2009-11-04 Thread Martin v. Löwis
> I thought that restricted mode died ages ago. > > Any ideas what could be causing this? Restricted mode is still available, and activated whenever a frame's builtins directory is different from the interpreter's; see PyFrame_IsRestricted. Regards, Martin -- http://mail.python.org/mailman/list

Re: Pyfora, a place for python

2009-11-04 Thread Alan Franzoni
On 11/2/09 3:44 PM, Diez B. Roggisch wrote: > Being from germany, I can say that we *have* this fragmentation, and > frankly: I don't like it. I prefer my communication via NNTP/ML, and not > with those visually rather noisy and IMHO suboptimal forums. E.g. it That's right... forums, although more

Re: problem in installing wxwidgets for python.

2009-11-04 Thread Threader Slash
This additional links should come in hand: http://www.gossamer-threads.com/lists/python/python/785413?page=last http://www.daniweb.com/forums/thread235862.html# http://forum.amule.org/index.php?topic=11728.0 http://www.linuxquestions.org/questions/linux-software-2/problem-in-installing-wxwidgets..

Re: disable image loading to speed up webpage load

2009-11-04 Thread Irmen de Jong
On 4-11-2009 8:32, elca wrote: Diez B. Roggisch-2 wrote: Use urllib2. you can show me some more specific sample or demo? It's not even more than 1 click away in the Python standard lib documentation... how hard can it be? http://docs.python.org/library/urllib2.html#examples -irmen --

Re: python os.path.exists failure

2009-11-04 Thread Aahz
In article <9aaf6a31-a34e-454b-a8f0-e206ad9b7...@t2g2000yqn.googlegroups.com>, koranthala wrote: > >path = r'C:/"Program Files"/testfolder/2.3/test.txt' >if os.path.lexists(path): >print 'Path Exists' >else: >print 'No file found in path - %s' %path >print Popen(path, stdout=PIPE, shell=T

Re: Using logging module for conditional nested logs

2009-11-04 Thread Vinay Sajip
On Nov 4, 7:40 pm, Reckoner wrote: > > I hope that made some sense. Not especially :-( Sorry I don't understand exactly what you mean, because I find your terminology confusing. For example, "logger that is attached to foo2" - loggers are not attached to functions. "It responds to the 'root' log

Re: Tkinter callback arguments

2009-11-04 Thread Alf P. Steinbach
* Terry Reedy: Alf P. Steinbach wrote: However, the natural semantics is that various logical properties, such as left, top, right, bottom, width and height, can be varied independently. But they *CANNOT* be varied independently. A rectangle with side parallel to the axes has exactly 4 degr

Re: regexp help

2009-11-04 Thread Dave Angel
Simon Brunning wrote: 2009/11/4 Nadav Chernin : Thanks, but my question is how to write the regex. re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) works for me. How about: os.path.splitext(x)[1] in (".exe", ".dll", ".ocx", ".py"): DaveA -- http://mail.python.org/mailman/list

Using logging module for conditional nested logs

2009-11-04 Thread Reckoner
Hi, I am getting started with your logging module and I went through the tutorial and know-how to create a top-level 'root' logger with the appropriate handlers. I have a number of functions,say, def foo1() def foo2() ... foo1() # foo2 calls foo1 and I know how to connect each of these f

Re: comparing alternatives to py2exe

2009-11-04 Thread Jorge
Hi, in this discussion I read that we con create a bundle executable for our application, since I'm having troubles with create a exe due problems with kinterbasdb, can you show me tutorials for creating exe from bundle. thanks in advance. On Wed, Nov 4, 2009 at 11:21 AM, Vesa Köppä wrote: > iu

Re: Pyfora, a place for python

2009-11-04 Thread Terry Reedy
Valentina Boycheva wrote: I was following this discussion first with curiosity and then with increasing disbelief. > So stop following it. Really. As a scientist and a programmer, I always considered myself belonging to a group of people who are broad-minded and task-oriented. Ditto. I re

Re: How do I install dlls and exes for libtidy and others?

2009-11-04 Thread Kevin Ar18
Lme clarify my problems. My earlier emails were pretty vague... so this should help. Problem: I have been wanting to try out many libraries that use Python to C/C++ app bindings. This means I install the Python library using easy_install and then install the pre-compiled Windows binaries and

Re: import from a string

2009-11-04 Thread Terry Reedy
Gabriel Genellina wrote: En Wed, 04 Nov 2009 02:45:23 -0300, iu2 escribió: On Nov 4, 3:10 am, "Gabriel Genellina" wrote: txt = """ def foo(x): print 'x=', x def bar(x): return x + x """ py> namespace = {} py> exec txt in namespace py> namespace.keys() ['__builtins__', 'foo', 'bar']

Re: Tkinter callback arguments

2009-11-04 Thread Terry Reedy
Alf P. Steinbach wrote: However, the natural semantics is that various logical properties, such as left, top, right, bottom, width and height, can be varied independently. But they *CANNOT* be varied independently. A rectangle with side parallel to the axes has exactly 4 degress of freedom, n

Re: a is b

2009-11-04 Thread Chris Rebert
On Wed, Nov 4, 2009 at 10:37 AM, Sebastian wrote: > I have a question from the pyar  list that may have been discussed on this > list, but i didn't catch it. > Have some common objects been somewhat hardcoded into python, like some > integers as shown in the examples below? What other object have

a is b

2009-11-04 Thread Sebastian
I have a question from the pyar list that may have been discussed on this list, but i didn't catch it. Have some common objects been somewhat hardcoded into python, like some integers as shown in the examples below? What other object have been hardcoded (strings ,etc) and what was the criteria use

[ANN] Pyjamas 0.7pre1 Web Widget Set and python-to-javascript Compiler released

2009-11-04 Thread Luke Kenneth Casson Leighton
Current Release: 0.7~pre1 --- This is a 0.7 prerelease of Pyjamas, to invite users to help test the latest version. The latest svn is regularly but informally tested against the regression tests and the examples, and used in production, but not extensively tested against all known bro

Re: About one class/function per module

2009-11-04 Thread Jean-Michel Pichavant
Peng Yu wrote: With some automated script, I don't think it is a nightmare to change function names. I can change function names and filenames and their reference with a simple command. I'd think that this is the limitation of current version control system. I don't aware of any version control

How do I install dlls and exes for libtidy and others?

2009-11-04 Thread Kevin Ar18
1. I already asked how to setup libxml2 and libxslt, but nobody answered how to... so if anyone knows I'm still having those problems. 2. I now can't get libtidy to work, which requires the same thing: I need to put some dlls and exes somewhere to make it work in Python. Thing is, I don't k

Re: Request for comments - concurrent ssh client

2009-11-04 Thread MRAB
mk wrote: Hello everyone, Since I'm not happy with shmux or pssh, I wrote my own "concurrent ssh" program for parallel execution of SSH commands on multiple hosts. Before I release program to the wild, I would like to hear (constructive) comments on what may be wrong with the program and/or h

Re: unable to compile Python 2.6.4 on AIX using gcc

2009-11-04 Thread chuck
Thanks Mark. That was indeed very helpful. Here's the current status: === 1. applied changes suggested by Bob Atkins in that thread. 2. setting env variables. export OBJECT_MODE=64 export CC="gcc" export CFLAGS="-maix64 -mcpu=power5" export LDFLAGS="-maix64 -L/usr/lib64 -L/

Re: regexp help

2009-11-04 Thread Simon Brunning
2009/11/4 Nadav Chernin : > No, I need all files except exe|dll|ocx|py not re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) Now that wasn't so hard, was it? ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

RE: regexp help

2009-11-04 Thread Nadav Chernin
No, I need all files except exe|dll|ocx|py -Original Message- From: simon.brunn...@gmail.com [mailto:simon.brunn...@gmail.com] On Behalf Of Simon Brunning Sent: ד 04 נובמבר 2009 19:13 To: Nadav Chernin Cc: Python List Subject: Re: regexp help 2009/11/4 Nadav Chernin : > Thanks, but my qu

Re: regexp help

2009-11-04 Thread Carsten Haese
Nadav Chernin wrote: > Thanks, but my question is how to write the regex. See http://www.amk.ca/python/howto/regex/ . -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp help

2009-11-04 Thread Simon Brunning
2009/11/4 Nadav Chernin : > Thanks, but my question is how to write the regex. re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) works for me. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

RE: regexp help

2009-11-04 Thread Nadav Chernin
Thanks, but my question is how to write the regex. -Original Message- From: simon.brunn...@gmail.com [mailto:simon.brunn...@gmail.com] On Behalf Of Simon Brunning Sent: ד 04 נובמבר 2009 18:44 To: Nadav Chernin; Python List Subject: Re: regexp help 2009/11/4 Nadav Chernin : > I’m trying t

Re: Web development with Python 3.1

2009-11-04 Thread rustom
On Oct 30, 6:23 pm, Dotan Cohen wrote: > The point is that I want to use only _Python_ features, not > Django/Mako/whatever features. Pure python has a builtin templating system -- its called % See http://simonwillison.net/2003/Jul/28/simpleTemplates/ -- http://mail.python.org/mailman/listinf

Re: Pyfora, a place for python

2009-11-04 Thread Valentina Boycheva
>>Daniel Fetchinson writes: > >Probably this thread is going by far too far :) >Ben Finney [ben+pyt...@benfinney.id.au] writes: > Agreed. I was following this discussion first with curiosity and then with increasing disbelief. As a scientist and a programmer, I always considered myself belonging

Re: regexp help

2009-11-04 Thread Simon Brunning
2009/11/4 Nadav Chernin : > I’m trying to write regexp that find all files that are not with next > extensions:  exe|dll|ocx|py,  but can’t find any command that make it. http://code.activestate.com/recipes/499305/ should be a good start. Use the re module and your regex instead of fnmatch.filter(

Re: Calendar Problem

2009-11-04 Thread Carsten Haese
Victor Subervi wrote: > That's what I initially had. My server, that I am in > the process of leaving, rejected that syntax. What version of Python does that server use? The calendar.Calendar class first appeared in Python 2.5. I suspect your server is using an older version. -- Carsten Haese htt

regexp help

2009-11-04 Thread Nadav Chernin
Hello all, I'm trying to write regexp that find all files that are not with next extensions: exe|dll|ocx|py, but can't find any command that make it. Please, help me Nadav -- http://mail.python.org/mailman/listinfo/python-list

Re: About one class/function per module

2009-11-04 Thread Bruno Desthuilliers
Peng Yu a écrit : On Mon, Nov 2, 2009 at 3:03 AM, Bruno Desthuilliers wrote: Peng Yu a écrit : (snip) I prefer organized my code one class/function per file (i.e per module in python). I know the majority of programmers don't use this approach. Therefore, I'm wondering what its disadvantage is

Re: Calendar Problem

2009-11-04 Thread Victor Subervi
Well, you're right. That's what I initially had. My server, that I am in the process of leaving, rejected that syntax. Lovely. Thanks, V On Tue, Nov 3, 2009 at 6:56 PM, Dave Angel wrote: > > > MichaB Klich wrote: > >> Dnia wtorek 03 listopada 2009 o 20:50:10 Victor Subervi napisał(a): >> >> >>>

Re: About one class/function per module

2009-11-04 Thread Bruno Desthuilliers
Ben Finney a écrit : "Diez B. Roggisch" writes: Don't get me wrong - innovation often comes from scratching ones personal itch. But you seem to be suffering from a rather bad case of neurodermatitis. +1 QOTW Make it +2 QOTW !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: self.__dict__ tricks

2009-11-04 Thread Ethan Furman
Dennis Lee Bieber wrote: > Perfectly valid answer -- there are no fish as there is no > Atlantic sea Steven D'Aprano wrote: > Once in the distant past, there were no fish in what would become the > Atlantic Ocean (not sea) What's with the bias against the word 'sea'? sea –noun 1. the salt w

Re: Calling a method with a variable name

2009-11-04 Thread Simon Mullis
May I be the first to say "Doh!" Problem solved, many thanks to both Carsten and Diez! SM 2009/11/4 Carsten Haese : > Simon Mullis wrote: >> def main(): >>     stats_obj = Statistic() >>     name = re.sub("[^A-Za-z]", "", sys.argv[0]) >>     method = getattr(stats_obj, name, None) >>     if call

Re: how to remove the same words in the paragraph

2009-11-04 Thread Tim Chase
Can we use inp_paragraph.count(iter_word) to make it simple ? It would work, but the performance will drop off sharply as the length of the paragraph grows, and you'd still have to keep track of which words you already printed so you can correctly print the first one. So you might as well

Re: Calling a method with a variable name

2009-11-04 Thread Carsten Haese
Simon Mullis wrote: > def main(): > stats_obj = Statistic() > name = re.sub("[^A-Za-z]", "", sys.argv[0]) > method = getattr(stats_obj, name, None) > if callable(method): > stats_obj.name() # else: > print "nope, not sure what yo

Re: C api and exception handling

2009-11-04 Thread lallous
Thanks for your help Carl as usual. Will go with the getattr override method which is cleaner as you explained. Regards, Elias "Carl Banks" wrote in message news:f02c069c-e536-4c6b-b114-2215aa611...@k17g2000yqh.googlegroups.com... On Nov 2, 7:16 am, "lallous" wrote: Hello, Is there is a w

Re: Calling a method with a variable name

2009-11-04 Thread Diez B. Roggisch
Simon Mullis wrote: > Hi All, > > I'm collating a bunch of my utility scripts into one, creating a > single script to which I will symbolic link multiple times. This way > I only have to write code for error checking, output-formatting etc a > single time. > > So, I have > > ~/bin/foo -> ~/C

Calling a method with a variable name

2009-11-04 Thread Simon Mullis
Hi All, I'm collating a bunch of my utility scripts into one, creating a single script to which I will symbolic link multiple times. This way I only have to write code for error checking, output-formatting etc a single time. So, I have ~/bin/foo -> ~/Code/python/mother_of_all_utility_scripts.

Re: Pyfora, a place for python

2009-11-04 Thread Ethan Furman
Daniel Fetchinson wrote: I was referring to this comment by Ben: "Suggestion: Please don't make efforts to fragment the community." This IMHO is hostile, because it presupposes that the mere goal of the OP is fragmenting the community It presupposes nothing of any goal. It describes a predict

Re: substituting list comprehensions for map()

2009-11-04 Thread J Kenneth King
Steven D'Aprano writes: > On Tue, 03 Nov 2009 10:22:28 -0500, J Kenneth King wrote: > >> However in this case the procedure by which we derive the value is not >> important or even interesting. It is much more succinct to think of the >> operation as a value and express it accordingly. There's

Request for comments - concurrent ssh client

2009-11-04 Thread mk
Hello everyone, Since I'm not happy with shmux or pssh, I wrote my own "concurrent ssh" program for parallel execution of SSH commands on multiple hosts. Before I release program to the wild, I would like to hear (constructive) comments on what may be wrong with the program and/or how to fix i

Re: How to test urllib|urllib2-using code?

2009-11-04 Thread Lutz Horn
Hi, kj wrote: > I want to write some tests for code that uses both urllib and > urllib2. Take a look at the discussion under the title "How can one mock/stub python module like urllib" at stackoverflow: http://stackoverflow.com/questions/295438/how-can-one-mock-stub-python-module-like-urllib Lu

Re: unittest & setup

2009-11-04 Thread Joe Riopel
On Tue, Nov 3, 2009 at 11:02 PM, Jonathan Haddad wrote: > I've got a class, in the constructor it loads a CSV file from disc.  I'd > like only 1 instance of the class to be instantiated.  However, when running > multiple unit tests, multiple instances of the class are created.  What's > the best w

Re: how to remove the same words in the paragraph

2009-11-04 Thread S.Selvam
On Wed, Nov 4, 2009 at 4:27 AM, Tim Chase wrote: > kylin wrote: > >> I need to remove the word if it appears in the paragraph twice. could >> some give me some clue or some useful function in the python. >> > > Sounds like homework. To fail your class, use this one: > > >>> p = "one two three fou

Re: Cast into custom type

2009-11-04 Thread Henning Bredel
Gabriel, thanks for your reply. See my comments below. On Tue, 03 Nov 2009 21:31:27 -0300, Gabriel Genellina wrote: > En Tue, 03 Nov 2009 09:07:01 -0300, Henning Bredel > escribió: >> On Tue, 03 Nov 2009 10:18:29 +, Steven D'Aprano wrote: > > Then forget about the code you read in that blo

Re: How do I install libxml2 and libxslt?

2009-11-04 Thread Stefan Behnel
Kevin Ar18, 02.11.2009 21:44: >> According to the lxml installation instructions you linked=2C >> the windows lxml binary is statically linked and you do not >> need to install the libraries separately. > > The install instructions say" "You need libxml2 and libxslt" and then links= > to where to

Re: elementtree XML() unicode

2009-11-04 Thread Stefan Behnel
John Machin, 04.11.2009 02:56: > On Nov 4, 12:14 pm, Kee Nethery wrote: >> The reason I am confused is that getResponse2 is classified as an >> "str" in the Komodo IDE. I want to make sure I don't lose the non- >> ASCII characters coming from the URL. > > str is all about 8-bit bytes. True in P

How to test urllib|urllib2-using code?

2009-11-04 Thread kj
I want to write some tests for code that uses both urllib and urllib2. I would like to be able to run these tests locally. Are there modules to facilitate the writing of such tests (e.g. for setting up a mock web server locally, etc.)? BTW, in the Perl world, one very easy way to learn how to

Re: Pyfora, a place for python

2009-11-04 Thread Dotan Cohen
> My personal preference would be a link in each sub-paragraph in the official > documentation to a wiki page devoted to that specific aspect of the Python > language. A place were users could augment the documentation by providing > sample code and by expanding out the documentation for those of u

python 3.1.1 and --libdir option broken.

2009-11-04 Thread Todd Lovette
I've been trying to install Python 3.1.1 into /usr/lib64 via the configure script option --libdir, but it is ignored and Python 3.1.1 is installed in /usr/lib. Has anyone ran into this problem and solved it? Looking at the Makefile is seems as thought /lib in hard coded into the file. Any sug

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
>>> Hi everyone, >>> >>> I am proud to announce the release of Pyfora (http://pyfora.org), an >>> online community of Python enthusiasts to supplement comp.lang.python >>> and #python. While the site is small right now, please feel free to >>> register and post any questions or tips you may have. >

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
I was referring to this comment by Ben: "Suggestion: Please don't make efforts to fragment the community." This IMHO is hostile, because it presupposes that the mere goal of the OP is fragmenting the community >>> >>>It presupposes nothing of any goal. It describes a predi

Re: Handling large datastore search

2009-11-04 Thread Dave Angel
(This reply was offline, but I forwarded parts so that others with Google App Engine experience might jump in) Ahmed Barakat wrote: but I was trying to make use of everything provided by App engine. On Wed, Nov 4, 2009 at 1:27 AM, Dave Angel wrote: Ahmed Barakat wrote: In

Re: problem in installing wxwidgets for python..

2009-11-04 Thread Ishwor Gurung
Hi, 2009/11/4 Jebagnana Das : > Hello friends, >   I've tried to install wxwidgets in my mandriva 2009 spring > for GUI interaction with python. In the installation instruction it said > that i need gtk+ library. So i downloaded GTK+. When i configured GTK+ i got > the message You

Re: substituting list comprehensions for map()

2009-11-04 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: > > from numpy import dot > > > > scalar = dot(vec1, vec2) > > Why would I want to use an already existing library that is fast, > well- written and well-supported, when I can toss together a nasty > kludge myself?

Re: substituting list comprehensions for map()

2009-11-04 Thread Tim Chase
Steven D'Aprano wrote: On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: Or use the appropriate libraries: from numpy import dot scalar = dot(vec1, vec2) Why would I want to use an already existing library that is fast, well- written and well-supported, when I can toss together a nasty

problem in installing wxwidgets for python..

2009-11-04 Thread Jebagnana Das
Hello friends, I've tried to install wxwidgets in my mandriva 2009 spring for GUI interaction with python. In the installation instruction it said that i need gtk+ library. So i downloaded GTK+. When i configured GTK+ i got the message checking for BASE_DEPENDENCIES... configure:

Re: comparing alternatives to py2exe

2009-11-04 Thread Vesa Köppä
iu2 wrote: Another thing that I think is of interest is whether the application support modifying the version and description of the exe (that is, on Windows, when you right-click on an application and choose 'properties' you view the version number and description of the application, it is a res

Re: unable to compile Python 2.6.4 on AIX using gcc

2009-11-04 Thread Mark Dickinson
On Nov 3, 10:40 pm, chuck wrote: > Hello -- I am trying to compile Python 2.6.4 on a Power 5 PC with AIX > 5.3.  Here are the settings: > > export OBJECT_MODE=64 > export AR="ar -X64" > export MAKE=/usr/bin/gmake > export CC="gcc" > export CFLAGS="-maix64 -O2 -g -mcpu=power5" > export LDFLAGS="-L/

Re: using csv dictreader in python

2009-11-04 Thread Johann Spies
On Wed, Nov 04, 2009 at 01:25:16PM +0530, Siva Subramanian wrote: > This only gets me the following output > > {'FieldName1': '4', 'FieldName2': '0.00', 'FieldName3': > '4001433', 'FieldName4': '759'} > > 1. How do i access the 4, 0.00, ... the values ? >>> a= {'FieldName1': '4', 'FieldName2':

restricted mode???

2009-11-04 Thread Robin Becker
A reportlab user running via mod_python+django (Python 2.5.2 and mod_python 3.3.1) reports a strange intermittent error involving failure to read files which are known to be present. After some debugging efforts we got this clearer error message File "/usr/lib/python2.5/site-packages/rep

Re: import bug

2009-11-04 Thread Mark Leander
On Oct 31, 5:12 pm, kj wrote: > I give up: what's the trick? (Of course, renaming ham/re.py is > hardly "the trick." It's rather Procrustes' Bed.) I realize that this is probably not the answer you were looking for, but: $ python -m ham.spam or ==> ./spammain.py <== import ham.spam $ python

Re: python compare and process a csv file

2009-11-04 Thread Peter Otten
Chris Rebert wrote: > On Tue, Nov 3, 2009 at 7:43 AM, Siva Subramanian > wrote: >> Hello all, >> >> I am new on this list and computer programming >> >> I have two distinct statistical files (both csv) >> >> 1. Report_2_5 – this is a report dump containing over a 10 million >> records and i

Re: Tkinter callback arguments

2009-11-04 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 04 Nov 2009 04:50:42 -0300, Alf P. Steinbach escribió: * Gabriel Genellina: I don't understand either. R1 and R2 have *different* semantics. Assume that they have the very exact same semantics -- like two TV sets that look the same and work the same except

Re: Tkinter callback arguments

2009-11-04 Thread Gabriel Genellina
En Wed, 04 Nov 2009 04:50:42 -0300, Alf P. Steinbach escribió: * Gabriel Genellina: I don't understand either. R1 and R2 have *different* semantics. Assume that they have the very exact same semantics -- like two TV sets that look the same and work the same except when you open 'em up

Re: python compare and process a csv file

2009-11-04 Thread Chris Rebert
On Tue, Nov 3, 2009 at 7:43 AM, Siva Subramanian wrote: > Hello all, > > I am new on this list and computer programming > > I have two distinct statistical files (both csv) > > 1.   Report_2_5 – this is a report dump containing over a 10 million > records and is different every day > > 2.

Re: How to print zero-padded floating point numbers in python 2.6.1

2009-11-04 Thread Chris Rebert
On Wed, Nov 4, 2009 at 12:04 AM, Lorenzo Di Gregorio wrote: > Hello, > > I thought that I could zero-pad a floating point number in 'print' by > inserting a zero after '%', but this does not work. > > I get: > > print '%2.2F' % 3.5 > 3.50 > print '%02.2F' % 3.5 > 3.50 > > How can I get print (in a

Re: Win XP: How to hide command window for sub processes?

2009-11-04 Thread Rüdiger Ranft
klausfpga schrieb: > On Oct 29, 11:25 am, Rüdiger Ranft <_r...@web.de> wrote: > Thanks Ruediger, > > I'll try that immediately tomorrow, when working again on a windows > host. > > Good to know, that the Python API supports this. > though this feature was not that easy to be found in the doc. W

Re: How to print zero-padded floating point numbers in python 2.6.1

2009-11-04 Thread Lutz Horn
Lorenzo Di Gregorio schrieb: > print '%2.2F' % 3.5 > 3.50 > print '%02.2F' % 3.5 > 3.50 > > How can I get print (in a simple way) to print 03.50? print '%05.2F' % 3.5 Lutz -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-04 Thread Steven D'Aprano
On Tue, 03 Nov 2009 02:11:59 -0800, Lorenzo Gatti wrote: > On Nov 1, 8:06 am, Saketh wrote: >> Hi everyone, >> >> I am proud to announce the release of Pyfora (http://pyfora.org), an >> online community of Python enthusiasts to supplement comp.lang.python >> and #python. While the site is small r

Re: self.__dict__ tricks

2009-11-04 Thread Ben Finney
Simon Brunning writes: > 2009/11/1 Steven D'Aprano : > > > > The only stupid question is the one you are afraid to ask. > > I was once asked, and I quote exactly, "are there any fish in the > Atlantic sea?" > > That's pretty stupid. ;-) Not at all. The person asking the question might be ignoran

Re: Pyfora, a place for python

2009-11-04 Thread Ben Finney
Daniel Fetchinson writes: > Probably this thread is going by far too far :) Agreed. -- \德不孤、必有鄰。 (The virtuous are not abandoned, they shall | `\ surely have neighbours.) —孔夫子 Confucius, 551 BCE – 479 BCE | _o__) |

Re: Pyfora, a place for python

2009-11-04 Thread Lorenzo Gatti
On Nov 3, 11:37 am, Steven D'Aprano wrote: > On Tue, 03 Nov 2009 02:11:59 -0800, Lorenzo Gatti wrote: [...] > Are you saying that now that comp.lang.python and stackoverflow exists, > there no more room in the world for any more Python forums? > > I think that's terrible. Although there is a high

python compare and process a csv file

2009-11-04 Thread Siva Subramanian
Hello all,   I am new on this list and computer programming   I have two distinct statistical files (both csv) 1.   Report_2_5 – this is a report dump containing over a 10 million records and is different every day 2.   Customer_id dump – this is a daily dump of customers who ha

Re: comparing alternatives to py2exe

2009-11-04 Thread Rüdiger Ranft
Maxim Khitrov schrieb: > 1. I don't think cx_freeze supports single exe. I haven't even been > able to get it to append the generated library.zip file to the > executable using documented options. Other things like .pyd files > always seem to be separate. At the same time, singe executables > gene

How to print zero-padded floating point numbers in python 2.6.1

2009-11-04 Thread Lorenzo Di Gregorio
Hello, I thought that I could zero-pad a floating point number in 'print' by inserting a zero after '%', but this does not work. I get: print '%2.2F' % 3.5 3.50 print '%02.2F' % 3.5 3.50 How can I get print (in a simple way) to print 03.50? Best Regards, Lorenzo -- http://mail.python.org/mail

using csv dictreader in python

2009-11-04 Thread Siva Subramanian
Hello all, I am now trying to access the csv file using dictreader. import csv r25 = csv.DictReader(open('Report_ 25', 'rb'), delimiter=',') rownum = 1 for row in r25: # Save header row. if rownum == 0: header = row else: colnum = 0 for col in row: This onl