Re: What is the best way to upgrade python?

2007-03-08 Thread Sick Monkey
Have you tried to upgrade the current python RPM? rpm -Uvh You can also build from source. Once you get Python 2.4 up and running I am pretty sure you can do a symbolic link on the python 2.3 application (either in /usr/bin or /usr/sbin) and point it to the 2.4 python file. On 8 Mar 2007

Re: SQLAlchemy and Oracle Functions?

2007-03-08 Thread Giles Brown
On 8 Mar, 22:19, "Greg Copeland" <[EMAIL PROTECTED]> wrote: > I'm using SQLAlchemy and have a need to call an Oracle function; which > is not the same as a stored procedure. Can this be done directory or > indirectly with SQLAlchemy? If so, can someone please provide an > example? If not, how do

convert time string in UTC to time in local time

2007-03-08 Thread davelist
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time = '2007-03-13T15:00:00Z' I want to convert it to my local time. start_time = time.mktime(time.strptime(start_t

Re: SQLAlchemy and Oracle Functions?

2007-03-08 Thread Greg Copeland
On Mar 8, 3:35 pm, "Giles Brown" <[EMAIL PROTECTED]> wrote: http://www.sqlalchemy.org/docs/sqlconstruction.myt#sql_whereclause_fu... > SQLAlchemy has its own google group > > http://groups.google.co.uk/group/sqlalchemy > > You could try asking there too. > > Giles Very nice. That exactly answered

Re: Configuration: Apache + mod_python

2007-03-08 Thread Graham . Dumpleton
On Mar 9, 12:02 am, "Danilo" <[EMAIL PROTECTED]> wrote: > On 8 Mrz., 12:18, [EMAIL PROTECTED] wrote: > > > > > On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > Hi there, > > > > is it possible to create a rewrite rule to send every server-request > > > to the directory /py? But only i

Re: What is the best way to upgrade python?

2007-03-08 Thread ying lcs
On 3/8/07, Sick Monkey <[EMAIL PROTECTED]> wrote: > Have you tried to upgrade the current python RPM? > > rpm -Uvh > > You can also build from source. Once you get Python 2.4 up and running I am > pretty sure you can do a symbolic link on the python 2.3 application (either > in /usr/bin or /u

Re: What is the best way to upgrade python?

2007-03-08 Thread Sick Monkey
Yeah, sorry I should have added more data. You will need to go to rhn.redhat.com and either download the RPM or get the url. So you would do: (1) download the rpm to your home directory rpm -Uvh nameOfRPM or (2) grab the url rpm -Uvh http://urlOfRPM either way should update your python. Dont

Re: Dyanmic import of a class

2007-03-08 Thread Arnaud Delobelle
On Mar 8, 9:09 pm, "rh0dium" <[EMAIL PROTECTED]> wrote: [snip] > for mod in listdir(): >__import__(mod) >a=mod() >a.dosomething() # This is a function which each class shares. > > Can anyone help? You are not using __import__ correctly. Perhaps reading the doc would be a good start:

Re: What is the best way to upgrade python?

2007-03-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > 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 > '

Re: pylint: don't warn about tabs

2007-03-08 Thread Bjoern Schliessmann
Ben Finney wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> >> IIRC it's planned in future Python versions that TABs aren't >> supported for indentation. > > I've not seen such plans, can you support that? No ... 8) > If you're thinking of this post from Guido, please note the date > it was ma

Re: What is the best way to upgrade python?

2007-03-08 Thread ying lcs
On 3/8/07, Sick Monkey <[EMAIL PROTECTED]> wrote: > Yeah, sorry I should have added more data. > You will need to go to rhn.redhat.com and either download the RPM or get the > url. > > So you would do: > (1) download the rpm to your home directory > rpm -Uvh nameOfRPM > > or > (2) grab the url > rp

Re: SQLAlchemy and Oracle Functions?

2007-03-08 Thread Greg Copeland
On 8 Mar, 15:35, "Giles Brown" <[EMAIL PROTECTED]> wrote: > On 8 Mar, 22:19, "Greg Copeland" <[EMAIL PROTECTED]> wrote: > > > I'm using SQLAlchemy and have a need to call an Oracle function; which > > is not the same as a stored procedure. Can this be done directory or > > indirectly with SQLAlche

Re: Where to "import"?

2007-03-08 Thread Paulo da Silva
Paulo da Silva escreveu: This is to thank all the answers I got so far. Now I understand perfectly how "import" works. Regards. Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to "import"?

2007-03-08 Thread Paulo da Silva
Paulo da Silva escreveu: This is to thank all the answers I got so far. Now I understand perfectly how "import" works. Regards. Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint: don't warn about tabs

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 14:33:38 -0300, Bjoern Schliessmann <[EMAIL PROTECTED]> escribió: > Alan Isaac wrote: >> As a tab user, I want the tabs warning turned off. > > Advice: Don't. IIRC it's planned in future Python versions that TABs > aren't supported for indentation. AFAIK, using tabs xor spac

Re: Where to "import"?

2007-03-08 Thread Paulo da Silva
Bruno Desthuilliers escreveu: > Paulo da Silva a écrit : ... >> >> c.py >> class c: > class C(object): > > 1/ better to stick to naming conventions (class names in CamelCase) Ok. Thanks. > 2/ do yourself a favor: use new-style classes I still have python 2.4.3 (The gentoo current vers

Re: merits of Lisp vs Python

2007-03-08 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > >Care to name a "real" hosting provider that cares whether Python works? http://www.webfaction.com/ -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM --

Re: Where to "import"?

2007-03-08 Thread Bruno Desthuilliers
Paulo da Silva a écrit : > Bruno Desthuilliers escreveu: > >>Paulo da Silva a écrit : > > ... > > >>>c.py >>>class c: >> >>class C(object): >> >>1/ better to stick to naming conventions (class names in CamelCase) > > Ok. Thanks. FWIW: http://www.python.org/dev/peps/pep-0008/ >>2/

Re: tkinter how to write

2007-03-08 Thread Gigs_
James Stroud wrote: > Gigs_ wrote: >> as I write my first gui program (text editor) I wanna ask you guys how >> to separate code in classes.? >> Should I put in one class my menu and in another class text and >> scorllbars etc? >> >> or something else? >> >> >> thanks > > Check out Grayson: http

Re: merits of Lisp vs Python

2007-03-08 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > >Care to name a "real" hosting provider that cares whether Python works? > http://www.webfaction.com/ Thanks! This is good to know about. -- http://mail.python.org/mailman/listinfo/python-list

Coding a scheduled journal application

2007-03-08 Thread [EMAIL PROTECTED]
I'm a python newbie and would like to develop a tiny application to schedule a document to open in a text processor and ask a question. I'd like to be able to give it multiple time:question pairs such as (monday 1:00pm : "Please enter your completed tasks for the morning?). It could just open a dia

Extend distutils bdist_rpm to support %config?

2007-03-08 Thread [EMAIL PROTECTED]
Is there any way to get the functionality of the %config RPM directive using python distutils? http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html %config /etc/foonly This will save the current file as fooonly.rpmsave if the file is different from the one in the package, so users

Re: catching exceptions from an except: block

2007-03-08 Thread Steven D'Aprano
On Thu, 08 Mar 2007 06:31:20 -0300, Gabriel Genellina wrote: > En Thu, 08 Mar 2007 06:17:37 -0300, Gerard Flanagan > <[EMAIL PROTECTED]> escribió: > >> @onfail(False) >> def a(x): >> if x == 1: >> return 'function a succeeded' >> else: >> raise > > I know it's irrelevan

Re: catching exceptions from an except: block

2007-03-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I thought "raise" on its own was supposed to re-raise the previous > exception, but I've just tried it in the interactive interpreter and it > doesn't work for me. It means you can catch an exception, do stuff with it, and then pass it upward to earlie

Re: {Possible_Spam} tkinter text editor

2007-03-08 Thread John McMonagle
Gigs_ wrote: > I'm writing text editor. > > How to enable/disable (cut, copy etc.) when text is selected/not selected Bind the Button1-ButtonRelease event to a function which checks the length of the SEL tag of the text widget. If it is zero length, disable the appropriate menu entries, if it

Re: writing dictionary to file

2007-03-08 Thread jim-on-linux
On Thursday 08 March 2007 14:40, kavitha thankaian wrote: > Hi Simon, > > iam till here: > > dorc=some['DorC'] > amount=some['amount'] > f=open("logfile.txt", "w") > if dorc =='C': >a = -(amount) > if dorc == 'D': >b = amount >sum=a + b >if sum == 0: >f.writelines

Re: property syntax

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 08:04:38 -0300, <[EMAIL PROTECTED]> escribió: > Gabriel Genellina: >> You miss this common way, that does not depend on metaclasses, >> nor base classes, nor custom decorators... > > My purpose was to discuss a new syntax. The other stuff is mostly for > reference, to show that

any better code to initalize a list of lists?

2007-03-08 Thread John
For my code of radix sort, I need to initialize 256 buckets. My code looks a little clumsy: radix=[[]] for i in range(255): radix.append([]) any better code to initalize this list? -- http://mail.python.org/mailman/listinfo/python-list

Re: any better code to initalize a list of lists?

2007-03-08 Thread Paul Rubin
"John" <[EMAIL PROTECTED]> writes: > For my code of radix sort, I need to initialize 256 buckets. My code looks a > little clumsy: > > radix=[[]] > for i in range(255): > radix.append([]) > > any better code to initalize this list? Typically you'd say radix = [[] for i in xrange(256)]

list of dictionary in embedded Python

2007-03-08 Thread ZiZi Zhao
I tried to build a list of dictionaries using embedded Python2.5 in the following way to append dictionaries to a list. Py_Object *pList = PyList_New(0); for (i=0; i-- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2007-03-08 Thread John Nagle
Paul Rubin wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > >>Any *real* hosting provider is going to support whatever >>language and environment I tell them to, because I'm going to pay them >>a lot of money for excellent support and if they give me any trouble I >>will go with someone who p

Re: merits of Lisp vs Python

2007-03-08 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > There's denial in the Python community that this is a problem, > but it is. The Ruby on Rails people get it; they work to provide a > seamless experience for web developers. Which is why their market > share is way up over two years ago. I do know th

Re: catching exceptions from an except: block

2007-03-08 Thread Steven D'Aprano
On Thu, 08 Mar 2007 16:19:27 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> I thought "raise" on its own was supposed to re-raise the previous >> exception, but I've just tried it in the interactive interpreter and it >> doesn't work for me. > > It means you can catch a

Re: How to check whether file is open or not

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 11:10:42 -0300, Bart Ogryczak <[EMAIL PROTECTED]> escribió: > On Mar 7, 6:28 am, "Ros" <[EMAIL PROTECTED]> wrote: >> There are 10 files in the folder. I wish to process all the files one >> by one. But if the files are open or some processing is going on them >> then I do not

Re: catching exceptions from an except: block

2007-03-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Are you saying it only works as advertised within the except clause of a > try...except block? I think that's the idea. It hadn't occurred to me that it could be used any other way, but I don't have the docs in front of me right now, so maybe I missed

Re: Python Source Code Beautifier

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 13:13:23 -0300, Alan Franzoni <[EMAIL PROTECTED]> escribió: > this > container does create a copy of the object even employing incremental > operators. > > Now, let's suppose I find that container type not useful for my purposes, > *or* I have already written a different cont

Re: any better code to initalize a list of lists?

2007-03-08 Thread John
I want to radix sort non-negative integers that can fit into 32-bits. That will take 4 passes, one for each byte. So, I will need 256 "buckets" The list radix of 256 elements of list is good for this purpose. Your code is much shorter, works and probably takes less time. Thanks! John "Paul Ru

Re: Python threading

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 14:25:02 -0300, <[EMAIL PROTECTED]> escribió: > I am wondering what happens to a thread in python in relation to > win32com extensions. > > If I create a new thread, that uses the Dispatch method from win32com, > what happens to the memory allocated in that thread when the thre

Re: Coding a scheduled journal application

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 20:42:45 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I guess the > question is how to get it to run in the background and pop-up at the > appropriate times? Use cron on linux or the task scheduler on windows -- Gabriel Genellina -- http://mail.python.org/mai

Re: any better code to initalize a list of lists?

2007-03-08 Thread Paul Rubin
"John" <[EMAIL PROTECTED]> writes: > I want to radix sort non-negative integers that can fit into 32-bits. But why do you want to do that? Why not just use Python's built-in sorting operation? -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions from an except: block

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 21:11:54 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: >>> @onfail(False) >>> def a(x): >>> if x == 1: >>> return 'function a succeeded' >>> else: >>> raise > > I thought "raise" on its own was supposed to re-raise the previous > exception, but

Re: Reading a portion of a file

2007-03-08 Thread attn . steven . kuo
On Mar 8, 10:35 am, [EMAIL PROTECTED] wrote: (snipped) > > Ok, regex was my first thought because I used to use grep with Perl > and shell scripting to grab everything from one pattern to another > pattern. The file is just an unformatted file. What is below is > exactly what is in the file. The

Re: list of dictionary in embedded Python

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 22:26:59 -0300, ZiZi Zhao <[EMAIL PROTECTED]> escribió: > I tried to build a list of dictionaries using embedded Python2.5 > in the following way to append dictionaries to a list. > > Py_Object *pList = PyList_New(0); > > for (i=0; i Py_Object *pDict = PyDict_New(); > /

Python books?

2007-03-08 Thread Tommy Nordgren
Could some kind soul please recommend a few text books on Python 2.5 and it's class library? Kine dies, Kinfolk dies, and thus at last yourself This I know that never dies, how a dead mans deeds are deemed. -- Elder edda Tommy Nordgren [EMAIL PROTECTED] -- http://mail.python.org/mailman

Re: Python threading

2007-03-08 Thread test . 07
On Mar 8, 6:15 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 08 Mar 2007 14:25:02 -0300, <[EMAIL PROTECTED]> escribió: > All threads share the same memory space, there is not a "per-thread" > memory allocator, if that's what you are thinking. > Perhaps you hold a reference to some ob

I am a new guy on python world

2007-03-08 Thread YySwing . 杨
I am study python today print "Python world,yang coming" lol-- http://mail.python.org/mailman/listinfo/python-list

Re: Where to "import"?

2007-03-08 Thread MonkeeSage
On Mar 8, 5:49 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> > >>1/ better to stick to naming conventions (class names in CamelCase) > > > Ok. Thanks. > > FWIW:http://www.python.org/dev/peps/pep-0008/ By my reading, PEP8 doesn't specify CamelCase as preferred over the other styles it mentions. non_c

Re: Where to "import"?

2007-03-08 Thread MonkeeSage
Disregard my last message, I'm stupid. I totally missed that Bruno was talking about classname. Bruno is exactly right. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am a new guy on python world

2007-03-08 Thread MonkeeSage
Welcome. :) Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to "import"?

2007-03-08 Thread Gabriel Genellina
En Fri, 09 Mar 2007 01:09:36 -0300, MonkeeSage <[EMAIL PROTECTED]> escribió: >> FWIW:http://www.python.org/dev/peps/pep-0008/ > > By my reading, PEP8 doesn't specify CamelCase as preferred over the > other styles it mentions. non_camel_case is also considered good > style, as I understand (and i

Re: Where to "import"?

2007-03-08 Thread MonkeeSage
On Mar 8, 10:27 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Class names should be CamelCase. Read it again, and notice the difference > between a "Descriptive" section and a "Prescriptive" one. Yes, I misread Bruno's comment (missed that he was speaking of class names). Disregard my post.

TitleCase, camelCase, lowercase (was: Where to "import"?)

2007-03-08 Thread Ben Finney
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > Class names should be CamelCase. Note that the term "camel case" has ambiguous usage. Some use it to refer to *both* of "nameWithSeveralWords" and "NameWithSeveralWords". I prefer to use the term "title case" to refer unambiguously to "NameWithSe

Re: heapq.heappush and pop to use key

2007-03-08 Thread [EMAIL PROTECTED]
On Mar 8, 9:02 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, > > [EMAIL PROTECTED] wrote: > > I wanted to have a heap of custom objects, and in different heaps I > > wanted to have the weights for my elements differently. So, I modified > > the heapq module to ac

Re: VIM: Python type indented-block command equivalent to % for C?

2007-03-08 Thread Paddy3118
On Mar 8, 5:02 am, "Paddy3118" <[EMAIL PROTECTED]> wrote: > Not python: > but python type > indented text > > Notice the blank line above. > It could have several > spaces or tabs, and still > be a part of the block > beginning 'Not python:': > The block ends at

Re: TitleCase, camelCase, lowercase

2007-03-08 Thread Scott David Daniels
Ben Finney wrote: > I prefer to use the term "title case" to refer unambiguously to > "NameWithSeveralWords", leaving the term "camel case" to describe the > case with the humps only in the middle :-) The names "TitleCase" and "camelCase" might suffice here. -- --Scott David Daniels [EMAIL PROTE

Re: any better code to initalize a list of lists?

2007-03-08 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] | "John" <[EMAIL PROTECTED]> writes: | > I want to radix sort non-negative integers that can fit into 32-bits. | | But why do you want to do that? Why not just use Python's built-in | sorting operation? Perhap

C++ and Python

2007-03-08 Thread [EMAIL PROTECTED]
Hi Everyone, I'm considering about generating some Python Bindings for C++ libraries. What are considered the best tools for doing something like this? I know that there are SWIG, SIP, Boost.Python, and GCC_XML. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Dyanmic import of a class

2007-03-08 Thread Scott David Daniels
Arnaud Delobelle wrote: > On Mar 8, 9:09 pm, "rh0dium" <[EMAIL PROTECTED]> wrote: > [snip] >> for mod in listdir(): >>__import__(mod) >>a=mod() >>a.dosomething() # This is a function which each class shares. >> >> Can anyone help? > > You are not using __import__ correctly. Perhap

Re: Python books?

2007-03-08 Thread Alex Martelli
Tommy Nordgren <[EMAIL PROTECTED]> wrote: > Could some kind soul please recommend a few text books on Python 2.5 > and it's class library? I believe recent books on Python (such as "Python for Dummies" and the second edition of "Core Python Programming") do cover 2.5; I do know that the 2nd editi

Re: merits of Lisp vs Python

2007-03-08 Thread Alex Martelli
Paul Rubin wrote: > "alex23" <[EMAIL PROTECTED]> writes: > > > Hosting providers and distro > > > makers aren't concerned over whether Python works. They > > > care if C, C++, Java, PHP, and Perl work, but not Python or LISP. > > > Ask them. > > > > Do you have any rea

Re: Python threading

2007-03-08 Thread Gabriel Genellina
En Fri, 09 Mar 2007 00:38:55 -0300, <[EMAIL PROTECTED]> escribió: > pythoncom.CoUninitialize(), if I am not mistaken, releases a COM > object (and therefore the memory it uses I assume). Not exactly. *You* must release the COM object (usually assigning None to all references to it). CoUninitial

Re: Python books?

2007-03-08 Thread rishi pathak
I would suggest you the python docs available on python.org.They are the best and latest On 3/9/07, Tommy Nordgren <[EMAIL PROTECTED]> wrote: Could some kind soul please recommend a few text books on Python 2.5 and it's class library? Kine dies, Kinfolk dies, and thus at last yourself Thi

Re: catching exceptions from an except: block

2007-03-08 Thread Gerard Flanagan
On Mar 8, 10:31 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 08 Mar 2007 06:17:37 -0300, Gerard Flanagan > <[EMAIL PROTECTED]> escribió: > > > @onfail(False) > > def a(x): > > if x == 1: > > return 'function a succeeded' > > else: > > raise > > I know it's ir

<    1   2