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.
>
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
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
> >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
> > 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
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
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
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
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
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
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
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,
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
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
(lst).
Cheers,
- harold -
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
,
Harold
--
http://mail.python.org/mailman/listinfo/python-list
_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
ry
But please, give us some more context of what you want to do.
- harold -
--
http://mail.python.org/mailman/listinfo/python-list
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
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
Was your mailbox module competed? If so where can i find it?
--
http://mail.python.org/mailman/listinfo/python-list
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
trying, or do I need to fall back on a config module/class?
Thanks!
- harold -
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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.
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
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
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
/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
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
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
>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
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
nknown
goodies
in the library, great :-)
- harold -
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
ScientifPython
without much timeconsuming
conversion a.s.o. in between?
Thanks for any suggestions!
- harold -
--
http://mail.python.org/mailman/listinfo/python-list
>>> import sys
>>> sys.stdout = file("output","w")
>>> print "here you go"
--
http://mail.python.org/mailman/listinfo/python-list
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
Great!
sys.excepthook() is exactly what I was looking for. Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
'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
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
[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
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
pydoc gc.collect
pydoc xrange
--
http://mail.python.org/mailman/listinfo/python-list
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
[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
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
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
Thank you Gerard.
This must be the problem. Now I can get it working.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
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?
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
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
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
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
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
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
> "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
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
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
.
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
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
>>
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
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
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
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) :
>
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
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
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
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 -
--
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
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
). 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
#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
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
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
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
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 - 100 of 123 matches
Mail list logo