1) I am writing a program, which needs to have a couple of buttons with
labels having non-English characters. I tried following the
internalization tutorial:
I made sure that I've compiled wxpython with unicode support and then
got the unicode versions of the strings using the python command
unicode(u'<string>')
However when I run the program, I get just garbage as opposed to the
unicode characters. Any ideas what the problem might be.
2) I am trying to create a simple program, which should edit a file in
the root directory of a computer. So I would like to be able to run this
program as a superuser. Therefore if a normal user is running that
program, I would like to create a pop-up window, where the user can add
the superuser password in order to make changes to the file. I guess
ideally what I would like to have is a similar behaviour to what happens
when one runs synaptic in Ubuntu. Unfortunately I was not able to find a
tutorial how to do that. Can someone point me to the right resource so
that I can achieve this task in a secure way?
1) I am writing a program, which needs to have a couple of buttons with
labels having non-English characters. I tried following the
internalization tutorial:
> > Dear all,
> >
> > I have two questions regarding wxpython.
> >
> > 1) I am writing a program, which needs to have a couple of
> > buttons with labels having non-English characters. I tried
> > following the internalization tutorial:
> >> Internationalisation in wxPython
> > I made sure that I've compiled wxpython with unicode support and
> > then got the unicode versions of the strings using the python
> > command
> >>>> unicode(u'<string>')
> > However when I run the program, I get just garbage as opposed to
> > the unicode characters. Any ideas what the problem might be.
> Do you have the following (with appropriate encoding) at the top of
> your source code?
> # -*- coding: utf-8 -*-#
>
> Are your .mo files correctly encoded?
>
> The Phoenix doc and the wiki have some more info:
> Internationalization Overview — wxPython Phoenix 4.2.3a1 documentation
Hi Werner,
Thanks for your reply. I guess I don't have a .po or .mo file. I was
just hoping that I can just put non-ascii character for the labels on
the buttons and that would work. But I guess that was wrong. So I will
read through the link you gave me but I guess it is a bit more
involved that I had originally thought.
Thanks for your reply. I guess I don't have a .po or .mo file. I was
just hoping that I can just put non-ascii character for the labels on
the buttons and that would work. But I guess that was wrong. So I will
read through the link you gave me but I guess it is a bit more
involved that I had originally thought.
If you just want non-ascii and not translate to other languages then having the following at the top of your source file should do the trick, assuming that your editor respects this or if you manually encode your files as "utf-8" (or whatever you define in the line.
On 18/11/2012 18:42, Георги Никифоров wrote:
>
>> Do you have the following (with appropriate encoding) at the top of
>> your source code?
>> # -*- coding: utf-8 -*-#
>>
>> Are your .mo files correctly encoded?
>>
>> The Phoenix doc and the wiki have some more info:
>> Internationalization Overview — wxPython Phoenix 4.2.3a1 documentation
> Hi Werner,
>
> Thanks for your reply. I guess I don't have a .po or .mo file. I was
> just hoping that I can just put non-ascii character for the labels
> on the buttons and that would work. But I guess that was wrong. So
> I will read through the link you gave me but I guess it is a bit
> more involved that I had originally thought.
If you just want non-ascii and not translate to other languages then
having the following at the top of your source file should do the
trick, assuming that your editor respects this or if you manually
encode your files as "utf-8" (or whatever you define in the line.
2) I am trying to create a simple program, which should edit a file in
the root directory of a computer. So I would like to be able to run this
program as a superuser. Therefore if a normal user is running that
program, I would like to create a pop-up window, where the user can add
the superuser password in order to make changes to the file. I guess
ideally what I would like to have is a similar behaviour to what happens
when one runs synaptic in Ubuntu. Unfortunately I was not able to find a
tutorial how to do that. Can someone point me to the right resource so
that I can achieve this task in a secure way?
2) I am trying to create a simple program, which should edit a file in
the root directory of a computer. So I would like to be able to run this
program as a superuser. Therefore if a normal user is running that
program, I would like to create a pop-up window, where the user can add
the superuser password in order to make changes to the file. I guess
ideally what I would like to have is a similar behaviour to what happens
when one runs synaptic in Ubuntu. Unfortunately I was not able to find a
tutorial how to do that. Can someone point me to the right resource so
that I can achieve this task in a secure way?
I don't remember for sure how it is doing it, but the Esky package has the ability to elevate privileges to root/admin on all 3 platforms, so if you want to be able to do this on multiple platforms then you may want to dive into their code to get some ideas.
···
On 11/14/12 10:37 AM, Георги Никифоров wrote:
2) I am trying to create a simple program, which should edit a file in
the root directory of a computer. So I would like to be able to run this
program as a superuser. Therefore if a normal user is running that
program, I would like to create a pop-up window, where the user can add
the superuser password in order to make changes to the file. I guess
ideally what I would like to have is a similar behaviour to what happens
when one runs synaptic in Ubuntu. Unfortunately I was not able to find a
tutorial how to do that. Can someone point me to the right resource so
that I can achieve this task in a secure way?
I am trying to create a simple program, which should edit a file in
the root directory of a computer. So I would like to be able to run this
program as a superuser. Therefore if a normal user is running that
program, I would like to create a pop-up window, where the user can add
the superuser password in order to make changes to the file. I guess
ideally what I would like to have is a similar behaviour to what happens
when one runs synaptic in Ubuntu. Unfortunately I was not able to find a
tutorial how to do that. Can someone point me to the right resource so
that I can achieve this task in a secure way?
I don’t remember for sure how it is doing it, but the Esky package has the ability to elevate privileges to root/admin on all 3 platforms, so if you want to be able to do this on multiple platforms then you may want to dive into their code to get some ideas.