Python Multimedia Beginner's Guide

Total Page:16

File Type:pdf, Size:1020Kb

Python Multimedia Beginner's Guide Python Multimedia Beginner's Guide Learn how to develop multimedia applications using Python with this practical step-by-step guide Ninad Sathaye BIRMINGHAM - MUMBAI x x Python Multimedia Beginner's Guide Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: August 2010 Production Reference: 1060810 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849510-16-5 www.packtpub.com Cover Image by Ed Maclean ([email protected]) x x Credits Author Editorial Team Leader Ninad Sathaye Aanchal Kumar Reviewers Project Team Leader Maurice HT Ling Priya Mukherji Daniel Waterworth Sivan Greenberg Project Coordinator Prasad Rai Acquisition Editor Steven Wilding Proofreader Lynda Sliwoski Development Editor Eleanor Duffy Graphics Geetanjali Sawant Technical Editor Charumathi Sankaran Production Coordinators Shantanu Zagade Indexers Aparna Bhagat Hemangini Bari Tejal Daruwale Cover Work Aparna Bhagat x x About the Author Ninad Sathaye ([email protected]) has more than six years of experience in software design and development. He is currently working at IBM, India. Prior to working for IBM, he was a Systems Programmer at Nanorex Inc. based in Michigan, U.S.A. At Nanorex, he was involved in the development of an open source, interactive 3D CAD software, written in Python and C. This is where he developed passion for the Python programming language. Besides programming, his favorite hobbies are reading and traveling. Ninad holds a Master of Science degree in Mechanical Engineering from Kansas State University, U.S.A. I would like to thank everyone at Packt Publishing, especially, Eleanor Duffy, Steven Wilding, Charu Sankaran, and Prasad Rai for their co-operation. This book wouldn't have been possible without your help. I also want to thank all the technical reviewers of the book for their valuable suggestions. I wish to express my sincere thanks and appreciation to Rahul Nayak, my colleague, who provided many professional quality photographs for this book. I owe a special thanks to Mark Sims and Bruce Smith, my former colleagues, for introducing me to the amusing world of Python. Finally, this book wouldn't have been possible without the encouragement and support of my whole family. I owe my loving thanks to my wife, Arati, for providing valuable feedback. She also happens to be the photographer of several of the pictures used throughout this book. x x About the Reviewers Maurice HT Ling completed his Ph.D. in Bioinformatics and B.Sc (Hons) in Molecular and Cell Biology, where he worked on microarray analysis and text mining for protein-protein interactions. He is currently an Honorary Fellow at The University of Melbourne and a Lecturer at Singapore Polytechnic where he lectures on microbiology and computational biology. Maurice holds several Chief Editorships including The Python Papers, iConcept Journal of Computational and Mathematical Biology, and Methods and Cases in Computational, Mathematical, and Statistical Biology. In his free time, Maurice likes to train in the gym, read, and enjoy a good cup of coffee. He is also a Senior Fellow of the International Fitness Association, U.S.A. Daniel Waterworth is a Python fanatic who can often be found behind his keyboard. He is always beavering away on a new project having learned to program from a young age. He is a keen blogger and his ideas can be found at http://active-thought.com. Sivan Greenberg is a Forum Nokia Champion, with almost ten years of multi-disciplinary IT experience and a sharp eye for quality. He started with open source technologies and the Debian project back in 2002. Joining Ubuntu development two years later, Sivan also contributed to various other open source projects, such as Plone and Nokia's Maemo. He has experience with quality assurance, application and web development, UNIX system administration (including some rather exotic IBM platforms), and GUI programming and documentation. He's been using Python for all of his development needs for the last five years. He is currently involved with Nokia's MeeGo project and works with CouchDB and Python in his day job for a living. I thank my unique and amazing family, specifically my Dad Eric for igniting the spark of curiosity from day zero. x x x x To my daughter, Anvita x x x x Table of Contents Preface 1 Chapter 1: Python and Multimedia 7 Multimedia 8 Multimedia processing 8 Image processing 8 Audio and video processing 10 Compression 10 Mixing 11 Editing 11 Animations 11 Built-in multimedia support 12 winsound 12 audioop 12 wave 13 External multimedia libraries and frameworks 13 Python Imaging Library 13 PyMedia 13 GStreamer 13 Pyglet 14 PyGame 14 Sprite 14 Display 14 Surface 14 Draw 14 Event 15 Image 15 Music 15 Time for action – a simple application using PyGame 15 QT Phonon 18 Other multimedia libraries 19 x x Table of Contents Snack Sound Toolkit 19 PyAudiere 20 Summary 20 Chapter 2: Working with Images 21 Installation prerequisites 21 Python 21 Windows platform 22 Other platforms 22 Python Imaging Library (PIL) 22 Windows platform 22 Other platforms 22 PyQt4 23 Windows platform 23 Other platforms 24 Summary of installation prerequisites 24 Reading and writing images 25 Time for action – image file converter 25 Creating an image from scratch 28 Time for action – creating a new image containing some text 28 Reading images from archive 29 Time for action – reading images from archives 29 Basic image manipulations 30 Resizing 30 Time for action – resizing 30 Rotating 33 Time for action – rotating 34 Flipping 35 Time for action – flipping 35 Capturing screenshots 36 Time for action – capture screenshots at intervals 36 Cropping 39 Time for action – cropping an image 39 Pasting 40 Time for action – pasting: mirror the smiley face! 40 Project: Thumbnail Maker 42 Time for action – play with Thumbnail Maker application 43 Generating the UI code 45 Time for action – generating the UI code 45 Connecting the widgets 47 Time for action – connecting the widgets 48 Developing the image processing code 49 [ ii ] x x Table of Contents Time for action – developing image processing code 49 Summary 53 Chapter 3: Enhancing Images 55 Installation and download prerequisites 56 Adjusting brightness and contrast 56 Time for action – adjusting brightness and contrast 56 Tweaking colors 59 Time for action – swap colors within an image! 59 Changing individual image band 61 Time for action – change the color of a flower 61 Gray scale images 63 Cook up negatives 64 Blending 65 Time for action – blending two images 65 Creating transparent images 68 Time for action – create transparency 68 Making composites with image mask 70 Time for action – making composites with image mask 71 Project: Watermark Maker Tool 72 Time for action – Watermark Maker Tool 73 Applying image filters 81 Smoothing 82 Time for action – smoothing an image 82 Sharpening 84 Blurring 84 Edge detection and enhancements 85 Time for action – detecting and enhancing edges 85 Embossing 87 Time for action – embossing 87 Adding a border 88 Time for action – enclosing a picture in a photoframe 89 Summary 90 Chapter 4: Fun with Animations 91 Installation prerequisites 92 Pyglet 92 Windows platform 92 Other platforms 92 Summary of installation prerequisites 93 Testing the installation 93 A primer on Pyglet 94 [ iii ] x x Table of Contents Important components 94 Window 94 Image 95 Sprite 95 Animation 95 AnimationFrame 95 Clock 95 Displaying an image 96 Mouse and keyboard controls 97 Adding sound effects 97 Animations with Pyglet 97 Viewing an existing animation 97 Time for action – viewing an existing animation 98 Animation using a sequence of images 100 Time for action – animation using a sequence of images 100 Single image animation 102 Time for action – bouncing ball animation 102 Project: a simple bowling animation 108 Time for action – a simple bowling animation 108 Animations using different image regions 113 Time for action – raindrops animation 114 Project: drive on a rainy day! 117 Time for action – drive on a rainy day! 118 Summary 122 Chapter 5: Working with Audios 123 Installation prerequisites 123 GStreamer 124 Windows platform 124 Other platforms 125 PyGobject 125 Windows platform 125 Other platforms 125 Summary of installation prerequisites 126 Testing the installation 127 A primer on GStreamer 127 gst-inspect and gst-launch 128 Elements and pipeline 128 Plugins 129 Bins 129 Pads 130 Dynamic pads 130 Ghost pads 131 Caps 131 [ iv ] x x Table of Contents Bus 131 Playbin/Playbin2 131 Playing music 132 Time for action – playing an audio: method 1 133 Building a pipeline from elements 137 Time for action – playing an audio: method 2 138 Playing an audio from a website 141 Converting audio file format 142 Time for action – audio file format converter 142 Extracting part of an audio 150 The Gnonlin plugin 151 Time for action – MP3 cutter! 152 Recording 156 Time for action – recording 157 Summary 160 Chapter 6: Audio Controls and Effects 161 Controlling playback 161 Play 162 Pause/resume 162 Time for action – pause and resume a playing audio stream 162 Stop 165 Fast-forward/rewind 166 Project: extract audio using playback controls 166 Time for action – MP3 cutter from basic principles 167 Adjusting volume 173 Time for action – adjusting volume 173 Audio effects 175 Fading effects 175 Time for action – fading effects 176 Echo echo echo..
Recommended publications
  • 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]
  • An Application Programming Interface for the MORSE Simulator
    Bachelor’s Thesis Czech Technical University in Prague Faculty of Electrical Engineering F3 Department of Control Engineering An application programming interface for the MORSE simulator Lukáš Bertl Cybernetics and Robotics: Systems and Control [email protected] January 2017 Supervisor: RNDr. Miroslav Kulich, Ph.D. Acknowledgement / Declaration I would like to express my gratitude to I hereby declare that I have complet- my supervisor RNDr. Miroslav Kulich, ed this thesis with the topic ”An ap- Ph.D. for a great mentorship, patience plication programming interface for the and wise comments that helped me com- MORSE simulator” independently and plete this project. that I have listed all sources of informa- I would like to thank my girlfriend tion used within it in accordance with and my parents for their unlimited men- the methodical instructions for observ- tal support throughout my whole stud- ing the ethical principles in the prepara- ies. tion of university theses. Finally, I thank my brother and Kač- In Prague, January ...., 2017 ka Janatková for the proofreading of this thesis. ........................................ Lukáš Bertl iii Abstrakt / Abstract Práce představuje CCMorse, což je Thesis presents the CCMorse, a simu- knihovna pro komunikaci se simuláto- lator communication library, that I have rem, kterou jsem vytvořil. Práce dále created. The thesis also describes the popisuje proces vývoje simulačního pro development process of a MORSE sim- simulátor MORSE. ulation environment. Teze probírá nejprve teorii robotic- The thesis
    [Show full text]
  • Flexible Modular Robotic Simulation Environment for Research and Education
    FLEXIBLE MODULAR ROBOTIC SIMULATION ENVIRONMENT FOR RESEARCH AND EDUCATION Dennis Krupke∗, Guoyuan Li and Jianwei Zhang Houxiang Zhang and Hans Petter Hildre Department of Computer Science Faculty of Maritime Technology and Operations University of Hamburg Aalesund University College Email: f3krupke, li, [email protected] Email: fhozh, [email protected] ∗corresponding author knowledge there is no special purpose simulation soft- ware for modular robots that allows for fast and easy cre- KEYWORDS ation of a simulation setup while being easy to use and easy to understand. Modular robots control, educational software, Open- A modular robot GUI has been developed that enables RAVE, interactive simulation the user to focus on robotics while most of the program- ming part is hidden. This idea is also described in (Zhang ABSTRACT et al., 2006). In contrast to other powerful systems only In this paper a novel GUI for a modular robots simula- few rules have to be learned for proper use of our sys- tion environment is introduced. The GUI is intended to tem. Motivation is the most important aspect for peo- be used by unexperienced users that take part in an edu- ple who have just begun with something new to proceed cational workshop as well as by experienced researchers and succeed. The GUI enables the user to get results who want to work on the topic of control algorithms of very quickly because only some basic knowledge about modular robots with the help of a framework. It offers the application space of modular robotics is needed. This two modes for the two kinds of users.
    [Show full text]
  • Free White Noise Mp3 Download
    free white noise mp3 download Software Downloads for "White Noise Mp3" If you have ever been in a situation while using your computer where the background noise in the room makes it impossible to work then White Noise Player is a very useful too. White Noise Player will play any .wav file on your computer you choose on a continuous loop cycle from your system tray. This allows you to choose any sound you like from simple white nose to a relaxing rainfall and at the same time, reduce the noise you hear that may distract you from your work.. Platform: Windows Publisher: Sardine Software Date: 25-03-2005 Size: 632 KB. Generate white noise from your computer speakers. White noise is usually used as a sleep or relaxation aid. The software can be set to start and stop at specified times during the day.. Platform: WinOther Publisher: Sobolsoft Date: 03-11-2012 Size: 5140 KB. The white noise is a combination of all frecuencies. The program generate white noise using randn and create a group of filters for the musical notes. The melody is introduced in a matrix. Platform: Matlab, Scripts Publisher: Francisco Canto Date: 20-03-2013 Size: 10 KB. Recommended as a miracle for better sleep! Features ambient sounds of the environment that will help you relax during the day and sleep great at night. Download White Noise Lite for FREE. Do you have trouble going to sleep? Are you traveling on a plane and need a quick power nap? Does your newborn baby wake up in the middle of the night? There are numerous benefits to using White Noise : **Helps you sleep by blocking distractions **Relaxes and reduces stress **Pacifies fussy and crying babies **Increases focus while enhancing privacy **Soothes headaches and migraines **Masks tinnitus (ringing of the ears) Even when youa*re asleep, your brain is constantly scanning and listening for sounds.
    [Show full text]
  • Getting Started
    Getting started Note: This Help file explains the features available in RecordNow! and RecordNow! Deluxe. Some of the features and projects detailed in the Help are only available in RecordNow! Deluxe. Click here to connect to a Web site where you can learn more about upgrading to RecordNow! Deluxe. Welcome to RecordNow! by Sonic, your gateway to the world of digital music, video, and data recording. With RecordNow! you can make perfect copies of your CDs and DVDs, transfer music from your CD collection to your computer, create personalized audio CDs containing all of your favorite songs, and much more. In addition, a full suite of data and video recording programs by Sonic can be started from within RecordNow! to back up your computer, create drag-and-drop discs, watch movies, edit digital video, and create your own DVDs. Some of these programs may already be installed on your computer. Others are available for purchase. This Help file is divided into the following sections to help you quickly find the information you need: Getting started — Learn about System requirements, Getting help, Accessibility, and Removing RecordNow!. Things you should know — Useful information for newcomers to digital recording. Exploring RecordNow! — Learn to use RecordNow! and find out more about associated programs and upgrade options. Audio Projects — Step-by-step instructions for every type of audio project. Data projects — Step-by-step instructions for every type of data project. Backup projects — Step-by-step instructions for backup projects. Video projects — Step-by-step instructions for video projects. Utilities — Instructions on how to erase and finalize a disc, how to display detailed information about your discs and drives, and how to create disc labels.
    [Show full text]
  • 28Th Daaam International Symposium on Intelligent Manufacturing and Automation
    28TH DAAAM INTERNATIONAL SYMPOSIUM ON INTELLIGENT MANUFACTURING AND AUTOMATION DOI: 10.2507/28th.daaam.proceedings.172 SERVICE ROBOTS INTEGRATING SOFTWARE AND REMOTE REPROGRAMMING Davydov D.V., Eprikov S.R., Kirsanov K.B., Pryanichnikov V.E. This Publication has to be referred as: Davydov, D[enis]; Eprikov, S[tanislav]; Kirsanov, K[irll] & Pryanichnikov, V[alentin] (2017). Service Robots Integrating Software 4nd Remote Reprogramming, Proceedings of the 28th DAAAM International Symposium, pp.1234-1240, B. Katalinic (Ed.), Published by DAAAM International, ISBN 978-3-902734- 11-2, ISSN 1726-9679, Vienna, Austria DOI: 10.2507/28th.daaam.proceedings.172 Abstract This paper presents a solution to the problems of redundancy and organisation of the software architecture inherent in robotic systems and its' simulators. The analysis and comparison of these solutions with the existing ones are given. It was designed a new software architecture for controlling mobile robotic complexes on the base of two models. Developed simulators and usage of the actor model were the base for creating the technological platforms for distributed software control, providing the simultaneous access of several users to a group of mobile robots and their virtual models. Keywords: building a network of robotarium; distributed control of mobile robots and their simulation software for mobile robot; reservation methods in robotics; dynamic reprogramming 1. Main problems When developing intelligent robots, one of the problems is the lack of effective software to create systems of group control. For example, in the well-known software packages (ROS, MRS, and others) does not included specific development tools for control of distributed mechatronic systems, especially in remote mode.
    [Show full text]
  • Openrave: a Planning Architecture for Autonomous Robotics
    OpenRAVE: A Planning Architecture for Autonomous Robotics Rosen Diankov James Kuffner [email protected] [email protected] CMU-RI-TR-08-34 July 2008 Robotics Institute Carnegie Mellon University Pittsburgh, Pennsylvania 15213 Copyright c 2008 by Rosen Diankov and James Kuffner. All rights reserved. Abstract One of the challenges in developing real-world autonomous robots is the need for integrating and rigorously test- ing high-level scripting, motion planning, perception, and control algorithms. For this purpose, we introduce an open-source cross-platform software architecture called OpenRAVE, the Open Robotics and Animation Virtual Envi- ronment. OpenRAVE is targeted for real-world autonomous robot applications, and includes a seamless integration of 3-D simulation, visualization, planning, scripting and control. A plugin architecture allows users to easily write cus- tom controllers or extend functionality. With OpenRAVE plugins, any planning algorithm, robot controller, or sensing subsystem can be distributed and dynamically loaded at run-time, which frees developers from struggling with mono- lithic code-bases. Users of OpenRAVE can concentrate on the development of planning and scripting aspects of a problem without having to explicitly manage the details of robot kinematics and dynamics, collision detection, world updates, and robot control. The OpenRAVE architecture provides a flexible interface that can be used in conjunction with other popular robotics packages such as Player and ROS because it is focused on autonomous motion planning and high-level scripting rather than low-level control and message protocols. OpenRAVE also supports a powerful network scripting environment which makes it simple to control and monitor robots and change execution flow dur- ing run-time.
    [Show full text]
  • Chi Lin Chang Taiwan (R.O.C.) +886-9-3038-6000 (張祺崙/Alan Chang) [email protected] Homepage
    7F, No.233, Bade Rd. East Dist., Hsinchu City 30069 Chi Lin Chang Taiwan (R.O.C.) +886-9-3038-6000 (張祺崙/Alan Chang) [email protected] Homepage: http://qi1002.github.io/ EXPERIENCE SKILLS Mentor Graphics, LINK, Taiwan/Hsinchu— Senior Software Engineer C and C++ June 2019 - PRESENT (AMS BU) Java, C# and Python ➢ Model extractor QT Tool development and common model interface with simulator. Android framework in java/native/kernel layers Mediatek, LINK, Taiwan/Hsinchu— Manager/ Technical Manager Linux Kernel and FPGA emulation 1. June 2012 - January 2019 (CTO BU) (more than 3 years’ team management experience) ➢ Camera team for smart phone project 8032 and ARM RISC - Manage the team for camera 3A & ISP flow and support image quality tuning flows on OpenCL, OpenVX, OpenCV our camera C++ modules. Familiar to android camera interface, camera ISP/3A on OpenGLES, GPU android C++ native framework and our bit-True flow with CModel by python scripts. DNN - Caffe - Involved in the CV algorithm survey for ADAS based OpenCL + OpenVX or OpenCL + ASP, JSP, CSS and HTML openCV or Halide. (ex: canny edge, pedestrian/face detection) and survey DNN – Caffe for the possibility of ADAS application. Caffe, OpenCV, Halide are all based on C++. - Hands on IQ tuning tool development. Use Python .NET to integrate with C# and python CERTIFICATION work together seamlessly in tool. Familiar to C# and Python. ➢ GPU team for smart phone project ISO 26262 Basic Training Course (Tuv Nord) - Hands on to develop the GPU driver (based on mesa 9.0) in the multiple environments, (ex: windows, Linux, android emulator, FPGA with Linux console, FPGA with android K, Tablet with android L) and be charge of the IP bring up in the first IC.
    [Show full text]
  • Pyglet Documentation Release 1.2Alpha1
    pyglet Documentation Release 1.2alpha1 Alex Holkner October 13, 2013 CONTENTS 1 Programming Guide: 3 1.1 pyglet Programming Guide.......................................3 2 API Reference: 87 2.1 API Reference.............................................. 87 3 Testing Framework: 117 4 Related Documentation: 119 Python Module Index 121 i ii pyglet Documentation, Release 1.2alpha1 Pyglet is a pure python cross-platform application framework intended for game development. It supports windowing, user interface event handling, OpenGL graphics, loading images and videos and playing sounds and music. It works on Windows, OS X and Linux. CONTENTS 1 pyglet Documentation, Release 1.2alpha1 2 CONTENTS CHAPTER ONE PROGRAMMING GUIDE: 1.1 pyglet Programming Guide breadcrumb Programming Guide The pyglet Programming Guide provides in-depth documentation for writing applications that use pyglet. Many topics described here reference the pyglet API reference, provided separately. If this is your first time reading about pyglet, we suggest you start at Writing a pyglet application. 1.1.1 Installation pyglet does not need to be installed. Because it uses no external libraries or compiled binaries, you can run it in-place. You can distribute the pyglet source code or runtime eggs alongside your application code (see Distribution). You might want to experiment with pyglet and run the example programs before you install it on your development machine. To do this, add either the extracted pyglet source archive directory or the compressed runtime egg to your PYTHONPATH. On Windows you can specify this from a command line: set PYTHONPATH c:\path\to\pyglet-1.1\;%PYTHONPATH% On Mac OS X, Linux or on Windows under cygwin using bash: set PYTHONPATH /path/to/pyglet-1.1/:$PYTHONPATH export PYTHONPATH or, using tcsh or a variant: setenv PYTHONPATH /path/to/pyglet-1.1/:$PYTHONPATH If you have downloaded a runtime egg instead of the source archive, you would specify the filename of the egg in place of pyglet-1.1/.
    [Show full text]
  • Psychology Software for Python Release 3.0.2
    PsychoPy - Psychology software for Python Release 3.0.2 Jonathan Peirce Jan 29, 2019 Contents 1 About PsychoPy 1 2 General issues 3 3 Installation 29 4 Manual install 31 5 Getting Started 35 6 Builder 43 7 Coder 75 8 Running studies online 95 9 Reference Manual (API) 103 10 Troubleshooting 325 11 Recipes (“How-to”s) 329 12 Frequently Asked Questions (FAQs) 341 13 Resources (e.g. for teaching) 343 14 For Developers 345 15 PsychoPy Experiment file format (.psyexp) 359 Python Module Index 363 i ii CHAPTER 1 About PsychoPy 1.1 Citing PsychoPy If you use this software, please cite one of the publications that describe it. • Peirce, J. W., & MacAskill, M. R. (2018). Building Experiments in PsychoPy. London: Sage. • Peirce J. W. (2009). Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2 (10), 1-8. doi:10.3389/neuro.11.010.2008 • Peirce, J. W. (2007). PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162 (1-2):8-13 doi:10.1016/j.jneumeth.2006.11.017 Citing these papers gives the reviewer/reader of your study information about how the system works and it attributes some credit for its original creation. Academic assessment (whether for promotion or even getting appointed to a job in the first place) prioritises publications over making useful tools for others. Citations provide a way for the developers to justify their continued involvement in the development of the package. 1 PsychoPy - Psychology software for Python, Release 3.0.2 2 Chapter 1. About PsychoPy CHAPTER 2 General issues These are issues that users should be aware of, whether they are using Builder or Coder views.
    [Show full text]
  • Python Language
    Python Language #python Table of Contents About 1 Chapter 1: Getting started with Python Language 2 Remarks 2 Versions 3 Python 3.x 3 Python 2.x 3 Examples 4 Getting Started 4 Verify if Python is installed 4 Hello, World in Python using IDLE 5 Hello World Python file 5 Launch an interactive Python shell 6 Other Online Shells 7 Run commands as a string 7 Shells and Beyond 8 Creating variables and assigning values 8 User Input 12 IDLE - Python GUI 13 Troubleshooting 14 Datatypes 15 Built-in Types 15 Booleans 15 Numbers 15 Strings 16 Sequences and collections 16 Built-in constants 17 Testing the type of variables 18 Converting between datatypes 18 Explicit string type at definition of literals 19 Mutable and Immutable Data Types 19 Built in Modules and Functions 20 Block Indentation 24 Spaces vs. Tabs 25 Collection Types 25 Help Utility 30 Creating a module 31 String function - str() and repr() 32 repr() 33 str() 33 Installing external modules using pip 34 Finding / installing a package 34 Upgrading installed packages 34 Upgrading pip 35 Installation of Python 2.7.x and 3.x 35 Chapter 2: *args and **kwargs 38 Remarks 38 h11 38 h12 38 h13 38 Examples 39 Using *args when writing functions 39 Using **kwargs when writing functions 39 Using *args when calling functions 40 Using **kwargs when calling functions 41 Using *args when calling functions 41 Keyword-only and Keyword-required arguments 42 Populating kwarg values with a dictionary 42 **kwargs and default values 42 Chapter 3: 2to3 tool 43 Syntax 43 Parameters 43 Remarks 44 Examples 44 Basic
    [Show full text]
  • Design and Implementation of an Autonomous Robotics Simulator
    DESIGN AND IMPLEMENTATION OF AN AUTONOMOUS ROBOTICS SIMULATOR by Adam Carlton Harris A thesis submitted to the faculty of The University of North Carolina at Charlotte in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering Charlotte 2011 Approved by: _______________________________ Dr. James M. Conrad _______________________________ Dr. Ronald R. Sass _______________________________ Dr. Bharat Joshi ii © 2011 Adam Carlton Harris ALL RIGHTS RESERVED iii ABSTRACT ADAM CARLTON HARRIS. Design and implementation of an autonomous robotics simulator. (Under the direction of DR. JAMES M. CONRAD) Robotics simulators are important tools that can save both time and money for developers. Being able to accurately and easily simulate robotic vehicles is invaluable. In the past two decades, corporations, robotics labs, and software development groups have released many robotics simulators to developers. Commercial simulators have proven to be very accurate and many are easy to use, however they are closed source and generally expensive. Open source simulators have recently had an explosion of popularity, but most are not easy to use. This thesis describes the design criteria and implementation of an easy to use open source robotics simulator. SEAR (Simulation Environment for Autonomous Robots) is designed to be an open source cross-platform 3D (3 dimensional) robotics simulator written in Java using jMonkeyEngine3 and the Bullet Physics engine. Users can import custom-designed 3D models of robotic vehicles and terrains to be used in testing their own robotics control code. Several sensor types (GPS, triple-axis accelerometer, triple-axis gyroscope, and a compass) have been simulated and early work on infrared and ultrasonic distance sensors as well as LIDAR simulators has been undertaken.
    [Show full text]