[Tutor] (no subject)

DiliupG diliupg at gmail.com
Tue Jul 26 01:23:17 EDT 2016


Thanks for the support.

Mu main problem was in the editor I was using which I did not mention.

I was using Wing IDE Pro instead of the Python IDE. BY the answer given by
erik sun I applied the same idea to th Wing IDE i/o to utf-8 and everything
worked. Thanks for your support and pardon me for not supplying all the
info.

On Tue, Jul 26, 2016 at 10:11 AM, DiliupG <diliupg at gmail.com> wrote:

> Thank you for the responses.
> Some filenames I use are in Unicode in this script and there is no display
> or typing problem in Windows (Vista, 7 and 10). Filenames and text in word
> processing and text files are ALL displayed properly WITHOUT any errors by
> the Windows system.
>
> When I use a standard font in the local language there is no problem at
> all but I need to retype ALL display text in all the Python programs which
> is a tedious task.
>
> Having read all answers is there no way this can be done without modifing
> code on my computer? Thepurpose is to deliver a WIndows software for ALL
> Windows users.
>
> I am reading in a list of file names with the following code.
>
>     def get_filelist(self):
>         """"""
>         app = QtGui.QApplication(sys.argv)
>         a = QtGui.QFileDialog.getOpenFileNames()
>
>         filelist = []
>         if a:
>             for name in a:
>                 a = unicode(name)
>
>                 filelist.append(a)
>
>         return filelist
>
> mainprg.filelist = mainprg.get_filelist()
>
> filelist = mainprg.filelist
>
> for name in filelist:
>     print name             < ---- THIS IS WHERE THE PROBLEM IS
>
> Thanks for feed back.
>
> On Mon, Jul 25, 2016 at 3:58 PM, Steven D'Aprano <steve at pearwood.info>
> wrote:
>
>> On Fri, Jul 22, 2016 at 01:08:02PM +0530, DiliupG wrote:
>> > I am using Python 2.7.12 on Windows 10
>>
>> Two errors:
>>
>> - first error is that Unicode strings in Python 2 need to be written as
>> unicode objects, with a "u" prefix in the delimiter:
>>
>> # ASCII byte string:
>> "Hello World"
>>
>> # Unicode string:
>>
>> u"මේක ත"
>>
>> ASCII strings "..." cannot give you the right results except by
>> accident. You must use unicode strings u"..."
>>
>> - Second possible problem: using Windows, which may not support the
>> characters you are trying to use. I don't know -- try it and see. If it
>> still doesn't work, then blame Windows. I know that Linux and Mac OS X
>> both use UTF-8 for filenames, and so support all of Unicode. But
>> Windows, I'm not sure. It might be localised to only use Latin-1
>> (Western European) or similar.
>>
>>
>> --
>> Steve
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
>>
>
>
>
> --
> Kalasuri Diliup Gabadamudalige
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **********************************************************************************************
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **********************************************************************************************
>
>


-- 
Kalasuri Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************


More information about the Tutor mailing list