id
int64
0
25.6k
text
stringlengths
0
4.59k
9,000
inside the try block we get the lambda function that is appropriate to the requested action we use lock to protect access to the call dictionaryalthough arguably we are being overly cautious as alwayswe do as little as possible within the scope of the lock--in this case we just do dictionary lookup to get reference to ...
9,001
networking if car is not noneif car mileage mileagecar mileage mileage return (truenonereturn (false"cannot wind the odometer back"return (false"this license is not registered"in this method we can do one check without acquiring lock at all but if the mileage is non-negative we must acquire lock and get the relevant ca...
9,002
tween the check for the license' existence in the requesthandler cars dictionary and adding the new car to the dictionary def shutdown(self*ignore)self server shutdown(raise finish(if the action is to shut down we call the server' shutdown(method--this will stop it from accepting any further requestsalthough it will co...
9,003
networking this involves adding or modifying about ten lines in the client program' handle_request(functionand adding or modifying about sixteen lines in the server program' handle(method--including code to handle the case where the protocol version read does not match the one expected solutions to this and to the foll...
9,004
no licence starts with start of licensea ( he ( ( abk enter choice ( to cancel) licenseabk seats mileage owneranthony jay the change involves deleting one line and adding about twenty more lines it is slightly tricky because the user must be allowed to get out or to go on at each stage make sure that you test the new f...
9,005
dbm databases sql databases database programming |||for most software developers the term database is usually taken to mean an rdbms (relational database management systemthese systems use tables (spreadsheet-like gridswith rows equating to records and columns equating to fields the tables and the data they hold are cr...
9,006
database programming in this we will implement two versions of program that maintains list of dvdsand keeps track of each dvd' titleyear of releaselength in minutesand director the first version uses dbm (via the shelve moduleto store its dataand the second version uses the sqlite database both programs can also load a...
9,007
the program offers options to addeditlistremoveimportand export dvd data we will skip importing and exporting the data from and to xml format since it is very similar to what we have done in and apart from addingwe will omit most of the user interface codeagain because we have seen it before in other contexts def add_d...
9,008
database programming to be able to edit dvdthe user must first choose the dvd to work on this is just matter of getting the title since titles are used as keys with the values holding the other data since the necessary functionality is needed elsewhere ( when removing dvd)we have factored it out into separate find_dvd(...
9,009
can choose the title just by entering its number (the console get_integer(function accepts even if the minimum is greater than zero so that can be used as cancelation value this behavior can be switched off by passing allow_zero=false we can' use enterthat isnothingto mean cancelsince entering nothing means accepting t...
9,010
database programming ||sql databases interfaces to most popular sql databases are available from third-party modulesand out of the box python comes with the sqlite module (and with the sqlite database)so database programming can be started right away sqlite is lightweight sql databaselacking many of the features ofsayp...
9,011
table db-api connection object methods syntax description db close(closes the connection to the database (represented by the db object which is obtained by calling connect(functiondb commit(commits any pending transaction to the databasedoes nothing for databases that don' support transactions db cursor(returns databas...
9,012
database programming table db-api cursor object attributes and methods syntax arraysize description the (readable/writablenumber of rows that fetchmany(will return if no size is specified close(closes the cursorcthis is done automatically when the cursor goes out of scope description read-only sequence of -tuples (name...
9,013
duration console get_integer("duration (minutes)""minutes"minimum= maximum= * director_id get_and_set_director(dbdirectorcursor db cursor(cursor execute("insert into dvds "(titleyeardurationdirector_id"values (????)"(titleyeardurationdirector_id)db commit(this function starts with the same code as the equivalent functi...
9,014
database programming fields cursor fetchone(return fields[ if fields is not none else none the get_director_id(function returns the id of the given director or none if there is no such director in the database we use the fetchone(method because there is either zero or one matching record (we know that there are no dupl...
9,015
we could use fresh dictionary for bothin which case for the update we would pass dict(title=titleyear=yearduration=durationdirector_id=director_idid=identity)instead of locals(once we have all the fields and the user has entered any changes they wantwe retrieve the corresponding director id (inserting new director reco...
9,016
database programming and since we expect the number of matching records to be smallwe fetch them all at once into sequence of sequences if there is more than one matching record and few enough to displaywe print the records with number beside each one so that the user can choose the one they want in much the same way a...
9,017
return ans console get_bool("remove { }?format(title)"no"if anscursor db cursor(cursor execute("delete from dvds where id=?"(identity,)db commit(this function is called when the user asks to delete recordand it is very similar to the equivalent function in the dvds-dbm py program we have now completed our review of the...
9,018
database programming databasesand this makes it possible to choose exactly the right approach for any given situation exercise ||write an interactive console program to maintain list of bookmarks for each bookmark keep two pieces of informationthe url and name here is an example of the program in actionbookmarks (bookm...
9,019
python' regular expression language the regular expression module regular expressions ||| regular expression is compact notation for representing collection of strings what makes regular expressions so powerful is that single regular expression can represent an unlimited number of strings--providing they meet the regul...
9,020
parsing xml files regular expressions regexes are widely and successfully used to create parsersthey do have limitation in that areathey are only able to deal with recursively structured text if the maximum level of recursion is known alsolarge and complex regexes can be difficult to read and maintain so apart from sim...
9,021
string escapes although most characters can be used as literalssome are "special characters"--these are symbols in the regex language and so must be escaped by preceding them with backslash (\to use them as literals the special characters are ^$?+*{}[]()most of python' standard string escapes can also be used within re...
9,022
regular expressions table character class shorthands symbol meaning matches any character except newlineor any character at all with the re dotall flagor inside character class matches literal \ matches unicode digitor [ - with the re ascii flag meaning of the flags \ matches unicode nondigitor [^ - with the re ascii f...
9,023
table regular expression quantifiers syntax meaning eor { , greedily match zero or one occurrence of expression ?or { , }nongreedily match zero or one occurrence of expression eor { ,greedily match one or more occurrences of expression +or { ,}nongreedily match one or more occurrences of expression eor { ,greedily matc...
9,024
regular expressions three solutions present themselves (apart from using proper parserone is ]*(match characters and then the tag' closing character)another is (match <imgthen any number of charactersbut nongreedilyso it will stop immediately before the tag' closing >and then the >)and third combines bothas in ]*?none ...
9,025
exampleif we have read text file with lines of the form key=valuewhere each key is alphanumericthe regex (\ +)=+will match every line that has nonempty key and nonempty value (recall that matches anything except newlines and for every line that matchestwo captures are madethe first being the key and the second being th...
9,026
regular expressions regex is (? =namefor example(? \ +)\ +(? =wordmatches duplicate words using capture called "wordassertions and flags |one problem that affects many of the regexes we have looked at so far is that they can match more or different text than we intended for examplethe regex aircraft|airplane|jet will m...
9,027
table regular expression assertions symbo meaning matches at the startalso matches after each newline with the re multiline flag matches at the endalso matches before each newline with the re multiline flag \ matches at the start \ \ matches at "wordboundaryinfluenced by the re ascii flag--inside character class this i...
9,028
regular expressions est way is to use the regex \ (helen\ +patricia)\ +sharman\ but we could also achieve the same thing using lookahead assertionfor example\ (helen\ +patricia)(?=\ +sharman\bthis will match "helen patriciaonly if it is preceded by word boundary and followed by whitespace and "sharmanending at word bou...
9,029
<img\ [^>]*src(?(? ["'](? [^\ >]+?(? =quote(? [^">]+[^>]* start of the tag any attributes that precede the src start of the src attribute opening quote image filename closing quote matching the opening quote ---or alternatively--unquoted image filename any attributes that follow the src end of the tag the indentation i...
9,030
regular expressions process called compiling--and then does its work this is very convenient for one-off usesbut if we need to use the same regex repeatedly we can avoid the cost of compiling it at each use by compiling it once using the re compile(function we can then call methods on the compiled regex object as many ...
9,031
plicate whole word similarlyif the input text was "one and and two let' say"without the last assertion there would be two matches and two capturesone and and two let' say the use of the lookahead assertion means that the second word matched is whole wordso we end up with one match and one captureone and and two let' sa...
9,032
regular expressions table the regular expression module' functions syntax description re compilerfreturns compiled regex with its flags set to if specified (the flags are described in table re escape(sreturns string with all nonalphanumeric characters backslash-escaped--thereforethe returned string has no special regex...
9,033
table regular expression object methods syntax description rx findall( startendreturns all nonoverlapping matches of the regex in string (or in the start:end slice of sif the regex has captureseach match is returned as tuple of captures rx finditer( startendreturns match object for each nonoverlapping match in string (...
9,034
regular expressions text re sub( """"html_text# text re sub( "]*?>""\ \ "text# text re sub( "]*?>"""text# text re sub( "&#(\ +);"lambda mchr(int( group( )))texttext re sub( "&([ -za- ]+);"char_from_entitytext# text re sub( "\ (?:\xa \ ]+\ )+""\ "text# return re sub( "\ \ +""\ \ "text strip()# the first regexmatches htm...
9,035
string)convert to an integer using the built-in int(functionand then use the built-in chr(function to obtain the unicode character for the given code point the function' return value (or in the case of lambda expressionthe result of the expressionis used as the replacement text the fifth re sub(call uses the regex &([ ...
9,036
regular expressions pression the middle name expression matches zero or more occurrences of whitespace followed by word the second part of the regex\ +(\ +)matches the whitespace that follows the forename (and middle namesand the surname if the regex looks bit too much like line noisewe can use named capture groups to ...
9,037
table match object attributes and methods syntax description end(greturns the end position of the match in the text for group if given (or for group the whole match)returns - if the group did not participate in the match endpos the search' end position (the end of the text or the end given to match(or search()returns s...
9,038
regular expressions terthen one or more word characters optionally followed by periodwith the whole of this second part itself matching zero or more times when we use alternation (|with two or more alternatives capturingwe don' know which alternative matchedso we don' know which capture group to retrieve the captured t...
9,039
and :\ *([-\ ]+)only one of which can match the first of these matches an equals sign followed by one or more word or hyphen characters (optionally enclosed in matching quotes using conditional match)and the second matches colon and then optional whitespace followed by one or more word or hyphen characters (recall that...
9,040
regular expressions ranges of characters in them without having to write each character individually we learned how to quantify expressions to match specific number of times or to match from given minimum to given maximum number of timesand how to use greedy and nongreedy matching we also learned how to group one or mo...
9,041
meta http-equiv content-type content text/htmlcharset=utf- li class right style margin-right px one approach is to use two regexesone to capture tags with their attributes and another to extract the name and value of each attribute attribute values might be quoted using single or double quotes (in which case they may c...
9,042
bnf syntax and parsing terminology writing handcrafted parsers pythonic parsing with pyparsing lex/yacc-style parsing with ply introduction to parsing |||parsing is fundamental activity in many programsand for all but the most trivial casesit is challenging topic parsing is often done when we need to read data that is ...
9,043
introduction to parsing in generalif python already has suitable parser in the standard libraryor as third-party add-onit is usually best to use it rather than to write our own when it comes to parsing data formats or dsls for which no parser is availablerather than handcrafting parserwe can use one of python' third-pa...
9,044
for examplegiven sentence in the english languagesuch as "the dog barked"we might transform the sentence into sequence of (part-of-speechword -tuples((definite_article"the")(noun"dog")(verb"barked")we would then perform syntactic analysis to see if this is valid english sentence in this case it isbut our parser would h...
9,045
introduction to parsing attribute_file ::(attribute '\ ')attribute ::name '=value name ::[ -za- ]\wvalue ::'true'false\ [ -za- ]\wfigure bnf for file of attributes the symbol ::means is defined as nonterminals are written in uppercase italics ( valueterminals are either literal strings enclosed in quotes (such as '=and...
9,046
here we have moved the newline to the end of the attribute nonterminalthus simplifying the definition of attribute_file we have also reused the name nonterminal in the value--although this is dubious change since it is mere coincidence that they can both match the same regex this version of the bnf should match exactly...
9,047
introduction to parsing expression would fail (assuming that didn' exist beforesince it would start by trying to assign the value of nonexistent variable to precedence and associativity can sometimes work together for exampleif two different operators have the same precedence (this is commonly the case with and -)witho...
9,048
now that we have passing familiarity with bnf syntax and with some of the terminology used in parsingwe will write some parsersstarting with ones written by hand writing handcrafted parsers ||in this section we will develop three handcrafted parsers the first is little more than an extension of the key-value regex seen...
9,049
introduction to parsing [playlistfile =blondie\atomic\ -atomic ogg title =blondie atomic length = file =blondie\atomic\ - ' gonna love you too ogg title =blondie ' gonna love you too length =- numberofentries= version= figure an extract from pls file the bnf we have created can handle pls filesand is actually generic e...
9,050
isn' relevant to parsing as suchand in any case it can be downloaded from the book' web site the parsing is done in single function that accepts an open file object (file)and boolean (lowercase_keysthat has default value of false the function uses two regexes and populates dictionary (key_valuesthat it returns we will ...
9,051
introduction to parsing we can immediately skip blank lines (and use slightly simpler regexes)we also skip comment lines since we expect most lines to be key=value lineswe always try to match the key_value_re regex first if this succeeds we extract the keyand lowercase it if necessary then we add the key and the value ...
9,052
#extm #extinf: ,blondie atomic blondie\atomic\ -atomic ogg #extinf:- ,blondie ' gonna love you too blondie\atomic\ - ' gonna love you too ogg figure an extract from file the bnf is shown in figure it defines as the literal text #extm followed by newline and then one or more entrys each entry consists of an info followe...
9,053
introduction to parsing want_infowant_filename range( state want_info the open file object is in variable fh if the file doesn' start with the correct text for file we output an error message and return an empty list the song named tuples will be stored in the songs list the regex is for matching the bnf' info nontermi...
9,054
we then restore the parser' state to its start state ready to parse another song' details at the end (not shown)we return the songs list to the caller and thanks to the use of named tupleseach song' attributes can be conveniently accessed by namefor examplesongs[ title keeping track of state using variable as we have d...
9,055
introduction to parsing figure the hierarchy svg file figure shows the complete messagebox blk file in which blocks are nestedand figure shows how the messagebox svg file is rendered [# ccdemessagebox window [lightgrayframe [[whitemessage text/[goldenrodok button[[#ff cancel button[figure the messagebox blk file colors...
9,056
now that we have seen couple of blocks fileswe will look at the blocks bnf to more formally understand what constitutes valid blocks file and as preparation for parsing this recursive format the bnf is shown in figure blocks ::nodesnodes ::new_row\snodenode ::'[\ (color ':')\sname\snodes\ ']color ::'#[\da-fa- ]{ [ -za-...
9,057
block has no name and the color white the children list contains blocks and nones--the latter representing new row markers rather than rely on users of the block class remembering all of these conventionswe have provided some module methods to abstract them away class blockdef __init__(selfnamecolor="white")self name n...
9,058
introduction to parsing we will begin by looking at the data classthen we will see how the class is used and the parsing startedand then we will review each parsing function as we encounter it class datadef __init__(selftext)self text text self pos self line self column self brackets self stack [block get_root_block()t...
9,059
all the advancing methods use this private method to actually advance the parser' position this means that the code to keep the line and column numbers up-to-date is kept in one place def advance_to_position(selfposition)while self pos positionself _advance_by_one(this method advances to given index position in the tex...
9,060
introduction to parsing from the internal exceptions we use unusuallythe error message contains an escaped str format(field name--the caller is expected to use this to insert the filenamesomething we cannot do here because we are only given the file' textnot the filename or file object at the end we return the root blo...
9,061
data stack append(blockparse(datadata stack pop(this function begins by advancing by one character (to skip the start-of-block open bracketit then looks for the next start of block and the next end of block if there is no following block or if the next end of block is before the start of another block then this block d...
9,062
introduction to parsing this is the easiest of the parsing functions it simply adds new row as the last child of the stack of block' top blockand advances over the new row character this completes the review of the blocks recursive descent parser the parser does not require huge amount of codefewer than linesbut that' ...
9,063
included in python' standard libraryso it must be downloaded and installed separately--although for linux users it is almost certainly available through the package management system it can be obtained from pyparsing wikispaces com--click the page' download link it comes in the form of an executable installation progra...
9,064
introduction to parsing alphanumsmatches text that starts with an alphabetic character and that is followed by zero or more alphanumeric characters (both alphas and alphanums are predefined strings of characters provided by the pyparsing module less frequently used alternative to word(is charsnotin(this element is give...
9,065
note that here and in the subsections that followwe import each pyparsing name that we need individually for examplefrom pyparsing_py import (alphanumsalphascharsnotinforwardgrouphexnumsoneormoreoptionalparseexceptionparsesyntaxexceptionsuppresswordzeroormorethis avoids using the import syntax which can pollute our nam...
9,066
introduction to parsing variable word(alphasalphanumsvar_list variable variable suppress(","var_list wrongthe problem seems to be simply matter of python syntax--we can' refer to var_list before we have defined it pyparsing offers solution to thiswe can create an "emptyparser element using forward()and then later on we...
9,067
sectionthe fourth parser is new and much more complexand is shown in this sectionand in lex/yacc form in the following section simple key-value data parsing |handcrafted keyvalue parser in the previous section' first subsection we created handcrafted regex-based key-value parser that was used by the playlists py progra...
9,068
introduction to parsing the key_value parser element is the one we are really interested in this matches "word"-- sequence of alphanumeric charactersfollowed by an equals signfollowed by the rest of the line (which may be emptythe restofline is predefined parser element supplied by pyparsing since we want to accumulate...
9,069
parser pythonic parsing with pyparsing playlist data parsing |in the previous section' second subsection we created handcrafted regexbased parser for files in this subsection we will create parser to do the same thingbut this time using the pyparsing module an extract from file is shown in figure ( )and the bnf is show...
9,070
introduction to parsing parse action is so simple that we have used lambda the combine(ensures that there is always precisely one token in the tokens tupleand we use int(to convert this to an integer if parse action returns valuethat value becomes the value associated with the token rather than the text that was matche...
9,071
the final example we will also see how to handle operators and their precedences and associativities parsing the blocks domain-specific language |handcrafted blocks parser in the previous section' third subsection we created recursive descent parser for blk files in this subsection we will create pyparsing implementati...
9,072
introduction to parsing time to strip whitespace since whitespace (apart from newlinesis allowed as part of nameyet we don' want any leading or trailing whitespace for the color parser element we have specified that the first character must be followed by exactly six hexadecimal digits (seven characters in all)or seque...
9,073
one important but subtle point to note is that we used the operator rather than the operator in the definition of the node parser element we could just as easily have used +since both (parserelement __add__()and (parserelement __sub__()do the same job--they return parser element that represents the concatenation of the...
9,074
introduction to parsing object we convert this object into standard python listso now we have list containing single item-- list of our results--which we assign to the items variableand that we then further process via the populate_children(call before discussing the handling of the resultswe will briefly mention the e...
9,075
the populate_children(function is quite shortbut also rather subtle def populate_children(itemsstack)for item in itemsif isinstance(itemblock block)stack[- children append(itemelif isinstance(itemlistand itemstack append(stack[- children[- ]populate_children(itemstackstack pop(elif isinstance(itemint)if item =emptybloc...
9,076
introduction to parsing parsing first-order logic |in this last pyparsing subsection we will create parser for dsl for expressing formulas in first-order logic this has the most complex bnf of all the examples in the and the implementation requires us to handle operatorsincluding their precedences and associativitiesso...
9,077
formula ::('forall'exists'symbol ':formula formula '->formula right associative formula '|formula left associative formula '&formula left associative '~formula '(formula ')term '=term 'true'falseterm ::symbol symbol '(term_list ')term_list ::term term ',term_list symbol ::[ -za- ]\wfigure bnf for first-order logic bina...
9,078
introduction to parsing exists keyword("exists"implies literal("->"or_ literal("|"and_ literal("&"not_ literal("~"equals literal("="boolean keyword("false"keyword("true"symbol word(alphasalphanumsall the parser elements created here are straightforwardalthough we had to add underscores to the end of few names to avoid ...
9,079
are straightforward to definewe've just used group(to make them sublists within the results list to keep their components together and at the same time distinct as unit the operatorprecedence(function (which really ought to have been called something like createoperators()creates parser element that matches one or more...
9,080
introduction to parsing in this case the error location is slightly off--the error is that should have the form xbut it is still pretty good in the case of successful parse we get list of parseresults which has single result--as before we convert this to python list earlier we saw some example formulasnow we will look ...
9,081
actually the samethese two formulas are true forall xx and true (forall xx )and fortunatelywhen parsed they both produce exactly the same list'true''&''forall'' '[' ''='' 'the parentheses don' matter here because only one valid parse is possible we have now completed the pyparsing first-order logic parserand in factall...
9,082
introduction to parsing the untar py example program that comes with this book' examples for instanceassuming the book' examples are located in :\py egthe command to execute in the console is :\python \python exe :\py eg\untar py ply tar gz once the tarball is unpackedchange directory to ply' directory--this directory ...
9,083
rule matches its corresponding function is called with parameter (called pfollowing the ply documentation' examples)this parameter can be indexed with [ corresponding to the nonterminal that the rule definesand [ and so oncorresponding to the parts on the right-hand side of the bnf precedence and associativity can be s...
9,084
introduction to parsing both the ini_header and comment tokensmatchers are simple regexesand since both use the t_ignore_ prefixboth will be correctly matched--and then discarded an alternative approach to ignoring matches is to define function that just uses the t_ prefix ( t_comment())and that has suite of pass (or r...
9,085
key_values {lexer ply lex lex(lexer input(file read()key none for token in lexerif token type ="key"key token value elif token type ="value"if key is noneprint("failed to parsevalue '{ }without keyformat(token value)elsekey_values[keytoken value key none the lexer reads the entire input text and can be used as an itera...
9,086
introduction to parsing stateply predefines the initial state which all lexers start in here is the definition of the states variable for the ply parserstates (("entry""exclusive")("filename""exclusive")now that we have defined our tokens and our states we can define the regexes and functions to match the bnf t_m "\#ex...
9,087
in this parser we want to ignore spurious whitespace that may occur between tokensand we want to do so regardless of the state the lexer is in this can be achieved by creating t_ignore variableand by giving it state of any which means it is active in any statet_any_ignore \ \nthis will ensure that any whitespace betwee...
9,088
introduction to parsing tokens ("node_start""node_end""color""name""new_rows""empty_node"pyparsing blocks parser blk bnf t_node_start "\[t_node_end "\]t_color "(?:\#[\da-fa- ]{ }|[ -za- ]\ *):t_name "[^][/\ ]+t_new_rows "/+t_empty_node "\[\]the regexes are taken directly from the bnfexcept that we have chosen to disall...
9,089
block none stack pop(whenever we start new node we increment the brackets count and create new empty block this block is added as the last child of the stack' top block' list of children and is itself pushed onto the stack if the block has color or name we will be able to set it because we keep reference to the block i...
9,090
introduction to parsing once lexing has finished we check that the brackets have balancedand if not we raise lexerror if lexerror occurred during lexingparsingor when we checked the bracketswe raise valueerror that contains an escaped str format(field name--the caller is expected to use this to insert the filenamesomet...
9,091
dict type the t_symbol(function is used to match both symbols (identifiersand keywords if the key given to dict get(isn' in the dictionary the default value (in this case "symbol"is returnedotherwise the key' corresponding token name is returned notice also that unlike in previous lexerswe don' change the ply lex lexto...
9,092
introduction to parsing is itself formula which may contain formulas and so on we don' have to concern ourselves with whitespace between tokens since we created t_ignore regex which told the lexer to ignore ( skipwhitespace in this examplewe could just as easily have created two separate functionssayp_formula_forall(an...
9,093
embody all the operatorsso while it would be harmless to use list here--and might be essential for other parsers--in this example it isn' necessary def p_formula_equals( )"formula term equals termp[ [ [ ] [ ] [ ]this is the part of the bnf that relates formulas and terms the implementation is straightforwardand we coul...
9,094
introduction to parsing sociativities and will set the precedences from lowest (first tuple in the listto highest (last tuple in the listfor unary operatorsassociativity isn' really an issue for ply (although it can be for pyparsing)so for not we could have used "nonassocand the parsing results would not be affected at...
9,095
although this can lead to if statements with lots of elifs and nested if elifs that can be difficult to maintain for more complex grammarsand those that are recursivepyparsingplyand other generic parser generators are better choice than using regexes or finite state automataor doing handcrafted recursive descent parser...
9,096
introduction to parsing exercise ||create suitable bnf and then write simple program for parsing basic bibtex book referencesand that produces output in the form of dictionary of dictionaries for examplegiven input like this@book{blanchette+summerfield author "jasmin blanchette and mark summerfield"title " +gui program...
9,097
dialog-style programs main-window-style programs introduction to gui programming |||python has no native support for gui (graphical user interfaceprogrammingbut this isn' problem since many gui libraries written in other languages can be used by python programmers this is possible because many gui libraries have python...
9,098
introduction to gui programming for developing gui programs that must run on any or all python desktop platforms ( windowsmac os xand linux)using only standard python installation with no additional librariesthere is just one choicetk if it is possible to use third-party libraries the number of options opens up conside...
9,099
invoke invoke read input create gui process start event loop write output no event to processterminate yes classic console program process request to terminateno yes terminate classic gui program figure console programs versus gui programs concentrate on the gui programming aspects without distraction in the coverage o...