1 Finn Årup Nielsen DTU Compute Technical University of Denmark August 31, 2014
2 Overview of Python parts Apart from Python itself : Builtins that include basic operations: file loading, construction of types, etc. They are available in a special module available with (available with >>> dir( builtins )). They are automatically loaded when you start python The Python Standard Library: bundled modules, such as copy, string, re, urllib. Write import module name to use them. Other libraries, such as NLTK, NetworkX, lxml and NumPy. You need to install them and write import module name to use them. Finn Årup Nielsen 1 August 31, 2014
3 Installation of Python Python can be installed from: Latest Python 2 (Python 2.7) are most relevant, but if you have Python 3 that is ok, since most data mining packages are now also running under that version. On Linux and Mac there are already packages in the distribution so you need not install it from that page. Finn Årup Nielsen 2 August 31, 2014
4 Installation on Debian-like systems On an Debian/Ubuntu-like system it is straightforward, e.g., with: aptitude search python sudo aptitude install python You can install further packages with, e.g.: sudo aptitude install python-nltk spyder This will setup the Linux distribution version of nltk, a Python package for natural language processing, and spyder, an integrated development environment for Python. Finn Årup Nielsen 3 August 31, 2014
5 Installation on Mac On Mac an (old?) version might already be installed: Start a terminal Applications / Utilities / Terminal and write python Or on a terminal, e.g., do: port search python26 sudo port install python26 Or follow the installation instructions on MacPython: jack/macpython/macpython-osx.html Finn Årup Nielsen 4 August 31, 2014
6 Installation on Microsoft Windows Besides installing from the Python download homepage there are different packages that assemble Python with libraries, editors,... ready for installation as one unit : Python(x,y): Scientific-oriented Python Distribution based on Qt and Spyder containing Python, numpy, pip, matplotlib, PyQt4 (for GUI development) and a lot of other packages. winpython: Windows Portable Scientific Python 2/3 32/64bit Distribution for With basic Python you need to be able to compile C-programs for C- code in the Python package, unless you install precompiled version, see, e.g., Finn Årup Nielsen 5 August 31, 2014
7 Commercial environments ActivePython at There is a free Community Edition. Enthought Canopy, requires the request of an academic license Anaconda. There is a free enterprise-ready Python distribution. Such system usually comes with interactive prompt, editor syntax highlighting, package manager,... Community/academic version may lack, e.g., database modules and may not be free for commercial applications. See a few further packages on the Python download page Finn Årup Nielsen 6 August 31, 2014
8 Other pythons bpython Interactive shell with help and pastebin (mostly for Linux) ipython Enhanced interaction, mimicks Matlab. ipython -pylab Eric and Spyder Integrated development environments. Spyder especially for numerical Python. idle Not so fancy GUI editor PyPE Python editor Other programs to run a python program: (JVM) and PyPy IronPython (.Net), Jython See also: Finn Årup Nielsen 7 August 31, 2014
9 Spyder Finn Årup Nielsen 8 August 31, 2014
10 ... Spyder Spyder has (or calls): Editor with syntax highlighting, and indentation, interactive code analysis Interactive Python shell (python or ipython) Debugger and breakpoints via editor Profiler to evaluate speed of the code Style checking via pylint Finn Årup Nielsen 9 August 31, 2014
11 IPython Notebook Web-based cell-based notebook interface. Cell may be Python code, text output, plots, documention in e.g., Markdown. Individual code cells may be executed in random order. IPython Notebook files are JSON file that may be shared on the Internet. Great for interactive data mining. Perhaps less interesting for traditional software development with reusable modules and testing. Finn Årup Nielsen 10 August 31, 2014
13 Packages on UNIX-derived systems python-beautifulsoup python-biopython python-cherrypy python-feedparser python-imaging python-networkx python-nltk python-nose python-numpy python-pysqlite2 python-scipy python-simplejson python-sklearn and quite a number of other packages... Finn Årup Nielsen 12 August 31, 2014
14 Installing packages outside distribution pip (and easy install) is a program that downloads package from central archive (or installs packages downloaded locally) $ pip search nltk nltk INSTALLED: 2.0b8 LATEST: 2.0b9 - Natural Language Toolkit pip install manages dependencies to other packages. To install pip you may need to use easy_install. pip may uninstall. easy_install cannot do that. Finn Årup Nielsen 13 August 31, 2014
15 PyPI PyPI the Python Package Index (the cheeseshop ) Central archive of distributed Python packages. Used by easy_install and pip. There are currently packages here. (of varying degree of quality) Finn Årup Nielsen 14 August 31, 2014
16 Downloading packages from developers Numpy: NTLK: and so on. This is only if you want to be on the blending edge. Finn Årup Nielsen 15 August 31, 2014
17 Using setup.py More basic if everything else does not work: Often packages contain a setup.py file which may install the package: python setup.py install You can create distribution package of your own by setting up a setup.py file in the directory your python program to distribute and then call: python setup.py bdist which generate (in this particular case) a tar.gz package: dist/helloworld-1.0.linux-i686.tar.gz Finn Årup Nielsen 16 August 31, 2014
18 setup.py example from distutils.core import setup setup(name= helloworld, version= 1.0, description= Simple Hello, World program, author= Finn Aarup Nielsen, author_ = url= license= GPL, scripts=[ helloworld.py ], ) The package contain a single script helloworld.py: #!/usr/bin/env python print("hello, World\n") Finn Årup Nielsen 17 August 31, 2014
19 Python packaging Note there are several different Python packaging systems distutils (the old simple way) setuptools (recommended for building to Python Package Index, PyPI) distribute (deprecated in newest versions, moved to setuptools 0.7) distutils2 distlib bento... Finn Årup Nielsen 18 August 31, 2014
20 virtualenv virtualenv is a Python module that allows you to have multiple installation of Python on your computer, e.g., a production and a development installation. This is important in some situation such as web-serving where you want to freeze the installation. On Ubuntu install the python package: aptitude install python-virtualenv Create a new virtual environment: python /usr/share/pyshared/virtualenv.py virtualenv1 You now have python in./virtualenv1/bin/python Finn Årup Nielsen 19 August 31, 2014
21 ... virtualenv $ cd virtualenv1/ $ which python /usr/bin/python $ source bin/activate # This will change the path $ which python /home/fn/virtualenv1/bin/python With pip: $ pip --environment virtualenv1 wikitools The wikitools package now got into ~/virtualenv1/lib/python2.6/site-packages/wikitools/ Finn Årup Nielsen 20 August 31, 2014
22 ... virtualenv You can freeze the installation. Recording the modules and their version into a requirement file with pip python /usr/share/pyshared/virtualenv.py --no-site-packages virtualenv1 cd virtualenv1 source bin/activate pip freeze > requirements.txt cat requirements.txt The content of this requirements.txt file is now: argparse==1.2.1 distribute== wsgiref==0.1.2 Finn Årup Nielsen 21 August 31, 2014
23 ... virtualenv Installation of a module in the virtual environment: $ pip install simplejson $ pip freeze > requirements.txt $ cat requirements.txt argparse==1.2.1 distribute== simplejson==3.3.0 wsgiref==0.1.2 $ python >>> import simplejson >>> simplejson. version Finn Årup Nielsen 22 August 31, 2014
24 ... virtualenv Now move the code to a new virtual environment (virtualenv2): $ deactivate # get out of the virtual environment $ cd $ python /usr/share/pyshared/virtualenv.py --no-site-packages virtualenv2 $ cd virtualenv2 $ source bin/activate $ pip install -r../virtualenv1/requirements.txt $ python >>> import simplejson >>> simplejson. version Now the simplejson module is available in the second virtual environment. Finn Årup Nielsen 23 August 31, 2014
25 Python in the cloud Web sites that allows you to run a Python program from their computers: Google App Engine (GAE), persistency with Googles approach. Pythonanywhere, e.g., with Flask web framework and MySQL. Others: Heroku, Plotly and (PiCloud and StarCluster). For GAE you need to download an SDK, whereas for Pythonanywhere you can start coding when you have setup the account. Finn Årup Nielsen 24 August 31, 2014
26 Summary There are different layers of Python: Standard Library, other libraries. the python language itself, the The easiest way of installation is probably in Linux with aptitude/apt-get Install further libraries not in the distribution with pip. There are a number of other Python environments: ipython (interactive), spyder (IDE), pypy (JIT, sandbox),... Commercial Python environments could be considered: Enthought, ActivePython. Consider virtualenv with pip for real deployment. Finn Årup Nielsen 25 August 31, 2014
Python and Google App Engine Dan Sanderson June 14, 2012 Google App Engine Platform for building scalable web applications Built on Google infrastructure Pay for what you use Apps, instance hours, storage,
Introduction to Python Sophia Bethany Coban Problem Solving By Computer March 26, 2014 Introduction to Python Python is a general-purpose, high-level programming language. It offers readable codes, and
Theorist HT Induc0on Course Lesson 1: Se6ng up your new computer (Mac OS X >= 10.6) As of 9/27/2012 Caveats These are recommended setup steps for Mac OS X >= 10.6. They are not the only possible setup.
Scientific Programming, Analysis, and Visualization with Python Mteor 227 Fall 2015 Python The Big Picture Interpreted General purpose, high-level Dynamically type Multi-paradigm Object-oriented Functional
I. Required Programs TAACO Quick Start Guide: Windows 7 Kristopher Kyle and Scott Crossley 9-9- 2014 Before TAACO will work correctly, you must have Python 2.7, Natural Language Toolkit (NTLK), and NumPy
Postprocessing with Python Boris Dintrans (CNRS & University of Toulouse) firstname.lastname@example.org Collaborator: Thomas Gastine (PhD) Outline Outline Introduction - what s Python and why using it? - Installation
An Introduction to Using Python with Microsoft Azure If you build technical and scientific applications, you're probably familiar with Python. What you might not know is that there are now tools available
Exercise 0 Deadline: None Computer Setup Windows Download Python(x,y) via http://code.google.com/p/pythonxy/wiki/downloads and install it. Make sure that before installation the installer does not complain
Data Mining with Python (Working draft) Finn Årup Nielsen May 8, 2015 Contents Contents List of Figures List of Tables i vii ix 1 Introduction 1 1.1 Other introductions to Python?...................................
Python programming Interfacing with other languages Finn Årup Nielsen DTU Compute Technical University of Denmark September 2, 2013 Overview Hello-world examples with different approaches. Calling C(++):
cloud-kepler Documentation Release 1.2 Scott Fleming, Andrea Zonca, Jack Flowers, Peter McCullough, El July 31, 2014 Contents 1 System configuration 3 1.1 Python and Virtualenv setup.......................................
CS-1004, Introduction to Programming for Non-Majors, C-Term 2015 Setting up Python 3.4 and numpy and matplotlib on your own Windows PC or laptop Hugh C. Lauer Adjunct Professor Worcester Polytechnic Institute
AuShadha Documentation Release 0.1 Dr. Easwar T.R and others (see credits) October 17, 2015 Contents 1 Introduction to AuShadha Project 3 1.1 AuShadha (): Means medicine in Sanskrit................................
Installation guide for Python & Co. Release 0.1 Hans-Martin von Gaudecker Contents February 01, 2013 1 Preface ii 2 Python and Python libraries ii 2.1 Python 2.7.2.........................................
Code::Block manual for CS101x course Department of Computer Science and Engineering Indian Institute of Technology - Bombay Mumbai - 400076. April 9, 2014 Contents 1 Introduction 1 1.1 Code::Blocks...........................................
Intro to IPython Notebooks for the Bioinformatics group 17 July 2014 Stace Beaulieu, WHOI Ocean Informatics Coordinator http://www.whoi.edu/dor/special projects/ocean informatics working group/ This is
Finn Årup Nielsen Department of Informatics and Mathematical Modelling Technical University of Denmark September 30, 2013 Overview Methods Model-view-controller Web-frameworks Cloud-based services CGI,
GUI application set up using QT designer Sana Siddique Team 5 Introduction: A very important part of the Team 5 breakout board project is to develop a user friendly Graphical User Interface that is able
OpenCobolIDE Documentation Release 2.4.0-beta Colin Duquesnoy July 03, 2014 Contents 1 Parts of the documentation: 3 1.1 What s New?............................................... 3 1.2 Download & Install...........................................
Eclipse Integrated Virtual Debugger User s Manual Workstation 6.0 Eclipse Integrated Virtual Debugger User s Manual Eclipse Integrated Virtual Debugger User s Manual Revision: 20070426 Item: WS-ENG-Q107-297
Esri International User Conference San Diego, California Technical Workshops July 26, 2012 ArcGIS Viewer for Silverlight An Introduction Rich Zwaap Agenda Background Product overview Getting started and
1. Objectives Homework 9 Android App for Weather Forecast Become familiar with Android Studio, Android App development and Facebook SDK for Android. Build a good-looking Android app using the Android SDK.
CS-1004, Introduction to Programming for Non-Majors, A-Term 2016 Setting up Python 3.5, numpy, and matplotlib on your Macintosh or Linux computer Hugh C. Lauer0F Adjunct Professor Worcester Polytechnic
All About Android WHAT IS ANDROID? Android specifically refers to a mobile operating system (based on Linux) that is developed by Google. It is open-source software, meaning that anyone can download the
Jan.12, 2014 Author: Rahav Dor Student installation of TinyOS TinyOs install Automatic installation... 1 Get Linux... 2 Install Ubuntu on a Virtual Machine... 2 Install Ubuntu on VMware... 2 Installing
Installing and Running the Google App Engine On Windows This document describes the installation of the Google App Engine Software Development Kit (SDK) on a Microsoft Windows and running a simple hello
Android: Setup Hello, World: Android Edition due by noon ET on Wed 2/22 Ingredients. Android Development Tools Plugin for Eclipse Android Software Development Kit Eclipse Java Help. Help is available throughout
CRASH COURSE PYTHON nr. Het begint met een idee This talk Not a programming course For data analysts, who want to learn Python For optimizers, who are fed up with Matlab 2 Python Scripting language expensive
Raspberry Pi Exercises Working with the Raspberry Pi, and in particular working with Google Coder, Raspbian, the version of Debian Linux that has been adapted for use with the Raspberry Pi, and Python,
Witango Application Server 6 Installation Guide for OS X January 2011 Tronics Software LLC 503 Mountain Ave. Gillette, NJ 07933 USA Telephone: (570) 647 4370 Email: email@example.com Web: www.witango.com
Slides from INF3331 lectures - web programming in Python Joakim Sundnes & Hans Petter Langtangen Dept. of Informatics, Univ. of Oslo & Simula Research Laboratory October 2013 Programming web applications
Writing standalone Qt & Python applications for Android Martin Kolman Red Hat & Faculty of Informatics, Masaryk University http://www.modrana.org/om2013 firstname.lastname@example.org 1 Overview Writing Android
WA2088 WebSphere Application Server 8.5 Administration on Windows Student Labs Web Age Solutions Inc. Copyright 2013 Web Age Solutions Inc. 1 Table of Contents Directory Paths Used in Labs...3 Lab Notes...4
Building a Python Plugin QGIS Tutorials and Tips Author Ujaval Gandhi http://google.com/+ujavalgandhi This work is licensed under a Creative Commons Attribution 4.0 International License. Building a Python
Zend Server 4.0 Beta 2 Release Announcement Thank you for your participation in the Zend Server 4.0 beta program. Your involvement will help us ensure we best address your needs and deliver even higher
Zend Server Amazon AMI Quick Start Guide By Zend Technologies www.zend.com Disclaimer This is the Quick Start Guide for The Zend Server Zend Server Amazon Machine Image The information in this document
Getting Started with Mplus Version 7.31 Demo for Mac OS X and Linux This document shows how to install Mplus Demo, how to use Mplus Demo, and where to find additional documentation. Overview Mplus Version
MultiValue Dashboard Installation Guide Introduction to MultiValue Dashboard MultiValue Dashboard is a dynamic Web-based development tool for the creation of desktop widgets utilizing your knowledge of
Homework #7 Google Cloud Platform This semester we are allowing all students to explore cloud computing as offered by the Google Cloud Platform. Using the instructions below one can establish a website
Enterprise Computing & Service Management How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac? In order to connect remotely to a PC computer from your Mac, we recommend
Partek Flow Installation Guide Partek Flow is a web based application for genomic data analysis and visualization, which can be installed on a desktop computer, compute cluster or cloud. Users can access
Content Introduction... 2 Data Access Server Control Panel... 2 Running the Sample Client Applications... 4 Sample Applications Code... 7 Server Side Objects... 8 Sample Usage of Server Side Objects...
Get the Android SDK The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android. The ADT bundle includes the essential Android SDK components
This document assumes that you have already installed the Dev-C++ Compiler on your computer and run it for the first time to setup the initial configuration. If you have not, then follow the steps on the
Rapid GUI Application Development with Python Volker Kuhlmann Kiwi PyCon 2009 Christchurch 7 November 2009 Copyright 2009 by Volker Kuhlmann Released under Creative Commons Attribution Non-commercial Share-alike
OpenCV on Android Platforms Marco Moltisanti Image Processing Lab http://iplab.dmi.unict.it email@example.com http://www.dmi.unict.it/~moltisanti Outline Intro System setup Write and build an Android
Best Practices for Python in the Cloud: Lessons Learned @ActiveState Best Practices for Python in the Cloud Presented by: Gisle Aas, Senior Developer, ActiveState whoami? Gisle Aas! firstname.lastname@example.org!
prajwaldesai.com http://prajwaldesai.com/how-to-deploy-lync-2010-client-using-sccm-2012-r2/ How To Deploy Lync 2010 Client Using SCCM 2012 R2 Prajwal Desai In this post we will see how to deploy Lync 2010
VOC Documentation Release 0.1 Russell Keith-Magee February 07, 2016 Contents 1 About VOC 3 1.1 The VOC Developer and User community................................ 3 1.2 Frequently Asked Questions.......................................
IBM SPSS Statistics Version 22 Concurrent License Administrator s Guide Contents Administrator's guide......... 1 Before you start............. 1 Ghosting............... 1 Citrix and Terminal Services........
Android: How To. This is just a collection of useful information and tricks that I used during the time I was developing on the android ADP1. In some cases the information might be a little old and new
Dr. Martin O. Steinhauser University of Basel Graduate Lecture Spring Semester 2014 Molecular Dynamics Simulations with Applications in Soft Matter Handout 1 Outfitting Your PC for Scientific Computing
White Label ios Application Installation and Customization Guide Background Background Application built for civic agencies to bring voting information to the public Code written to make deployment easy,
Cyclope 6 Installation Guide CYCLOPE let s talk productivity Cyclope Employee Surveillance Solution is provided by Cyclope Series 2003-2014 1 P age Table of Contents 1. Cyclope Employee Surveillance Solution
Android Setup Phase 2 Instructor: Trish Cornez CS260 Fall 2012 Phase 2: Install the Android Components In this phase you will add the Android components to the existing Java setup. This phase must be completed
The Mantid Project The challenges of delivering flexible HPC for novice end users Nicholas Draper SOS18 What Is Mantid A framework that supports high-performance computing and visualisation of scientific
Building Cantera 1.7 with Visual C++.NET D. G. Goodwin Caltech November 2006 This presentation explains how to compile and install Cantera from source code on a PC running Windows If you just want to use
David Moses January 2014 Paper on Cloud Computing I Background on Tools and Technologies in Amazon Web Services (AWS) In this paper I will highlight the technologies from the AWS cloud which enable you
Contents SP Term Cloud Installation... 2 SP Term Cloud User Solution... 2 Installing the user solution... 2 Adding the SP Term Cloud web part to a page... 2 SP Term Cloud User Solution license activation...
IceWarp to IceWarp Server Migration Registered Trademarks iphone, ipad, Mac, OS X are trademarks of Apple Inc., registered in the U.S. and other countries. Microsoft, Windows, Outlook and Windows Phone
Appendix Installing Java (Windows) and Writing your First Program We will be running Java from the command line and writing Java code in Notepad++ (or similar). The first step is to ensure you have installed
ECE155: Engineering Design with Embedded Systems Winter 2013 Lab 0 (Setting up your Development Environment) Week 1 Prepared by Kirill Morozov version 1.2 1 Objectives In this lab, you ll familiarize yourself
Ve Version 3.4 Copyright 2014, SafeNet, Inc. All rights reserved. http://www.safenet-inc.com We have attempted to make these documents complete, accurate, and useful, but we cannot guarantee them to be
AzMERIT Secure Browser Installation Manual For Technology Coordinators 2014-2015 Revised January 5, 2015 Prepared by the American Institutes for Research Descriptions of the operation of the Test Information
Installing the Android SDK To get started with development, we first need to set up and configure our PCs for working with Java, and the Android SDK. We ll be installing and configuring four packages today
Mirtrak 6 Powered by Cyclope Installation Guide Mirtrak Activity Monitoring Solution v6 is powered by Cyclope Series 2003-2013 Info Technology Supply Ltd. 2 Hobbs House, Harrovian Business Village, Bessborough
Titanium Mobile: How-To Getting Started With Appcelerator Titanium For Windows Release GSW August 17, 2010 Copyright 2010 Appcelerator, Inc. All rights reserved. Appcelerator, Inc. 444 Castro Street, Suite
NaviCell Data Visualization Python API Tutorial - Version 1.0 The NaviCell Data Visualization Python API is a Python module that let computational biologists write programs to interact with the molecular
Deploying Intellicus Portal on IBM WebSphere Intellicus Web-based Reporting Suite Version 4.5 Enterprise Professional Smart Developer Smart Viewer Intellicus Technologies email@example.com www.intellicus.com
Chemical and Biological Engineering Calculations using Python 3 Jeffrey J. Heys Copyright c 2014 Jeffrey Heys All rights reserved. This version is being made available at no cost. Please acknowledge access
How to Create an Android Application using Eclipse on Windows 7 Kevin Gleason 11/11/11 This application note is design to teach the reader how to setup an Android Development Environment on a Windows 7