Skip to main content

Part of the book series: Texts in Computational Science and Engineering ((TCSE,volume 3))

  • 12k Accesses

The present chapter provides an overview of functionality frequently needed in Python scripts, including file reading and writing, list and dictionary operations, simple text processing, writing and calling Python functions, checking a file's type, size, and age, listing and removing files, creating and removing directories, and traversing directory trees. In a sense, the overview is a kind of quick reference with embedded examples containing useful code segments in Python scripts. A corresponding overview of more advanced Python functionality is provided in Chapter 8. For real, complete quick references, see links in doc.html.

The many Python modules developed as part of this book project, and referred to in this and other chapters, are collected in a package scitools. This package must be downloaded and installed (by running a setup.py script) as described in Chapter 1.2. The various modules in scitools are accessible through the dot notation, e.g., scitools.misc denotes the misc module within the scitools package. Many of the functions referred to in the forthcoming sections are found in the misc module.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 64.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

(2009). Basic Python. In: Langtangen, H.P. (eds) Python Scripting for Computational Science. Texts in Computational Science and Engineering, vol 3. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73916-6_3

Download citation

Publish with us

Policies and ethics