Thanks all for your suggestions, I'll look into them.
See you.
--
F. Delente
--
http://mail.python.org/mailman/listinfo/python-list
Hello.
I've googled for hints but I didn't find anything, I hope it's not an
RTFM question :^)
I want to have dialog boxes (a message with Yes/No/Cancel options,
possibly with keyboard accels) in python + curses.
Does anyone have a pointer to docs about this?
Thanks!
--
F. Delente
--
http://
Christian Heimes wrote:
> Don't nest classes. Just don't. This might be a valid and good approach
> in some programming languages but it's not Pythonic. Your code can
> easily be implemented without nested classes.
I think you're right. It would have been more aesthetically pleasant
to me (a Hand
Jean-Michel Pichavant wrote:
> Always post working code, or at least something we can paste in the
> python interpreter (even if it's buggy)
Ok, noted.
> class A:
>class B:
>x=2
>class C:
>def __init__(self):
>print A.B.x
>
> c = A.C()
>
> >2
Good, thanks.
Gary Herron wrote:
> Well, your code still doesn't make sense, but the generic answers are:
I'll clarify what I need then:
I'm drawing Bézier curves. I draw them on a zone that is defined as a
subclass of GtkDrawingArea.
In a zone, I define a system of coordinates by 4 values: xmin, xmax,
ymin,
Neil Cerutti wrote:
>> I have a class A that contains two classes B and C:
>>
>> class A:
>> class B:
>> self.x = 2
>>
>> class C:
I only wanted to show the structure of the code, not the actual
instructions.
> That's not valid Python code. Do you mean:
>
> Class A:
> Class B:
>
Hello.
I have a class A that contains two classes B and C:
class A:
class B:
self.x = 2
class C:
Is there a way to access the x defined in B in class C?
Thanks.
--
F. Delente
--
http://mail.python.org/mailman/listinfo/python-list
> Another possibility is to open the file in binary mode and do the
> encoding yourself when writing text. This might actually be a better
> solution, since I'm not sure RTF uses utf-8 by default.
Yes, thanks for this suggestion, it seems the best to me. Actually RTF
is not UTF-8 encoded, it's 8
Thanks, I'll try this.
> I have no idea how you'd go about reading the contents of such a file
> in a sensible way.
The purpose is to embed PNG pictures in an RTF file that will be read
by OpenOffice. It seems that OpenOffice reads RTF in 8-bit, so it
should be ok.
The RTF is produced from a TeX
Hello.
I have to read the contents of a binary file (a PNG file exactly), and
dump it into an RTF file.
The RTF-file has been opened with codecs.open in utf-8 mode.
As I expected, the utf-8 decoder chokes on some combinations of bits;
how can I tell python to dump the bytes as they are, without
Thanks for your insights.
I have taken the easy way out, I read on a page that python 3 worked
by default in UTF-8, so I downloaded and installed it.
Apart from a few surprises (print is not a funtion, and rules about
mixing spaces and tabs in indentation are much more strict, and I
guess more is
> Change your string literals to unicode by adding the u-prefix and you should
> be OK.
Thanks, it solved the problem... for a while!
I need now to know if s[i] gives the next byte or the next character,
when I scan the string s. I've googled pages about python and unicode,
but didn't find a sol
Hello.
I read a string from an utf-8 file:
fichierLaTeX = codecs.open(sys.argv[1], "r", "utf-8")
s = fichierLaTeX.read()
fichierLaTeX.close()
I can then print the string without error with 'print s'.
Next I parse this string:
def parser(s):
i = 0
while i < len(s):
if s[i:i+1] == '\\':
13 matches
Mail list logo