Notes  >  Beginning Python

Beginning Python PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 1


Wrox Programmer to Programmer™ Join the discussion @ p2p.wrox.com
Using Python 2.6 and Python 3.1
Beginning
Python
®
James Payne
  
  
   
     
  
 
    
    
   
    
    
     
    
   
  
  
     
     
     
     
   
  
    
     
     
    
    
 
         
         
             
           
           
            
           
           
            
    
 
          
         
       
        
         
          
     
    
             
           
            
      
          
           
        
 
  
 
 
www.it-ebooks.info
Page 2


Wrox Programmer to Programmer™ Join the discussion @ p2p.wrox.com
Using Python 2.6 and Python 3.1
Beginning
Python
®
James Payne
  
  
   
     
  
 
    
    
   
    
    
     
    
   
  
  
     
     
     
     
   
  
    
     
     
    
    
 
         
         
             
           
           
            
           
           
            
    
 
          
         
       
        
         
          
     
    
             
           
            
      
          
           
        
 
  
 
 
www.it-ebooks.info
Get more out of  
wrox.com
Programmer to Programmer
™
Interact
Take an active role online by participating in our 
P2P forums @ p2p.wrox.com
Wrox Online Library
Hundreds of our books are available online 
through Books24x7.com
Wrox Blox 
Download short informational pieces and code  
to keep you up to date and out of trouble!
Join the Community
Sign up for our free monthly newsletter at  
newsletter.wrox.com 
Browse
Ready for more Wrox? We have books and  
e-books available on .NET, SQL Server, Java,  
XML, Visual Basic, C#/ C++, and much more!
Contact Us. 
 We always like to get feedback from our readers. Have a book idea?  
Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
  
     
 
                    
                    
                       
        
         
 
                       
                 
                    
                 
                  
www.it-ebooks.info
Page 3


Wrox Programmer to Programmer™ Join the discussion @ p2p.wrox.com
Using Python 2.6 and Python 3.1
Beginning
Python
®
James Payne
  
  
   
     
  
 
    
    
   
    
    
     
    
   
  
  
     
     
     
     
   
  
    
     
     
    
    
 
         
         
             
           
           
            
           
           
            
    
 
          
         
       
        
         
          
     
    
             
           
            
      
          
           
        
 
  
 
 
www.it-ebooks.info
Get more out of  
wrox.com
Programmer to Programmer
™
Interact
Take an active role online by participating in our 
P2P forums @ p2p.wrox.com
Wrox Online Library
Hundreds of our books are available online 
through Books24x7.com
Wrox Blox 
Download short informational pieces and code  
to keep you up to date and out of trouble!
Join the Community
Sign up for our free monthly newsletter at  
newsletter.wrox.com 
Browse
Ready for more Wrox? We have books and  
e-books available on .NET, SQL Server, Java,  
XML, Visual Basic, C#/ C++, and much more!
Contact Us. 
 We always like to get feedback from our readers. Have a book idea?  
Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
  
     
 
                    
                    
                       
        
         
 
                       
                 
                    
                 
                  
www.it-ebooks.info
Beginning Python®: Using Python 2.6 and Python 3.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
Part I: Dipping Your Toe into Python
Chapter 1: Programming Basics and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Numbers and Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 3: Variables — Names for Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Part II: Python Language and the Standard Library
Chapter 4: Making Decisions ....................................................................... 51
Chapter 5: Functions ................................................................................... 71
Chapter 6: Classes and Objects ................................................................... 93
Chapter 7: Organizing Programs ................................................................. 111
Chapter 8: Files and Directories ................................................................. 127
Chapter 9: Other Features of the Language ................................................ 143
Chapter 10: Building a Module ................................................................... 157
Chapter 11: Text Processing ...................................................................... 189
Part III: Putting Python to Work
Chapter 12: Testing ................................................................................... 207
Chapter 13: Writing a GUI with Python ....................................................... 227
Chapter 14: Accessing Databases.............................................................. 239
Chapter 15: Using Python for XML      ............................................................. 265
Chapter 16: Network Programming ............................................................ 287
Continues
              
www.it-ebooks.info
Page 4


Wrox Programmer to Programmer™ Join the discussion @ p2p.wrox.com
Using Python 2.6 and Python 3.1
Beginning
Python
®
James Payne
  
  
   
     
  
 
    
    
   
    
    
     
    
   
  
  
     
     
     
     
   
  
    
     
     
    
    
 
         
         
             
           
           
            
           
           
            
    
 
          
         
       
        
         
          
     
    
             
           
            
      
          
           
        
 
  
 
 
www.it-ebooks.info
Get more out of  
wrox.com
Programmer to Programmer
™
Interact
Take an active role online by participating in our 
P2P forums @ p2p.wrox.com
Wrox Online Library
Hundreds of our books are available online 
through Books24x7.com
Wrox Blox 
Download short informational pieces and code  
to keep you up to date and out of trouble!
Join the Community
Sign up for our free monthly newsletter at  
newsletter.wrox.com 
Browse
Ready for more Wrox? We have books and  
e-books available on .NET, SQL Server, Java,  
XML, Visual Basic, C#/ C++, and much more!
Contact Us. 
 We always like to get feedback from our readers. Have a book idea?  
Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
  
     
 
                    
                    
                       
        
         
 
                       
                 
                    
                 
                  
www.it-ebooks.info
Beginning Python®: Using Python 2.6 and Python 3.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
Part I: Dipping Your Toe into Python
Chapter 1: Programming Basics and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Numbers and Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 3: Variables — Names for Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Part II: Python Language and the Standard Library
Chapter 4: Making Decisions ....................................................................... 51
Chapter 5: Functions ................................................................................... 71
Chapter 6: Classes and Objects ................................................................... 93
Chapter 7: Organizing Programs ................................................................. 111
Chapter 8: Files and Directories ................................................................. 127
Chapter 9: Other Features of the Language ................................................ 143
Chapter 10: Building a Module ................................................................... 157
Chapter 11: Text Processing ...................................................................... 189
Part III: Putting Python to Work
Chapter 12: Testing ................................................................................... 207
Chapter 13: Writing a GUI with Python ....................................................... 227
Chapter 14: Accessing Databases.............................................................. 239
Chapter 15: Using Python for XML      ............................................................. 265
Chapter 16: Network Programming ............................................................ 287
Continues
              
www.it-ebooks.info
Chapter 17: Extension Programming with C ................................................ 337
Chapter 18: Numerical Programming .......................................................... 367
Chapter 19: An Introduction to Django ....................................................... 387
Chapter 20: Web Applications and Web Services ........................................ 407
Chapter 21: Integrating Java with Python ................................................... 481
Part IV: Appendices
Appendix A: Answers to the Exercises ........................................................ 515
Appendix B: Online Resources.................................................................... 549
Appendix C: What’s New in Python 3.1 ....................................................... 553
Appendix D: Glossary ................................................................................. 559
Index ........................................................................................................ 569
              
www.it-ebooks.info
Page 5


Wrox Programmer to Programmer™ Join the discussion @ p2p.wrox.com
Using Python 2.6 and Python 3.1
Beginning
Python
®
James Payne
  
  
   
     
  
 
    
    
   
    
    
     
    
   
  
  
     
     
     
     
   
  
    
     
     
    
    
 
         
         
             
           
           
            
           
           
            
    
 
          
         
       
        
         
          
     
    
             
           
            
      
          
           
        
 
  
 
 
www.it-ebooks.info
Get more out of  
wrox.com
Programmer to Programmer
™
Interact
Take an active role online by participating in our 
P2P forums @ p2p.wrox.com
Wrox Online Library
Hundreds of our books are available online 
through Books24x7.com
Wrox Blox 
Download short informational pieces and code  
to keep you up to date and out of trouble!
Join the Community
Sign up for our free monthly newsletter at  
newsletter.wrox.com 
Browse
Ready for more Wrox? We have books and  
e-books available on .NET, SQL Server, Java,  
XML, Visual Basic, C#/ C++, and much more!
Contact Us. 
 We always like to get feedback from our readers. Have a book idea?  
Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
  
     
 
                    
                    
                       
        
         
 
                       
                 
                    
                 
                  
www.it-ebooks.info
Beginning Python®: Using Python 2.6 and Python 3.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
Part I: Dipping Your Toe into Python
Chapter 1: Programming Basics and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Numbers and Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 3: Variables — Names for Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Part II: Python Language and the Standard Library
Chapter 4: Making Decisions ....................................................................... 51
Chapter 5: Functions ................................................................................... 71
Chapter 6: Classes and Objects ................................................................... 93
Chapter 7: Organizing Programs ................................................................. 111
Chapter 8: Files and Directories ................................................................. 127
Chapter 9: Other Features of the Language ................................................ 143
Chapter 10: Building a Module ................................................................... 157
Chapter 11: Text Processing ...................................................................... 189
Part III: Putting Python to Work
Chapter 12: Testing ................................................................................... 207
Chapter 13: Writing a GUI with Python ....................................................... 227
Chapter 14: Accessing Databases.............................................................. 239
Chapter 15: Using Python for XML      ............................................................. 265
Chapter 16: Network Programming ............................................................ 287
Continues
              
www.it-ebooks.info
Chapter 17: Extension Programming with C ................................................ 337
Chapter 18: Numerical Programming .......................................................... 367
Chapter 19: An Introduction to Django ....................................................... 387
Chapter 20: Web Applications and Web Services ........................................ 407
Chapter 21: Integrating Java with Python ................................................... 481
Part IV: Appendices
Appendix A: Answers to the Exercises ........................................................ 515
Appendix B: Online Resources.................................................................... 549
Appendix C: What’s New in Python 3.1 ....................................................... 553
Appendix D: Glossary ................................................................................. 559
Index ........................................................................................................ 569
              
www.it-ebooks.info
Beginning 
Python
®
              
www.it-ebooks.info
Read More

FAQs on Beginning Python

1. What is Python?
Ans. Python is a high-level programming language that is widely used for various applications such as web development, data analysis, artificial intelligence, and more. It is known for its simplicity, readability, and versatility.
2. How can I install Python on my computer?
Ans. To install Python on your computer, you can visit the official Python website and download the latest version of Python. The website provides installation instructions for different operating systems such as Windows, macOS, and Linux. Follow the instructions specific to your operating system to successfully install Python.
3. What are the advantages of using Python for programming?
Ans. There are several advantages of using Python for programming. Firstly, Python has a simple and easy-to-understand syntax, making it beginner-friendly. It also has a large and active community, which means there are plenty of resources and support available. Python also offers extensive libraries and frameworks for various purposes, allowing developers to work efficiently and save time. Additionally, Python is highly versatile and can be used for multiple purposes, from web development to data analysis and machine learning.
4. How can I write a "Hello, World!" program in Python?
Ans. Writing a "Hello, World!" program in Python is quite simple. You can use the following code: ``` print("Hello, World!") ``` Save the code with a .py extension, such as hello_world.py, and run it using a Python interpreter. The program will display "Hello, World!" as the output.
5. Can Python be used for web development?
Ans. Yes, Python can be used for web development. There are several frameworks available in Python, such as Django and Flask, that make web development easier and faster. These frameworks provide tools and libraries for handling web-related tasks, such as routing, database management, and form handling. Python's simplicity and readability also make it a popular choice for web development projects.
Download as PDF
Explore Courses for exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev