Essential Python for the Physicist

This book introduces the reader with little or no previous computer-programming experience to the Python programming language of interest for a physicist or a natural-sciences student. The book starts with basic interactive Python in order to acquire an i

  • PDF / 6,533,274 Bytes
  • 304 Pages / 453.543 x 683.15 pts Page_size
  • 66 Downloads / 343 Views

DOWNLOAD

REPORT


Essential Python for the Physicist

Essential Python for the Physicist

Giovanni Moruzzi

Essential Python for the Physicist

123

Giovanni Moruzzi Department of Physics “Enrico Fermi” University of Pisa Pisa, Italy

ISBN 978-3-030-45026-7 ISBN 978-3-030-45027-4 https://doi.org/10.1007/978-3-030-45027-4

(eBook)

© Springer Nature Switzerland AG 2020 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

Preface

Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. Python is an interpreted language emphasizing code readability: Its syntax allows programmers to express concepts in fewer lines of code than other languages such as C++ or Java. Python features a dynamic type system and automatic memory management. It supports multiple programming paradigms, including object-oriented, imperative, functional and procedural, and has a very large and comprehensive standard library. The purpose of the present book is to introduce the physics student, or, more generally, a natural science student, to Python. The book requires no previous experience with other programming languages even if, of course, such a previous experience, if present, makes learning Python easier and faster. We start with a brief introduction to the basics of Python programming in interactive mode, then present scripts, or programs, of increasing complexity, and finally reach fundamental computer animation. Special regard is given to simple animations of physical interest. In fact, a great advantage of Python is its being, at least at the moment, the only programming language allowing cross-platform graphics. This means that your programs involving graphics and animation will