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

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: 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: 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 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: 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

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: 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

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: 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: 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

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: 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.

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: 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 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: 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

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: 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

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: 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(); > /

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: 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: 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: 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: 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: 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 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: 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: 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 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: 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: 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

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: 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)]

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: 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

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: {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: 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: 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

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

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

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

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: 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: 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 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: 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
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: 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: 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: 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 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: 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 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: 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: 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: 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

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 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

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: implementing SFTP using Python

2007-03-08 Thread Ravi Terala
Kiran, You should look into Twisted Python and their Twisted Python Conch package. You might not need to reinvent the wheel. http://twistedmatrix.com/trac/wiki/TwistedConch Ravi kadarla kiran kumar wrote: > Hi Everybody, > > I have to implement SFTP conection from client to the server using

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-08 Thread Ant
On Mar 8, 8:20 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > And the problem with a dictionary is that some people want to make sense > of its order, just like in this case, and the fifty thousand previous > times people have asked this newsgroup how they can sort a dictionary. ... > What ma

Re: multithreading concept

2007-03-08 Thread Paul Rubin
"Paul Boddie" <[EMAIL PROTECTED]> writes: > What makes all of the following not "Pythonic"...? > http://wiki.python.org/moin/ParallelProcessing I'd say mainly that they don't allow sharing data between processes except through expensive IPC mechanisms involving system calls. > I'm sure one could

Re: pylint: don't warn about tabs

2007-03-08 Thread Robert Kern
Alan Isaac wrote: > I am brand new to pylint. > As a tab user, I want the tabs warning turned off. > How? > > Larger question: > where is the config file format documented? doc/features.txt examples/pylintrc -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: SQLAlchemy and Oracle Functions?

2007-03-08 Thread Sick Monkey
Helpful Links http://sourceforge.net/projects/cx-oracle http://www.python.net/crew/atuining/cx_Oracle/html/cursorobj.html == Example: Replace the data types as appropriate. v_Vars = v_Cursor.setinputsizes(p_Result = cx_Oracle.NUMBER) v_Cursor.execute(""" begin

SQLAlchemy and Oracle Functions?

2007-03-08 Thread Greg Copeland
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 I obtain the raw cx_Oracle cursor so I can use callfunc directly on

Re: Where to "import"?

2007-03-08 Thread Ben Finney
Paulo da Silva <[EMAIL PROTECTED]> writes: > Hi! > > If I have two files .py such as > > m.py > from c import * Best done as either import c# then use 'x = c.c()' or from c import c Using 'from foo import *' leads to names appearing in your current namespace that are difficu

Re: worker thread catching exceptions and putting them in queue

2007-03-08 Thread Gabriel Genellina
En Thu, 08 Mar 2007 13:31:14 -0300, Aahz <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, > Paul Sijben <[EMAIL PROTECTED]> wrote: >> >> in a worker thread setup that communicates via queues is it possible to >> catch exceptions raised by the worker executed, put them in an object

Re: pylint: don't warn about tabs

2007-03-08 Thread Ben Finney
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > Alan Isaac wrote: > > As a tab user, I want the tabs warning turned off. > > Advice: Don't. Agreed. Sticking to spaces for indentation avoids the ambiguity of interpretation that ASCII TAB characters are subject to. In addition, PEP 8 (which many

What is the best way to upgrade python?

2007-03-08 Thread [EMAIL PROTECTED]
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 'failed dependencies'. Thank you for any ide

SQLAlchemy and Oracle Functions?

2007-03-08 Thread Greg Copeland
I have a need to call an Oracle function, which is not the same thing as a stored procedure. Can SQLAlchemy do this directly? Indirectly? If so, an example would be appreciated. If not, how do I obtain the raw cx_Oracle cursor so I can use that directly? Thanks, Greg -- http://mail.python.o

Dyanmic import of a class

2007-03-08 Thread rh0dium
Hi all, I have a directory with a bunch of python classes each uniquely named such that the file name (dropping .py) is also the class name of the file in question. So for example foo.py class foo: def __init__(self): print "Hi I am %s" % self.__class__.__name__ Now I have a bunch of

Re: tkinter how to write

2007-03-08 Thread James Stroud
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://www.manning.com/grayson/ Its

Re: tkinter text editor

2007-03-08 Thread James Stroud
Gigs_ wrote: > jim-on-linux wrote: > >> On Friday 09 March 2007 12:04, Gigs_ wrote: >> >>> Gigs_ wrote: >>> I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected >>> >>> Btw it is cut copy ... in edit menu >> >> >> >> state = 'diable

Re: Where to "import"?

2007-03-08 Thread Matimus
> both using os module where should I put the "import os"? In both files? You don't really have a choice, you have to import os in both files. Python will only load the os module into memory once, but the import statements are needed to add the os module to the c and m module namespaces. The code

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-08 Thread Bruno Desthuilliers
Adam Atlas a écrit : > Doesn't seem to work. I guess zipimport doesn't support that by > default... but if I remember correctly, Setuptools adds that. Maybe > I'll take a look at how it does it (I think by extracting the .so to / > tmp?) or to another known location, IIRC. > and see how easy it

Re: Where to "import"?

2007-03-08 Thread Bruno Desthuilliers
Paulo da Silva a écrit : > Hi! > > If I have two files .py such as > > m.py > from c import * avoid this kind of import except in an interactive interpreter and eventually in a package __init__.py. Better to use either: from c import c or import c ... x = c.c() > ... >

Re: Tell me the truth

2007-03-08 Thread francois . petitjean
Duncan Booth wrote : > francois.petitjean at bureauveritas.com wrote: >> After much head scrating and experimenting with dis.dis() I have found >> that chaining comparisons (with is or ==) a == b == c in Python is >> never a good idea. It is interpreted as >> ( a == b ) and ( b == c) >> Such a m

Re: writing dictionary to file

2007-03-08 Thread kavitha thankaian
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("name:") f.writelines("%s" %some['name']) f.writelines("credit:"

Re: tkinter text editor

2007-03-08 Thread Gigs_
jim-on-linux wrote: > On Friday 09 March 2007 12:04, Gigs_ wrote: >> Gigs_ wrote: >>> I'm writing text editor. >>> >>> How to enable/disable (cut, copy etc.) when >>> text is selected/not selected >> Btw it is cut copy ... in edit menu > > > state = 'diabled' ## no change allowed >

Re: Where to "import"?

2007-03-08 Thread Terry Reedy
"Paulo da Silva" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi! | | If I have two files .py such as | | m.py | from c import * | ... | x=c() | ... | os.any_method ... | ... | | c.py | class c: | def __init__(self, ...): | ... | os.any_method ... | ... | ... | | both using os mo

Where to "import"?

2007-03-08 Thread Paulo da Silva
Hi! If I have two files .py such as m.py from c import * ... x=c() ... os.any_method ... ... c.py class c: def __init__(self, ...): ... os.any_method ...

Re: merits of Lisp vs Python

2007-03-08 Thread Paul Rubin
"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 provides what I want. H

Re: Reading a portion of a file

2007-03-08 Thread cmfvulcanius
On Mar 8, 12:50 pm, "Jordan" <[EMAIL PROTECTED]> wrote: > On Mar 8, 12:46 pm, "Jordan" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 8, 11:52 am, "Rune Strand" <[EMAIL PROTECTED]> wrote: > > > > On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > > > > > I am using a script with a single file containing al

Re: merits of Lisp vs Python

2007-03-08 Thread Chris Mellon
On 3/8/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 08 Mar 2007 06:13:15 GMT, John Nagle <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > When starting out with this project, I'd made the assumption that > > Python was a stable, working, well-supported

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-08 Thread Matthias Julius
"John" <[EMAIL PROTECTED]> writes: > I am coding a radix sort in python and I think that Python's dictionary may > be a choice for bucket. > > The only problem is that dictionary is a mapping without order. But I just > found that if the keys are numeric, the keys themselves are ordered in the

Re: tkinter text editor

2007-03-08 Thread jim-on-linux
On Friday 09 March 2007 12:04, Gigs_ wrote: > Gigs_ wrote: > > I'm writing text editor. > > > > How to enable/disable (cut, copy etc.) when > > text is selected/not selected > > Btw it is cut copy ... in edit menu state = 'diabled' ## no change allowed ## to Text Wige

Re: Reading a portion of a file

2007-03-08 Thread Jordan
On Mar 8, 12:46 pm, "Jordan" <[EMAIL PROTECTED]> wrote: > On Mar 8, 11:52 am, "Rune Strand" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > > > > I am using a script with a single file containing all data in multiple > > > sections. Each section begins with "#VS:C

Python threading

2007-03-08 Thread test . 07
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 thread is done. Will the Dispatch release the memory it created, or will the mem

Re: Copy geodatabase(mdb) if it is locked

2007-03-08 Thread Tim Golden
Ahmed, Shakir wrote: > I am trying to copy a geodatabase (.mdb) file from source to destination > using > > shutil.copyfile(src, dest) > > It is working fine but the main problem when the destination (.mdb) file > is locked by other users then it's bumped out and not copied over. > > Is there an

Re: Reading a portion of a file

2007-03-08 Thread Jordan
On Mar 8, 11:52 am, "Rune Strand" <[EMAIL PROTECTED]> wrote: > On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > > > I am using a script with a single file containing all data in multiple > > sections. Each section begins with "#VS:CMD:command:START" and ends > > with "#VS:CMD:command:STOP". There is a

Re: Tell me the truth

2007-03-08 Thread Erik Johnson
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > > > After much head scrating and experimenting with dis.dis() I have found > > that chaining comparisons (with is or ==) a == b == c in Python is > > never a good idea. It is interpreted as > >

tkinter text editor

2007-03-08 Thread Gigs_
I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter text editor

2007-03-08 Thread Gigs_
Gigs_ wrote: > I'm writing text editor. > > How to enable/disable (cut, copy etc.) when text is selected/not selected Btw it is cut copy ... in edit menu -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint: don't warn about tabs

2007-03-08 Thread Bjoern Schliessmann
Alan Isaac wrote: > I am brand new to pylint. > As a tab user, I want the tabs warning turned off. > How? Advice: Don't. IIRC it's planned in future Python versions that TABs aren't supported for indentation. Regards, Björn -- BOFH excuse #401: Sales staff sold a product we don't offer. --

Re: Reading a portion of a file

2007-03-08 Thread Rune Strand
On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > I am using a script with a single file containing all data in multiple > sections. Each section begins with "#VS:CMD:command:START" and ends > with "#VS:CMD:command:STOP". There is a blank line in between each > section. I'm looking for the best way to

pylint: don't warn about tabs

2007-03-08 Thread Alan Isaac
I am brand new to pylint. As a tab user, I want the tabs warning turned off. How? Larger question: where is the config file format documented? Thanks, Alan Isaac PS This is a wonderful tool. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >