Hi,
I have a class (a gui) with buttons and other controls. A button, for
example, has a callback method, so that writing
b = Button(label, OnClick)
will call the global OnClick method.
Now, if I want the OnClick method to call some of my main class methods,
I need to write:
UI = No
Thanks to you all for these answers. I'll try these ideas and post back
comments and results.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm trying to write a small installer for a server. But this program
should be able to run in the future under heterogenous environments and
os (at least linux/windows). I mean, the install will be done either in
text mode or curses or gtk or tk, either in debian or windows 2000 and
so on...
bruno modulix a écrit :
> You may want to have a look at the Factory pattern...
>
> # outrageously oversimplified dummy exemple
> class Gui(object):
>def __init__(self, installer):
> self.installer = installer
>
> class PosixGui(Gui):
>pass
>
> class Win32Gui(Gui):
>pass
>
> c
Scott David Daniels a écrit :
> cantabile wrote:
>
>> bruno modulix a écrit :
>>
>>> You may want to have a look at the Factory pattern...
>>> ... demo of class Factory ...
>
>
> Taking advantage of Python's dynamic nature, you could simply:
&
Hi, I'm trying and updating an .ini file with ConfigParser but each time
I call 'write', it appends the whole options another time to the file.
For example :
Here's the inital ini file
[section1]
foodir: %(dir)s/whatever
dir: foo
Here's my code :
filename = ...
config = ConfigParser.ConfigParser(
Robert Kern a écrit :
> cantabile wrote:
>
>> Hi, I'm trying and updating an .ini file with ConfigParser but each time
>> I call 'write', it appends the whole options another time to the file.
>> For example :
>> Here's the inital ini file
>&g
Hi, I'm trying to write an internationalized app. I'm learning python
and read that pygettext would help me, but I found elsewhere it was
obsolete (??)
So, what's the correct and up to date tool to i18n python ?
Is there a tutorial somewhere (python docs has nothing really usable :
I'd like at l
Reinout van Schouwen a écrit :
> Hi,
>
> On Wed, 3 Aug 2005, cantabile wrote:
>
>> Hi, I'm trying to write an internationalized app. I'm learning python
>> and read that pygettext would help me, but I found elsewhere it was
>> obsolete (??)
>> So,
Jon Hewer a écrit :
> Hi
>
> I'm pretty new to Python, and recently been working my way through
> Dive Into Python, and I'm currently writing a really simple rss reader
> purely to get familiarised with the language. I want to move onto
> something a little more challenging, but I'm stuck for ide
Hi, being a newbie in Python, I'm a bit lost with the '-*- coding : -*-'
directive.
I'm using an accented characters language. Some of them are correctly
displayed while one doesn't. I've written :
-*- coding: utf-8 -*-
Is this wrong ?
Where can I find a pratical explanation about these encodi
Robert Kern a écrit :
> It depends. Are those characters encoded as UTF-8? Or, more likely, are
> they encoded as ISO-8859-1?
>
>> Where can I find a pratical explanation about these encodings ?
>
>
> http://www.amk.ca/python/howto/unicode
> http://en.wikipedia.org/wiki/Character_encoding
> ht
Hi,
I'm failing to make it work but can't find out what's wrong. Here's what
I do :
test.py
import gettext
gettext.install('')
msg = _("Message without accented characters")
print msg
Then I do :
xgettext test.py
mv message.po message pot
msginit --> outpu
stasz a écrit :
> On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote:
>
>
>>Hi,
>>I'm failing to make it work but can't find out what's wrong. Here's what
>>I do :
>
> []
>
>>How come ? What's wrong with what I
stasz a écrit :
> On Sun, 07 Aug 2005 21:33:21 +0200, cantabile wrote:
>
>
>>stasz a écrit :
>>
>>>On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote:
>>>
>>>
>>>
>>>>Hi,
>>>>I'm failing to make it work but c
stasz a écrit :
> Your steps seems alright.
> Just a thought; you do start test1.py from a [EMAIL PROTECTED]
> environment do you?
> I mean in a xterm do: export [EMAIL PROTECTED]
> And then start test1.py from there.
>
> Stas
Wht ! Working at last, after three days... It wasn't the LANG par
BTW stasz,
Maybe you'll have still some time for the following question. Trying my
luck :))
Suppose I have several units (.py files), say test.py test1.py tets2.py
, test.py being my main file.
I've read I can import gettext and install in the main unit. Then, must
I create .po files for each u
Ok, I'll try that.
Thanks again Stasz !
--
http://mail.python.org/mailman/listinfo/python-list
stas a écrit :
> As a reminder, make sure that you install gettext in the namespace
> of your toplevel module.
> What I mean is this:
>
> test1.py imports test2.py and test3.py
> test2.py imports test4.py
>
> Now you have to place the gettext.install call in test1.py and
> then the other modules
stasz a écrit :
> On Tue, 09 Aug 2005 23:59:26 +0200, cantabile wrote:
>
>
>>stas a écrit :
>>
>>
>>>As a reminder, make sure that you install gettext in the namespace
>>>of your toplevel module.
>
> []
>
>>Noticed something :
Hi, I'd like to get drives and partitions (and their size too) with
python under Linux. So far, I thought of reading /proc/partitions but
maybe i could use fdsik also ?
How would I do that in python ?
Thanks for your help (newbie here :) )
--
http://mail.python.org/mailman/listinfo/python-list
Hi, Jeff
Great help : this works like a charm. I think I can customize it to read
from sfdisk. Do you agree with Peter Hansen (post below) about fdisk ?
Jeff Epler wrote:
> Using /proc/partitions is probably preferable because any user can read
> it, not just people who can be trusted with read a
Hi, Peter
Thanks for the reply. I'll check popen().
But you said I should not rely on fdisk... Why ? And should I prefer
sfdisk ? Why ?
Peter Hansen wrote:
> cantabile wrote:
>
>> Hi, I'd like to get drives and partitions (and their size too) with
>> python under
Thanks for the answer and help.
Cheers :)
Peter Hansen wrote:
> cantabile wrote:
>
>> Hi, Peter
>> Thanks for the reply. I'll check popen().
>> But you said I should not rely on fdisk... Why ? And should I prefer
>> sfdisk ? Why ?
>
>
> I was under
Le Mon, 17 Mar 2008 09:03:07 -0700, joep a écrit :
> An example: looks for all 'junk*.txt' files in current directory and
> replaces in each line the string 'old' by the string 'new'
> Josef
Works like a charm. Many thanks for the example Josef :-)
--
http://mail.python.org/mailman/listinfo/pyth
x27;t work. It doesn't find anythin wrong if remove, say msg,
from **md. I thought it should because I believed that this list
comprehension would check that every keyword in required would have a
match in params.keys.
Could you explain why it doesn't work and do you have any idea of how it
could work ?
Thanks in advance :)
Cheers,
Cantabile
--
http://mail.python.org/mailman/listinfo/python-list
Thanks everyone for your answers. That's much clearer now.
I see that I was somehow fighting python instead of using it. Lesson
learned (for the time being at least) :)
I'll probably get back with more questions...
Cheers,
Cantabile
--
http://mail.python.org/mailman/listinfo/python-list
Wow, lots of things I had never heard of in your posts.
I guess I need to do some homework...
Cantabile
--
http://mail.python.org/mailman/listinfo/python-list
28 matches
Mail list logo