RE: trying to access Oracle

2005-07-27 Thread Albert Leibbrandt
>> I am trying to access Oracle using the cx_Oracle module. I can login to Oracle OK, but I >> am at a loss as to how I should then access the specific table I need so that I can join it to >> our county parcel layer using the “make table view” tool. I have scoured the internet looking >> f

Re: how to get function signature

2005-07-27 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > > I was working on a dir like function that gives more information than > the usual dir, but I am not satisfied with the way I get function > arguments for callable members of an object. Take a look at it here: > http://nerdierthanthou.nfshost.com/2005/07/mdir-for-

how to get function signature

2005-07-27 Thread [EMAIL PROTECTED]
Hi, I was working on a dir like function that gives more information than the usual dir, but I am not satisfied with the way I get function arguments for callable members of an object. Take a look at it here: http://nerdierthanthou.nfshost.com/2005/07/mdir-for-python.html. I have seen PythonWin sh

Re: [path-PEP] Path inherits from basestring again

2005-07-27 Thread Ron Adam
Peter Hansen wrote: > Ron Adam wrote: > >> Michael Hoffman wrote: >> >>> Ron Adam wrote: >>> In all current cases, (that I know of), of differing types, '+' raises an error. >>> >>> >>> Not quite: >>> >>> "hello " + u"world" >>> u'hello world' >>> >>> 4.5 + 5 >>> 9.5 >>> >> In the cas

Re: can list comprehensions replace map?

2005-07-27 Thread Paolino
Raymond Hettinger wrote: > [David Isaac] > >>>I have been generally open to the proposal that list comprehensions >>>should replace 'map', but I ran into a need for something like >>>map(None,x,y) >>>when len(x)>len(y). I cannot it seems use 'zip' because I'll lose >>>info from x. How do I do th

Re: Are you interested in Saving money on projects?

2005-07-27 Thread mustafa
globalbid wrote: > Hi, > > I have a website www.FreelancingProject.com and I would like to invite > freelancer, programmer's or web designer's to sign up and receive a > nice sign up bonus! > > Our goal is to connect professional freelancers to webmasters providing > both freelancers and webmaste

Re: Earthquake Forecasting Program July 11, 2005

2005-07-27 Thread Hank Oredson
"Lemming" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 13 Jul 2005 23:39:46 GMT, "Hank Oredson" > <[EMAIL PROTECTED]> wrote: > >>In particular I am interested in the EM dataset. > > Hank, with respect ... > > Posted to nine newsgroups; fluffy responses when you ask specifi

Re: searching string url

2005-07-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Anyway to the orginally replier - I wish it was homework ;-), that > would mean I wouldnt be trying to find myself a job as a recent > graduate... I decided to crawl something similar to the yellow pages > (do you have them in the US?) for my select area and then find

retrieve data from 2 database

2005-07-27 Thread crespoh
Hi, How do I select data from two tables from two different databases and compare them? using dbi,odbc -- http://mail.python.org/mailman/listinfo/python-list

Re: any thing to do???

2005-07-27 Thread mustafa
James Stroud wrote: > The world needs an open source tool for working with DNA sequences > graphically. I know what needs to be done, but I am not finding much time to > do it. I have already coded a graphical sequence editor and some cool tools > for sequence analysis. For this project I am usi

Re: [OT] Problems with permissions etc

2005-07-27 Thread Mike Meyer
"Frank Millman" <[EMAIL PROTECTED]> writes: > While developing under linux, I use my own computer, as the only user, > so it has become my habit to login as root and do all my work as a > superuser. I know that this is not desirable, but it has become a > habit, which I am now trying to get out of

Re: multiple inheritance super()

2005-07-27 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: >>I am mostly >>using old style (without type unification) init but this motivate the >>shift for the new style. Is there somewhere a document about this? > Yes, see http://www.python.org/2.3/mro.html by yours truly I'd also recommend reading http:/

Re: any thing to do???

2005-07-27 Thread James Stroud
The world needs an open source tool for working with DNA sequences graphically. I know what needs to be done, but I am not finding much time to do it. I have already coded a graphical sequence editor and some cool tools for sequence analysis. For this project I am using Tkinter as the gui and b

Re: [path-PEP] Path inherits from basestring again

2005-07-27 Thread Peter Hansen
Ron Adam wrote: > Michael Hoffman wrote: >> Ron Adam wrote: >>> In all current cases, (that I know of), of differing types, '+' >>> raises an error. >> >> Not quite: >> >>> "hello " + u"world" >> u'hello world' >> >>> 4.5 + 5 >> 9.5 >> > In the case of numeric types, it's an addition and not a j

Re: Rich Graphics?

2005-07-27 Thread D H
Cairo is an option, for Linux only though at the moment. There is a python binding: http://cairographics.org/bindings You can use it in combination with pygtk: http://cvs.cairographics.org/pycairo/examples/svg/ See also the backends used by matplotlib, a python plotting module. -- http://mail.py

Re: Path inherits from basestring again

2005-07-27 Thread Jordan Rastrick
Personally, I *like* the current distinction between + as a regular string join, which gives the already much discussed benefit of allowing paths to be dropped in seamlessly and painlessly anywhere strings are currently used, and then having in addition the / operator for "concatenate with a path s

Re: Earthquake Forecasting Program July 11, 2005

2005-07-27 Thread Lemming
On Wed, 13 Jul 2005 23:39:46 GMT, "Hank Oredson" <[EMAIL PROTECTED]> wrote: >In particular I am interested in the EM dataset. Hank, with respect ... Posted to nine newsgroups; fluffy responses when you ask specific questions; evasion when you repeatedly ask for real data ... I regret to say, YHB

Trimming X/HTML files

2005-07-27 Thread Thomas SMETS
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear, I need to parse XHTML/HTML files in all ways : ~ _ Removing comments and javascripts is a first issue ~ _ Retrieving the list of fields to submit is my following item (todo) Any idea where I could find this already made ... ? \T, -BEGIN

Re: can list comprehensions replace map?

2005-07-27 Thread Steven Bethard
David Isaac wrote: > I ran into a need for something like map(None,x,y) > when len(x)>len(y). I cannot it seems use 'zip' because I'll lose > info from x. I almost never run into this situation, so I'd be interested to know why you need this. Here's one possible solution: py> import itertools

Re: can list comprehensions replace map?

2005-07-27 Thread Raymond Hettinger
[David Isaac] > > I have been generally open to the proposal that list comprehensions > > should replace 'map', but I ran into a need for something like > > map(None,x,y) > > when len(x)>len(y). I cannot it seems use 'zip' because I'll lose > > info from x. How do I do this as a list comprehensio

Re: anything to do

2005-07-27 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > is there any place which lists jobs to be done...you know minor jobs > and requests thats nobody has found time to do. Not all of these are pure Python, so you may have to wade through a bit to avoid the C ones, but a good place to look is the Python trackers on source

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Steven D'Aprano
On Wed, 27 Jul 2005 14:18:25 -0400, Bill Mill wrote: > On 7/27/05, Tito <[EMAIL PROTECTED]> wrote: >> Hi all: >> >> Is there a metalanguage capability in Python (I know there are many) to >> call a function having its name in a string? >> >> Something like: >> __call__("foo") >> >> instead of:

Re: [path-PEP] Path inherits from basestring again

2005-07-27 Thread Ron Adam
Michael Hoffman wrote: > Ron Adam wrote: > >> In all current cases, (that I know of), of differing types, '+' raises >> an error. > > > Not quite: > > >>> "hello " + u"world" > u'hello world' > >>> 4.5 + 5 > 9.5 > >> Question: Is a path object mutable? > > > No. > > This should answer t

Rich Graphics?

2005-07-27 Thread Chris Spencer
I'm trying to write a Gui in Python for manipulating rich graphical representations, similar to something like Inkscape. I've tried tkinter, wxPython, pyGtk, and while they all do traditional widgets well enough, none of them really handle anti-aliased, transparent, transformed shapes typical o

Job available: SF Bay Area (was Re: OT: finding a job)

