Langage Evolué 1 Mr

Total Page:16

File Type:pdf, Size:1020Kb

Langage Evolué 1 Mr Langage Evolué 1 Mr. BOUZIDI L’hadi, Octobre 2017 A l’issue de ce cours : • d’un point de vue théorique, l’étudiant sera capable : o d’expliquer les concepts de programmation et de paradigmes de programmation o de citer le processus de programmation o d’expliquer c’est quoi un environnement de programmation o de choisir un langage pour débuter • d’un point de vue pratique, il sera capable : o d’expliquer comment installer le langage Python o d’utiliser Python en mode commande o d’utiliser Python en mode scripte o d’expliquer en quoi un programme python est-il plus claire syntaxiquement o d’écrire des programmes simples permettant de manipuler : Objectifs ▪ des variables, des opérateurs et des expressions ▪ des structures de contrôle (conditions, boucles, exceptions) ▪ des séquences (chaines de caractères, listes, tuples, ensembles) ▪ des dictionnaires ▪ des fichiers ▪ des fonctions ▪ des modules ▪ des interfaces graphiques o de citer les bibliothèques Python permettant de répondre à des problèmes de mathématiques o d’utiliser quelques bibliothèques comme numpy, scipy ou mathplot Un cours + 2 TP • Le cours magistral sera accompagné d’un support de cours papier, PDF et éventuellement de vidéos sur Internet • Les séances de TP auront lieu dans une salle équipée d’ordinateurs et d’un vidéo projecteur. • Les étudiants vont travailler (individuellement) sur l’IDE IDLE. • A l’issue de chaque séance de cours, les étudiants vont répondre à un QCM (sur papier), • A l’issue de chaque séance de TP, ils vont rendre un compte rendu. • Tout au lent du module, ils auront des activités d’autoévaluation à réaliser en ligne. • A la fin du module (système de sorite) seront organisés : Scénario pédagogique o Une interrogation écrite o Un test en ligne o Une EMD Évaluation : Calcul de la note de TP : Les éléments d’évaluation: • Test en ligne • Note TP = Test en ligne + Test sur machine + • Tests sur machine Interrogation + Assiduité et Participation • Interrogation • Assiduité et participation Calcul de la note du module : • EMD • Note du module = (Note du TP + note d’EMD *2)/3 Plan du cours (11 chapitres) 1. Dictionnaires 7. Concepts de base 2. Fichiers 8. Environnement de programmation 3. Fonctions 9. Variables, expressions et opérateurs 4. Modules et package 10. Structures de contrôle 5. Interfaces graphiques 11. Séquences 6. Python et les mathématiques 1 Planning 2017-2018 (semestre I) Octobre 2017 Novembre 2016 Décembre 2016 Janvier 2017 Activité S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 s 14 21 28 4 11 18 25 2 9 16 6 13 20 27 Cours graphiques Magistral Fichiers Modules Fonctions opérateurs Python et les Dictionnaires programmation mathématiques Séquences (listes) Environnement de Concepts de base + Séquences (chaines) Interfaces Interfaces graphiques Variables, expressions et Tps TP1 TP2 TP3 TP4 TP5 TP6 TP7 TP8 TP9 TP10 TP11 TP12 TP13 Auto- évaluati 7 Test 2 Test 3 Test 4 Test 5 Test 6 Test Test 8 Test 9 on en Test 1 Test10 Test11 Test12 Test13 ligne Quiz Quiz 2 Quiz 3 Quiz 4 Quiz 5 Quiz 6 Quiz 7 Quiz 8 Quiz 9 papier Quiz 1 Quiz 10 Quiz 11 Quiz 12 Quiz 13 Tests en X ligne Interro. X X Ressources : Support de cours « papier » (exemplaire en ligne en PDF), forum en ligne, éventuellement des vidéos en ligne. Les étudiants pourront s’inscrire à des cours en ligne massifs (MOOC : Massive Open On ligne Courses) : Dès qu’ils seront inscrits, ils pourront télécharger des ressources (vidéos et document PDF) gratuitement. Cours PDF en ligne Intitulé Auteur URL Licence Apprendre à programmer Gérard Swinnen http://www.inforef.be/swi/download/apprendre_python3.pdf CC- BY-SA avec Python3 2.0 FR Une introduction à Bob CORDEAU & http://perso.limsi.fr/pointal/_media/python:cours:courspython3.pdf CC- BY-NC- Python 3 Laurent POINTAL SA-3.0 Cours de Python Patrick Fuchs et http://www.dsimb.inserm.fr/~fuchs/python/ CC- BY-SA (univ-paris-diderot) Pierre POULIN 2.0 FR Apprenez à programmer Vincent LEGOF http://www.siteduzero.com CC-BY-NC- en Python SA 2.0 Vidéos en ligne Intitulé URL Pythonneries : Série de plus de 34 petites vidéos http://www.youtube.com/playlist?list=UUEBgesbuuHivHmYbh8TGXzQ Tutoriel Python : Apprendre à programmer en Python https://www.youtube.com/watch?v=A5dl7XRnmM4 (Série de 8 vidéos sur Youtube) 2 MOOC (Massive Open Online Course) Sur FUN (https://www.fun-mooc.fr/cours/#search?query=Python&page=1&rpp=50) Nom Editeur Certifiant Temps Début Durée Python 3 : des fondamentaux aux concepts FUN - UCA Oui 8h30/sem 06/11/2017 9 sem avancés du langage Python pour les scientifiques IONISx - EPITA Non 2h/sem Permanent 4 sem Perfectionnez-vous en Python Openclassrooms Certificat pour les premium 1h/sem Permanent 3 sem Testez votre projet avec Python Openclassrooms Certificat pour les premium 1h/sem Permanent 3 sem Découvrez la programmation orientée objet avec Openclassrooms Certificat pour les premium 1h30/sem Permanent 4 sem Python Apprenez à programmer en Python Openclassrooms Certificat pour les premium 8h/sem Permanent 5 sem FLOT : Programmation en Python pour débutants, URL : http://flot.sillages.info/?portfolio=flot-programmation-pour-debutants Programmer en ligne avec Python : • Python Tutor : http://pythontutor.com/ • Repl.it : https://repl.it/languages/python3 • Execute Python Online : https://www.tutorialspoint.com/execute_python_online.php • Easy and Quick way to run Python3 Code Online : https://www.jdoodle.com/python3-programming-online 3 Chapitre 1 – Concepts de base • La programmation orientée objets défini un I.1 – Programmation programme comme un ensemble d’objets La programmation dans le domaine informatique est communiquant via des interfaces. Les objets l'ensemble des activités qui permettent l'écriture des possèdent des propriétés et des comportements. programmes informatiques. Pour écrire des Ils permettent de représenter les objets du monde programmes, on utilise un langage de programmation. réel au sein de l’ordinateur. Quelques langages de La programmation représente usuellement le codage, programmation sont par essence orientés objets, c’est-à-dire la rédaction du code source d'un logiciel. c’est le ca s de Smaltalk. La plus part des langages On utilise plutôt le terme développement pour dénoter procéduraux ont évolué et permettent maintenant l'ensemble des activités liées à la création d'un logiciel. de faire de la programmation orientée objet : Pascal-objet, C++, Java, PHP, Python, C# en sont L’écriture des programmes est basée sur des des exemples. Attention, le langage C ne permet techniques et des méthodes permettant de formaliser pas de faire de la programmation orientée objet les problèmes et d’exprimer des solutions en utilisant (POO). Il est cependant à la base de plusieurs l’ordinateur. La technique de base communément autres langages permettant la POO comme C++, utilisé est l’expression algorithmique. Une façon Java, PHP, C# et Python. d’exprimer la solution à un problème en utilisant un langage évolué très proche du langage humain. La programmation met en relation un problème, un I.2 – Processus de programmation programmeur, une machine et un utilisateur. Il s’agit On suppose que l’on a un problème que l’on souhaite d’une étape importante du génie logiciel. Elle se met en résoudre en utilisant l’ordinateur. On suppose aussi place à la suite d’un processus de conception de que le problème est bien explicité sous une forme logiciel. textuelle. Il est question de construire un programme Il existe divers types de programmation : procédurale permettant de solutionner le problème. Voici les étapes (ou impérative), fonctionnelle, logique, orientée objet, à suivre : etc. La plus utilisée est la programmation procédurale. 1. Exprimer un algorithme à partir de l’énoncé textuel • La programmation fonctionnelle définie un 2. Traduire l’algorithme en langage évolué. Ceci programme comme une fonction qui fait appel à donne ce qu’on appel par « code source » d’autre fonctions. Il n’ya pas de variables globales 3. Saisir le code source sur ordinateur (en utilisant un dans un programme fonctionnel. L’état du éditeur de texte) ; programme n’est pas défini par les valeurs des 4. Compiler le programme pour vérifier si le code variables. LISP et ML sont deux exemples de source respect les règles du langage évolué. Ceci langages de programmation permettant la donne lieu à un programme dit objet. programmation fonctionnelle. 5. Procéder une phase qui permet de lier le code • La programmation logique (exemple de langage : objet généré avec d’éventuelles fonctions issues Prolog) défini un programme comme une de bibliothèques déjà existantes. On parle expression de prédicat. Ecrire un programme d’édition de liens. Cette phase donne lieu à un consiste à déclarer des expressions logiques et des programme exécutable. faits. Prolog est le langage par excellence basée sur 6. Tester le programme exécutable en lançant son la programmation logique (ou déclarative) exécution • La programmation procédurale (ou impérative) défini un programme comme une hiérarchie de Notez bien que le processus est à la fois procédures (ou de fonctions) qui appliquent des itératif (passer d’une étape à l’autre) et traitements sur des données. La plus part des cyclique (des retours en arrière sont possibles langages de programmation permettent la notamment lors de la compilation, de l’édition des liens programmation procédurale : Fortran, Cobol, C, et de l’exécution). Pascal, C++, Java en sont des exemples. 4 Formalisation Problème Traduction dans un langage comme C++ Correction Algorithme des erreurs de syntaxe Compilation Code source Correction des erreurs de référence aux Code objet Bibliothèque Code objet fonctions ou s bibliothèques Edition des liens Programme exécutable Correction des erreurs Exécution de logique Ajouter de ces traitement procéduraux, la majorité des I.3 – Langages de programmation. langages de programmation actuels prennent en charge Un langage est un codage permettant de le style de programmation orienté objet.
Recommended publications
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Python Programming
    Python Programming Wikibooks.org June 22, 2012 On the 28th of April 2012 the contents of the English as well as German Wikibooks and Wikipedia projects were licensed under Creative Commons Attribution-ShareAlike 3.0 Unported license. An URI to this license is given in the list of figures on page 149. If this document is a derived work from the contents of one of these projects and the content was still licensed by the project under this license at the time of derivation this document has to be licensed under the same, a similar or a compatible license, as stated in section 4b of the license. The list of contributors is included in chapter Contributors on page 143. The licenses GPL, LGPL and GFDL are included in chapter Licenses on page 153, since this book and/or parts of it may or may not be licensed under one or more of these licenses, and thus require inclusion of these licenses. The licenses of the figures are given in the list of figures on page 149. This PDF was generated by the LATEX typesetting software. The LATEX source code is included as an attachment (source.7z.txt) in this PDF file. To extract the source from the PDF file, we recommend the use of http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ utility or clicking the paper clip attachment symbol on the lower left of your PDF Viewer, selecting Save Attachment. After extracting it from the PDF file you have to rename it to source.7z. To uncompress the resulting archive we recommend the use of http://www.7-zip.org/.
    [Show full text]
  • Jupyter Tutorial Release 0.8.0
    Jupyter Tutorial Release 0.8.0 Veit Schiele Oct 01, 2021 CONTENTS 1 Introduction 3 1.1 Status...................................................3 1.2 Target group...............................................3 1.3 Structure of the Jupyter tutorial.....................................3 1.4 Why Jupyter?...............................................4 1.5 Jupyter infrastructure...........................................4 2 First steps 5 2.1 Install Jupyter Notebook.........................................5 2.2 Create notebook.............................................7 2.3 Example................................................. 10 2.4 Installation................................................ 13 2.5 Follow us................................................. 15 2.6 Pull-Requests............................................... 15 3 Workspace 17 3.1 IPython.................................................. 17 3.2 Jupyter.................................................. 50 4 Read, persist and provide data 143 4.1 Open data................................................. 143 4.2 Serialisation formats........................................... 144 4.3 Requests................................................. 154 4.4 BeautifulSoup.............................................. 159 4.5 Intake................................................... 160 4.6 PostgreSQL................................................ 174 4.7 NoSQL databases............................................ 199 4.8 Application Programming Interface (API)..............................
    [Show full text]
  • The Pisharp IDE for Raspberry PI
    http://researchcommons.waikato.ac.nz/ Research Commons at the University of Waikato Copyright Statement: The digital copy of this thesis is protected by the Copyright Act 1994 (New Zealand). The thesis may be consulted by you, provided you comply with the provisions of the Act and the following conditions of use: Any use you make of these documents or images must be for research or private study purposes only, and you may not make them available to any other person. Authors control the copyright of their thesis. You will recognise the author’s right to be identified as the author of the thesis, and due acknowledgement will be made to the author where appropriate. You will obtain the author’s permission before publishing any material from the thesis. The PiSharp IDE for Raspberry PI Bo Si This thesis is submitted in partial fulfillment of the requirements for the Degree of Master of Science at the University of Waikato. August 2017 © 2017 Bo Si Abstract The purpose of the PiSharp project was to build an IDE that is usable for beginners developing XNA-like programs on a Raspberry-Pi. The system developed is capable of 1. Managing and navigating a directory of source files 2. Display a file in a code text editor 3. Display code with syntax highlight 4. Automatically discovering program library structure from code namespaces 5. Compiling libraries and programs automatically with recompilation avoided if source code has not been updated 6. Compiling and running from the IDE 7. Editing more than one file at a time 8.
    [Show full text]
  • Antonio Ferraro Software Developer / IT Professional
    Antonio Ferraro Software Developer / IT Professional Rue Du Village, 6, 4600 - Lanaye – Belgium +32 4 3791181 +32 479 122523 [email protected] → PROFESSIONAL PROFILE • Independent, experienced, committed IT professional. • Eager to learn new tools and new technologies. • Positive, adaptable, respectful and team-minded. • Extensive experience in the field of NATO Military Tactical Data Links. • Other: ◦ Driving License type B ◦ NATO Security Clearance: NS ◦ Linkedin profile: https://www.linkedin.com/in/antonio-ferraro-860b1825 ◦ Company’s web page: http://safits.be → IT / PROFESSIONAL SKILLS • Programming Languages: Java (Eclipse RCP, Swing, Spring, Hibernate...), C, Python (Flask, Pandas...), R, some C++ and Javascript, VB / VBA, Pascal (Delphi and other dialects), Powerbuilder, XML/HTML/CSS/Bootstrap, data representation in XML/JSON. • Scripting: Perl, bash • Databases: MS SQL, MySQL, Postgresql, SQLLite. • IDEs: Eclipse (for Java and C), IntelliJ Idea. Pycharm/Atom/Wing IDE (Python), Jupyter Notebook (Python, R, Nodes), Rstudio (R), Source Navigator and more. • Virtualization: VirtualBox, Vmware. • OS Administration: Oracle Solaris 8, 10, 11, UNIX/Linux (Red Hat and Ubuntu families current versions), Windows up to 2012, OS User Experience: All of the above and Mac OS X, IOS, Android. • Version Control: Git, SVN, CVS, RCS, MS Sharepoint 2016. • Network Administration: CISCO and network design and administration (CCNA), RAD Megaplex Configuration and Administration, Network services design / reorganization. • CMSs: Wordpress, Joomla,
    [Show full text]
  • Python: Easy to Learn
    Python: Easy to Learn Clifford French, CAS London Conference, 25 Feb 2017 Easy to misunderstand From Pycon Conference Ned Batchelder, Montreal 2015 2 May not be a very satisfactory session For some participants, too basic For some participants, too advanced For the presenter, wish I could do more Please do get in touch - [email protected] if you want a multi-session course, a one off half day or day, one to one coaching… 3 Three themes 1. Brief look behind the scenes 2. How understanding “behind the scenes” helps in the classroom 3. Speaking like a Python native and a little extra if we have time. [email protected] 4 Everything is an object Other languages use variables Key concept in Python is objects A variable is basically a name for a value No concept of declaring variables ● spring into life when needed ● removed by garbage collector when a new value is assigned to a name 5 Theme 1 - “behind the scenes” www.ranker.com 6 REPL Read Evaluate Print Loop If no name, object is swept away 7 Every object has a type and an id a = ‘pizza!’ type(a) id(a) a = 9 type (a) id(a) 8 Analogies - box, cup, aunty In some other C based languages, we declare a variable int(x) It can hold only integers - box a good analogy In Python, we don’t declare a variable and a type is dynamic We can use several names for the same value, as a person can be “aunty”, “sister”, “Ms ..” Box, cup - not good analogies in Python 9 Meet my aunties - first anna aunty Like us, this Russian doll has many names.
    [Show full text]
  • Profile Positions
    MARTIN ZACHRISON Prinsessvägen 3A Kodmagi AB 131 46 Nacka phone: +46 768 04 4747 email: [email protected] PROFILE POSITIONS CEO, STRAWPAY AB — 2014– I founded Strawpay with two co-founders. Strawpay develops a system for micropayments based on bitcoin. The system is written in Scala/ScalaJs/SBT using Akka and Play Framework, Protobuf and BitcoinJ. We use Ansible and Docker for deploying our services. Apart from designing the system and implementing it, I also setup a CI/CD pipeline using Docker/Travis/Ansible/DigitalOcean. Testing is done with ScalaTest and Scala- Check. CEO, KODMAGI AB — 2012– Consulting at: 1. Youmoni 2019-, Scala Backend, IoT applications 2. Spotify 2018-2019: Java Backend Developer,-testing, BigQuery, BigTable, Scio 3. Nordnet 2017-2018: Java/Kotlin Backend Developer, Maven, Java8, Kotlin, Oracle 4. Spotify 2017: Java Backend Developer, Payment Settlement. 5. Previa 2016-2017: Integration Java Developer, Apache Camel, Maven, TeamCity 6. Luftfartsverket 2016: Integration Java Developer, RedHat Fuse, Apache Camel, Java 8, Jenkins, Maven, Git Stup of CI/CD 7. ComHem 2012-2014: Integration Java Developer, Java, JavaScript, Bash, Spring, Mockito, Apache Camel, Jdbc, Slf4j, logstash, Junit, TestNG, Tomcat, Maven, Git, Svn, Puppet, Ansible, XML, Json, Jenkins, Sonar. SENIOR JAVA CONSULTANT, CYGNI AB — 2009–2012 Cygni is a Java Server side centered consultant company. My assignments has been within Telecom, Digital Archiving for Libraries, Point of Sales Systems, Stock Market Analysis. and Credit Rating Systems.Tech- nologies used Java, Spring, Apache Camel, Junit, TestNG, Mockito, SiteMesh, Git, Maven, Hudson, Sonar, Glassfish, Tomcat, Puppet, Ansible, IDE’s IntelliJ Idea and Eclipse. SYSTEMS DEVELOPER, NETWORKS IN MOTION — 2008–2009 Networks in Motion, NIM, sells a GPS application for mobile phones as a service to telecom operators.
    [Show full text]
  • Integrated Development Environments
    INTEGRATED DEVELOPMENT ENVIRONMENTS VENDOR PRODUCT LANGUAGES SUPPORTED DEPLOYMENT PLATFORM INCLUDES OTHER KEY FEATURES PRICE CODE-VERSIONING SYSTEM? ACTIVESTATE SOFTWARE INC. Komodo Perl, PHP, Python, Ruby, XSLT; Any PHP, Perl, Python or Ruby-based applica- Yes Fully-integrated XSLT support, including an XSLT editor, $295; $495 bundled with Vancouver, British Columbia Professional 3.5.3 customizable context-aware editor tion server; client applications supported debugger and code intelligence. Komodo installs on Linux, one year of ActivePerl www.activestate.com supports many other languages through GUI builder Mac OS X, Solaris and Windows; all four platforms are includ- Profesional or ActiveTcl (778) 786-1114 ed with each license Professional subscription service BEA SYSTEMS INC. BEA Workshop Java, SOA, J2EE and Support for debugging and deployment Yes AppXRay creates a database of all the artifacts and their hierar- San Jose, Calif. Studio 3.0 Web applications requires Apache Jakarta Tomcat, BEA chy of relationships and interdependencies; benefits include code Starts at $899 www.bea.com WebLogic Server, Caucho Resin, IBM completion that reaches multiple levels, page variable names and (408) 570-8000 WebSphere, JBoss or Mortbay Jetty their fields, real-time consistency and validation checking BORLAND SOFTWARE CORP. Jbuilder 2006 Java J2EE 1.4 and J2EE application servers, including BEA Yes Eclipse-based; JSF, Struts and Web Services designers, UML Cupertino, Calif. JDK 5.0 WebLogic, IBM WebSphere, Sybase EAServer, code visualization,
    [Show full text]
  • Python Ides Review.Pdf
    REVIEWS Python IDEs Comparing Python IDEs BEST BUILDERS Codrut Popa, Fotolia A number of useful development environments are available for Python Without a license, the program runs for only 10 minutes. For just US$ 30 in Linux. We’ll show you around some popular Python IDEs that are more, the developer will send you a CD, but only within the United States. more than just text editors. BY CARSTEN SCHNOBER What I like about Wing IDE is its clear overview of the programming environ- ment. The Source Browser in the Profes- hat can you do with an Inte- support Python along with a number of sional version lists functions, classes, grated Development Environ- other programming languages. and methods. Down to the level of indi- Wment (IDE) that you can’t do vidual variables, you can expand entries with a text editor? Vi, Emacs, Gedit, and Wing IDE and then click to add them to your code. Kate all offer features such as syntax Wing IDE [1] (Figure 1) is a commercial The Project Management feature sup- highlighting and code folding for all developer environment that focuses en- ports multiple-file software develop- major programming languages. tirely on Python. Two variants of Wing ment, giving the programmer an over- A good IDE, on the other hand, adds are available: Wing IDE Professional view of the files within the project scope features such as debugging and project costs around US$ 180, whereas the Per- and defining specific properties, such as management. sonal edition is US$ 35. Despite its price, an alternative Python interpreter or an Wing does lack a couple of critical fea- extended Python path.
    [Show full text]
  • Learn to Code
    CompSoc Presents LEARN TO CODE Created by: Amanda Deacon Emily Price and Caitlin Duncan 2016 A quick introduction … Welcome to CompSoc’s second workshop of the year! We’re very excited to be able to present our first ever workshop on learning to code. We hope that you find this workshop interesting, enlightening, educational, or all of the above! We understand that learning something new takes time, and by no means are you expected to be a pro by the end of this session. Don’t feel like you HAVE to complete this entire document by the end of this workshop, if you do we will be extremely impressed! The one thing we do ask is that you work through it in the order we’ve laid it out. Each section builds on the previous ones, and the Python section assumes you’ve already worked through the Scratch section. PART ONE - SCRATCH Getting Started with Scratch What is Scratch? Scratch is, simply put: a fun, visual programming language. Scratch is a great first language as it allows you to learn about programming without the hassle of memorising how to type confusing and sometimes counter-intuitive commands. How do I open it? For this tutorial we’ll be using the online version of Scratch. The lab computers in here do have Scratch installed, but this is an older version. For sake of everyone’s sanity (and a more enjoyable experience), we encourage you to use the online version, available at the following link: https://scratch.mit.edu/projects/editor/ ​ If you want to save any programs you create you can download them from the website, or if you’re really keen you can create a Scratch account and save them there.
    [Show full text]
  • Learning Python Mark Lutz
    Learning Python FOURTH EDITION Learning Python Mark Lutz Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo Learning Python, Fourth Edition by Mark Lutz Copyright © 2009 Mark Lutz. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Julie Steele Indexer: John Bickelhaupt Production Editor: Sumita Mukherji Cover Designer: Karen Montgomery Copyeditor: Rachel Head Interior Designer: David Futato Production Services: Newgen North America Illustrator: Robert Romano Printing History: March 1999: First Edition. December 2003: Second Edition. October 2007: Third Edition. September 2009: Fourth Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Learning Python, the image of a wood rat, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-0-596-15806-4 [M] 1252944666 To Vera.
    [Show full text]
  • Using Python for Interactive Data Analysis
    Using Python for Interactive Data Analysis Perry Greenfield Robert Jedrzejewski Space Telescope Science Institute June 13, 2005 1 Copyright (c) 2005, Association of Universities for Research in Astronomy, Inc (AURA). All rights reserved. 2 Contents Purpose 7 Prerequisites 7 Practicalities 7 1 Reading and manipulating image data 8 1.1 Example session to read and display an image from a FITS file . 8 1.2 Starting the Python interpreter . 8 1.3 Loading modules . 8 1.4 Reading data from FITS files . 9 1.5 Displaying images . 9 1.6 Array expressions . 9 1.7 FITS headers . 10 1.8 Writing data to FITS files . 10 1.9 Some Python basics . 11 1.9.1 Memory vs. data files . 11 1.9.2 Python variables . 11 1.9.3 How does object oriented programming affect you? . 11 1.9.4 Errors and dealing with them . 12 1.10 Array basics . 13 1.10.1 Creating arrays . 13 1.10.2 Array numeric types . 14 1.10.3 Printing arrays . 14 1.10.4 Indexing 1-D arrays . 15 1.10.5 Indexing multidimensional arrays . 16 1.10.6 Compatibility of dimensions . 16 1.10.7 ufuncs . 17 1.10.8 Array functions . 18 1.10.9 Array methods . 20 1.10.10 Array attributes: . 21 1.11 Example . 21 1.12 Exercises . 21 2 Reading and plotting spectral data 23 2.1 Example session to read spectrum and plot it . 23 2.2 An aside on how Python finds modules . 23 2.3 Reading FITS table data . 24 2.4 Quick introduction to plotting .
    [Show full text]