Re: Need help to learn Python

2007-03-22 Thread soarnil
On 3月23日, 下午1时03分, "PythonBiter" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm very new in this Group as well Python language. I want to learn > Python. So could you please advice me, and guide me how can i become > master in Python ! > > Thanks, > Partha Programming Python 3ed Edition is a gr

Re: Idiom for running compiled python scripts?

2007-03-22 Thread Mark
On Fri, 23 Mar 2007 14:03:12 +1100, Steven D'Aprano wrote: > Since you've done these tests already, perhaps you can tell us what gain > you actually got? About the same as you, ~20 msecs for my small script samples. > Of course you have to type the "c". You're not deleting the source files > away

Re: fine grain logging cotrol

2007-03-22 Thread Peter Otten
Eric S. Johansson wrote: [in private mail -- please don't, Eric] > Peter Otten wrote: > > > As a general direction try to understand the logging package, the > > __new__() method (a constructor in C++), and metaclasses (a class is > > an instance of another class which is called metaclass to avo

python on window

2007-03-22 Thread sandeep patil
i have install python on window xp os. C:/program files/python i have done print program it working but .py can't working help me to how i will execute this file this file where i will save it. path execution how . tell me about any envorment veriable in python to set before python editor run,i

Making a non-root daemon process

2007-03-22 Thread Ben Finney
Howdy all, For making a Python program calve off an independent daemon process of itself, I found Carl J. Schroeder's recipe in the ASPN Python Cookbook. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731> This is a thorough approach, and I'm cribbing a simpler process from this examp

Re: Two Command prompts in parallels

2007-03-22 Thread Gabriel Genellina
En Thu, 22 Mar 2007 15:37:58 -0300, Boudreau, Emile <[EMAIL PROTECTED]> escribió: > I have two batch files and I'm trying to run them in parallel. I > haven't been able to find any information on how to make python open 2 > command prompt and then make each prompt run one of the batch file

Re: How can I check if the listdir result a directory?

2007-03-22 Thread Tim Daneliuk
[EMAIL PROTECTED] wrote: > I have the following code which list out all the files/directories > under the current directory. > > But how can I find out if 'f' is a directory? > > for f in os.listdir("."): > // how can I check if 'f' a directory? > Try os.path.isdir() -- -

Re: How can I check if the listdir result a directory?

2007-03-22 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > for f in os.listdir("."): > // how can I check if 'f' a directory? Your two approaches are 1) use os.stat (or stat.stat) and check the mode bits; or 2) use os.listdir and catch the OSError exception you get if you use it on a non-directory. --

How can I check if the listdir result a directory?

2007-03-22 Thread [EMAIL PROTECTED]
I have the following code which list out all the files/directories under the current directory. But how can I find out if 'f' is a directory? for f in os.listdir("."): // how can I check if 'f' a directory? -- http://mail.python.org/mailman/listinfo/python-list

Re: Technical Answer - Protecting code in python

2007-03-22 Thread Gabriel Genellina
En Thu, 22 Mar 2007 14:04:04 -0300, Bart Willems <[EMAIL PROTECTED]> escribió: >> chown scriptuser script.py # a unique user >> chmod a-rwx script.py >> chmod u+rx script.py > > If it works on the target machine - I am under the assumption that the > client is some kind of government office - m

Re: #!/usr/bin/env python > 2.4?

2007-03-22 Thread Gabriel Genellina
En Wed, 21 Mar 2007 14:42:53 -0300, Jon Ribbens <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, Sion Arrowsmith > wrote: >> Jon Ribbens <[EMAIL PROTECTED]> wrote: >>> if sys.hexversion < 0x020400f0: >>>... error ... >> >> "Readability counts." >> >> if sys.version_info <

Re: design question: generator object with other attributes

2007-03-22 Thread Alex Martelli
Alan Isaac <[EMAIL PROTECTED]> wrote: > Essentially I want a generator that I can query about > its characteristics. (E.g., a random number generator > that I want to be able to ask about is distributional > parameters.) > > I am thinking of a class that wraps a generator. > An object of this cl

Re: Need help to learn Python

2007-03-22 Thread Ben Finney
"PythonBiter" <[EMAIL PROTECTED]> writes: > I'm very new in this Group as well Python language. I want to learn > Python. Welcome, and congratulations on your decision. > So could you please advice me, and guide me how can i become master > in Python ! Work through the Python Tutorial. This mea

Re: Still the __new__ hell ...

2007-03-22 Thread Gabriel Genellina
En Wed, 21 Mar 2007 07:51:32 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribió: > Paulo da Silva a écrit : >> As a relatively inexperient >> in python, how could I know that a 'string' is an instance of >> basestring? > > By reading this newsgroup ?-) Or asking Python itself: >>> type("a

Need help to learn Python

2007-03-22 Thread PythonBiter
Hi everyone, I'm very new in this Group as well Python language. I want to learn Python. So could you please advice me, and guide me how can i become master in Python ! Thanks, Partha -- http://mail.python.org/mailman/listinfo/python-list

Re: #!/usr/bin/env python > 2.4?

2007-03-22 Thread Gabriel Genellina
En Wed, 21 Mar 2007 07:07:20 -0300, Jon Ribbens <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, Stargaming wrote: >> from sys import version_info >> if version_info[0] < 2 or version_info[1] < 4: >> raise RuntimeError("You need at least python2.4 to run this >> script") >

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread John Pye
On Mar 23, 3:33 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > import msvcrt > fh = msvcrt.get_osfhandle(f.fileno()) .. > example.filetest(fh) > f.close() Cool, that looks great, Gabriel. But is there any way I can hide the get_osfhandle call inside my Python module? That way I wouldn't nee

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread Gabriel Genellina
En Wed, 21 Mar 2007 03:35:09 -0300, John Pye <[EMAIL PROTECTED]> escribió: > Gabriel, if you think you can make an example that works, that would > be great. I'm afraid I feel a bit out of my depth and don't have much > confidence in this idea. Try this. It's based on the example_nt extension mod

Re: Python Oracle 10g odbc blob insertion problem

2007-03-22 Thread Godzilla
On Mar 23, 9:50 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Godzilla wrote: > > On Mar 23, 4:38 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> On 22 Mar 2007 05:36:46 -0700, "Godzilla" <[EMAIL PROTECTED]> > >> declaimed the following in comp.lang.python: > > >>> Steve, I think I've tried w

Re: Printing from a text file quirk

2007-03-22 Thread AWasilenko
> Where can I see that? From the python language documentation here: > > http://docs.python.org/lib/lib.html > > you can look up readline() and see: > -- > readline( [size]) > Read one entire line from the file. A trailing newline character is > kept in the string > - > > The

Re: design question: generator object with other attributes

2007-03-22 Thread James Stroud
Alan Isaac wrote: > Essentially I want a generator that I can query about > its characteristics. (E.g., a random number generator > that I want to be able to ask about is distributional > parameters.) > > I am thinking of a class that wraps a generator. > An object of this class will have a ``nex

Re: Printing from a text file quirk

2007-03-22 Thread 7stud
On Mar 22, 9:34 pm, [EMAIL PROTECTED] wrote: > self.headertxt = open("pages/header.html","r") > > *** Irrelevant code omitted *** > > headerp1 = "" > for i in range(5): > headerp1 += self.headertxt.readline() > headerp2 = self.headertxt.readline(7) > headerp3 = self.headertxt.readline() > h

Re: Printing from a text file quirk

2007-03-22 Thread AWasilenko
Humm I think I messed up the code before I pasted it, I am now able to get the left tag on the same line with this: headerp1 = "" for i in range(5): headerp1 += self.headertxt.readline() headerp2 = self.headertxt.readline(7) headerp3 = self.headertxt.readline() headerp4 = self.headertxt.re

Cool new website

2007-03-22 Thread scuba . margie
Brand new site. Loads of great stuff Free membership and full access Check out Yapooh! http://www.yapooh.org -- http://mail.python.org/mailman/listinfo/python-list

Printing from a text file quirk

2007-03-22 Thread AWasilenko
I have a html document saved as a text file that I'm trying to load. Its just the header section so my object is to read all the lines till I hit the tag, break, then read the rest. I have kinda achieved what I wanted, but I'm getting a new line where I stopped. It will become clear once you see

Re: Been a while...

2007-03-22 Thread James Stroud
John Salerno wrote: > Hi guys. It's been a while since I've used Python, so I got a little > rusty, but I really want to start using it again, just out of habit and > for fun. Can anyone suggest a book or a website with little projects I > could work on to keep me busy? > > (I do have Beginning

Re: Idiom for running compiled python scripts?

2007-03-22 Thread Steven D'Aprano
On Fri, 23 Mar 2007 01:01:15 +, Mark wrote: > So given the lack of response it seems that there is probably no such > idiom and that I should not be concerned by the inefficiency inherent in > running .py scripts directly? > > I did some time tests and sure, the speed gain is slight, but it i

Re: My MVC critique

2007-03-22 Thread James Stroud
James Stroud wrote: > [EMAIL PROTECTED] wrote: > >> Looking at different MVC frameworks from many langauges from PHP to >> Python, I've concluded that the explosion of MVC frameworks is mainly >> due to undisciplined & unexperienced programmers. >> >> Nobody would argue about the separation of the

Re: My MVC critique

2007-03-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > Looking at different MVC frameworks from many langauges from PHP to > Python, I've concluded that the explosion of MVC frameworks is mainly > due to undisciplined & unexperienced programmers. > > Nobody would argue about the separation of the layers because this is > not

Re: Idiom for running compiled python scripts?

2007-03-22 Thread Steve Holden
Mark wrote: > So given the lack of response it seems that there is probably no such > idiom and that I should not be concerned by the inefficiency inherent in > running .py scripts directly? > > I did some time tests and sure, the speed gain is slight, but it is a > gain none the less. Sorry, wh

Re: class / instance question

2007-03-22 Thread belinda thom
On Mar 22, 2007, at 7:10 PM, Ben Finney wrote: >> abstract base class, where I've used an "abstract()" hack to >> somewhat enforce this). > > You can use the 'NotImplemented' built-in object, or the > 'NotImplementedError' exception, for this purpose: Thanks---I'd forgotten about that. >> I now

Re: class / instance question

2007-03-22 Thread Ben Finney
belinda thom <[EMAIL PROTECTED]> writes: > I've written two game classes---Nim and TicTacToe---where each > derives from a Game class that I've created (it is essentially an > abstract base class, where I've used an "abstract()" hack to > somewhat enforce this). You can use the 'NotImplemented' b

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread Robert Kern
John Pye wrote: > Sorry, I'm not clear on this and will need a bit more help. I'm not > even sure where this _ctype dependency could be coming from -- do you > have any ideas? std::iostream triggers this, IIRC the last time I ran into this problem. > Are you saying that I can't make your GCC too

class / instance question

2007-03-22 Thread belinda thom
Hello, I'm hoping the Python community knows whether or not the following is possible, and if it is possible, how I would go about writing code to do this. I've written two game classes---Nim and TicTacToe---where each derives from a Game class that I've created (it is essentially an abst

Re: Idiom for running compiled python scripts?

2007-03-22 Thread Steve Holden
Mark wrote: > So given the lack of response it seems that there is probably no such > idiom and that I should not be concerned by the inefficiency inherent in > running .py scripts directly? > > I did some time tests and sure, the speed gain is slight, but it is a > gain none the less. Someone a

Re: TypeError: 'int' object is not callable

2007-03-22 Thread AWasilenko
On Mar 22, 8:59 pm, "Dan Bishop" <[EMAIL PROTECTED]> wrote: > On Mar 22, 6:54 pm, [EMAIL PROTECTED] wrote: > > > > > > > I'm trying to test a few different approaches to displaying pages via > > Cherrypy and I'm not having much luck. Here is my code so far: > > > import sys, cherrypy, html > > > c

Re: how can I invoke a Java code?

2007-03-22 Thread momobear
> If you're wanting to interact with the code, your best option may be > Jython, an implementation of Python in Java. I do have to interact with Java module, and when talk about Jython, since I use third parts of python modules I am puzzled about it. -- http://mail.python.org/mailman/listinfo/py

Re: Idiom for running compiled python scripts?

2007-03-22 Thread Mark
So given the lack of response it seems that there is probably no such idiom and that I should not be concerned by the inefficiency inherent in running .py scripts directly? I did some time tests and sure, the speed gain is slight, but it is a gain none the less. -- http://mail.python.org/mailman

Re: TypeError: 'int' object is not callable

2007-03-22 Thread Dan Bishop
On Mar 22, 6:54 pm, [EMAIL PROTECTED] wrote: > I'm trying to test a few different approaches to displaying pages via > Cherrypy and I'm not having much luck. Here is my code so far: > > import sys, cherrypy, html > > class Root: > @cherrypy.expose > def index(self, pageid = None):

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread John Pye
On Mar 23, 10:59 am, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > On 22/03/2007 15.34, John Pye wrote: > > > I downloaded your package and installed it in c:/mingw1. It complained > > that it could not detect Python, although I have Python 2.4 installed > > on my system (did you check HKCU as well as

TypeError: 'int' object is not callable

2007-03-22 Thread AWasilenko
I'm trying to test a few different approaches to displaying pages via Cherrypy and I'm not having much luck. Here is my code so far: import sys, cherrypy, html class Root: @cherrypy.expose def index(self, pageid = None): selection = html.Page() ret

Re: how can I invoke a Java code?

2007-03-22 Thread Michael Ekstrand
On Thu, 22 Mar 2007 17:49:01 -0700, momobear wrote: > A friend of my write a Java program, and I want use it in my python > program as a module. I searched the topic in Google and find maybe the > better way is use GCJ to compile it. Is there any other way for me? the > simple and speediness choic

how can I invoke a Java code?

2007-03-22 Thread momobear
A friend of my write a Java program, and I want use it in my python program as a module. I searched the topic in Google and find maybe the better way is use GCJ to compile it. Is there any other way for me? the simple and speediness choice the better. thanks. -- http://mail.python.org/mailman/lis

Re: What is the best way to upgrade python?

2007-03-22 Thread John Nagle
Facundo Batista wrote: > [EMAIL PROTECTED] wrote: > > > >>i am using red hat enterprise 4. It has python 2.3 installed. What is >>the best way to upgrade to python 2.4? Very carefully. All the C libraries that work with Python are version-dependent. Joh

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Lawrence Oluyede
Jaroslaw Zabiello <[EMAIL PROTECTED]> wrote: > Why nobody wants to add SOAP to standard Python library? XML-RPC was added > and it works without any problems. I think because SOAP is kinda crappy :-) Did you try soaplib? I've never used it (nor SOAP in a whi

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread Giovanni Bajo
On 22/03/2007 15.34, John Pye wrote: > I downloaded your package and installed it in c:/mingw1. It complained > that it could not detect Python, although I have Python 2.4 installed > on my system (did you check HKCU as well as HKLM, perhaps?) E you're totally right! I'll have that fixed! >

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Anton Vredegoor
John J. Lee wrote: > You may not realise it if you haven't been applying for work since you > did that, but I'm sure you've done a lot for your "employability" (I > hate that word, it implies that it's a one-sided business, clearly > false) by working as a freelancer. Since I'm freelancing my lev

Re: Python Oracle 10g odbc blob insertion problem

2007-03-22 Thread Steve Holden
Godzilla wrote: > On Mar 23, 4:38 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On 22 Mar 2007 05:36:46 -0700, "Godzilla" <[EMAIL PROTECTED]> >> declaimed the following in comp.lang.python: >> >>> Steve, I think I've tried what you have suggested without any luck as >>> well... The statement

Re: Upgrading python question

2007-03-22 Thread Steve Holden
Tommy Grav wrote: > I am currently using Activepython 2.4.4, but would like to upgrade to > 2.5. Am I right in thinking that if I do that I need to reinstall all > the > packages and modules (like numpy, scipy, pyfits, and so on)? Or is > there a way to avoid that? > > Cheers >Tommy There's

Re: Question regarding __new__

2007-03-22 Thread Dustan
On Mar 22, 10:19 am, Frank Benkstein <[EMAIL PROTECTED]> wrote: > Hi, > > the behaviour I always observed when creating instances by calling the > class A is that '__init__' is always only called when the object > returned by A.__new__ is an instance of A. This can be observed by the > following co

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Jaroslaw Zabiello
Dnia Thu, 22 Mar 2007 22:48:26 +0100, Jarek Zgoda napisał(a): > If you really must write client for this service, go and do it in Ruby, > if it works. I cannot. I am using Pylons framework so I have to use Python. Ruby solves this problem but not others, like its low speed. -- Jaroslaw Zabiello

Re: Python Oracle 10g odbc blob insertion problem

2007-03-22 Thread Godzilla
On Mar 23, 4:38 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 22 Mar 2007 05:36:46 -0700, "Godzilla" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Steve, I think I've tried what you have suggested without any luck as > > well... The statement works fine, but what

Re: fine grain logging cotrol

2007-03-22 Thread Peter Otten
Eric S. Johansson wrote: > Peter Otten wrote: >> Eric S. Johansson wrote: >> >>> I need to to be able to conditionally log based on the method the log >>> statement is in and one other factor like a log level. in order to do >>> so, I need to be able to automatically find out the name of the met

Re: Python Oracle 10g odbc blob insertion problem

2007-03-22 Thread Godzilla
On Mar 23, 4:38 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 22 Mar 2007 05:36:46 -0700, "Godzilla" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Steve, I think I've tried what you have suggested without any luck as > > well... The statement works fine, but what

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Paul Boddie
Jaroslaw Zabiello wrote: > > I tried to use different library - SOAPpy, but I couldn't. It requires > fpconst library which cannot be installed because its server does not > respond at all. Locating fpconst has been quite a challenge in the past, but a search for "fpconst" on Google yielded the Py

Re: Upgrading python question

2007-03-22 Thread kyosohma
On Mar 22, 4:00 pm, Tommy Grav <[EMAIL PROTECTED]> wrote: > I am currently using Activepython 2.4.4, but would like to upgrade to > 2.5. Am I right in thinking that if I do that I need to reinstall all > the > packages and modules (like numpy, scipy, pyfits, and so on)? Or is > there a way to avoid

Re: Been a while...

2007-03-22 Thread Erik Johnson
"Michael Bentley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Mar 22, 2007, at 10:34 AM, John Salerno wrote: > > > Hi guys. It's been a while since I've used Python, so I got a little > > rusty, but I really want to start using it again, just out of habit > > and > > for fun

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Jarek Zgoda
Jaroslaw Zabiello napisał(a): >> However, it is an interesting question. Ruby has smaller community, >> how could they implement a standard SOAP lib? > > Yes. It is interesting why it is so difficult to make it working for > Python. It is not difficult to write in .NET a client for the service

Re: why brackets & commas in func calls can't be ommited? (maybe it couldbe PEP?)

2007-03-22 Thread Enrico 'Mc Osten' Franchi
<[EMAIL PROTECTED]> wrote: > But I think in some situations Ruby allows to omit them, solving some > of the "impossibile" problems shown in this thread. This makes Ruby a > bit better than Python to create application-specific mini languages, > that are quite useful in some situations. Yes. Howev

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Jaroslaw Zabiello
Dnia Thu, 22 Mar 2007 18:44:31 +0100, Laszlo Nagy napisał(a): > However, it is an interesting question. Ruby has smaller community, > how could they implement a standard SOAP lib? Yes. It is interesting why it is so difficult to make it working for Python. > My personal opinion is that SOAP is

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread John J. Lee
> > Michael Bentley wrote: > > > Perhaps it is different where you live, but here you can put on your > > resume relevant things that aren't paying jobs. Otherwise nobody > > would ever get their first job, right? > > Sure you can. But around here if one has been unemployed for a while > it's near

Making GIF image twice the size - in memory

2007-03-22 Thread Miki
Hello All, I get an image from a web page (via urlopen), and like to make it twice the size. I'm trying (using PIL): code from ImageFile import Parser def double(image_data): image_parser = Parser() image_parser.feed(image_data) im = image_parser.close() new_size = tuple(

Upgrading python question

2007-03-22 Thread Tommy Grav
I am currently using Activepython 2.4.4, but would like to upgrade to 2.5. Am I right in thinking that if I do that I need to reinstall all the packages and modules (like numpy, scipy, pyfits, and so on)? Or is there a way to avoid that? Cheers Tommy -- http://mail.python.org/mailman/listinf

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > high-profile hiring fests like pycon. > What! I resent that remark. PyCon was started precisely because I felt > a low-cost event would better encourage community involvement. If > PyCon is beyond your means that you clearly aren't looking to be hired >

Re: XML based programming language

2007-03-22 Thread stefaan
Thank you for all the answers! Stefaan. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to upgrade python?

2007-03-22 Thread jim-on-linux
On Thursday 22 March 2007 15:18, Facundo Batista wrote: > [EMAIL PROTECTED] wrote: > > i am using red hat enterprise 4. It has > > python 2.3 installed. What is the best way to > > upgrade to python 2.4? > > > > I think one way is to compile python 2.4 from > > the source, but I can't remove the o

Re: How can I tar each sub-directories inside a directory

2007-03-22 Thread kyosohma
On Mar 22, 1:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > how can I do > * for each sub-directory of the current directory > * tar that to a tar file > * remove that sub-directory Grab the directories with the glob module and read them into a list. Use a for loop to loop over the

Re: Been a while...

2007-03-22 Thread kyosohma
On Mar 22, 2:22 pm, "alisonken1" <[EMAIL PROTECTED]> wrote: > On Mar 22, 11:48 am, John Salerno <[EMAIL PROTECTED]> wrote: > > > > > >http://www.pythonchallenge.com > > > Ugh, I gave up on that site a long time ago! :) > > I got stuck on 34 a couple of months ago and haven't had time to go > back

Re: design question: generator object with other attributes

2007-03-22 Thread Robert Kern
Alan Isaac wrote: > Essentially I want a generator that I can query about > its characteristics. (E.g., a random number generator > that I want to be able to ask about is distributional > parameters.) > > I am thinking of a class that wraps a generator. > An object of this class will have a ``nex

Re: Dyanmic import of a class

2007-03-22 Thread Facundo Batista
rh0dium wrote: > foo.py > > class foo: >def __init__(self): > print "Hi I am %s" % self.__class__.__name__ I wrote this in a file here... > Now I have a bunch of these files. I want to be able to dynamically > import each one and run it. I am having a problem actually doing the > wo

Re: My MVC critique

2007-03-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > What MVC does not emphasis is the separation of the data access layer, Why should it ? Smalltalk is not only a language, it's a complete environment that provides automatic persistency. (snip some more OT stuff) And what's your question about Python, exact

design question: generator object with other attributes

2007-03-22 Thread Alan Isaac
Essentially I want a generator that I can query about its characteristics. (E.g., a random number generator that I want to be able to ask about is distributional parameters.) I am thinking of a class that wraps a generator. An object of this class will have a ``next`` method that simply returns t

Re: Been a while...

2007-03-22 Thread alisonken1
On Mar 22, 11:48 am, John Salerno <[EMAIL PROTECTED]> wrote: > >http://www.pythonchallenge.com > > Ugh, I gave up on that site a long time ago! :) I got stuck on 34 a couple of months ago and haven't had time to go back to it. Fun challenge. -- http://mail.python.org/mailman/listinfo/python

Re: What is the best way to upgrade python?

2007-03-22 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > i am using red hat enterprise 4. It has python 2.3 installed. What is > the best way to upgrade to python 2.4? > > I think one way is to compile python 2.4 from the source, but I can't > remove the old one since when i do 'rpm -e python', i get error like > 'failed depe

Re: #!/usr/bin/env python > 2.4?

2007-03-22 Thread starGaming
On Mar 22, 5:23 pm, Jon Ribbens <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > > I don't see any problem with:: > > > if version_info[0] <= 2 and version_info[1] < 4: > > raise RuntimeError() > > What if the version number is 1.5? Ah, now I get your pro

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Steve Holden
Anton Vredegoor wrote: [...] I mean, not everyone is able to visit expensive > high-profile hiring fests like pycon. What! I resent that remark. PyCon was started precisely because I felt a low-cost event would better encourage community involvement. If PyCon is beyond your means that you clearl

Re: Problem with time

2007-03-22 Thread Steve Holden
ian wrote: > Hi, > > i have a problem with time in python. > > 1) i got 2 values from mysql db (fields are "time" type) > 2) python get it as "" (why timedelta???) timedelta because a time doesn't represent a fixed point until it's associated with a date, I presume. > 3) i need to compare 2 fi

Two Command prompts in parallels

2007-03-22 Thread Boudreau, Emile
Hello, I have two batch files and I'm trying to run them in parallel. I haven't been able to find any information on how to make python open 2 command prompt and then make each prompt run one of the batch files. Can anyone point me in the right direction? Thanks, Emile Boudreau Th

Re: Been a while...

2007-03-22 Thread John Salerno
[EMAIL PROTECTED] wrote: > On Mar 22, 11:21 am, Michael Bentley <[EMAIL PROTECTED]> > wrote: >> On Mar 22, 2007, at 10:34 AM, John Salerno wrote: >> >>> Hi guys. It's been a while since I've used Python, so I got a little >>> rusty, but I really want to start using it again, just out of habit >>> a

Re: Been a while...

2007-03-22 Thread John Salerno
Michael Bentley wrote: > > On Mar 22, 2007, at 10:34 AM, John Salerno wrote: > >> Hi guys. It's been a while since I've used Python, so I got a little >> rusty, but I really want to start using it again, just out of habit and >> for fun. Can anyone suggest a book or a website with little projects

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-22 Thread Duncan Booth
Steve Holden <[EMAIL PROTECTED]> wrote: >> As a matter of interest do PyLint or PyChecker check for this situation >> (chained assignment where the target of an assignment is also a >> subexpression of a later assignment)? >> > Where's the published syntax for chained assignment? http://docs.p

How can I tar each sub-directories inside a directory

2007-03-22 Thread [EMAIL PROTECTED]
Hi, how can I do * for each sub-directory of the current directory * tar that to a tar file * remove that sub-directory -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-22 Thread Terry Reedy
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Terry Reedy wrote: | > The assignment order is specified in the language reference. | | Where? I'm looking at | | http://docs.python.org/ref/assignment.html | | right now. The first line of the syntax grammar is: assi

Re: challenge ?

2007-03-22 Thread Michael Spencer
alain wrote: > I have a problem I wonder if it has been solved before. > I have a dictionnary and I want the values in the dictionnary to be > annotated with the rank that would be obtained by sorting the values > > def annotate_with_rank(my_dict): > > return my_annotated_dict >

[ANN] Python courses this Spring

2007-03-22 Thread wesley chun
I'll be giving a variety of Python courses this Spring. Daytime courses are for visitors and locals who need Python training in the shortest amount of time possible via consecutive workdays. Python is certainly gaining momentum as our February course filled up completely! Although I had planned

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 1:00 PM, Anton Vredegoor wrote: > So HRM people keep asking questions like 'But > what have you been doing?' In the end I just started my own > company, and > while I'm not always employed as a freelancer I can at least now > say I'm > running my own business. Yeah, I've

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-22 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > I agree that in you example the first syntax yields a full /five/ > > spaces less than the second syntax. However, it ignores the fact > > that if you are creating functions with that many arguments, you are > > probably doing something wrong. Can't thos

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-22 Thread Steve Holden
Bart Willems wrote: > dmitrey wrote: >> 1st still is shorter by 1 char; considering majority of people use >> space after comma & number of parameters can be big it yileds >> foo bar baz bar2 bar3 bar4 >> vs >> foo(bar, baz, bar2, bar3, bar4) > > I think most readers already agree on the ambiguiti

Re: challenge ?

2007-03-22 Thread Paul Rubin
"alain" <[EMAIL PROTECTED]> writes: > def annotate_with_rank(my_dict): > > return my_annotated_dict > > In other words, any value a_value would become a 2-tuple > (a_value,rank_of_a_value) > > I seek an elegant solution. Untested: def annotate_with_rank(my_dict): s =

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-22 Thread Erik Johnson
Actually, after studying this a bit more: http://docs.python.org/ref/assignment.html I guess that makes sense. Sorry if I muddied the water for anyone else in my boat: n1 = n1.next = n2 The first thing that happens is the expression list is evaluated which is the thing on the far right, n2. That

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Michael Bentley
On Mar 22, 2007, at 12:07 PM, Anton Vredegoor wrote: > Agreed. There's now probably even room on the job market for those who > don't belong to the select elite of early adopters. We might even root > out the professionalist attitude and address the problem of tying > people > to their resumes.

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-22 Thread Anton Vredegoor
Michael Bentley wrote: > Perhaps it is different where you live, but here you can put on your > resume relevant things that aren't paying jobs. Otherwise nobody > would ever get their first job, right? Sure you can. But around here if one has been unemployed for a while it's nearly impossib

testing

2007-03-22 Thread anita_group1
This is a test. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with time

2007-03-22 Thread Michael Bentley
> > 1) i got 2 values from mysql db (fields are "time" type) > 2) python get it as "" (why timedelta???) > 3) i need to compare 2 fields with actual time ... EG: > if ArrOutputsAuto[i].TimeFrom >= GNow and ArrOutputsAuto[i].TimeTo > <= GNow: > > i need actual time, and 2 fields from DB in datetim

Re: parsing tables with beautiful soup?

2007-03-22 Thread cjl
DB: Thank you, that worked perfectly. -CJL -- http://mail.python.org/mailman/listinfo/python-list

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Laszlo Nagy
> I tried to use different library - SOAPpy, but I couldn't. It requires > fpconst library which cannot be installed because its server does not > respond at all. What a shit... > I concur! When I tried to use ZSI the first time, it turned out it has no support for attachments. Next time I it

Problem with time

2007-03-22 Thread ian
Hi, i have a problem with time in python. 1) i got 2 values from mysql db (fields are "time" type) 2) python get it as "" (why timedelta???) 3) i need to compare 2 fields with actual time ... EG: if ArrOutputsAuto[i].TimeFrom >= GNow and ArrOutputsAuto[i].TimeTo <= GNow: i need actual time, and

Re: flattening/rolling up/aggregating a large sorted text file

2007-03-22 Thread Eddie Corns
[EMAIL PROTECTED] writes: >Hi, >Given a large ascii file (delimited or fixed width) with one ID field >and dimensions/measures fields, sorted by dimensions, I'd like to >"flatten" or "rollup" the file by creating new columns: one for each >combination of dimension level, and summing up measures o

Re: challenge ?

2007-03-22 Thread Frank Benkstein
Hi, again, On Thu, 22 Mar 2007 18:11:46 +0100 Frank Benkstein <[EMAIL PROTECTED]> wrote: > On 22 Mar 2007 09:41:43 -0700 > "alain" <[EMAIL PROTECTED]> wrote: > > > I have a problem I wonder if it has been solved before. > > I have a dictionnary and I want the values in the dictionnary to be > >

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-22 Thread Erik Johnson
"Virgil Dupras" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > class Node: > > > ... pass > > > ... > > node = Node() > > nextnode = Node() > > backup_node = node > > node = node.next = nextnode > > node.next is node > > > True > > hasattr(ba

  1   2   >