2005-07-27 Thread Aahz
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > >Mass-mailed resumes with generic cover letters are a good way to kill >trees but not a particular effective way to get noticed by an employer, >at least not noticed in a good way... Excellent advice! Speaking of which,

Re: Why Tcl/Tk?

2005-07-27 Thread William Park
Jerry He <[EMAIL PROTECTED]> wrote: > I'm a little curious, why does most scripting > languges(i.e. python and ruby) use Tcl/Tk rather than > wx or Fox as its standard GUI? Although I did notice > that the Vpython IDE that uses Tkinker starts up a lot > faster than the DrPython IDE that uses wxpyth

OT: finding a job (was Re: searching string url)

2005-07-27 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Anyway to the orginally replier - I wish it was homework ;-), that > would mean I wouldnt be trying to find myself a job as a recent > graduate... I decided to crawl something similar to the yellow pages Sounds like a useful task, and a good way to learn more about Pytho

Are you interested in Saving money on projects?

2005-07-27 Thread globalbid
Hi, I have a website www.FreelancingProject.com and I would like to invite freelancer, programmer's or web designer's to sign up and receive a nice sign up bonus! Our goal is to connect professional freelancers to webmasters providing both freelancers and webmasters the opportunity to expand thei

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Peter Hansen
Tito wrote: > Thank you both for your quick answers. > > What I wanted is to parameterize a function with another member > function, like this: > > def printFunctionForEach(collection, functionName): > for elem in collection: > print eval("elem." + functionName + "()") Note: "member funct

Re: SciPy and NetCDF

2005-07-27 Thread Rocco Moretti
Scott Kilpatrick wrote: > So wherever pycdf does a: > > from Numeric import * > > what is the equivalent for SciPy? i.e. where is the full Numeric module > in SciPy? Python packages are in a pretty flat hierarchy. There really isn't a "SciPy Numeric" and a "pycdf Numeric" - Numeric, as an indep

Re: getting Arrays and variables from R [fixed]

2005-07-27 Thread Nicolas Lebas
Finally i found the solution in Rpy-list : there is a bug in python2.4-rpy_0.4.1. An alternative solution which works fine it's to use the R get(str) function instead of using directly the variable (i.e r.tab) like that : r.get('tab') Nicolas Lebas a écrit : > hello, > > i don't know if thi

Re: SciPy and NetCDF

2005-07-27 Thread Robert Kern
Scott Kilpatrick wrote: > Oh ok, so if my sysadmin installs SciPy, then to get the netCDF support > we need he just needs to then install pycdf? 1. Install Numeric. 2. Install Scipy. 3. Install pycdf. Numeric is not, yet, bundled into Scipy. -- Robert Kern [EMAIL PROTECTED] "In the fields of h

Re: SciPy and NetCDF

2005-07-27 Thread Scott Kilpatrick
Oh ok, so if my sysadmin installs SciPy, then to get the netCDF support we need he just needs to then install pycdf? I really appreciate the help. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-07-27 Thread Dean N. Williams
[snip] >I didn't get this error. Did you forgot to install one of the >libdb${version}-devel packages: > >$ cygcheck -cd | grep 'libdb.*-devel' >libdb2-devel2.7.7-4 >libdb3.1-devel 3.1.17-2 >libdb4.1-devel 4.1.25-1 >libdb4.2-devel 4.2.52

Re: searching string url

2005-07-27 Thread googlinggoogler
Thanks for the rapid replys, I cracked the problem 15 seconds after posting here, doh! Anyway to the orginally replier - I wish it was homework ;-), that would mean I wouldnt be trying to find myself a job as a recent graduate... I decided to crawl something similar to the yellow pages (do you hav

Re: SciPy and NetCDF

2005-07-27 Thread Robert Kern
Scott Kilpatrick wrote: > So wherever pycdf does a: > > from Numeric import * > > what is the equivalent for SciPy? i.e. where is the full Numeric module > in SciPy? Scipy also does a from Numeric import * Numeric isn't contained within Scipy; Scipy uses Numeric like pycdf does. -- Robert

Re: Wrapping a class set method

2005-07-27 Thread Paolino
snoe wrote: > I have a suspicion that there's an easier way to do this than > explicitly adding a Project.pickleme() call to the beginning of all of > my set/add methods. > So is there a way to wrap methods for this type of functionality or is > there another way of doing this, maybe without usi

Re: Wrapping a class set method

2005-07-27 Thread Paolino
snoe wrote: > I have a suspicion that there's an easier way to do this than > explicitly adding a Project.pickleme() call to the beginning of all of > my set/add methods. > So is there a way to wrap methods for this type of functionality or is > there another way of doing this, maybe without usi

Re: SciPy and NetCDF

2005-07-27 Thread Scott Kilpatrick
So wherever pycdf does a: from Numeric import * what is the equivalent for SciPy? i.e. where is the full Numeric module in SciPy? -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping a class set method

2005-07-27 Thread Bengt Richter
On 27 Jul 2005 11:42:24 -0700, "snoe" <[EMAIL PROTECTED]> wrote: >Hi there, > >I have the following simplified classes: > >class Project: >def __init__(self,pname): >self.devices = {} # Dictionary of Device objects >self.pname = pname > >def setpname(self,pname): >s

Re: Emacs skeletons

2005-07-27 Thread Florian Diesch
Michael Hoffman <[EMAIL PROTECTED]> wrote: > Does anyone have any Emacs skeletons they find useful for Python? I > Googled a little but didn't find anything enticing. I already have a > script that sets up script/module templates, so those aren't all that > useful. else-mode

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-07-27 Thread Jason Tishler
Dean, On Wed, Jul 27, 2005 at 12:41:05PM -0700, Dean N. Williams wrote: > Thanks for fixing this bug in Cygwin. You are welcome. However, I didn't fix it -- I just got it fixed. :,) > Remember there was another undefined variable for the Python build > _bsd... I didn't get this error. Did you

Re: question about deleting records from mysql

2005-07-27 Thread Cantankerous Old Git
nephish wrote: > Man, thanks for the link. and the tip. i am testing > the db.commit() and printing the doc right now. > thanks again. If it's any help, using cursor.execute("set autocommit = 1") before doing anything else works nicely unless you actually need transactions. The Cog -- ht

Re: searching string url

2005-07-27 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hiya, > > Im trying to find a method of searching a html file (ive grabbed it > with FancyURLopener), basically in the html file there is a series of > links in the following format - > > A HREF="../../company/11/13/820.htm">some name > so I want to search the file for

Re: searching string url

2005-07-27 Thread Devan L
Sounds somewhat like homework. So I won't just give you a code solution. Use the regular expression(re) module to match the urls. -- http://mail.python.org/mailman/listinfo/python-list

acidulous courtyard izvestia rutabaga bushy attribute sicily stayed starlet lance chaos crest donald fondle backwater revisionary fanciful wanton terre calf purport indissoluble become transom antigen pokerface shrubbery behave lineal chrysler pyroxenite eyeful checklist downing

2005-07-27 Thread Judy Dunn
PROGRAMS AND GAMES! www.geocities.com/software1 rotateacquaintbehindbespeakbreathygabbleprofiteerporous.edmundcannelcaramel. flutedarwindutydioriteashleyco

Re: Why Tcl/Tk?

2005-07-27 Thread Robert Kern
Jerry He wrote: > I'm a little curious, why does most scripting > languges(i.e. python and ruby) use Tcl/Tk rather than > wx or Fox as its standard GUI? Way back in the day, wx and Fox didn't exist (at least not in a usable form) while Tcl/Tk was rock-solid stable. > Although I did notice > that

searching string url

2005-07-27 Thread googlinggoogler
Hiya, Im trying to find a method of searching a html file (ive grabbed it with FancyURLopener), basically in the html file there is a series of links in the following format - A HREF="../../company/11/13/820.htm">some namehttp://mail.python.org/mailman/listinfo/python-list

MESSAGE NOT DELIVERED: Returned mail: Data format error

2005-07-27 Thread dan
Your message could not be delivered. The User is out of space. Please try to send your message again at a later time. -- http://mail.python.org/mailman/listinfo/python-list

Re: can list comprehensions replace map?

2005-07-27 Thread Andrew Dalke
David Isaac wrote: > I have been generally open to the proposal that list comprehensions > should replace 'map', but I ran into a need for something like > map(None,x,y) > when len(x)>len(y). I cannot it seems use 'zip' because I'll lose > info from x. How do I do this as a list comprehension? (O

Why Tcl/Tk?

2005-07-27 Thread Jerry He
I'm a little curious, why does most scripting languges(i.e. python and ruby) use Tcl/Tk rather than wx or Fox as its standard GUI? Although I did notice that the Vpython IDE that uses Tkinker starts up a lot faster than the DrPython IDE that uses wxpython. But that makes no sense, Tk is based on Tc

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-07-27 Thread Dean N. Williams
Jason, Thanks for fixing this bug in Cygwin. Remember there was another undefined variable for the Python build _bsd... Best regards, Dean >On Mon, Jul 25, 2005 at 03:02:45PM -0700, [EMAIL PROTECTED] wrote: > > >>Let me know when you have it solved. >> >> > >The problem has be

Re: can list comprehensions replace map?

2005-07-27 Thread Paolino
David Isaac wrote: > Newbie question: > > I have been generally open to the proposal that list comprehensions > should replace 'map', but I ran into a need for something like > map(None,x,y) > when len(x)>len(y). I cannot it seems use 'zip' because I'll lose > info from x. How do I do this as a

Supporting << and >> operators in C extension type

2005-07-27 Thread Pedro Werneck
Hi list I'm trying to implement a new type in a C extension and it must support some binary operators, like &, |, ^, << and >>. With &, | and ^, the method must receive another object of the same type, perform the operation with an attribute of both, create a new object with the result as the at

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Tito
Once again: thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-27 Thread rafi
Michele Simionato wrote: >>I am mostly >>using old style (without type unification) init but this motivate the >>shift for the new style. Is there somewhere a document about this? > > Yes, see http://www.python.org/2.3/mro.html by yours truly > >Michele Simionato Thanks a lot -- rafi

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-07-27 Thread Jason Tishler
On Mon, Jul 25, 2005 at 03:02:45PM -0700, [EMAIL PROTECTED] wrote: > Let me know when you have it solved. The problem has been fixed in Cygwin CVS: http://cygwin.com/ml/cygwin/2005-07/msg01257.html http://cygwin.com/ml/cygwin-cvs/2005-q3/msg00046.html > In the meantime, I have a workarou

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Paul Rubin
Tito <[EMAIL PROTECTED]> writes: > def printPropertyForEach(collection, propertyName): >for elem in collection: > print eval("elem." + propertyName) > > Is there another approach to do it? Yes, use the getattr function: for elem in collection: print getattr(elem, propertyName) -

Re: multilanguage site and user informations edition

2005-07-27 Thread limi
Plone 2.1 RC is released on Monday. Hopefully the LinguaPlone update is available that same week. If you can't wait that long, I suggest you stick to Plone 2.0.5 and LinguaPlone 0.7.x. -- Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Bill Mill
On 7/27/05, Tito <[EMAIL PROTECTED]> wrote: > Thank you both for your quick answers. > > What I wanted is to parameterize a function with another member > function, like this: > > def printFunctionForEach(collection, functionName): >for elem in collection: > print eval("elem." + function

Re: Create a variable "on the fly"

2005-07-27 Thread Do Re Mi chel La Si Do
Hi ! Try : OSCAR='the grouch' print OSCAR useless to thank me Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Tito
> Thank you both for your quick answers. Thank you *all* for your quick answers. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Tito
Thank you both for your quick answers. What I wanted is to parameterize a function with another member function, like this: def printFunctionForEach(collection, functionName): for elem in collection: print eval("elem." + functionName + "()") Moreover, I wanted to do it with a property:

Re: [path-PEP] Path inherits from basestring again

2005-07-27 Thread Michael Hoffman
Ron Adam wrote: > In all current cases, (that I know of), of differing types, '+' raises > an error. Not quite: >>> "hello " + u"world" u'hello world' >>> 4.5 + 5 9.5 > Question: Is a path object mutable? No. This should answer the rest of your questions. -- Michael Hoffman -- http://ma

Re: can list comprehensions replace map?

2005-07-27 Thread Larry Bates
This isn't really a question about list comprehensions as you are using a "feature" of map by passing None as the function to be executed over each list element: This works when len(x) > len(y): zip(x,y+(len(x)-len(y))*[None]) This works when len(y) >=0 len(x): zip(x+(len(x)-len(y))*[None],y)

Wrapping a class set method

2005-07-27 Thread snoe
Hi there, I have the following simplified classes: class Project: def __init__(self,pname): self.devices = {} # Dictionary of Device objects self.pname = pname def setpname(self,pname): self.pname = pname def adddevice(self,dname): self.devices[dname]

Re: can list comprehensions replace map?

2005-07-27 Thread Michael Hoffman
Michael Hoffman wrote: > David Isaac wrote: > >> Newbie question: >> >> I have been generally open to the proposal that list comprehensions >> should replace 'map', but I ran into a need for something like >> map(None,x,y) >> when len(x)>len(y). I cannot it seems use 'zip' because I'll lose >> in

Re: can list comprehensions replace map?

2005-07-27 Thread Michael Hoffman
David Isaac wrote: > Newbie question: > > I have been generally open to the proposal that list comprehensions > should replace 'map', but I ran into a need for something like > map(None,x,y) > when len(x)>len(y). I cannot it seems use 'zip' because I'll lose > info from x. How do I do this as a

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Grant Edwards
On 2005-07-27, Paolino <[EMAIL PROTECTED]> wrote: >> Is there a metalanguage capability in Python (I know there are many) to >> call a function having its name in a string? > eval('foo()') should do, but it's said a bad practice ;) An alternative to eval() is: >>> def foo(): ... print "foo w

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Michael Hoffman
Tito wrote: > Hi all: > > Is there a metalanguage capability in Python (I know there are many) to > call a function having its name in a string? > > Something like: > __call__("foo") > > instead of: > foo() locals()["foo"]() will be a little more predictable than eval("foo()"). -- Michael Hof

can list comprehensions replace map?

2005-07-27 Thread David Isaac
Newbie question: I have been generally open to the proposal that list comprehensions should replace 'map', but I ran into a need for something like map(None,x,y) when len(x)>len(y). I cannot it seems use 'zip' because I'll lose info from x. How do I do this as a list comprehension? (Or, more gen

Re: GUI - Windows: Where to get started

2005-07-27 Thread Larry Bates
First you need to pick up a copy of Python Programming for Win32 book. It is a good starting place for GUI as well as COM and writing services. It was well worth the price to me. -Larry Ernesto wrote: > Hi all, > > Would anyone know a good place to start for learning how to build > simple GUI'

Re: Tkinter - Resizing a canvas with a window

2005-07-27 Thread Gordon Airporte
Thanks you very much. I found something interesting though, the canvas's width and height properties are not updated when it is resized by its packing. Looks like an oversight to me, but I've just demonstrated that I don't have a complete grasp of Tk, so... I can use a Configure callback to kee

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Paolino
Tito wrote: > Hi all: > > Is there a metalanguage capability in Python (I know there are many) to > call a function having its name in a string? > > Something like: > __call__("foo") > > instead of: > foo() > > Regards, > Tito eval('foo()') should do, but it's said a bad practice ;) -- http:/

Re: [path-PEP] Path inherits from basestring again

2005-07-27 Thread Ron Adam
Toby Dickenson wrote: > On Wednesday 27 July 2005 05:37, Meyer, Tony wrote: > > >>I can see that this would make sense in some situations, but ISTM that it >>would make a great deal more sense (and be much more intuitive) to have >>concatenation include the separator character (i.e. be join). >

Re: [Beginner] Calling a function by its name in a string

2005-07-27 Thread Bill Mill
On 7/27/05, Tito <[EMAIL PROTECTED]> wrote: > Hi all: > > Is there a metalanguage capability in Python (I know there are many) to > call a function having its name in a string? > > Something like: > __call__("foo") > > instead of: > foo() > >>> def foo(): print "foobarred" ... >>> foo() foobar

[Beginner] Calling a function by its name in a string

2005-07-27 Thread Tito
Hi all: Is there a metalanguage capability in Python (I know there are many) to call a function having its name in a string? Something like: __call__("foo") instead of: foo() Regards, Tito -- http://mail.python.org/mailman/listinfo/python-list

Re: A Module on Time & Date

2005-07-27 Thread Fernando Perez
Robert Maas, see http://tinyurl.com/uh3t wrote: >> From: Robert Kern <[EMAIL PROTECTED]> >> As you can see in the datetime documentation, the module was introduced >> in Python 2.3. I recommend updating your Python installation. > > What do you mean "your"?? I don't have any Python installation o

Re: Create a variable "on the fly"

2005-07-27 Thread Willem Broekema
Steve M: > >>> locals()['OSCAR'] = 'the grouch' > >>> OSCAR > 'the grouch' > >>> Use "globals", not "locals": globals()['OSCAR'] = 'the grouch' because states: locals() Update and return a dictionary representing the current loca

Re: any thing to do???

2005-07-27 Thread Paolino
mustafa wrote: > i hav just finished learning pythob from "A byte of python"(an online > book) so i wanted to apply my new skills. to learn and to have some fun. > is there any place which lists jobs to be done...you know minor jobs and > requests thats nobody has found time to do. > i would poin

any thing to do???

2005-07-27 Thread mustafa
i hav just finished learning pythob from "A byte of python"(an online book) so i wanted to apply my new skills. to learn and to have some fun. is there any place which lists jobs to be done...you know minor jobs and requests thats nobody has found time to do. i would point out that i am not looki

Re: [OT] Problems with permissions etc

2005-07-27 Thread Jeremy Moles
On Wed, 2005-07-27 at 00:36 -0700, Frank Millman wrote: > Hi all > > This is not strictly a Python question, but this newsgroup feels like a > family to me, so I hope that someone will be kind enough to respond to > this, or at least point me in the right direction. > > While developing under lin

Re: Create a variable "on the fly"

2005-07-27 Thread bruno modulix
Paul D.Smith wrote: > Can Python create a variable "on-the-fly". For example I would like > something like... > > make_variable('OSCAR', 'the grouch'); > print OSCAR; > > ...to output... > > the grouch > > Anything like this in Python? The bad news is that yes, there is something "like this"

Bash Helper Script

2005-07-27 Thread Jeremy Moles
I wrote something real quick this morning that I thought might be somewhat useful to someone else. It's just a bash script that lets you do a few things do a "project directory" (in my case, python subversion projects) in a decently sensible way. Usage is: # cp pypadmin MyProjectDir/pypadmin # ./p

Re: html special characters to latin-1 conversion

2005-07-27 Thread Kent Johnson
ulrice jardin wrote: > hi > > I had a look to this htmlentitydefs lib, but I still > don't know how to convert html special characters into > latin-1 characters. > For instance, how can I convert ' into ' or é > and é into é? Searching comp.lang.python for 'htmlentitydefs' gives quite a few solut

Re: Create a variable "on the fly"

2005-07-27 Thread Steve M
PythonWin 2.3.5 (#62, Feb 9 2005, 16:17:08) [MSC v.1200 32 bit (Intel)] on win32. Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) - see 'Help/About PythonWin' for further copyright information. >>> locals()['OSCAR'] = 'the grouch' >>> OSCAR 'the grouch' >>> -- http://mail.python.or

Re: Could anyone write a small program to log the Signal-to-Noise figures for a Netgear DG834 router?

2005-07-27 Thread mustafa
Chris wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> writes > >>On Tue, 19 Jul 2005 07:24:19 +0100, Chris wrote: > > >>>Could anyone write a small program to log the Signal-to-Noise figures >>>for a Netgear DG834 router? > > >>Are you offering to pay somebody t

On fighting fire with fire...

2005-07-27 Thread skip
Twice today I responded to rude messages (once here, once on the SpamBayes list) whose authors didn't deserve the benefit of my time. In both cases, other people rightfully responded with some small amount of return venom (but provided useful responses nonetheless). Let me suggest that there is

anything to do

2005-07-27 Thread [EMAIL PROTECTED]
i hav just finished learning pythob from "A byte of python"(an online book) so i wanted to apply my new skills. to learn and to have some fun. is there any place which lists jobs to be done...you know minor jobs and requests thats nobody has found time to do. i would point out that i am not looking

pygtk - scale widget events

2005-07-27 Thread ch424
Hi I'm trying to make a zooming in/out slider, but I want to make it re-center when I let go of the mouse button on it -- i.e. it starts with a value of 1 (in the center of the slider), then the user can drag it to the right or left, while it does UPDATE_CONTINUOUS, but when the user lets go, I wa

Re: Stripping C-style comments using a Python regexp

2005-07-27 Thread [EMAIL PROTECTED]
Neat! I didn't realize that re.sub could take a function as an argument. Thanks. Lorin -- http://mail.python.org/mailman/listinfo/python-list

Re: A Module on Time & Date

2005-07-27 Thread skip
>> As you can see in the datetime documentation, the module was >> introduced in Python 2.3. I recommend updating your Python >> installation. Robert> What do you mean "your"?? I don't have any Python installation Robert> of my own. All I have is what this small local ISP pro

Re: Stripping C-style comments using a Python regexp

2005-07-27 Thread Lonnie Princehouse
> Is there some equivalent feature in Python regexps? cpp_pat = re.compile('(/\*.*?\*/)|(".*?")', re.S) def subfunc(match): if match.group(2): return match.group(2) else: return '' stripped_c_code = cpp_pat.sub(subfunc, c_code) ...I suppose this is what the Perl code might do, but

Re: Create a variable "on the fly"

2005-07-27 Thread Paolino
Paul D.Smith wrote: > Can Python create a variable "on-the-fly". For example I would like > something like... > > make_variable('OSCAR', 'the grouch'); > print OSCAR; > > ...to output... Python has only 'on the fly' variables and ';' is not used for one expression in one line. Probably the tu

Re: Create a variable "on the fly"

2005-07-27 Thread Dan
> make_variable('OSCAR', 'the grouch'); > print OSCAR; Try using "setattr". (It's in __builtins__; you don't have to import anything.) >>> print setattr.__doc__ setattr(object, name, value) Set a named attribute on an object; setattr(x, 'y', v) is equivalent to ``x.y = v''. -- If builders b

Re: Create a variable "on the fly"

2005-07-27 Thread Paolino
Paul D.Smith wrote: > Can Python create a variable "on-the-fly". For example I would like > something like... > > make_variable('OSCAR', 'the grouch'); > print OSCAR; > > ...to output... Python has only 'on the fly' variables and ';' is not used for one expression in one line. Probably the tu

trying to access Oracle

2005-07-27 Thread Patrick Thorstenson
I am trying to access Oracle using the cx_Oracle module. I can login to Oracle OK, but I am at a loss as to how I should then access the specific table I need so that I can join it to our county parcel layer using the “make table view” tool. I have scoured the internet looking for any examp

Re: Stripping C-style comments using a Python regexp

2005-07-27 Thread Lonnie Princehouse
> Is there some equivalent feature in Python regexps? cpp_pat = re.compile('(/\*.*?\*/)|(".*?")', re.S) def subfunc(match): if match.group(2): return match.group(2) else: return '' stripped_c_code = cpp_pat.sub(subfunc, c_code) ...I suppose this is what the Perl code might do, but

Re: Stripping C-style comments using a Python regexp

2005-07-27 Thread Jeff Epler
# import re, sys def q(c): """Returns a regular expression that matches a region delimited by c, inside which c may be escaped with a backslash""" return r"%s(\\.|[^%s])*%s" % (c, c, c) single_quoted_string = q('

Create a variable "on the fly"

2005-07-27 Thread Paul D.Smith
Can Python create a variable "on-the-fly". For example I would like something like... make_variable('OSCAR', 'the grouch'); print OSCAR; ...to output... the grouch Anything like this in Python? And in case anyone is interested, I want to instantiate a set of variables based on environment var

  1   2   >