Professional Documents
Culture Documents
Page
Contents
1
. . . . . . . . . . . . . . . . . . . . 01
. . . . . . . . . . . . . . . . . . . . 02
. . . . . . . . . . . . . . . . . . . . 03
Source Code
. . . . . . . . . . . . . . . . . . . . 07
Out put
. . . . . . . . . . . . . . . . . . . . 12
. . . . . . . . . . . . . . . . . . . . 16
A ck now l edgement
Ever y wor k accom pl ish ed is a pl easu r e - a sen se of
satisfaction . H owever a n u m ber of peopl e m otivate, cr iticize
an d appr eciate a wor k with th eir objectives, ideas an d
opin ion s. H en ce, I tak e th is oppor tu n ity to th an k al l , wh o
h ave dir ectl y or in dir ectl y h el ped m e to accom pl ish th is
pr oject.
- Fir stl y, I wou l d l ik e to th an k m y com puter science
teacher , M r s Pa vi t hr a with ou t wh ose su ppor t th is
pr oject wou l d n ot h ave been com pl ete. Next, I wou l d l ik e
to th an k al l th e peopl e wh o gave th eir val u abl e tim e,
cooper ation an d feedback to th is pr oject. I wou l d al so l ik e
to th an k m y sch ool for pr ovidin g m e with th e r esou r ces
wh ich beyon d an y dou bt h ave h el ped m e.
- Secon dl y, I wou l d l ik e to sin cer el y th an k ou r Pr incipal
V.Thi a ga r a ja n an d Vice Pr incipal, M r s. La kshm i
K a nna n for th eir gu idan ce th r ou gh ou t.
- Th ir dl y, I th an k m y cl ass teach er, M r s M yth er ee for
h el pin g u s fin ish ou r pr oject in tim e.
Last bu t n ot th e l east, I wou l d wan t to th an k m y par en ts an d
oth er facu l ty m em ber s for stan din g beside m e to m ak e th is
pr oject a wh ol esom e on e.
1
Notescribe app
Open Source
Formattable
User Friendly
2
Program Structure
Sever al Pyth on con cepts h ave been u sed to cr eate th is pr oject.
Th ese pr im ar il y in cl u de th e fol l owin g:
Cl asses:
Tki nt er Cla ss:
Tk in ter su ppor ts 15 cor e widgets ou t of wh ich th e fol l owin g
few h ave been in str u m en tal in th e design of th e pr ogr am .
Th ey ar e:
- Bu t t on : u sed to execu te a com m an d or oth er oper ation .
- Can v as: Str u ctu r ed gr aph ics. Th is widget can be u sed to
dr aw gr aph s an d pl ots, cr eate gr aph ics editor s, an d to
im pl em en t cu stom widgets.
- En t r y : A text en tr y fiel d.
- Fr am e: A con tain er widget. Th e fr am e can h ave a bor der
an d a back gr ou n d, an d is u sed to gr ou p oth er widgets wh en
cr eatin g an appl ication or dial og l ayou t.
- L abel : Displ ays a text or an im age.
- M en u : A m en u pan e. Used to im pl em en t pu l l -down an d
pop-u p m en u s.
- M essage: Displ ay a text. Sim il ar to th e l abel widget, bu t can
au tom atical l y wr ap text to a given width or aspect r atio.
- Scal e: Al l ows you to set a n u m er ical val u e by dr aggin g a
3
?sl ider ?.
- Scr ol l bar : Stan dar d scr ol l bar s for u se with can vas, en tr y,
l istbox an d text widgets.
- Tex t : For m atted text displ ay. Al l ows you to displ ay an d edit
text with var iou s styl es an d attr ibu tes. Al so su ppor ts
em bedded im ages an d win dows.
- Pan ed W i n d ow : A con tain er widget th at or gan izes ch il d
widgets in r e-sizabl e pan es.
Scrol l edText
Simpl eEdit or
For m at t i n g Fu n ct i on s:
- on Sav e(): Ask s sav e_as_f i l en am e an d copies al l text
with ou t for m attin g an d wr ites th em to th e text fil e u sin g
w r i t e() fu n ction .
- on Cu t (): Sel ect r equ ir ed text u sin g tag in dexes an d del ete
th e sel ected text wh il e u sin g tk in ter to access cl ipboar d
an d appen d th e data sel ected fr om th e given text.
M od u l es u sed :
-
Tk in ter
os
sys
tk Sim pl eDial og
tk Fil eDial og
tk M essageBox
Program Code
# - * - c odi ng:
ut f - 8 - * -
f r om Tk i nt er i mpor t
as k s t r i ng
f r om t k Fi l eDi al og
as k s av eas f i l ename
i mpor t
as k ok c anc el
= Tk ( )
ex pand=1)
__i ni t __( s el f ,
par ent )
s el f . pac k ( )
def
qui t ( s el f ) :
ans = as k ok c anc el ( ' Ver i f y ex i t ' ,
i f
ans :
Fr ame. qui t ( s el f )
7
c l as s Sc r ol l edTex t ( Fr ame) :
def
__i ni t __( s el f ,
t ex t =' ' ,
f i l e=None) :
par ent )
s el f . pac k ( ex pand=YES,
f i l l =BOTH)
f i l e)
= Tex t ( s el f ,
r el i ef =SUNKEN)
t ex t . pac k ( s i de=LEFT,
s el f . t ex t
def
f i l l =BOTH)
= t ex t
s et t ex t ( s el f ,
i f
ex pand=YES,
t ex t =' ' ,
f i l e=None) :
f i l e:
t ex t
= open( f i l e,
END)
s el f . t ex t . i ns er t ( ' 1. 0' ,
t ex t )
s el f . t ex t . mar k _s et ( I NSERT,
' 1. 0' )
s el f . t ex t . f oc us ( )
def
get t ex t ( s el f ) :
r et ur n s el f . t ex t . get ( ' 1. 0' ,
END+' - 1c ' )
def
__i ni t __( s el f ,
f i l e=None) :
par ent ,
f i l e=f i l e)
s el f . t ex t . c onf i g(
bor der wi dt h=0,
f ont =" { Hel v et i c a Neue} 40" ,
f or egr ound=" #000000" ,
bac k gr ound=" #FFFFFF" ,
# c ur s or
# s el ec t i on
# us e wor d wr appi ng
undo=Tr ue,
wi dt h=64, )
def
onSav e( s el f ) :
f i l ename = as k s av eas f i l ename( )
i f
f i l ename:
al l t ex t
= s el f . get t ex t ( )
open( f i l ename,
def
' w' ) . wr i t e( al l t ex t )
onCut ( s el f ) :
t ex t
SEL_LAST)
SEL_LAST)
onPas t e( s el f ) :
t r y:
t ex t
s el f . t ex t . i ns er t ( I NSERT,
ex c ept
t ex t )
Tc l Er r or :
pas s
def
onI t al i c ( s el f ) :
s el f . t ex t . t ag_add( " y es wher e" ,
40,
Neue' ,
40,
el s e:
10
Neue' ,
40,
def
onBol d( s el f ) :
s el f . t ex t . t ag_add( " her e" ,
s el f . t ex t . t ag_c onf i g( ' her e' , f ont =( ' Hel v et i c a Neue' , 40,
' bol d' ) , f or egr ound=" bl ac k " )
def
onSt r i k e( s el f ] :
s el f . t ex t . t ag_add( " nowher e" ,
onUnder l i ne( s el f ) :
s el f . t ex t . t ag_add( " t her e" , SEL_FI RST, SEL_LAST)
I ndex Er r or :
11
Output Screens
Th e com p l et e Tex t w i d get :
#1
12
Qu ot e:
#2
Un d er l i n e:
#3
St r i k e t h r ou gh :
#4
13
I t al i c:
#5
Cu t an d Past e:
#6
14
#7
15
Concl usi on
H en ce, th e a pyth on pr ogr am was wr itten to dem on str ate a
pr oject with th e u se of fil es, cl asses an d fu n ction s. Th is
pr ogr am featu r es th e car bon copy of a sim pl e text editor th at
en abl es easy an d fu n fil l ed wr itin g.
I th an k th e sch ool m an agem en t for givin g u s th e gol den
oppor tu n ity to wor k on a pr ogr am th at is r eal istic an d fil l ed
with fu n . I th an k ou r com pu ter scien ce teach er, M r s.Pavitr a
wh o h el ped u s an d su ppor ted u s in m ak in g th is pr oject a
gr eat su ccess. I fin al l y th an k th e m an agem en t for givin g u s
th e per m ission to wor k in ou r l abs an d ou r par en ts wh o h ave
su ppor ted u s an d h ave been in th e m ost ter r ibl e m om en ts of
ou r l ife an gu ided u s!
Bi bl i ograph y
-
Th ank You.
Pr ogr am m er : Ar vin d Sr in ivasan
Cl ass: 12 A
Sch ool : Ar sh a Vidya M an dir