[python] Bez -i to funguje
Jarek Krcmar
krcmar1 na volny.cz
Pátek Èerven 5 14:28:36 CEST 2009
Zdravím,
Je pravda, ¾e mi ten program funguje, ale jeden øádek je skrytý. Je skrytý
první øádek, ale jinak OK.
Jarek
----- Original Message -----
From: "zu1234" <zu1234 na seznam.cz>
To: "Konference PyCZ" <python na py.cz>
Sent: Friday, June 05, 2009 11:33 AM
Subject: Re: [python] Bez -i to funguje
Proè máte na prvním øádku obou souborù text zaèivající: <div class= a
tak dále?
A na konci text </div>
Myslím ¾e bude dìlat paseku.
Vyzkou¹el, opravil a posílám zpìt
ZU
--------------------------------------------------------------------------------
>A friend of mine|jeden mA?j pATAtel
> Amr.White has called|byl tu jakA?si pan White
> Be taken aback|bA?t pATekvapen,zmaten
> Abandon all hope|vzdA!t se veA!kerAC nadÄ>je
> Abandon oneself to|oddA!vat se Äemu
> Abide by a promise|dodrA?et slib
> Be able|moci
> Able-bodied|silnA?,tÄ>lesnÄ> schopnA?
> Abominable weather|ohavnAC poÄasA
> Abortive attempt|nezdaATenA? pokus
> Abound in st|oplA?vat ÄAm
> Walk about the town|chodit po mÄ>stÄ>
> I haven't any money about me|nemA!m u sebe penAze
> There is nothing strange about it|na tom nenA nic divnACho
> Talk about st|hovoATit o Äem
> What is it all about?|co to mA! vA!echno znamenat?,oÄ jde?
> Be about to|chystat se
> The book is above me|kniha je pro mne nesrozumitelnA!
> As was stated above|jak bylo uvedeno dATAve
> Travel abroad|cestovat do ciziny
> Visitors from abroad|zahraniÄnA nA!vA!tÄ>vnAci
> Absence from school|nepATAtomnost ve A!kole
> Absent from school|nepATAtomnA? ve A!kole
> Be absorbed in|bA?t upoutA!n ÄAm,ponoATen do
> Abstain from st|zdrA?ovat se Äeho
> Food in abundance|hojnost jAdla
> Abundance of food|nadbytek jAdla
> Be abundant|hojnÄ> se vyskytovat
> Abundant in|bohatA? na
> Alternating current|stATAdavA? proud
> Accede to|souhlasit s
> By accident|nA!hodou
> Have an accident|mAt nehodu
> Meet with an accident|mAt nehodu
> Accompanied luggage|spoluzavazadlo
> He was accorded a warm welcome|dostalo se mu vATelACho uvAtA!nA
> Give an account of|popsat,vylAÄit
> Take st into account|vzAt v Aovahu co
> On account of|pro,kvA?li
> On my account|kvA?li mnÄ>
> On no account|v A?A!dnACm pATApadÄ>
> Account for|vysvÄ>tlit
> Accustom oneself to|zvyknout si na
> Be accustomed to|bA?t zvyklA? na
> Have an headache|mAt bolenA hlavy
> My head aches|bolA mÄ> hlava
> Achieve one's aim|dosA!hnout svACho cAle
> Acknowledge one's mistake|uznat svou chybu
> Be acquainted with|bA?t obeznA!men s
> Acquiesce in st|dA!t svolenA k Äemu
> Acquit of st|zprostit Äeho
> Acquit oneself of st|zprostit se Äeho
> Acquit oneself well like|osvÄ>dÄit se, jako
> Across the river|pATes ATeku
> Across the street|na druhAC stranÄ> ulice
> Across from|naproti Äemu
> Act as an interpreter|dÄ>lat tlumoÄnAka
> On active service|v ÄinnAC sluA?bÄ>
> Adhere to|lpÄ>t na
> Adjust oneself to the circumstances|pATizpA?sobit se okolnostem
> Be admitted into a school|bA?t pATijat do A!koly
> Much ado about nothing|mnoho povyku pro nic
> Adult education college|stATednA A!kola pro pracujAcA
> Advanced in years|v pokroÄilACm vÄ>ku
> Take advantage of st|vyuA?At Äeho
> Take advantage of sb|oA!idit nÄ>koho
> Take sb's advice|dA!t si poradit od koho
> Follow sb's advice|dA!t si poradit od koho
> On the advice of sb|na ÄA radu
> A good word of advice|dobrA! rada
> You would be well advised to|doporuÄuje se, abyste
>>From afar|zdaleka
> The answer is affirmative|odpovÄ>Ä je kladnA!
> I can't afford it|nemohu si to dovolit
> Be afraid of|bA!t se Äeho
> Be afraid for|bA!t se o
> I'm afraid|bohuA?el
> After dark|po setmÄ>nA
> Shut the door after you|zavATi za sebou dveATe
> This afternoon|dnes odpoledne
> On Sunday afternoon|v nedÄ>li odpoledne
> Now and again|obÄas
> Time and again|znovu a znovu
> As much,many again|dvakrA!t tolik
> Lean against the wall|opArat se o zeÄ
> At your age|v tvACm vÄ>ku
> Come of age|dosA!hnout zletilosti
> I haven't seen you for ages|nevidÄ>l jsem tÄ> ani nepamatuji
> A boy aged ten|chlapec starA? deset let
> An aged man|starA? muA?
> The aged and infirm|staATA a nemocnA
> Two days ago|pATed dvÄ>ma dny
> Agree to,with st|souhlasit s
> Agree about st|souhlasit v Äem
> Agree with sb|souhlasit s kA?m
> Agree on|dohodnout se na
> Coffee does not agree with me|kA!va mi nedÄ>lA! dobATe
> Agreable to st|srozumÄ>nA? s ÄAm
> I'm agreeable|jsem pro
> Come to an agreement with sb|dohodnout se na
> Go ahead?|jen raÄte?
> Aim at|zamÄ>ATit se na,usilovat o
> Aim high|mAATit vysoko
> In the open air|pod A!irA?m nebem
> Walk on air|chodit jako ve snu
> Be on the air|vysAlat,bA?t vysAlA!n rozhlasem
> Give oneself on|dÄ>lat se dA?leA?itA?m,pATedvA!dÄ>t se
> With arms akimbo|ruce v bok
> On the alert|ve stATehu
> Alight from the bus|vystoupit z autobusu
> Be alive to st|uvÄ>domovat si co
> All day long|celA? den
> Beyond all doubt|nad veA!kerou pochybnost
> Why help him, of all people?|proÄ pomA!hat prA!vÄ> jemu?
> All of us|my vA!ichni
> Not at all|nenA zaÄ
> There is to it|v tom to vÄ>zA
> For all I know|co jA! vAm
> Once for all|jednou pro vA?dy
> All along|od zaÄA!tku
> All at once|najednou
> I'm all for it|jsem pro
> All over the world|po celACm svÄ>tÄ>
> All right|v poATA!dku
> All the better|tAm lACpe
> Allocate a flat to sb|pATidÄ>lit byt komu
> Allow for|vzAt v Aovahu,poÄAtat s
> Allow of|pATipouA!tÄ>t
> Be allowed to|smÄ>t
> Along the street|po ulici
> Along here|tudy,dA!le
> Come along|tak pojÄ
> Along with|spolu
> Get along with|vychA!zet s dobATe,A!patnÄ>
> Be along|pATijAt,pATijet
> Be aloof from st|stranit se Äeho
> Have the shops closed already?|to uA? majA obchody zavATeno?
> A.m.|rA!no,dopoledne
> Amazed at st|udiven,uA?aslA? nad
> Make amends to sb for st|nahradit komu co
> Come amiss|pATijAt nevhod
> Take st amiss|mAt co za zlAC
> There is st amiss|tady nÄ>co neklape
> Who among you|kdo z vA!s
> Be anong the best|patATit k nejlepA!Amu
> Among other things|mezi jinA?m
> They had a pound among them|mÄ>li dohromady libru
> It amounts to the same thing|to je vlastnÄ> totACA?
> Bread and butter|chlACb s mA!slem
> Nice and warm|hezky teplo
> Try and come|snaA? se pATijAt
> Angry young man|rozzlobenA? mladA? muA?
> Get angry|rozzlobit se
> Ankle socks|krA!tkAC ponoA?ky
> Ankle-deep in the mud|po kotnAky v blA!tÄ>
> Be annoyed with sb,at st|zlobit se na
> Another time|jindy
> Another cup of tea|jeA!tÄ> jeden A!A!lek Äaje
> Another two hours|jeA!tÄ> dalA!A dvÄ> hodiny
> Answer the door|jAt otevATAt
> Answer back|odmlouvat
> Answerable to sb for st|zodpovÄ>dnA? komu zaÄ
> Antique shop|obchod se staroA?itnostmi
> Anxiety for|starost o
> Anxieti about|starost ohlednÄ>
> Anxieti for|touha po
> Anxieti to|touha aby
> Anxious about,for one's health|znepokojenA? o svAC zdravA
> Be anxious|velmi si pATA!t,snaA?it se
> Anxious to please|vyhovÄ>t
> At any rate|alespoA^
> In any case|v kaA?dACm pATApadÄ>
> If it's any good|stojA-li to vA?bec za nÄ>co
> Not in any way|nijak
> Not anybody|nikdo
> Not anything|nic
> Anything but|vA!echno, jenom ne
> Not anywhere|nikde,nikam
> Apart from|nehledÄ> k
> Tel,know apart|rozeznat
> Set apart|vyhradit
> Take apart|rozebrat
> Joking apart|A?erty stranou
> Apartment house|nA!jemnA dA?m,penziA3n
> Apologize to sb for st|omluvit se komu zaÄ
> Apology to sb for st|omluva komu zaÄ
> Appeal to sb for st|prosba ke komu oÄ
> In apple-pie order|ve vzornACm poATA!dku
> Apply a compress|pATiloA?it obklad
> Apprehensive of|obA!vajAcA se Äeho
> Apprehensive for|obA!vajAcA se Äeho
> Apprehensive that|obA!vajAcA se, A?e
> Easy,difficult to approach|snadno,tÄ>A?ko pATAstupnA?
> Approach to work|postoj k prA!ci
> Approval to st|souhlas s ÄAm
> Apt At st|schopnA? k Äemu
> We are apt to forget|rA!di zapomAnA!me
> Aptitude for|talent k
> Arabic numerals|arabskAC ÄAslice
> With open arms|s otevATenou nA!ruÄA
> Keep sb at arm's length|drA?et si koho od tÄ>la
> He's been around a lot|vidÄ>l kus svÄ>ta,vyznA! se
> Arouse from sleep|vzbudit ze spA!nku
> Arouse sb's suspicion|vzbudit nÄ>ÄA podezATenA
> Arouse sb's anger|vzbudit nÄ>ÄA hnÄ>v
> Arrival to the town|pATAjezd,pATAchod do mÄ>sta
> Arrive home|pATijet,pATijAt domA?
> As usual|jako obyÄejnÄ>
> As a rule|zpravidla
> Twice as large|dvakrA!t tak velkA?
> Just as good|stejnÄ> tak dobrA?
> As I said before|jak uA? jsem ATekl
> As it were|jaksi
> As it is|stejnÄ>,beztoho
> Old as he is|i kdyA? je starA?
> As far as Prague|aA? do Prahy
> As for|co se tA?Äe,pokud jde o
> As good as|skoro
> As if,as though|jako kdyby
> As long as|pokud
> As soon as|jakmile
> As to|co se tA?Äe
> As well|rovnÄ>A? takAC
> As well as|jakoA? i,a takAC
> As yet|aA? dosud
> Ascent of mountain|vA?stup na horu
> Be ashamed of|stydÄ>t se za
> Be ashamed of yourself|styÄ se
> Lay aside|odloA?it
> Put aside|rezervovat
> Step aside|ustoupit stranou
> Ask the way|ptA!t se na ceestu
> Ask a question|ptA!t se na co
> Ask after sb,sb's health|ptA!t se na koho,na ÄA zdravA
> Ask for sb|ptA!t se po kom
> Ask for help|A?A!dat o pomoc
> Ask for a favour|A?A!dat o laskavost
> Ask to dinner|pozvat na obÄ>d
> You have asked for it|sA!m jsi to chtÄ>l
> Ask me another|to se mÄ> moc ptA!A!
> Look askance at|dAvat se podezAravÄ> na
> Be asleep|spA!t
> fall asleep|usnout
> Two aspirins for a headache|dva prA!A!ky proti bolenA hlavy
> Assist sb|pomoci komu
> Be of any assistance to sb|bA?t nA!pomocnA? komu
> On the assumption|za pATedpokladu, A?e
> Be astonished to see|s AoA?asem vidÄ>t
> Be astonished at the news|bA?t udiven zprA!vou
> To my astonishment|k mACmu AoA?asu
> Go astray|zabloudit,ztratit se
> Lead astray|svACst ze sprA!vnAC cesty
> At the door|u dveATA
> At the theatre|v divadle
> At the corner|na rohu
> At a lesson|pATi hodinÄ>
> At table|pATi jAdle
> At the station|na nA!draA?A
> At home|doma
> At night|v noci
> At three o.clock|ve tATi hodiny
> At that time|v tAC dobÄ>,tehdy
> At the moment|v tomto okamA?iku,teÄ
> At any moment|kdykoli
> At the age of six|v A!esti letech
> At December 31|k 31 prosinci
> At work,v zamÄ>stnA!nA
> At peace|v mAru
> At 10 crowns a piece|po deseti korunA!ch za kus
> What are you at now?|ÄAm se teÄ zabA?vA!te?
> Be hard at it|pilnÄ> pracovat
> Be at one|bA?t zajedno
> At full speed|plnou rychlostA
> At that|a k tomu jeA!tÄ>
> Atone for st|odÄinit co
> Attach much importance to st|pATiklA!dat velkou dA?leA?itost k Äemu
> Attainone's object|dosA!hnout svACho cAle
> Attempt at|pokus o
> Attend to|vÄ>novat se komu,Äemu
> Have you been attended to?|byl jste uA? obslouA?en?
> Attend school|navA!tÄ>vovat A!kolu
> Attend sb,on sb|lACÄit,oA!etATovat koho
> Attendance at school,school attendance|nA!vA!tÄ>va A!koly
> Medical attendance|lACkaATskA! pACÄe
> Pay attention to st|vÄ>novat pozornost Äemu
> Call sb's attention to st|upozornit koho naÄ
> Power of attorney|plnA! moc
> Avail oneself of st|pouA?At Äeho
> Further information is available on request|dalA!A informace lze obdrA?et
> na poA?A!dA!nA
> On an average|prA?mÄ>rnÄ>
> Avert an accident|odvrA!tit neA!tÄ>stA
> Awake to st|uvÄ>domit si co
> Be awake to st|bA?t si vÄ>dom Äeho
> Be awave of st,that|bA?t si vÄ>dom Äeho,A?e
> He was grumbling away|poATA!d mu nebylo nÄ>co po chuti
> Awkward door to open|dveATe, kterAC se A!patnÄ> otvArajA
> Go awry|zhatit se
> Bable a secret|vyzvonit tajemstvA
> Behind one's back|komu za zA!dy
> Turn one's back on|obrA!tit se zA!dy k
> The of one's hand|hATbet ruky
> Stand back|ustupte
> There and back|tam a zpÄ>t
> Be,come back|vrA!tit se
> Put it back|dejte to zpA!tky
> 20 years back|pATed 20 lety
> Go back upon one's word|nedodrA?et slovo
> Back in 1900|jiA? v roce 1900
> Call sb bad names|nadA!vat komu
> A bad mistake|vA!A?nA! chyba
> A bad headache|silnAC bolenA hlavy
> That's too bad|to je zlAC
>>From bad to worse|od devAti k pÄ>ti
> Feel bad|cAtit se A!patnÄ>
> It baffles all description|to se nedA! popsat
> As if he had just come out of a band|jako ze A!katulky
> Bang one'shead|uhodit se do hlavy
> Bang the door|prA!sknout dveATmi
> Bash the typewriter|buA!it do psacAho stroje
> Not an eyelid|ani nemrknout
> Have,take a bath|vykoupat se
> Bath-tub|vana
> Bay window|arkA?ATovAC okno
> Keep at bay|drA?et v A!achu
>
> How much is it?|kolik to stojA?
> I am to see him tomorrow|mA!m ho zAtra navA!tAvit
> It was not to be found|nedalo se to najAt
> Don't be long|nebuÄ tam dlouho
> Has the postman been yet?|uA? tady byl listonoA!?
> I haven't a bean|nemA!m ani krejcar
> I can't bear him|nemohu ho vystA!t
> The road bears to the left|cesta zahA?bA! doleva
> Bear on st|tA?kat se Äeho
> Take one's bearings|orientovat se
> Beckon sb,to sb|pokynout komu
> Go to bed|jAt spA!t
> Be in bed|leA?et v posteli
> Take to one's bed|zA?stat v posteli
> Make the bed|ustlat
> Have a bee in a bonnet|bA?t posedlA? myA!lenkou
> The day before yesterday|pATedevÄArem
> Before my eyes|pATed mA?ma oÄima
> I beg your pardon|promiA^te
> I beg to differ|jsem bohuA?el jinACho nA!zoru
> At the beginning of|na zaÄA!tku Äeho
> In the beginning|zpoÄA!tku
>>From Beginning to end|od zaÄA!tku do konce
> Behave oneself|chovat se sluA!nÄ>
> Behind your back|za tvA?mi zA!dy
> He is behind the times|zaspal dobu
> Belief in|vAra v
> The best of my belief|podle mACho nejlepA!Aho svÄ>domA
> Believe it or not|vÄ>ATte tomu nebo ne
> Below zero|pod nulou
> It is below my dignity|je to pod moji dA?stojnost
> As stated below|jak je uvedeno nAA?e
> It is beneath my dignity|to je pod moji dA?stojnost
> ¨
> Sit beside me|sedni si vedle mÄ>
> This is beside the point|to nepatATA k vÄ>ci
> Be beside oneself with joy|bA?t bez sebe radostA
> No better than|o nic lepA!A neA?
> Get the better of|pATemoci,zvlA!dnout
> Know better|mAt lepA!A rozum
> For better or worse|v dobrACm i ve zlACm
> He is better today|je mu dnes lACpe
> You had better go|bylo by lACpe, kdybys A!el,mÄ>l bys radÄ>ji jAt
> There is no love lost bettween them|nemajA se rA!di
> We had five pounds between us|mÄ>li jsme dohromady pÄ>t liber
> That's going beyond a joke|tady pATestA!vajA A?erty
> It'squite beyond me|to mi vA?bec nejde na rozum
> The big toe|palec u nohy
> He is bound up in his work|je AoplnÄ> zabrA!n do prA!ce
> Bite one'slips|kousat se do rtA?
> Bite in the leg|kousnout do nohy
> Have a little bite of st;snÄ>z si nÄ>co malACho
> Bituminous coal;ÄernAC uhlA
> Be black and blue;bA?t samA! modATina
> In black and white;ÄernAC na bAlACm
> Give sb a black look;zle se na koho podAvat
> Dressed in black;obleÄenA? v ÄernACm
> Black out;zatemnit
> Who is to blame?;ÄA je to vina?
> Bleed to death;vykrvA!cet
> Bless me!,bless my soul!;mA?j ty boA?e!
> Be blessed with good health;tÄ>A!it se dobrACmu zdravA
> Blind in one eye;slepA? na jedno oko
> Blind to sb's faults;slepA? k nÄ>ÄAm chybA!m
> The roses are in full bloom now|rA?A?e jsou teÄ v plnACm kvÄ>tu
> Be in blossom|kvACst
> Blow one's nose|vysmrkat se
> Blue with cold|modrA? zimou
> Things are looking blue|vypadA! to bledÄ>
> Blush for,with shame|Äervenat se hanbou
> Boast of,about st|chlubit se ÄAm
> Burn one's boats|spA!lit za sebou mosty,jezdit na loÄce
> Have a bone to pick with sb|mAt nevyATAzenA? AoÄet s kA?m
> Make no bones about st|neotA!let s ÄAm
> Be born|narodit se
> Both of us,we both|my oba
> It is both good and cheap;je to nejen dobrAC, ale takAC levnAC
> At bottom;v podstatÄ>
>>From the bottom of my heart;z hloubi srdce
> Get to the bottom of st;dostat se na kloub Äemu
> At the bottom of the page;dole na strA!nce
> Bounce a ball;hrA!t si s mAÄem
> Advance by leaps and bounds;postupovat mAlovA?mi kroky
> Where are you bound for?;kam mA!te namAATeno?
> He is bound to come;urÄitÄ> pATijde
> Brag about st;chvA!stat se ÄAm
> Rack one's brain;lA!mat si hlavu
> Turn sb's brain;poplACst hlavu komu
> Get down to brass tacks;pATejAt k vÄ>ci
> A breach of the peace|poruA!enA veATejnACho poATA!dku
> A breach of promise|nedodrA?enA slibu manA?elskACho
> Escape by a hair's breadth|uniknout o vlas
> Breake into pieces|rozbAt se na kusy
> Breake to one's word|nedodrA?et slovo
> Breake to one's journey|pATeruA!it cestu
> The day breaks|rozednAvA! se
> Breake the bad news to sb|A!etrnÄ> sdÄ>lit A!patnou zprA!vu komu
> Breake away from st|zbavit se Äeho
> Make a clean breast of st|otevATenÄ> pATiznat co
> Out of breath|bez dechu
> With bated breath|se zatajenA?m dechem
> Take breath|oddychnout si
> Take a deep breath|zhluboka se nadechnout
> Take sb's breath away|vzAt komu dech,pATekvapit
> Not a breath of suspicion|ani stAn podezATenA
> Drop a brick|dopustit se netaktnosti
> Go on a brigade|jet na brigA!du
> Bring to an end|ukonÄit
> Bring up-to-date|zmodernizovat
> Bring round to|pATivACst k sobÄ>,vzkATAsit
> Broad daylight|jasnA? den
> In broad outline|velkorysy, tolerantnA
> Broad views|tolerantnA nA!zory
> Broil in the sun|praA?it se na slunci
> Be broke|bA?t bez halACATe
> A new broom sweeps clean|novAC koA!tÄ> dobATe mete
> Give the clothes a good brush|dobATe vykartA!Äovat A!aty
> He won's budge an inch|neustoupA o krok
> His eyes bulged|oÄi mu vylACzaly z dA?lkA?
> Bump one's head against,on st|narazit naÄ
> Burst into tears|propuknout v plA!Ä
> Burst out laughing|dA!t se do smAchu
> Go by bus|jet autobusem
> Miss the bus|zmeA!kat autobus,propA!st pATAleA?itost
> Let's down to business|pATistupme k vÄ>ci
> Busy oneself with|zamÄ>stnA!vat se ÄAm
> Excuse my butting in|promiA^te, A?e vA!m skA!Äu do ATeÄi
> My ears buzz|huÄA mi v uA!Ach
> It must be ready by now|teÄ uA? je to jistÄ> hotovAC
> Know by the name|znA!t jmACnem
> Let's call it day|pro dneA!ek konÄAme
> What is it called in English?|jak se to ATekne anglicky?
> He was out when I called|byl pryÄ, kdyA? jsem tam pATiA!el
> Call sb up|telefonovat komu
> Give sb a call|zavolat komu
> Pay a call on sb|pATijAt ke komu na krA!tkou nA!vA!tÄ>vu
> Go camping|jet tA!boATit
> I can hear you|jA! tÄ> slyA!Am
> I cannot but|musAm
> Capable for st|schopnA? Äeho
> Take care that|dA!t pozor, aby
> Take care of|postarat se o
> I don't care for soup|jA! polACvku nerad
> She doesn't a hang,pin|je jA to AoplnÄ> jedno
> Be careful not to|dej pozor, abys ne
> Be careful about,while ...ing|dej si pozor pATi
> Be careful of|dbA!t na
> Carry oneself|nACst se
> Carry one's head|drA?et hlavu
> In case|pro pATApad,A?e
> In case of fire|pro pATApad poA?A!ru
> In any case|v kaA?dACm pATApadÄ>,rozhodnÄ>
> In no case|za A?A!dnA?ch okolnostA
> If that is the case|je-li tomu tak
> Just in case|pro kaA?dA? pATApad
> As the case may be|popATApadÄ>,eventuA!lnÄ>
> Cash on delivery|na dobArku
> Be short of cash|mAt mA!lo penÄ>z
> It's raining cats and dogs|lije jako z konve
> Catch me riding a bus!|jA! a jet autobusem!
>
--------------------------------------------------------------------------------
# -*- coding: utf8 -*-
import sys
import wx
class MainFrame(wx.Frame):
u"""HlavnA okno aplikace."""
def __init__(self, title, application):
u"""VybudovA!nA a prvnA aktualizace obsahu hlavnAho okna."""
# Inicializujeme bA!zovou tATAdu a uschovA!me parametry.
x, y, w, h = wx.GetClientDisplayRect()
pos = (x + 50, y + 50)
size = (w - 100, h - 100)
wx.Frame.__init__(self, None, -1, title, pos, size)
self.application = application
# HlavnA okno bude rozdÄ>leno na hornA panel pro ATA!dky
needitovatelnACho
# textu a dolnA panel pro vstup z klA!vesnice.
splitter = wx.SplitterWindow(self)
self.topPanel = wx.TextCtrl(splitter, -1,
style = wx.TE_MULTILINE | wx.TE_RICH2 | wx.TE_READONLY )
self.bottomPanel = wx.TextCtrl(splitter, -1,
style = wx.TE_MULTILINE
| wx.TE_RICH2
| wx.TE_PROCESS_ENTER)
splitter.SplitHorizontally(self.topPanel, self.bottomPanel, -100)
# NavA!A?eme stisk Enter ve spodnAm panelu na oA!etATujAcA
metodu.
self.Bind(wx.EVT_TEXT_ENTER, self.OnEnter, self.bottomPanel)
def displayTopText(self):
self.topPanel.SetValue(self.getMultilineText())
def getMultilineText(self):
# SpojAme celA? seznam ATA!dkA? do vAceATA!dkovACho ATetÄ>zce.
VynechA!me
# ale prvnA ATA!dek, kterA? se zobrazuje v zA!hlavA okna. ZnaÄky
|
# nahradAme ÄitelnÄ>jA!Am stATednAkem a mezerou.
text = u''.join(self.application.lines[1:])
return text.replace(u'|', u'; ')
def OnEnter(self, event):
# ZAskA!me zadanA? ATA!dek a pATipojAme jej na konec seznamu
ATA!dkA?.
text = self.bottomPanel.GetValue()
self.application.lines.append(text.rstrip() + u'\r\n')
# ZobrazAme aktualizovanA? obsah. Obsah spodnAho panelu vymaA?eme.
self.displayTopText()
self.bottomPanel.SetValue(u'')
# ZjednoduA!enA! implementace -- pokaA?dAC zapAA!eme novA? obsah do
# souboru.
import codecs
f = codecs.open(self.application.filename, 'w', 'utf-8-sig')
f.write(u''.join(self.application.lines))
f.close()
class App(wx.App):
"""Application class."""
def OnInit(self):
# VytvoATAme hlavnA okno vycentrovanAC na stATed obrazovky.
title = u'SlovnAk'
self.filename = 'database.txt'
self.frame = MainFrame(title, self)
self.frame.Center()
self.frame.Show()
self.SetTopWindow(self.frame)
# NaÄteme obsah slovnAku -- zatAm jen jednoduA!e -- a pouA?ijeme
jej
# jako obsah hornAho panelu. Tenhle kA3d bude pozdÄ>ji umAstÄ>n
jinde.
import codecs
f = codecs.open(self.filename, 'r', 'utf-8-sig')
self.lines = f.readlines()
f.close()
# PrvnA ATA!dek z databA!ze slovnAku pouA?ijeme jako titulek okna.
self.frame.SetTitle(self.lines[0])
# OstatnA ATA!dky zaÄneme zobrazovat jako text hornAho okna.
self.frame.displayTopText()
return True
#---------------------------------------------------------------------
def main():
app = App(False)
app.MainLoop()
if __name__ == '__main__':
main()
sys.exit
--------------------------------------------------------------------------------
_______________________________________________
Python mailing list
Python na py.cz
http://www.py.cz/mailman/listinfo/python
--------------------------------------------------------------------------------
Pøíchozí zpráva neobsahuje viry.
Zkontrolováno AVG - www.avg.cz
Verze: 8.5.339 / Virová báze: 270.12.53/2155 - Datum vydání: 06/04/09
17:55:00
Dal¹í informace o konferenci Python