473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

iso_8859_1 mystery/tkinter

These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.

However, if I run from IDLE and output to a console
window, 0xb0 produces the correct character for degrees.
Any idea why?
Thanks

Jul 19 '05 #1
4 1337
phil wrote:
These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.


I don't understand what you mean by that. Do you have
the symbol for degrees in your source code (so that
the editor for the source code displays it as a little
circle)? Or do you use the numeric code?

Can you show a small program that demonstrates this
effect?

Regards,
Martin

Jul 19 '05 #2
phil wrote:
These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.


I don't understand what you mean by that. Do you have
the symbol for degrees in your source code (so that
the editor for the source code displays it as a little
circle)? Or do you use the numeric code?

Can you show a small program that demonstrates this
effect?

Regards,
Martin
Jul 19 '05 #3

""Martin v. Löwis"" <ma****@v.loewis.de> schrieb im Newsbeitrag
news:ma*************************************@pytho n.org...
| phil wrote:
| > These work fine on Linux
| > s.const = {}
| > s.const['DEG'] = '%c' % (0xb0)
| > s.const['DIV'] = '%c' % (0xf7)
| > s.const['ANG'] = '%c' % (0xd8)
| >
| > On WinXP the symbols for division and angle work fine.
| > But the symbol for degrees, a little circle, produces
| > a vertical bar in Tkinter Text box or Canvas.
|
| I don't understand what you mean by that. Do you have
| the symbol for degrees in your source code (so that
| the editor for the source code displays it as a little
| circle)? Or do you use the numeric code?
|
| Can you show a small program that demonstrates this
| effect?

OP probably means something like:

import Tkinter
root = Tkinter.Tk()
t = Tkinter.Text()
t.pack()
t.insert(0.0, '%c' % 0xb0)
root.mainloop()

which shows a vertical bar in the Text widget.

Changing:

t.insert(0.0, '%c' % 0xb0)

to

t.insert(0.0, u'%c' % 0xb0)
should do the trick though.

--

Regards,

Vincent Wehren

|
| Regards,
| Martin
|
Jul 19 '05 #4
| > s.const['DEG'] = '%c' % (0xb0) | > But the symbol for degrees, a little circle, produces
| > a vertical bar in Tkinter Text box or Canvas.
t.insert(0.0, u'%c' % 0xb0)

should do the trick though.


COOL! Thanks, though that seems a little odd.
As far as I know %c ignores the sign bit everywhere
else, including X11 and Win consoles.
But I'll just note it and do it.
Thanks again.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles...
3
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter...
7
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of...
1
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the...
0
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
3
by: dwelch91 | last post by:
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
3
by: joshdw4 | last post by:
I hate to do this, but I've thoroughly exhausted google search. Yes, it's that pesky root window and I have tried withdraw to no avail. I'm assuming this is because of the methods I'm using. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.