id int64 0 25.6k | text stringlengths 0 4.59k |
|---|---|
9,700 | the animal class tracks three characteristicsnameageand type production application would probably track more characteristicsbut these characteristics do everything needed for this example the code also includes the required accessors for each of the characteristics the __str__(method completes the picture by printing ... |
9,701 | type the following code into the window -pressing enter after each lineimport animals mychicken animals chicken("sally" print(mychickenmychicken setage(mychicken getage( print(mychickenmychicken settype("gorilla"print(mychickenmychicken makesound(the first step is to import the animals module remember that you always i... |
9,702 | performing advanced tasks see an example of how you can interact with the directory structure of your plat form at www dummies com/extras/beginningprogrammingwith python |
9,703 | create file read file update file delete file send an email |
9,704 | storing data in files in this considering how permanent storage works with applications deciding how to work with permanently stored content writing to file for the first time obtaining content from the disk changing file content as needed removing file from disk ntil nowapplication development might seem to be all abo... |
9,705 | crud operations must be performed in securereliableand controlled manner this also helps you set few guidelines for how access must occur to ensure data integrity ( measure of how often data errors occur when performing crud operationsunderstanding how permanent storage works you don' need to understand absolutely ever... |
9,706 | directory howeverthis directory doesn' actually contain any source code files to locate the source code filesyou must open one of the directories contained in the bp directory first to locate the source code files for this you look in the bp ddirectory notice that 've used backslash (\to separate the directory levels s... |
9,707 | the cues that make content usable for permanent storage are often hidden from sight all you see when you work with the file is the data itself the formatting remains invisible for number of reasonssuch as thesethe cue is control charactersuch as carriage return or linefeedthat is normally invisible by default at the pl... |
9,708 | def __str__(self)outstring "'{ }'{ }{ }formatself nameself ageself marriedreturn outstring this is shortened class normallyyou' add accessors (getter and setter methodsand error-trapping code (remember that getter methods provide read-only access to class data and setter methods provide write-only access to class data ... |
9,709 | any application that saves data goes through some sort of output loop in this casethe loop simply prints the data onscreen howeverin the upcoming sectionsyou actually output the data to file choose runrun module you see the output shown in figure - this is representation of how the data would appear in the file in this... |
9,710 | python actually supports huge number of file types nativelyand libraries that provide additional support are available if you have file type that you need to support using pythonyou can usually find third-party library to support it when python doesn' support it natively unfortunatelyno comprehensive list of supported ... |
9,711 | in order to write outputyou need writer object the datawriter object is configured to use csvfile as the output fileto use / as the record characterto quote records using spaceand to provide quoting only on nonnumeric values this setup will produce some interesting results laterbut for nowjust assume that this is what ... |
9,712 | figure - the appli cation output as it appears in excel figure - the appli cation output as it appears in wordpad reading file content at this pointthe data is on the hard drive of courseit' nice and safe therebut it really isn' useful because you can' see it to see the datayou must read it into memory and then do some... |
9,713 | type the following code into the window at the end of the existing code -pressing enter after each linedef readdata(filename "")with open(filename" "newline='\ 'as csvfiledatareader csv readercsvfiledelimiter="\ "quotechar="quoting=csv quote_nonnumericoutput [for item in datareaderoutput append(item[ ]csvfile close(pri... |
9,714 | type the following code into the window -pressing enter after each linefrom formatteddata import formatdata newdata formatdata readdata("testfile csv"for entry in newdataprint(entrythe readcsv py code begins by importing the formatdata class it then creates newdata objecta listby calling formatdata readdata(notice that... |
9,715 | in most applicationsyou can further break down the second step of modifying the in-memory presentation of the data an application can provide some or all of these features as part of the modification processprovide an onscreen presentation of the data allow additions to the data list allow deletions from the data list ... |
9,716 | if not os path isfile("testfile csv")print("please run the createfile py example!"quit(newdata formatdata readdata("testfile csv"for entry in newdataprint(entryprint("\ \nadding record for harry "newrecord "'harry' falsenewdata append(newrecordfor entry in newdataprint(entryprint("\ \nremoving doug' record "location ne... |
9,717 | strings on diskso that' what you get when the data is read back in you can either add the new data as string or create formatdata object and then use the __str__(method to output the data as string the next step is to remove record from newdata to perform this taskyou must first find the record of coursethat' easy when... |
9,718 | figure - the applica tion shows each of the modifica tions in turn figure - the updated information appears as expected in changed file csv |
9,719 | deleting file the previous section of this "updating file content,explains how to adddeleteand update records in file howeverat some point you may need to delete the file the following steps describe how to delete files that you no longer need this example also appears with the downloadable source code as deletecsv py ... |
9,720 | sending an -mail in this defining the series of events for sending an -mail developing an -mail application testing the -mail application his helps you understand the process of sending an -mail using python more importantthis is generally about helping you understand what happens when you communicate outside the local... |
9,721 | considering the simple mail transfer protocol when you work with -mailyou see lot of references to simple mail transfer protocol (smtpof coursethe term looks really techni caland what happens under the covers truly is technicalbut all you really need to know is that it works on the other handunderstanding smtp little m... |
9,722 | letter leaving one location and ending up precisely where it should at the other end seems impossible -mind-bogglingeven howeverboth -mail and its real-world equivalent have several aspects in common that improve the likelihood that they'll actually work as intended the following sections examine what happens when you ... |
9,723 | the process is little more complex than this explanationbut this is essentially what happens in factit' much the same as the process used when working with physical letters in that the essential steps are the same with physical mailthe -mail application is replaced by you on one end and the recipient at the other the s... |
9,724 | local hostnamethe local hostname is the human-readable form of the combination of the host and port for examplethe website www myplace com might resolve to an address of : (where the first four numbers are the host address and the number after the colon is the portpython takes care of these details behind the scenes fo... |
9,725 | figure - the local host address actually cor responds to your machine type socket gethostbyname("www johnmuellerbooks com"and press enter you see the output shown in figure - this is the address for my website the point is that these addresses work wherever you are and whatever you're doing -just like those you place o... |
9,726 | granted using combination of the host address and the port the following steps help illustrate how ports work with the host address to provide server access open python shell window you see the familiar python prompt type import socket and press enter remember that socket provides both host address and port information... |
9,727 | figure - most internet locations provide only an ipv address type socket getservbyport( and press enter you see the output shown in figure - the socket getservbyport(method provides the means to determine how particular port is used port is always dedicated to smtp support on any server sowhen you access : you're askin... |
9,728 | local hostname hostname is simply the human-readable form of the host address humans don' really understand very well (and the ipv addresses make even less sensehoweverhumans do understand localhost just fine there is special server and setup to translate human-readable hostnames to host addressesbut you really don' ne... |
9,729 | figure - avoid using hard-coded values for the local system whenever possible defining the parts of the letter the "envelopefor an -mail address is what the smtp server uses to route the -mail howeverthe envelope doesn' include any content -that' the purpose of the letter lot of developers get the two elements confused... |
9,730 | messagecontains the information that you want the recipient to see this information can include the followingfromthe human-readable form of the sender tothe human-readable form of the recipients ccvisible recipients who also received the messageeven though they aren' the primary targets of the message subjectthe purpos... |
9,731 | although you can create any sort of an -mail message with pythonthe easiest type to create is one that contains plain text the lack of formatting in the content lets you focus on the technique used to create the messagerather than on the message content the following steps help you understand how the message-creating p... |
9,732 | figure - python adds some additional information required to make your message work specifying the transmission an earlier section ("defining the parts of the envelope"describes how the envelope is used to transfer the message from one location to another the process of sending the message entails defining transmission... |
9,733 | type sendmail('senderaddress'['recipientaddress']msg as_string)and press enter in order for this step to workyou must replace senderaddress and recipientaddress with real addresses don' include the humanreadable form this time -the server requires only an address this is the step that actually creates the envelopepacka... |
9,734 | working with text message text messages represent the most efficient and least resource-intensive method of sending communication howevertext messages also convey the least amount of information yesyou can use emoticons to help get the point acrossbut the lack of formatting can become problem in some situations the fol... |
9,735 | considering the smtp server if you tried the example in this with out modifying ityou're probably scratching your head right now trying to figure out what went wrong it' unlikely that your system has an smtp server connected to localhost the reason for the examples to use localhost is to provide placeholder that you re... |
9,736 | msg['subject'' test html messagemsg['from']='senderaddressmsg['to''recipientaddresss smtplib smtp('localhost' sendmail('senderaddress'['recipientaddress']msg as_string()print("message sent!"the example follows the same flow as the text message example in the previous section howevernotice that the message now contains ... |
9,737 | figure - the html output contains header and paragraph as expected the point of creating your own application to send and receive -mail isn' convenience -using an off-the-shelf application serves that purpose much better the point is flexibility as you can see from this short on the subjectyou control every aspect of t... |
9,738 | the part of tens enjoy an additional part of tens article about ten sites with unique designs at www dummies com/extras/beginningprogrammingwithpython |
9,739 | discover really cool resources that you can use to make your python programming experience better earn living with the python knowledge you gain get the tools you need to work more efficiently with python make python do even more by adding libraries |
9,740 | ten amazing programming resources in this using the python documentation accessing an interactive python tutorial creating online applications using python extending python using third-party libraries obtaining better editor than python' for python application development getting the syntax for your python application ... |
9,741 | working with the python documentation online an essential part of working with python is knowing what is available in the base language and how to extend it to perform other tasks the python documentation at version of the product at the time of this writingit may be updated by the time you read this contains lot more ... |
9,742 | using the learnpython org tutorial many tutorials are available for python and many of them do great jobbut they're all lacking special feature that you find when using the learnpython org tutorial at just reading about python featureyou read it and then try it yourself using the interactive feature of the site you hav... |
9,743 | performing web programming using python this book discusses the ins and outs of basic programmingso it relies on desktop applications because of their simplicity howevermany developers specialize in creating online applications of various sorts using python the web programming in python site at webprogramming helps you... |
9,744 | using python although all the links provide you with useful resourcesthe "downloads (downloads effbot org)link is the one you should look at first this download site provides you with access to aggdrawa library that helps you create anti-aliased drawings celementtreean add-on to the elementtree library that makes worki... |
9,745 | creating applications faster using an ide an interactive development environment (idehelps you create applications in specific language the integrated development environment (idleeditor that comes with python worked well for the needs of the bookbut you may find it limited after while for exampleidle doesn' provide th... |
9,746 | the python vim utility (php?script_id= provides enhanced syntax highlighting that makes finding errors in your python script even easier this utility runs as scriptwhich makes it fast and efficient to use on any platform in additionyou can tweak the source code as needed to meet particular needs using xml to your advan... |
9,747 | using schools to your advantage one of the most used online resources for learning online computing technologies is schools you can find the main page at single resource can help you discover every web technology needed to build any sort of modern application you can imagine the topics includehtml css javascript sql jq... |
9,748 | pythoncommon newbie mistakespart (rachum com/blog//python-common-newbiemistakes-part- /pythoncommon newbie mistakespart (rachum com/blog//python-common-newbiemistakes-part- /many other resources are available for people who are just starting with pythonbut these particular resources are succinct and easy to understand ... |
9,749 | making your python application fast nothing turns off user faster than an application that performs poorly when an application performs poorlyyou can count on users not using it at all in factpoor performance is significant source of application failure in enterprise environments an organization can spend ton of money ... |
9,750 | ten ways to make living with py thon in this using python for qa creating your own way in smaller organization employing python for special product-scripting needs working as an administrator demonstrating programming techniques delving into location data mining data of various sorts working with embedded systems proce... |
9,751 | python excels at certain kinds of taskswhich means that it also lends itself to certain types of programming the kind of programming you can perform determines the job you get and the way in which you make your living for examplepython probably isn' very good choice for writing device driversas / +areso you probably wo... |
9,752 | why you need to know multiple programming languages most organizations see knowledge of multiple programming languages as big plus (some see it as requirementof coursewhen you're an employerit' nice to get the best deal you can when hiring new employee knowing broader range of languages means that you can work in more ... |
9,753 | some developers are unaware that python is available in some non-obvious products for exampleeven though you can' use python scripting with internet information server iisright out of the boxyou can add python scripting support to this product using the steps found in the microsoft knowledge base article at if you aren... |
9,754 | this is just the tip of the iceberg you can also use python with the gnu debugger to create more understandable output of complex structuressuch as those found in +containers some video games also rely on python as scripting language in shortyou could build career around creating application scripts using python as the... |
9,755 | helping people decide on location geographic information system (gisprovides means of viewing geographic information with business needs in mind for exampleyou could use gis to determine the best place to put new business or to determine the optimum routes for shipping goods howevergis is used for more than simply deci... |
9,756 | of coursedata mining is used for more than generating sales for examplepeople use data mining to perform tasks such as locating new planets around stars or other types of analysis that increase our knowledge of the universe python figures into this sort of data mining as well you can likely find books and other resourc... |
9,757 | you could produce the same result using another languagebut the other language might not include the prebuilt modules to perform the taskand it would most definitely require more lines of code even if it did the two sciences that have dedicated python modules are space sciences and life sciences for examplethere is act... |
9,758 | ten interesting tools in this keeping track of application bugs creating safe place to test applications getting your application placed on user system documenting your application writing your application code looking for application errors working within an interactive environment performing application testing sorti... |
9,759 | integrateddevelopmentenvironments pythondebuggers pythoneditors pythonshells skeletonbuildertools testsoftware usefulmodules versioncontrol interestingly enoughit' quite possible that the lists on the python developmenttools site aren' even complete you can find python tools listed in quite few places online given that... |
9,760 | if you're willing to put little more work into the installationyou can get additional featuresand these additional features are what make the product special howeverto get themyou may need to install other productssuch as database management system (dbmsthe product instructions tell you what to install and which third-... |
9,761 | never test on production server mistake that some developers make is to test their unreleased application on the production server where the user can easily get to it of the many reasons not to test your application on production serverdata loss has to be the most important if you allow users to gain access to an unrel... |
9,762 | avoid the orphaned product some python tools floating around the internet are orphanedwhich means that the devel oper is no longer actively supporting them developers still use the tool because they like the features it supports or how it works howeverdoing so is always risky because you can' be sure that the tool will... |
9,763 | both kinds of documentation depending on who uses it and how the service is put together the majority of your documentation is likely to affect developersand pdoc (solution for creating it the pdoc utility relies on the documentation that you place in your code in the form of docstrings and comments the output is in th... |
9,764 | debugging your application using pydbgr high-end idesuch as komodo idecomes with complete debugger even komodo edit comes with simple debugger howeverif you're using something smallerless expensiveand less capable than high-end ideyou might not have debugger at all debugger helps you locate errors in your application a... |
9,765 | entering an interactive environment using ipython the python shell works fine for many interactive tasks you've used it extensively in this book howeveryou may have already noted that the default shell has certain deficiencies (and if you haven'tyou'll notice them as you work through more advanced examplesof coursethe ... |
9,766 | the nice part of this product is that you actually create python code to perform the testing your script is simply anotherspecializedapplication that tests the main application for problems you may be thinking that the scriptsrather than your professionally written applicationcould be bug ridden the testing script is d... |
9,767 | track of the changes that occur in an application between application releases to the production environment when you say you're using myapp you're referring to version of the myapp application versioning lets everyone know which application release is being used when bug fixes and other kinds of support take place num... |
9,768 | ten libraries you need to know about in this securing your data using cryptology working with databases getting to where you're going and finding new locations presenting the user with gui creating tables that users will enjoy viewing working with graphics finding the information you need allowing access to java code f... |
9,769 | the purpose of this isn' to add to your already overflowing list of potential library candidates insteadit provides you with list of ten libraries that work on every platform and provide basic services that just about everyone will need think of this as source for core group of libraries to use for your next coding adv... |
9,770 | the most common type of database is called relational database management system (rdbms)which uses tables that are organized into records and fields (just like table you might draw on sheet of papereach field is part of column of the same kind of informationsuch as the customer' name tables are related to each other in... |
9,771 | commonly used product is tkinter (tkinterdevelopers like it so much because tkinter keeps things simple it' actually an interface for the tool command language (tcl)/toolkit (tkfound at basis for creating gui you might not relish the idea of adding gui to your application doing so tends to be time consuming and doesn' ... |
9,772 | classifying python sound technologies it' important to realize that sound comes in many forms in computers the basic multime dia services provided by python (see the docu mentation at org/ /library/mm htmlprovide essential playback functionality you can also write certain types of audio filesbut the selec tion of file ... |
9,773 | even though the library is designed around engineeringmathematicaland scientific requirementsyou have no reason to avoid using it for other purposes pyqtgraph supports both and displaysand you can use it to generate new graphics based on numeric input the output is completely interactiveso user can select image areas f... |
9,774 | irlab works by creating search index of whatever information you want to work with you can then save this index to disk for later use the search mechanism works through the use of metrics -you locate one or more entries that provide best fit for the search criteria creating an interoperable java environment using jpype... |
9,775 | accessing local network resources using twisted matrix depending on your network setupyou may need access to files and other resources that you can' reach using the platform' native capabilities in this caseyou need library that makes such access possiblesuch as twisted matrix (library is to provide you with the calls ... |
9,776 | operator symbols and numerics <<(less-than or equaloperator (minus sign) !(not equaloperator (number sign) operator %operator operator parentheses (asteriskmultiplication operator variable argument lists *operator **operator *operator (forward slash) /operator /operator //operator (colon) square brackets (backslash) - ... |
9,777 | application system (as/ ) applications commands in - commercialwritten in python compile time errors creating in edit window - crud and debugging decision-making and defined designing - installing using pyinstaller - loading in edit window multithreaded overview procedures and purpose of quitting readme files running f... |
9,778 | boolean type - break statements overview - for while statements bugs defined tracking sites for using virtual environments __builtins__ attribute byte code byte type bytearray type - option *ccjob opportunities and python versus user interfaces __cached__ attribute caller - capitalization capitalize(function car securi... |
9,779 | code (continuedrunnable spaghetti code understandable using edit window - version control - collections - colon ) color coding - comma separated values (csv) command-line python see also idle accessing from command prompt - advantages of arguments close button of terminal commands in enter key in environment variables ... |
9,780 | copy(function copyright(function copyright messages count(function counter object - createreadupdatedelete see crud credits(command - cross-platform support - crud (createreadupdatedeleteapplications and defined file storage - for lists css (cascading style sheets) csv (comma separated values) curly brackets } current ... |
9,781 | documentation accessing from idle - in comments creating using pdoc - online opening pydoc application - quick-access links - searching - docx files double quotes ) downloading python - drawing characters dynamic systems - option *eedit windowidle - effbot library elementsoap library elementtidy library elementtree lib... |
9,782 | custom - defined listing arguments - online resources raising - exceptionshandling except clause - finally clause - length checking multiple exceptions - nesting - passing error information to caller - raising exceptions - range checking single exception - specific and unknown exceptions - exec(command exemaker library... |
9,783 | function arguments default values - overview required - using keywords variable number of - functions calling - code reusability and - comparing output from defined defining - overloading partial purpose of returning data from - user input - functions topic *ggcc (gnu compiler collection) general tabidle - generators g... |
9,784 | *iide (integrated development environment) identity operators idle (interactive development environmentsee also commandline python accessing on mac accessing on windows - color coding in - command-line python versus commands in comments in - configuration - edit window - exiting feature overview help in - indentation i... |
9,785 | interactive environment internet engineering task force (ietf) internet information server (iis) ioerror exception ipv (internet protocol version ) ipv (internet protocol version ) ipython irlib library - is not operator is operator isalnum(function isalpha(function isdecimal(function isdigit(function islower(function ... |
9,786 | scipy socket sqlalchemy - third-party libraries - tkinter - twisted matrix license(command lifo (last in/first out) lightwave linefeed character lineno warning level linq (language integrated query) linux accessing python on installing python - python support lists accessing items in - computer view of - counter object... |
9,787 | microsoft windows accessing idle - accessing python from command prompt - ignoring case in import statements installing python - opening pydoc application platform support mime (multipurpose internet mail extensions) - min(function minus sign ) minute value modo module warning level modules defined finding on disk - fi... |
9,788 | open source operands operating system (os/ ) operating system (os/ ) operators arithmetic - assignment binary bitwise - comparisons and identity logical membership overloading - overview - precedence relational - ternary unary using with lists optimizing code or operator ord(function orphaned projects os _exit(command ... |
9,789 | procedures (continueddefined separating from user interface tasks as - processorsmultiple production servers production-grade classes program files directory programming application usage types - code reusability - common mistakes - communication with computer exceptions and - knowing multiple languages languages - pyt... |
9,790 | pythonpath environment variable pythonstartup environment variable pythonunbuffered environment variable pythonverbose environment variable python vim utility pythonware site - pythonwarnings environment variable pythonwritebytecode environment variable pyunit - *qq command - option qa (quality assurance) qnx quantum m... |
9,791 | roundup issue tracker rpm (red hat package manager) rstrip(function runnable code running applications from command line defined from edit window in idle - - runtime errors - * - option - option scientific applications - scientific notation scipy library screenshots in book scribus sd (secure digital) searching irlib l... |
9,792 | functions for - overview - searching in - selecting individual characters in - upper(function using special characters - as viewed by computers strip(function structured data structured query language (sql) subtraction operator ) sudo command suse linux swapcase(function switch statements - switchescommand-line - synta... |
9,793 | beginning programming with python for dummies update(function upper(function usb (universal serial bus) usefulmodules site user access control (uac) user input - user interfaces * \ escape sequence - option - option valueerror exception variables assigning values class - defined determining type of instance - returning... |
9,794 | john mueller is freelance author and technical editor he has writing in his bloodhaving produced books and more than articles to date the topics range from networking to artificial intelligence and from database management to heads-down programming some of his current books include windows command-line referencebooks o... |
9,795 | some people are simply there in your life -as reliable as the day is long scott and pegg conderman are two such people -they have helped me through an extremely hard time simply by being themselves and knowing just what to do to make the day little better |
9,796 | thanks to my wiferebecca even though she is gone nowher spirit is in every book writein every word that appears on the page she believed in me when no one else would russ mullen deserves thanks for his technical edit of this book he greatly added to the accuracy and depth of the material you see here russ is always pro... |
9,797 | senior acquisitions editorkyle looper project coordinatorpatrick redmond project and copy editorsusan christophersen cover image(cistock com glam- technical editorruss mullen editorial assistantclaire johnson sr editorial assistantcherie case |
9,798 | whowhenwhatwherewhyhoweasy environments programming primer coding conventions fussing with the flow script samples excellent -resources |
9,799 | charlene nielsen ccn@ualberta ca gis analyst in biological sciences www biology ualberta ca/gis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.