Re: use fileinput to read a specific line

2008-01-07 Thread jo3c
On Jan 8, 2:08 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > Given that the OP is talking 2000 files to be processed, I think I'd > > recommend explicit open() and close() calls to avoid having lots of I/O > > structures floating around... > > Good point. I didn't think of that. It could als

Re: Python setup not working on Windows XP

2008-01-07 Thread Tim Roberts
Gowri <[EMAIL PROTECTED]> wrote: > >I am new to Python and am trying to setup Apache to serve Python using >mod_python. I'm using a Windows XP box. here is a list of steps i >followed for the installation: > >1. Installed Apache 2.2.6 >2. Installed Python 2.5.1 >3. Installed mod_python 3.3.1 > >I t

Pet Store

2008-01-07 Thread George Maggessy
Hi there, I'm an experience Java developer trying to learn Python. I just finished the Python tutorial on python.org and I'm currently reading the "Learning Python" book. However, if I could find something like a simple web app with some best practices, such as those famous "Java Pet Store" apps,

web service between python and c#

2008-01-07 Thread abhishek
Hello group i need to make a web service to work between python and c# . Where python would server as backend (server) preferebly cherrypy (turbogears) and client would be on a c# appln. I have developed a webservice using TGWebServices package which runs on top of turbogears. but have no idea on

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
On Jan 7, 9:41 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 7 Jan 2008 20:10:58 -0800 (PST), "Russ P." > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > for file0 in files: > > > lnum = 0 # line number > > > for line in file(file0): > > lnum += 1

User Group

2008-01-07 Thread George Maggessy
Hi Guys, Is there a python user group in the bay area? Cheers, George -- http://mail.python.org/mailman/listinfo/python-list

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
> Given that the OP is talking 2000 files to be processed, I think I'd > recommend explicit open() and close() calls to avoid having lots of I/O > structures floating around... Good point. I didn't think of that. It could also be done as follows: for fileN in files: lnum = 0 # line

ctypes and 3rd party dll

2008-01-07 Thread hkimball
I am trying to call a function in a third party dll that spawns anr exe and I am using ctypes. Python does not complain at all but the other process does not get spawned. It appears that I am gaining access to the functions but with no results. Any ideas? Thanks in advance. >>> from ctypes imp

Re: any() and all() shorthand

2008-01-07 Thread castironpi
>print 'lookahead2(initial=3.14159, last=42)' >for this, next in lookahead2([1,2,3,4,5], >initial=3.14159, last=42): > print this, next No, actually. But my mistake. [ a.b() or _previous_ for a in c ] means 1 or 2 or 3 or 4 or 5 where c= [ 1, 2, 3, 4, 5]. The mistake: thi

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
On Jan 7, 7:15 pm, jo3c <[EMAIL PROTECTED]> wrote: > hi everybody > im a newbie in python > i need to read line 4 from a header file > using linecache will crash my computer due to memory loading, because > i am working on 2000 files each is 8mb > > fileinput don't load the file into memory first >

Re: linecache and glob

2008-01-07 Thread jo3c
On Jan 4, 5:25 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > jo3c wrote: > > i have a 2000 files with header and data > > i need to get the date information from the header > > then insert it into my database > > i am doing it in batch so i use glob.glob('/mydata/*/*/*.txt') > > to get the date on

Re: TIOBE declares Python as programming language of 2007!

2008-01-07 Thread Paddy
On Jan 7, 10:55 am, [EMAIL PROTECTED] wrote: > Seehttp://www.tiobe.com/index.htm?tiobe_index. > > Marc ohloh "Monthly Commits by Language" also shows Python open-source work being healthy: http://tinyurl.com/2wcadu If you remove C/C++ the other languages can be more easily compared. (C/C++ I see

use fileinput to read a specific line

2008-01-07 Thread jo3c
hi everybody im a newbie in python i need to read line 4 from a header file using linecache will crash my computer due to memory loading, because i am working on 2000 files each is 8mb fileinput don't load the file into memory first how do i use fileinput module to read a specific line from a file

Python Help

2008-01-07 Thread Donald Bozeman
To all, Just requesting Python Help - currently taking online courses for Computer Science degree. Is anyone willing to help on some issues. Please let me know, thank you. Donald Bozeman -- http://mail.python.org/mailman/listinfo/python-list

windows service

2008-01-07 Thread Michael Chesterton
I'm trying to get a program that uses M2Crypto ThreadingSSLServer to run in windows as a service. I have a few problem, it doesn't listen on its port and I don't know how to debug it. I used the pipeservice example as a framework to get it running as a service def SvcDoRun(self):

Re: I'm searching for Python style guidelines

2008-01-07 Thread ajaksu
On Jan 7, 11:25 am, [EMAIL PROTECTED] wrote: > There's a lot of dumb stuff out there. "Algorithms should be coded > efficiently ..." Thanks, I'll keep that in mind. > > van Rossum's guidelines tend toward "pick something and stick to it" > which is OK if you have enough experience to pick something

Open a List of Files

2008-01-07 Thread BJ Swope
given a list such as ['messages', 'recipients', 'viruses'] how would I iterate over the list and use the values as variables and open the variable names a files? I tried for outfile in ['messages', 'recipients', 'viruses']: filename = os.path.join(Host_Path, outfile) outfile = open(file

Re: code doesn't reference immutables?

2008-01-07 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | >From the manual: | | "code objects are immutable and contain no references (directly or | indirectly) to mutable objects" (3.2) | | I thought my code worked with both mutable and immutable objects. | Whassup? Consider the following:

Re: Python's great, in a word

2008-01-07 Thread jo3c
On Jan 7, 9:09 pm, [EMAIL PROTECTED] wrote: > I'm a Java guy who's been doing Python for a month now and I'm > convinced that > > 1) a multi-paradigm language is inherently better than a mono-paradigm > language > > 2) Python writes like a talented figure skater skates. > > Would you Python old-tim

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread [EMAIL PROTECTED]
On Jan 7, 5:10 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > On Jan 7, 2:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > > > Can anyone point me to a downloadable open source English dictionary > > > suitable for programma

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Martin v. Löwis
> Tk itself has a stubs mechanism that allows libraries compiled against > earlier versions to be used with later versions. It's different than > Python in this respect. A pure-Tk library (such as Img or TkPNG) built > against Tk 8.4 would not require re-compilation to be used with 8.5. > Since PIL

Re: How to refer to the current module?

2008-01-07 Thread Stargaming
On Mon, 07 Jan 2008 05:21:42 -0800, Mike wrote: > I want to do something like the following (let's pretend that this is in > file 'driver.py'): > > #!/bin/env python > > import sys > > def foo(): > print 'foo' > > def bar(arg): > print 'bar with %r' % arg > > def main(): > getattr

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
Kevin Walzer wrote: > > Tk itself has a stubs mechanism that allows libraries compiled against > earlier versions to be used with later versions. It's different than > Python in this respect. A pure-Tk library (such as Img or TkPNG) built > against Tk 8.4 would not require re-compilation to be

Re: Python's great, in a word

2008-01-07 Thread MRAB
On Jan 7, 5:40 pm, Martin Marcher <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > The best thing about Python is ___. > > it's pythonicness. > I think it sounds better as "its pythonicity". -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's great, in a word

2008-01-07 Thread Carl Banks
On Jan 7, 8:09 am, [EMAIL PROTECTED] wrote: > I'm a Java guy who's been doing Python for a month now and I'm > convinced that > > 1) a multi-paradigm language is inherently better than a mono-paradigm > language > > 2) Python writes like a talented figure skater skates. > > Would you Python old-tim

Modules and descriptors

2008-01-07 Thread Chris Leary
As I understand it, the appeal of properties (and descriptors in general) in new-style classes is that they provide a way to "intercept" direct attribute accesses. This lets us write more clear and concise code that accesses members directly without fear of future API changes. I love this feature

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread Paul McGuire
On Jan 7, 5:10 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > Sorry for my ignorance: I can query an Access DB w/ standard SQL > queries (and this is how I would access it w/ Python)? > > DG If you are running on a Mac, just use sqlite, it's built-in to Python as of v2.5 and you will find more h

Re: Python's great, in a word

2008-01-07 Thread Joe Riopel
On Jan 7, 2008 8:09 AM, <[EMAIL PROTECTED]> wrote: > The best thing about Python is ___. it's mailing list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
Martin v. Löwis wrote: > OTOH, it's more likely that the PIL binaries you are using conflict with > your Tk installation - if the binaries were for Tk 8.4 (which isn't > quite clear to me whether that's indeed the case), then they can't work > with Tk 8.5, as Tk doesn't provide that kind of binary

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread dgoldsmith_89
On Jan 7, 2:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > > Can anyone point me to a downloadable open source English dictionary > > suitable for programmatic use with python: I'm programming a puzzle > > generator, and I nee

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread dgoldsmith_89
On Jan 7, 2:47 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > dgoldsmith_89 wrote: > > Can anyone point me to a downloadable open source English dictionary > > suitable for programmatic use with python: I'm programming a puzzle > > generator, and I need to be able to generate more or less complete

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Martin v. Löwis
> Since Python itself is the same version number (2.5.1), the only thing I > can find to account for the crash is the different version of Tk--could > this be making a difference, or am I doing something wrong? Yes, Tk 8.5 isn't quite compatible with existing Tkinter code; there have been a lot of

Re: What is the encoding of __file__?

2008-01-07 Thread Martin v. Löwis
> Thanks, I'll then use sys.getfilesystemencoding() to decode _file__ > and re-encode into utf-8, which is the default encoding of all strings > in our software, as we deal a bit with Chinese terms. > > Windows-1252 on my box. I just created a directory containing Chinese > characters (on Vista),

Re: Tkinter variable trace problem

2008-01-07 Thread Fredrik Lundh
C Martin wrote: > What am I doing wrong in this code? The callback doesn't work from the Entry > widget. > > ##start code > import Tkinter > > tk = Tkinter.Tk() > var = Tkinter.StringVar() > print var._name > > def cb(name, index, mode): > print "callback called with name=%r, index=%r, mod

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread [EMAIL PROTECTED]
On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > Can anyone point me to a downloadable open source English dictionary > suitable for programmatic use with python: I'm programming a puzzle > generator, and I need to be able to generate more or less complete > lists of English words, alp

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread dgoldsmith_89
On Jan 7, 2:46 pm, Rick Dooling <[EMAIL PROTECTED]> wrote: > On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > > Can anyone point me to a downloadable open source English dictionary > > suitable for programmatic use with python: I'm programming a puzzle > > generator, and I need to be

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread Rick Dooling
On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > Can anyone point me to a downloadable open source English dictionary > suitable for programmatic use with python: I'm programming a puzzle > generator, and I need to be able to generate more or less complete > lists of English words, alp

Re: Open source English dictionary to use programmatically w/ python

2008-01-07 Thread Fredrik Lundh
dgoldsmith_89 wrote: > Can anyone point me to a downloadable open source English dictionary > suitable for programmatic use with python: I'm programming a puzzle > generator, and I need to be able to generate more or less complete > lists of English words, alphabetized. Thanks! DG here's one:

Open source English dictionary to use programmatically w/ python

2008-01-07 Thread dgoldsmith_89
Can anyone point me to a downloadable open source English dictionary suitable for programmatic use with python: I'm programming a puzzle generator, and I need to be able to generate more or less complete lists of English words, alphabetized. Thanks! DG -- http://mail.python.org/mailman/listinfo/

Re: What is the encoding of __file__?

2008-01-07 Thread anne . nospam01
On 7 Jan., 23:06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > can someone quickly tell me what the encoding of __file__ is? I can't > > find it in the documentation. > > > BTW, I'm using Python 2.5.1 on WIndows XP and Vista. > > It's platform-specific - the same encoding that is used for file

Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
I'm using a build of Python 2.5.1 on OS X 10.5.1 that links to Tk 8.5. Trying to test PIL with this new build, Python barfs when trying to display an image in a Tkinter Label. Here is my sample code: --- from Tkinter import * import Image, ImageTk root = Tk() im = Image.open('/Users/kevin/Desk

Tkinter variable trace problem

2008-01-07 Thread C Martin
What am I doing wrong in this code? The callback doesn't work from the Entry widget. ##start code import Tkinter tk = Tkinter.Tk() var = Tkinter.StringVar() print var._name def cb(name, index, mode): print "callback called with name=%r, index=%r, mode=%r" % (name, index, mode) varValue =

Re: What is the encoding of __file__?

2008-01-07 Thread Martin v. Löwis
> can someone quickly tell me what the encoding of __file__ is? I can't > find it in the documentation. > > BTW, I'm using Python 2.5.1 on WIndows XP and Vista. It's platform-specific - the same encoding that is used for file names (i.e. sys.getfilesystemencoding()). On Windows, it will be "mbcs"

What is the encoding of __file__?

2008-01-07 Thread anne . nospam01
Dear all, can someone quickly tell me what the encoding of __file__ is? I can't find it in the documentation. BTW, I'm using Python 2.5.1 on WIndows XP and Vista. Kind regards, Sebastian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's great, in a word

2008-01-07 Thread James Matthews
Just Another Vague Acronym = (Java) On Jan 7, 2008 10:32 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > > The best thing about Python is ___. > > The best thing about Python is its elegance. > > -- > \"Like the creators of sitcoms or junk food or package to

Re: Python's great, in a word

2008-01-07 Thread Ben Finney
[EMAIL PROTECTED] writes: > The best thing about Python is ___. The best thing about Python is its elegance. -- \"Like the creators of sitcoms or junk food or package tours, | `\ Java's designers were consciously designing a product for | _o__)people n

Re: Does Python cache the startup module?

2008-01-07 Thread Baz Walter
John Machin lexicon.net> writes: > If you execute that stuff inside a function (see below) instead of in > global scope, do you get the same effect? Thanks for your reply. No, running it inside a function means I can't rely on python to garbage collect, so there will be widgets left over whethe

Re: Does Python cache the startup module?

2008-01-07 Thread Baz Walter
Fredrik Lundh pythonware.com> writes: > So what you're concerned about is the lack of cleanup during interpreter > shutdown, not a true leak (which would result in "Max widgets" growing > towards infinity). Yes, sorry about my sloppy terminology. > The problem here is that you're relying on Py

Re: Python's great, in a word

2008-01-07 Thread Stefan Behnel
Henry Chang wrote: > On Jan 7, 2008 5:41 AM, alain <[EMAIL PROTECTED]> wrote: >> Paraphrasing Steve Jobs but in this context: >> PYTHON = a bycycle for the mind > What exactly does it mean "a bycycle for the mind"?? Ask the Dutch guy near you. Stefan -- http://mail.python.org/mailman/listinfo/py

Re: Python's great, in a word

2008-01-07 Thread Pablo Ziliani
Dustan wrote: > On Jan 7, 11:40 am, Martin Marcher <[EMAIL PROTECTED]> wrote: > >> it's pythonicness. >> > > "it is pythonicness"??? > Obviously a typo, for "It is pythonic, Ness". A reference to the well-known Loch Ness Monster, definitely pythonic if you see some pictures: http://ima

Re: Python's great, in a word

2008-01-07 Thread Martin Marcher
On Monday 07 January 2008 21:25 Dustan wrote: > On Jan 7, 11:40 am, Martin Marcher <[EMAIL PROTECTED]> wrote: >> it's pythonicness. > > "it is pythonicness"??? not all here are native english speakers, but thanks for the correction. I'll try to keep it in mind. -- http://noneisyours.marcher.na

Re: Killing worker threads

2008-01-07 Thread Ruediger
maybe following recipe from activestate may be usefull. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496960 http://sebulba.wikispaces.com/recipe+thread2 -- http://mail.python.org/mailman/listinfo/python-list

Re: TIOBE declares Python as programming language of 2007!

2008-01-07 Thread Richard Jones
Berco Beute wrote: > What I would like to know is what it was that boosted Python's > popularity in 2004 (see http://www.tiobe.com/tiobe_index/Python.html). > Equally interesting is the question why it dropped shortly after. They explain the discontinuity on the index page in the FAQ. Richar

Tutorials at PyCon 2008 (US)

2008-01-07 Thread Greg Lindstrom
Hello Everyone- I'd like to announce the tutorials sessions for PyCon 2008 (US). As you may know, this year PyCon is being held in Chicago, Illinois March 14-16 with the Thursday before (the 13th) being "Tutorial Thursday". We are expecting nearly 600 Python enthusiasts to meet up for the confer

Re: any() and all() shorthand

2008-01-07 Thread Tim Chase
> The idea is a shorthand for reduce. Here, _next_ meant the next item > in the iterable c. You mean like one of these: def lookahead(iterator): i = iter(iterator) x = i.next() for item in i: yield x, item x = item def lookahead2(iterator, **kwarg): i = i

Re: any() and all() shorthand

2008-01-07 Thread castironpi
On Jan 7, 1:45 pm, [EMAIL PROTECTED] wrote: > On Jan 7, 1:29 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > The idea is a shorthand for reduce. Here, _next_ meant the next item > in the iterable c. 'Only' is another known quantifier in logic: 'all and only'. Any (there exists) and all (for

Re: Python's great, in a word

2008-01-07 Thread Dustan
On Jan 7, 11:40 am, Martin Marcher <[EMAIL PROTECTED]> wrote: > it's pythonicness. "it is pythonicness"??? -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python cache the startup module?

2008-01-07 Thread John Machin
On Jan 8, 6:21 am, Baz Walter <[EMAIL PROTECTED]> wrote: > Guilherme Polo gmail.com> writes: > > > Uhm.. this didn't make much sense. If you say the module is cached, > > then supposing you did a minor edit, and then supposing because it is > > cached your application wouldn't detect the change, t

Re: Does Python cache the startup module?

2008-01-07 Thread Fredrik Lundh
Baz Walter wrote: > Before changing the name 'mainwindow' to 'mainwidget' it reports: > > Widgets left: 0Max widgets: 2 > Widgets left: 0Max widgets: 149 (full program) > > Afterwards it reports: > > Widgets left: 1Max widgets: 2 > Widgets left: 146Max widgets: 149 (full program

Any interest in an SQS alternative???

2008-01-07 Thread cbmeeks
I'm a big fan of Amazon's SQS web services. However, I think their SQS is simply too expensive. I was doing some tests in python using SQS and created 1,513 messages in just a few minutes. Then I looked at my bill. It was $0.15 not counting the S3 fee. $0.15 seems like a lot to me for the appl

Re: TIOBE declares Python as programming language of 2007!

2008-01-07 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : > Berco Beute schrieb: > >> Cool! We knew it would happen one day :) >> What could be the reason? Python 3? Jython 2.2? Java's loss of >> sexiness? > > > I'd say Java was never sexy, but dressed up in expensive lingerie by > marketing maniacs... +2 QOTW > Diez -- h

Re: TIOBE declares Python as programming language of 2007!

2008-01-07 Thread ajaksu
On Jan 7, 9:53 am, Berco Beute <[EMAIL PROTECTED]> wrote: > Cool! We knew it would happen one day :) > What could be the reason? Python 3? Jython 2.2? Java's loss of > sexiness? > > What I would like to know is what it was that boosted Python's > popularity in 2004 (seehttp://www.tiobe.com/tiobe_in

Re: dictionary/hash and '1' versus 1

2008-01-07 Thread Paddy
On Jan 7, 7:26 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of Paddy > > Sent: Monday, January 07, 2008 12:52 PM > > To: [EMAIL PROTECTED] > > Subject: Re: dictionary/hash and '1' versus 1

Re: Does Python cache the startup module?

2008-01-07 Thread Baz Walter
Fredrik Lundh pythonware.com> writes: > > Baz Walter wrote: > > > It's hard to supply an example for this, since it is local to the machine I am > > using. The startup module would look something like this: > > would look, or does look? if it doesn't look like this, what else does > it con

Re: any() and all() shorthand

2008-01-07 Thread castironpi
On Jan 7, 1:29 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > > You are too late, any and all are built-in into python 2.5 > > > Hi, excellent. Now how about something more generic, possibly: > > > [ x.y() for x or _next_ in c ] > > > where

Re: Does Python cache the startup module?

2008-01-07 Thread Fredrik Lundh
Baz Walter wrote: > It's hard to supply an example for this, since it is local to the machine I > am > using. The startup module would look something like this: would look, or does look? if it doesn't look like this, what else does it contain? > #!/usr/local/bin/python > > if __name__ == '_

Re: any() and all() shorthand

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > You are too late, any and all are built-in into python 2.5 > > Hi, excellent. Now how about something more generic, possibly: > > [ x.y() for x or _next_ in c ] > > where the context of _next_ is limited in complexity, and/or can only > occur in

RE: dictionary/hash and '1' versus 1

2008-01-07 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Paddy > Sent: Monday, January 07, 2008 12:52 PM > To: python-list@python.org > Subject: Re: dictionary/hash and '1' versus 1 > > Or how using different operators for similar operations on differ

PostgreSQL Conference East: Call for Papers

2008-01-07 Thread [EMAIL PROTECTED]
PostgreSQL Conference East is being held on the weekend of March 29th and 30th, 2008 in College Park, Maryland. The conference will have a series of talks, mini-tutorials and tutorials and we are now accepting submissions! If you are a third pary vendor, PostgreSQL developer, PostgreSQL consultant

Re: Does Python cache the startup module?

2008-01-07 Thread Baz Walter
Guilherme Polo gmail.com> writes: > Uhm.. this didn't make much sense. If you say the module is cached, > then supposing you did a minor edit, and then supposing because it is > cached your application wouldn't detect the change, then I don't see > the connection with memory leak. > > Bring some

Re: Does Python cache the startup module?

2008-01-07 Thread kyosohma
On Jan 7, 12:30 pm, Baz Walter <[EMAIL PROTECTED]> wrote: > Hello > > I remember reading somewhere (probably this list) that python may cache the > module that starts a program (e.g. 'main.py'). I'm asking because I have found > that this can sometimes cause problems when making small edits to the

Re: any() and all() shorthand

2008-01-07 Thread castironpi
> You are too late, any and all are built-in into python 2.5 Hi, excellent. Now how about something more generic, possibly: [ x.y() for x or _next_ in c ] where the context of _next_ is limited in complexity, and/or can only occur in a generator? -- http://mail.python.org/mailman/listinfo/pyth

Re: any() and all() shorthand

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > any( iterab ) and all( iterab ) > > as shorthand for reduce( operator.or_, iterab ) and > reduce( operator.and_, iterab ). > > What do you think? > -- > http://mail.python.org/mailman/listinfo/python-list > You are too late, any and all are built-

Re: Does Python cache the startup module?

2008-01-07 Thread Guilherme Polo
2008/1/7, Baz Walter <[EMAIL PROTECTED]>: > Hello > > I remember reading somewhere (probably this list) that python may cache the > module that starts a program (e.g. 'main.py'). Something like mod_python will do caching. > I'm asking because I have found > that this can sometimes cause problems

any() and all() shorthand

2008-01-07 Thread castironpi
any( iterab ) and all( iterab ) as shorthand for reduce( operator.or_, iterab ) and reduce( operator.and_, iterab ). What do you think? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's great, in a word

2008-01-07 Thread George Sakkis
On Jan 7, 8:09 am, [EMAIL PROTECTED] wrote: > I'm a Java guy who's been doing Python for a month now and I'm > convinced that > > 1) a multi-paradigm language is inherently better than a mono-paradigm > language > > 2) Python writes like a talented figure skater skates. > > Would you Python old-ti

Does Python cache the startup module?

2008-01-07 Thread Baz Walter
Hello I remember reading somewhere (probably this list) that python may cache the module that starts a program (e.g. 'main.py'). I'm asking because I have found that this can sometimes cause problems when making small edits to the module. For instance, in my current module I changed the name of

Re: I'm searching for Python style guidelines

2008-01-07 Thread Paul McGuire
On Jan 7, 12:26 pm, [EMAIL PROTECTED] wrote: > Guilherme Polo wrote: > > foo = [ > >     'too long', > >     'too long too', > >     ... > >     ] > > OK, I'll put it there too, and it will be easy for us to read each > other's code (at least in this particular). While not required by any means, y

Re: I'm searching for Python style guidelines

2008-01-07 Thread MartinRinehart
Guilherme Polo wrote: > foo = [ > 'too long', > 'too long too', > ... > ] OK, I'll put it there too, and it will be easy for us to read each other's code (at least in this particular). -- http://mail.python.org/mailman/listinfo/python-list

Re: TIOBE declares Python as programming language of 2007!

2008-01-07 Thread George Sakkis
On Jan 7, 9:27 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On Jan 7, 12:53 pm, Berco Beute <[EMAIL PROTECTED]> wrote: > > > Cool! We knew it would happen one day :) > > What could be the reason? Python 3? Jython 2.2? Java's loss of > > sexiness? > > Python eats Perls lunch as a scripting languag

Re: Python's great, in a word

2008-01-07 Thread Paddy
On Jan 7, 1:09 pm, [EMAIL PROTECTED] wrote: > I'm a Java guy who's been doing Python for a month now and I'm > convinced that > > 1) a multi-paradigm language is inherently better than a mono-paradigm > language > > 2) Python writes like a talented figure skater skates. > > Would you Python old-tim

Re: dictionary/hash and '1' versus 1

2008-01-07 Thread Paddy
On Jan 7, 5:09 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > Bingo. Perl has specific operators to establish intent: > > Perl -e "'1' + 1" > > 2 > > Perl -e "'1' . 1" > > 11 > '+' is the operator for addition > '.' is the operator for string concatenation > >

Re: Python's great, in a word

2008-01-07 Thread Martin Marcher
[EMAIL PROTECTED] wrote: > The best thing about Python is ___. it's pythonicness. -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours You are not free to read this message, by doing so, you have violated my licence and are required to urinate publicly. Thank you. --

Re: Python's great, in a word

2008-01-07 Thread Henry Chang
What exactly does it mean "a bycycle for the mind"?? (assuming s/bycycle/bicycle) On Jan 7, 2008 5:41 AM, alain <[EMAIL PROTECTED]> wrote: > On Jan 7, 2:09pm, [EMAIL PROTECTED] wrote: > > I'm a Java guy who's been doing Python for a month now and I'm > > convinced that > > > > 1) a multi-paradigm

RE: dictionary/hash and '1' versus 1

2008-01-07 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Steven D'Aprano > Sent: Saturday, January 05, 2008 7:01 PM > To: python-list@python.org > Subject: Re: dictionary/hash and '1' versus 1 > > The problem with automatic conversions between strin

Re: dictionary/hash and '1' versus 1

2008-01-07 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >In Java you can add the number 1 to a string, and have it >automatically converted to string before the string join... What do >you think of that feature? "-%s" % 1 -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ "Frankly I have no feelings towards pe

Re: Killing worker threads

2008-01-07 Thread kyosohma
On Jan 6, 7:48 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > tarun wrote: > > Can anyone help me with a simple code through which the main thread can > > kill the worker thread it started. > > it cannot. threads cannot be killed from the "outside". > > The only way to "kill" a thread is to have

Re: python syntax

2008-01-07 Thread Fredrik Lundh
mpho raborife wrote: > Please help me get this syntax right: > > os.system("HCopy -T 1 -C" 'os.path.join(conf_dir, "/hcopy.conf")' "-S" > 'os.path.join(list_dir, "hcopy_list.txt")') instead of attempting to get your program working by random trial and error process, maybe you should spend an

Re: I'm searching for Python style guidelines

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Thank you both. > > Stupid me, went to Python.org and found Style Guidelines and thought > that was the last word. Oh well. > > PEP 8 reminds me a lot of Sun's Java conventions, in ways I wish it > didn't. The overall structure seems like a random

Re: I'm searching for Python style guidelines

2008-01-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Here's just one of my questions: > > foo = [ > 'some item, quite long', > 'more items, all demanding there own line as they are not short', > ... > > Where would you put the closing ']'? on a line by itself, indented as your favourite Python editor indents

Re: list property fires get on append

2008-01-07 Thread Soviut
On Jan 6, 11:36 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sun, 06 Jan 2008 00:31:13 -0800, Soviut wrote: > > I figured that an append would be treated as a set since I'm adding to > > the list. But what you say makes sense, although I can't say I'm happy > > with the behaviour. Is there any

Re: I'm searching for Python style guidelines

2008-01-07 Thread MartinRinehart
Thank you both. Stupid me, went to Python.org and found Style Guidelines and thought that was the last word. Oh well. PEP 8 reminds me a lot of Sun's Java conventions, in ways I wish it didn't. The overall structure seems like a random list of topics and it omits a lot. For Java I went from Sun t

PostgreSQL with Python

2008-01-07 Thread Sunil Ghai
I am looking for an E-Book or some tutorial in which a good explanation about PostgreSQL/MySQL database, then about interacting with them using Python is explained. I want to start RDBMS, i have no idea about them. I have been doing Python, willing to do some good project in RDBMS. Thanks in advanc

Re: dealing with binary files

2008-01-07 Thread Gerardo Herzig
Tom Brown wrote: >On Mon, 2008-01-07 at 11:57 -0200, Guilherme Polo wrote: > > >>2008/1/7, Gerardo Herzig <[EMAIL PROTECTED]>: >> >> >>>Hi all. Im trying to read a binary data from an postgres WAL archive. >>>If i make a >>>xfile = open('filename', 'rb').xreadlines() >>>line = xfile.next() >

Re: introspection question

2008-01-07 Thread Peter Otten
Alex K wrote: Please don't top-post. > On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: >> Alex K wrote: >> >> > What would be the simplest way of enumerating all methods and members >> > (including inherited) of a given object? Thank you. >> >> inspect.getmembers() > Nice thank you. But an

Re: introspection question

2008-01-07 Thread Guilherme Polo
2008/1/7, Alex K <[EMAIL PROTECTED]>: > Nice thank you. But anyway to make it look pretty? > pprint.pprint(inspect.getmembers(someobject)) > On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: > > Alex K wrote: > > > > > What would be the simplest way of enumerating all methods and members > >

Re: dealing with binary files

2008-01-07 Thread Tom Brown
On Mon, 2008-01-07 at 11:57 -0200, Guilherme Polo wrote: > 2008/1/7, Gerardo Herzig <[EMAIL PROTECTED]>: > > Hi all. Im trying to read a binary data from an postgres WAL archive. > > If i make a > > xfile = open('filename', 'rb').xreadlines() > > line = xfile.next() > > > > i see this sort of thing

ctypes

2008-01-07 Thread hkimball
I am trying to call a funtinon in a third party dll that spawns another exe and I am using ctypes. Python does not complain at all but the other process does not get spawned. It appears that I am gaining access to the functions but with no results. Any ideas? Thanks in advance. >>> from ctypes

Re: How to refer to the current module?

2008-01-07 Thread Christian Heimes
Mike wrote: > Is there any way around this? Can I somehow scope the 'current > module' and give getattr(...) an object that will (at run time) have > the appropriate bindings? globals() for the current name space import sys sys.modules[__name__] gets you the module object Christian -- http://

Re: introspection question

2008-01-07 Thread Alex K
Nice thank you. But anyway to make it look pretty? On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: > Alex K wrote: > > > What would be the simplest way of enumerating all methods and members > > (including inherited) of a given object? Thank you. > > inspect.getmembers() > > Peter > -- > htt

  1   2   >