Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

You're reading from  Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

Product type Book
Published in Sep 2015
Publisher
ISBN-13 9781783551590
Pages 200 pages
Edition 1st Edition
Languages
Author (1):
Dan Nixon Dan Nixon
Profile icon Dan Nixon

Input/output


We will now take a look at some of the ways we can access the files and directories on the filesystem and create, modify, and read the files. Here we will look at using Python's file objects which are documented in full at https://docs.python.org/2/library/stdtypes.html#bltin-file-objects.

While this will suffice for simple files, there is a good selection of free libraries available online that take a lot of work out of creating and parsing the more complex files such as XML, JSON, and MIDI.

The os.path module

The os.path module contains various functions for performing manipulation of path names specific to the host operating system. This goes hand in hand with the file objects for accessing the files and directories on the filesystem, and helps to ensure that code can be used on any platform by handing all of the platform dependent and specific tasks for you (for example, the differences in file paths on Windows and Linux).

The following example demonstrates the most commonly...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}