On Nov 28, 5:35 am, Steven D'Aprano <st...@remove-this- cybersource.com.au> wrote: > On Fri, 27 Nov 2009 12:41:42 -0800, joy99 wrote: > > Dear Group, > > > I have written a small and simple program like the following: > > > def alphabet1(n): > > file_open=open("/python26/alphabetlist1.txt","r") > > file_read=file_open.read() > > file_word=file_read.split() > > print file_word > > > Here, I am using a file “alphabetlist1.txt” which I am reading and then > > splitting them into words. > > > In this file “alphabetlist1.txt” I have arranged few alphabets like the > > following: > > > a A > > b B > > c C > > d D > > E e > > F f > > > Where, a/b/c/d/e/f are in lower case and A/B/C/D/E/F are in upper case > > which I can say as > > SHIFT+a > > SHIFT+b > > SHIFT+c > > SHIFT+d > > SHIFT+e > > SHIFT+f > > > Now, in the list or anywhere in the program if I want to write > > CTRL+a/b/c/d/e/f or ALT+a/b/c/d/e/f for which I may assign any value I > > may feel not only cut/copy/paste. > > > How would I represent them? > > This question is badly defined. What are your constraints? Is this meant > to be a human-readable program? If so, you need to stick to ASCII text > and probably want something like: > > a A CTRL-A ALT-A > b B CTRL-B ALT-B > ... > > but I'm not sure what the point of that would be. > > Normally, control-combinations generate control-characters. For example, > CTRL-M would normally generate a carriage-return character. Depending on > your needs, you can write this as any of the following: > > a description: CTRL-M > an escape sequence: \r > caret notation: ^M > the standard abbreviation: CR > the Unicode display glyph: ␍ > or an actual carriage-return character. > > Note that in ASCII control characters only have a standard definition for > the following: > > ctrl-@ > ctrl-A through ctrl-Z > ctrl-[ > ctrl-\ > ctrl-] > ctrl-^ > ctrl-_ > ctrl-? > > See here for more:http://en.wikipedia.org/wiki/Control_characters > > As for Alt-combinations, I don't think there is any standard for what > they are. I believe that they are operating system specific, and possibly > even program specific. > > -- > Steven- Hide quoted text - > > - Show quoted text -
Dear Sir, I was writing a transliteration program from Bengali to English and vice versa. The program using Unicode chart is giving me perfect outputs in Bengali and vice versa with Bengali input -> English. I wanted to add some more power to the key board entry scheme, as I have developed few fonts also and now trying to work out a windows based word processor in Bengali. Thank you for your kind answer. It helped me lot. ALT portion I'll work out on my own. Sorry for a wrongly given problem statement. Wishing you a happy day ahead, Regards, Subhabrata. -- http://mail.python.org/mailman/listinfo/python-list