Python
  Home arrow Python arrow Python 101 (part 5): Snake Oil For The Soul
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PYTHON

Python 101 (part 5): Snake Oil For The Soul
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2001-07-09


    Table of Contents:
  • Python 101 (part 5): Snake Oil For The Soul
  • Air In A Bottle
  • Treading The Right Path
  • Standing In Line
  • Learning To Write
  • Desperately Seeking Python
  • String Theory
  • Pop() Goes The Weasel

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Python 101 (part 5): Snake Oil For The Soul
    ( Page 1 of 8 )

    Now that you know how to create and use Python's tuples, lists and dictionaries, it's time to get your hands dirty. In this article, find out how to read from, and write to, files on the filesystem with built-in Python methods, and also take a look at some of the new features available in Python 2.x. Yeah, yeah, I know. So far, all we've been doing in this tutorial is mucking around with Python's data structures, dumb creatures with names like "tuples" and "lists", and messing about with twisty things like the "for" and "while" loops. And you're fed up.

    All these concepts and structures, beautifully-designed and wonderfully-elegant though they may be, leave you cold. You just don't see the point of this exercise. As a matter of fact, you're thinking, now is probably a good time to drop this thing and get on with something more worthwhile - "Ally McBeal", perhaps?

    I hear you.

    Over the next few pages, we're going to leave the rarefied world of Python data structures and enter something a lot more tangible - the filesystem. I'm going to be showing you how to use Python to interact with files on your filesystem, opening them, reading them and writing to them.

    No longer will you be playing abstract games with list slices and dictionary keys - by the end of this article, you'll be able to watch as your Python code creates new files in front of your eyes, or rub your hands in glee as you read other people's private documents. You will have the power to wipe out each and every file on your hard drive, or selectively nuke only the ones you don't like. You will be respected...and, more importantly, you will be feared.

    Even "Ally McBeal" can't top that!

     
     
    >>> More Python Articles          >>> More By Vikram Vaswani, (c) Melonfire
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek