Re: problems importing from /usr/lib/pyshared/

2013-01-12 Thread Harold
Thank you Dieter, > Ubuntu 12 has introduced important changes with respect to "glib" (and > depending packages). In fact, there are now two quite incompatible > implementations - the old "static" one and a new "dynamic" one. > It looks as if in your case, old and new implementations were mixed. >

problems importing from /usr/lib/pyshared/

2013-01-10 Thread Harold
Dear all, I recently upgraded my system from ubuntu 11.4 to 12.4 and since run into an issue when trying to import several packages in python2.7, e.g. harold@ubuntu:~$ python -c 'import gtk' Traceback (most recent call last): File "", line 1, in File "/usr/lib/py

Re: Significant figures calculation

2011-06-27 Thread Harold
On Jun 25, 9:04 pm, Chris Torek wrote: > >I'm curious.  Is there a way to get the number of significant digits > >for a particular Decimal instance? > > Yes: > > def sigdig(x): >     "return the number of significant digits in x" >     return len(x.as_tuple()[1]) Great, Chris, this is (almost) ex

Re: Significant figures calculation

2011-06-26 Thread Harold
> >I'm curious.  Is there a way to get the number of significant digits > >for a particular Decimal instance? > > Yes: > > def sigdig(x): >     "return the number of significant digits in x" >     return len(x.as_tuple()[1]) Great! that's exactly what I needed. thanks Chris! -- http://mail.python

Re: Significant figures calculation

2011-06-24 Thread Harold
> > I tried to modify the DecimalContext (e.g. getcontext().prec = 2) but > > that did not lead to the correct behavior. > > Really? It works for me. You are right, I did something wrong when attempting to set the precision. And the trick with rounding the decimal with the unary + is neat. It's th

Significant figures calculation

2011-06-24 Thread Harold
Hi, I am looking for an easy way to do significant figure calculations in python (which I want to use with a class that does unit calculations). Significant figure calculations should have the semantics explained, e.g., here: http://chemistry.about.com/od/mathsciencefundamentals/a/sigfigures.htm

Python Opportunity at OPNET

2010-03-04 Thread Harold Meder
I stumbled across this Job Posting<https://enterprise1.opnet.com/recruiting/positions/show_job/4836>at OPNET. I hope that it is acceptable to post this type of info on this mailing list. I do not know any further information regarding this opportunity. Harold Meder. -- http://mail.pyth

Problem combining Scientific (leastSquaresFit) and scipy (odeint)

2009-11-21 Thread Harold Fellermann
odule FirstDerivatives". What is a good solution or workaround to this problem which appears to be quite a standard situation to me? Thanks for any help, harold. -- http://mail.python.org/mailman/listinfo/python-list

RE: Use python to execute a windows program

2009-09-11 Thread Doran, Harold
09 3:09 PM > To: python-list@python.org > Subject: Re: Use python to execute a windows program > > On Fri, Sep 11, 2009 at 12:46 PM, Doran, Harold > wrote: > > I am working with this now. I'm toying with the examples to > test out a > > few things and learn ho

RE: Use python to execute a windows program

2009-09-11 Thread Doran, Harold
nuSelect("File->Open Database") def Main(): start = time.time() AM() if __name__ == "__main__": Main() > -Original Message- > From: simon.brunn...@gmail.com > [mailto:simon.brunn...@gmail.com] On Behalf Of Simon Brunning > Sent: Fr

Use python to execute a windows program

2009-09-11 Thread Doran, Harold
Dear list: My question is conceptual at the moment. Current problem: I have a windows-based program that reads in a file and from that file generates data that is saved to a file. The way we do this now is a person sits in front of their machine and proceeds as follows: 1) Open windows program

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Harold Fellermann
On Dec 4, 10:39 am, Cong Ma <[EMAIL PROTECTED]> wrote: > Lawrence D'Oliveiro wrote: > > for \ > >         Entry \ > >     in \ > >         sorted \ > >           ( > >             f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != > > None > >           ) \ > > : > >     Patch = (open,

Re: Creating classes and objects more than once?

2008-11-27 Thread Harold Fellermann
On Nov 27, 6:42 pm, Viktor Kerkez <[EMAIL PROTECTED]> wrote: > Is this a bug? It is not a bug: the dictionaries are different because they are loaded from different modules. >>> import os >>> import test.data >>> test.data >>> os.chdir('test') >>> import data >>> data >>> test.data is data Fals

Re: Python Linear Programming on Ubuntu

2008-09-17 Thread Harold Fellermann
makes 6. You are right that this is an unsatisfying experience. Fortunately, the referred site is a wiki. Why don't you edit it and delete the broken links or add the package that did the job for you to the list, so that others do not need to go through the same hassle. - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Profiling, sum-comprehension vs reduce

2008-09-13 Thread Harold Fellermann
(lst). Cheers, - harold - -- http://mail.python.org/mailman/listinfo/python-list

Making Windows Larger in Tkinter

2008-04-18 Thread Doran, Harold
Thanks to some help I received on list the other day, I now have a very nice windows-based application that implements multiple programs. This is a very powerful tool. Now I am working to make this window pretty. One problem I cannot find help on is how to make the windows a certain size. For examp

Learning Tkinter

2008-04-16 Thread Doran, Harold
onfig(menu=menu) filemenu = Menu(menu) menu.add_cascade(label="File", menu=filemenu) filemenu.add_command(label="New", command=harold) filemenu.add_command(label="Open...", command=callback) filemenu.add_separator() filemenu.add_command(label="Exit", command=callba

Process multiple files

2008-04-14 Thread Doran, Harold
Say I have multiple text files in a single directory, for illustration they are called "spam.txt" and "eggs.txt". All of these text files are organized in exactly the same way. I have written a program that parses each file one at a time. In other words, I need to run my program each time I want to

Elementtree to parse xml

2008-03-31 Thread Doran, Harold
can send as well as my python code to offer suggestions? I would normally insert a minimal, commented example inside this email. But the xml file is a bit too big to put in this email. I am *very* close to having this resolved, but just need a nudge in the right direction. Thanks, Harold -- http

Python and xml

2008-03-29 Thread Doran, Harold
, Harold -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with the strip string method

2008-03-03 Thread Harold Fellermann
_strip(string,sep='\n') : return sep.join(line.strip() for line in string.split(sep)) cheers, - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Better writing in python

2007-10-24 Thread Harold Fellermann
ry But please, give us some more context of what you want to do. - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: why did MIT drop scheme for python in intro to computing?

2007-10-09 Thread Harold Ancell
ool, much like S-expressions in LISP), I looked hard at the beginning of 6.01 where they're only teaching SICP. For that purpose, Python is not "awful" (remember, I believe LISP is the One True Way of Computing). For that initial bit of SICP material, I do not believe the student

Checking if elements are empty

2007-09-05 Thread Doran, Harold
Dear list: Suppose I have a string as follows x = ' \t'ff' I can split this up as y = x.split('\t') Which gives [ ' ', 'ff'] len(y) 2 Is there a way to check if the first element of y is null? -- http://mail.python.org/mailman/listinfo/python-list

Sorting Unix mailboxes

2007-08-06 Thread harold barker
Was your mailbox module competed? If so where can i find it? -- http://mail.python.org/mailman/listinfo/python-list

Output to csv

2007-07-25 Thread Doran, Harold
ed in ways to write better code. If anyone has any suggestions, they are most appreciated. Below is the program in its current form. Harold filename = raw_input("Please enter the WinSteps ISF file: ") new_file = raw_input("Enter the name of the csv file to output: ") # create

passing options to __import__

2007-04-03 Thread Harold Fellermann
trying, or do I need to fall back on a config module/class? Thanks! - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: design question: no new attributes

2007-03-14 Thread Harold Fellermann
Something like: class Foo(object) : def __init__(self) : self._locked = False But no! The initialization would trigger Foo.__setattr__(foo,'_locked',False) which naturally runs into an attribute error since __setattr__ looks up this attribute. So this very same implementation is one of the pro examples you asked for :-) cheers, - harold - -- http://mail.python.org/mailman/listinfo/python-list

RE: Wow, Python much faster than MatLab

2006-12-30 Thread Doran, Harold
R is the open-source implementation of the S language developed at Bell laboratories. It is a statistical programming language that is becoming the de facto standard among statisticians. Rpy is what allows an interface between python and the R language. Harold > -Original Mess

Beginner question on text processing

2006-12-29 Thread Doran, Harold
I am beginning to use python primarily to organize data into formats needed for input into some statistical packages. I do not have much programming experience outside of LaTeX and R, so some of this is a bit new. I am attempting to write a program that reads in a text file that contains some value

Generating text files (newbie)

2006-12-28 Thread Doran, Harold
Assume I have a tab-delimited text file called foo.txt organized as follows: x11 -0.04 x22 -0.42 x33 0.3 My goal is to read in this file and use the information therein to output a new file that is organized as follows: x11 IRM=3PL IPB= -0.04 x22 IRM=3PL IPB= -0.

Re: A suggestion/request for IDEs

2006-10-19 Thread Harold Trammel
John Salerno wrote: > I apologize for the slightly off-topic nature, but I thought I'd just > throw this out there for anyone working on text editors or IDEs with > auto-completion. > > I think it should be a feature, when an item is selected for > auto-completion in a drop-down box, that press

MySQLdb for Python 2.5

2006-09-29 Thread Harold Trammel
Hi everyone, Does anyone know the status of a version of MySQLdb that will work with Python 2.5? I will accept a workaround if you know one. Thanks in advance. Harold Trammel -- http://mail.python.org/mailman/listinfo/python-list

Re: mp3 libs and programs

2006-09-15 Thread Harold Fellermann
hi, Jay wrote: > I'm writing a python script that involves playing mp3 files. The first > approach I had was sending commands to unix command-line programs in > order to play them. I tired mpg123 and moosic, but there was a key > feature to my program's success that's missing. SEEK! I need to

Re: ScientificPython - LeastSquareFit diverges

2006-07-19 Thread Harold Fellermann
/levmar/). Are there any plans to improve the SciPy algorithm? Would it be a welcome contribution to SciPy to work this part out? - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter help

2006-07-18 Thread Harold Fellermann
that option to do > advance search. If I understood you correctly, this is how I would go for it: consider to create all submenus during initialization but make them invisible (put each of them in a single frame) anf toggle the visibility of these frames in the handler of your option

ScientificPython - LeastSquareFit diverges

2006-07-18 Thread Harold Fellermann
ld easily fit the above data using gnuplots internal fitting procedure. Any idea what is going wrong here? Is it a known problem? Are there any work arounds or other packages? Any help is appreciated! - harold - -- http://mail.python.org/mailman/listinfo/python-list

Using SQLite3 with python 2.5 beta

2006-06-22 Thread Harold Shore
>From the release notes I read that "If you're compiling the Python source yourself, note that the source tree doesn't include the SQLite code, only the wrapper module. You'll need to have the SQLite libraries and headers installed before compiling Python, and the build process will compile th

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Harold Fellermann
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given a

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
nknown goodies in the library, great :-) - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
Maric Michaud wrote: > Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit : > > to os.tmpfile() which is supposed to be safer, but I do not know how to > > get > > the path information from the file object returned by tmpfile(). any > > clues? > There is no path

Re: From Python to Shell

2006-06-08 Thread Harold Fellermann
its stdout and stderr streams. have a look at the docs of that module for more information. - harold - -- http://mail.python.org/mailman/listinfo/python-list

how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
r, but I do not know how to get the path information from the file object returned by tmpfile(). any clues? thanks! - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: sorting a list slice

2006-05-19 Thread Harold Fellermann
k that the additional load they impose on the sort function is also minor. In my oppinion, this is a straight-forward extension of what we already find in other places in the library. I would like to see it in a future version. - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help System For Python Applications

2006-05-16 Thread Harold Fellermann
I usually go for the webbrowser package that allows me to launch the systems webbrowser and opens my html help files. It is really simple: >>> import webbrowser >>> webbrowser.open("file:///path_to/help.html#topic") and thats all there is to do. - harold - -- ht

Re: what is the difference between tuple and list?

2006-05-16 Thread Harold Fellermann
t; But if you e.g. want to exchange, that dictionary by another, you need to go for a list instead of a tuple. Hope that made sense... - harold - -- http://mail.python.org/mailman/listinfo/python-list

scientific libraries for python

2006-05-11 Thread Harold Fellermann
ScientifPython without much timeconsuming conversion a.s.o. in between? Thanks for any suggestions! - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: redirecting print to a a file

2006-05-11 Thread Harold Fellermann
>>> import sys >>> sys.stdout = file("output","w") >>> print "here you go" -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I do this with python ?

2006-05-09 Thread Harold Fellermann
Better go for the subprocess module. It is supposed to replace os.popen and has a much nicer interface. - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ for global namespace?

2006-05-06 Thread Harold Fellermann
Great! sys.excepthook() is exactly what I was looking for. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

__getattr__ for global namespace?

2006-05-04 Thread Harold Fellermann
'some_name' is not defined For classes, there are the __getattr__ and __getattribute__ functions. I wonder if there is some related function for (failed) global attribute lookup that is invoked with name as its argument instead. I consulted the docs, but could not find anything. Any

Re: python game with curses

2006-04-28 Thread Harold Fellermann
Jerry, if you want anyone to answer your question, please read this: http://www.catb.org/~esr/faqs/smart-questions.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Protocols for Python?

2006-04-27 Thread Harold Fellermann
[EMAIL PROTECTED] wrote: > Still, I'm designing an application that I want to be extendable by > third-party developers. I'd like to have some sort of documentation > about what behavior is required by the components that can be added to > extend the application. I'd thought I might try documenting

Re: how do I make a class global?

2006-04-27 Thread harold
basically, you can create new types on the fly using type() with three arguments: my_class = type("className",(BaseClass,),class_dict) then, you can assign this vlass to the golbal namespace using globals(): globals()["className"] = my_class In your case, you would need to populate the class_di

Re: how to free the big list memory

2006-04-27 Thread harold
pydoc gc.collect pydoc xrange -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclass str: where is the problem?

2006-04-24 Thread harold
value again. Be carefull with the condition/and/or chain! You must be 110% sure, that the desired return value in case of condition==True can never evaluate to False! - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclass str: where is the problem?

2006-04-24 Thread harold
[EMAIL PROTECTED] schrieb: > Hello, can anybody explain/help me: > > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > > > class Upper(str): > def __new__(cls, value): > return str.__new__(cls, value.upper()) > > u = Upper('test

Re: check whether a value is scalar

2006-04-22 Thread harold
would isinstance(value,(type(None),str,int,float,bool)) be enough? This yields true if the type value is in the list of type objects given as second argument, or a subtype of one of them. What, however, do you mean with "I care about the value only, and not its class method"? -- http://mail

Re: problems when unpacking tuple ...

2006-04-22 Thread harold
Thanks for all your answer! Of course, I wanted to assign the outcome of the split(), not to iterate over them. Thinks are done so easy in python that, sometimes, one does not even notice that one actually does them ;-) Cheers, - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: problems when unpacking tuple ...

2006-04-22 Thread harold
Thank you Gerard. This must be the problem. Now I can get it working. -- http://mail.python.org/mailman/listinfo/python-list

Re: problems when unpacking tuple ...

2006-04-22 Thread harold
Rene Pijlman schrieb: > harold: > >The output (when given the data I want to parse) is: > > If you'd told us that data, and told us what version of Python you're > using, we could have reproduced the problem to look into it. > Thank you for the answers and so

problems when unpacking tuple ...

2006-04-22 Thread harold
s to unpack What is going wrong here? Why does python think that I want to unpack the outcome of line.split() into three values instead of four? I must be really tired, but I just cannot see the problem. Any clues?? Thanks, - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-27 Thread Harold Stevens
Any M$ apologists saying M$ isn't an illegal monopoly are just as much a part of that pack of liars and thieves as M$ itself. They need to discuss it with Judge Colleen, and STignorantFU about it. -- Regards, Weird (Harold Stevens) * IMPORTANT EMAIL INFO FOLLOWS * Pardon any bogus email ad

Re: Microsoft Hatred FAQ

2005-10-25 Thread Harold Stevens
s a legitimate business strategy." Well, duh. All they got was a useless wrist-slap from the dickless US DOJ in 2002, so this is not at all surprising--just bidness as usual for M$. More: http://biz.yahoo.com/ap/051020/microsoft_antitrust.html?.v=6 And any M$ apologists are just as mu

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread harold fellermann
rt a module whose name is given as a string. - harold - -- Tages Arbeit, abends Gäste, saure Wochen, frohe Feste! -- Johann Wolfgang v. Goethe -- http://mail.python.org/mailman/listinfo/python-list

Re: automatic form filling

2005-07-12 Thread harold fellermann
de form_data = { 'byDay' : '12' , 'byMonth' : '07' , 'byYear' : '2005' } html_data = urlopen( "http://www.los40.com/actualidad/listas/busquedas_b.html";, urlencode(form_data) ).read() print html_da

Re: Missing Something Simple

2005-07-12 Thread harold fellermann
n varList : i.set(returnVarFromFunction()) print a,b,c prints whatever returnVarFromFunction has returned. n.b.: instead of the Proxy class, you can use any other mutable objects, e.g. lists. - harold - -- "All unsere Erfindungen sind nichts als verbesserte Mittel zu einem nicht verbesserten Zweck." -- H.D. Thoreau -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing Something Simple

2005-07-12 Thread harold fellermann
his example the former list values are not used anyway, you could just write: varList = [ returnVarFromFunction for i varList ] cheers, - harold - -- Tages Arbeit, abends Gäste, saure Wochen, frohe Feste! -- Johann Wolfgang v. Goethe -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Cmd.exe Window

2005-07-07 Thread harold fellermann
On 07.07.2005, at 15:43, harold fellermann wrote: > On 07.07.2005, at 15:25, Giles Brown wrote: > >> Nah. You're missing my point. I only want the command window not to >> be closed if there is an *exception*. Picky I know, but there you go. > > well, then regist

Re: Windows Cmd.exe Window

2005-07-07 Thread harold fellermann
it.register(raw_input) works fine in my terminal. should do in your framework also. cheers, - harold - -- What is mind? -- Doesn't matter. What is matter? -- Never mind! -- -- http://mail.python.org/mailman/listinfo/python-list

Re: inheriting file object

2005-07-06 Thread harold fellermann
If you would tell as your use case, it would be easier to give you an advice. - harold - -- Yesterday is but today's memory and Tomorrow is today's dream. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: inheriting file object

2005-07-06 Thread harold fellermann
be invoked automatically. class myFile(file) : def __init__(self,fname,mode="r") : file.__init__(self,fname,mode) for line in myFile('testfile') : print line - harold - -- If your only tool is a hammer, every problem looks like a nail. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditionally implementing __iter__ in new style classes

2005-07-06 Thread harold fellermann
eve it, but why don't you simply use class Base: pass class Concrete(Base): def __iter__(self) : yield 1 yield 2 yield 3 What is the advantage to have a baseclass that essentially does some method renaming __iter__ ==> Iterator?

trace function calls to get signatures

2005-07-04 Thread harold fellermann
m.pulldom.PullDOM.clear However, I cannot find a way from the frame object to the function object where I could find the information. 2. The KeyError in my code is raised by the "from XXX import" statement: "from distutils import setup" results in File &q

Re: I need help figuring out how to fix this code.

2005-06-28 Thread harold fellermann
ot;]: > print "May I have your autograph please!" > else > print name,", that's a nice name!" name = raw_input("What is your name, plase? ") if name == "Nathan" : print "What a great name!" elif name

Re: Python internals and parser

2005-06-23 Thread harold fellermann
Hi, On 22.06.2005, at 23:18, Michael Barkholt wrote: > Is there any detailed documentation on the structure of Pythons > internals, > besides the source code itself? > > More specifically I am looking for information regarding the C parser, > since > I am looking into the viability of using it i

Re: eval() in python

2005-06-21 Thread harold fellermann
ot;, "credits" or "license" for more information. >>> s="print 'hello Xah Lee :-)'" >>> exec(s) hello Xah Lee :-) >>> - harold - -- I wish there was a knob on the TV to turn up the intelligence. There's a knob called &quo

Re: dir() with string as argument

2005-06-16 Thread harold fellermann
to import the module: name = "sys" mod = __import__(name) dir(mod) - harold - -- Bitte verlassen Sie diese Welt so, wie Sie sie vorfinden möchten. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: extending Python base class in C

2005-06-15 Thread harold fellermann
simple purposes it works just fine. - harold - -- "Mr Ghandi, what do you think of western civilization?" "Oh, this would be a great idea." -- http://mail.python.org/mailman/listinfo/python-list

Re: extending Python base class in C

2005-06-14 Thread harold fellermann
> "harold fellermann" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Hi all, > > I once read that it is possible to use a python base class for a C > extension class. On 14.06.2005, at 09:29, Grigoris Tsolakidis wrote: > There was good

Re: Problem with simple C extension

2005-06-14 Thread harold fellermann
On 14.06.2005, at 18:58, harold fellermann wrote: > Am I stupid or what? Yes I was ... > // PhysicsDPD instance structure > typedef struct { >PyObject_HEAD >double cutoff; >double friction; >double noise; >double

Problem with simple C extension

2005-06-14 Thread harold fellermann
sicsDPDType) < 0) return; Py_INCREF(&hyper_PhysicsDPDType); PyModule_AddObject(m, "physics_DPD", (PyObject *)&hyper_PhysicsDPDType); } Now, compilation and import works without problem. But I cannot assign members in the init-call. >>> import simulatio

Re: translating C++ exceptions to python

2005-06-14 Thread harold fellermann
. AFAIK it has fascilities to transform exceptions from one type into the other. - harold - --- Everybody lies. but it does not matter, as no one listens. --- -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling assignation

2005-06-13 Thread harold fellermann
On 13.06.2005, at 19:23, Terry Reedy wrote: > > "harold fellermann" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> if you write >>>>> a=A() >> an instance of class A is created and bound to the local identifier >>

extending Python base class in C

2005-06-13 Thread harold fellermann
pass Unfortunately, google could not find me the right reference. Does anyone know how to do it, or where I can find relevant information? Thanks, - harold - -- Je me suis enfermé dans mon amour -- je rève. -- Paul Eluard -- http://mail.python.org/mailman/listinfo/python-list

Re: string formatting using the % operator

2005-06-13 Thread harold fellermann
archterm ='%'+'smith'+'%' >sql += 'WHERE name LIKE %s' % searchterm > > Any Ideas? >>> "%%%s%%" % "here you go" '%here you go%' Cheers, - harold - -- If your only tool is a hammer, every problem looks like a nail. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling assignation

2005-06-13 Thread harold fellermann
is worth mentioning the name of the member to set. IMHO this increases the readability of your source code: >>> a.pressure=5 Cheers, - harold - -- "I was born not knowing and have had only a little time to change that here and there." -- Richard Feynman -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I know when a thread quits?

2005-06-09 Thread harold fellermann
On 07.06.2005, at 16:44, harold fellermann wrote: > import thread > > def parentThread() : > lock = thread.allocate_lock() > child = thread.start_new_thread(childThread,(parent,)) > lock.acquire() > > def childThread(parent) : >

Re: redirecting messgaef from sys.stdout

2005-06-07 Thread harold fellermann
On 07.06.2005, at 16:43, Ahmad Hosseinzadeh wrote: > Hello, > > I’m trying to run an external program in my > application. Both are coded in python. I need to write > an independent module that is used in the main > application. Its responsibility is to run the external > program and redirect its

Re: How do I know when a thread quits?

2005-06-07 Thread harold fellermann
child thread has done a lck.release() but does > not get a chance to quit before execution is whisked away from it and > given to the main thread. Now the main thread sees that the lock has > been released and quits. The child thread hasn't quit yet and we are > back in the same

Re: How do I know when a thread quits?

2005-06-07 Thread harold fellermann
sed. otherwiese, use the higher level Threading module which provides a function Thread.join that allows the main thread to wait for the subthread. I think it uses the same mechanism that I explained above. - harold - -- Outside of a dog, a book is a man's best friend: and inside a dog, i

Re: Declaring self in PyObject_CallMethod

2005-05-13 Thread harold fellermann
ble_object, PyObject *args, PyObject *kw) i.e. PyObject resultObj = PyObject_Call(doMath,NULL,NULL); If, however, doMath is declared as a class-bound method, you have to use PyObject_CallMethod() with a pointer to an instance of this class as the first argument. Cheers, - harold - --

Re: Question about extending the interperter

2005-05-13 Thread harold fellermann
voked. Consider: >>> g=f >>> print g.func_name f of course, the situation can be much more sphisticated. f could be a value in a dict returned by some other function, and so on. Of course there are ways to inspect the source code (like pdb or exceptions do), but are you sure this is t

Re: curses for different terminals

2005-04-14 Thread harold fellermann
On 14.04.2005, at 19:17, Christos TZOTZIOY Georgiou wrote: On Thu, 14 Apr 2005 18:39:14 +0200, rumours say that harold fellermann <[EMAIL PROTECTED]> might have written: Hi all, I want to use curses in a server application that provides a GUI for telnet clients. Therefore, I ne

curses for different terminals

2005-04-14 Thread harold fellermann
). However, this function seems not to be defined in the python library. Does anyone know how this can be done in python? cheers, - harold - -- Life is what happens while you're busy making other plans -- John Lennon -- http://mail.python.org/mailman/listinfo/python-list

Re: Equivalent string.find method for a list of strings

2005-04-08 Thread harold fellermann
#x27;my particular string') : do_something() of just read in the whole file, if you are not interested in the particular line, where 'my particular string occurs': myfile.read().find('my particular string') Cheers, - harold - -- "All unsere Erfindungen sind nichts al

Re: richcmpfunc semantics

2005-04-07 Thread harold fellermann
eturn NULL; instead. What is the difference between the two and which one is to prefer. Also, do you need to increment the reference count of Py_NotImeplemented before returning it? Thanks, - harold - -- I like pigs. Dogs look up to us. Cats look down to us. Pigs treat us as equal. -- Winston Churchi

richcmpfunc semantics

2005-04-06 Thread harold fellermann
good documentation available, but I cannot find it. So, any references or help is appreciated. Cheers, - harold - -- "Scientist are very good in answering the questions they choose to answer." -- Richard Alley -- http://mail.python.org/mailman/listinfo/python-list

Re: Class, object question.

2005-04-06 Thread harold fellermann
of course, class is written lower case. Cheers, - harold - -- Es ist schon längst alles gesagt worden -- aber noch nicht von jedem. -- Karl Valentin -- http://mail.python.org/mailman/listinfo/python-list

Re: class attributes and inner classes in C extensions

2005-04-01 Thread harold fellermann
ks for the proposal. - harold - -- I wish there was a knob on the TV to turn up the intelligence. There's a knob called "brightness", but it doesn't seem to work. -- Gallagher -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >