Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sviluppare con python con l’ipad

Sviluppare con python con l’ipad

Da quando è stato introdotto l’iPad, questo si è evoluto velocemente, trasformandosi da un iPhone agli steroidi ad un surrogato di computer ultraportatile. Questo mi ha spinto ad esplorare la piattaforma per vedere fino a che punto ci si poteva spingere nell’utilizzo di un iPad come sostituto di un ultra portatile: volevo poter sviluppare con python anche su un iPad.

Finalmente dopo molte ricerche scopro l’app Pythonista che consente di sviluppare in python sull’iPad e senza alcun jailbreak, secondo le regole della Apple!

Vi voglio far conoscere questo strumento con il quale potrete sviluppare script python per automatizzare il vostro lavoro sull’iPad, fare test al volo di codici anche quando non avete un pc, utilizzare l’iPad per le vostre ricerche scientifiche (grazie al supporto di numpy e matplotlib) ad adirittura scrivere app con una gui che potrete pubblicare sull’app store!!!

Lelio Campanile

April 07, 2017
Tweet

More Decks by Lelio Campanile

Other Decks in Programming

Transcript

  1. CHI SONO? LELIO CAMPANILE WORK AT UNICAMPANIA.IT (EX UNINA2) TEACHER

    AT APPLE FOUNDATION COURSE FOR UNICAMPANIA FOLLOW ME ON TWITTER: @LELIOC WWW.LELIOCAMPANILE.IT Lelio Campanile per Pycon Otto
  2. PYTHONISTA APP > Python 3.5 e 2.7 > Supporto per

    lo split screen > App Universale > Debugger integrato > Una console interativa > Grafica e multitouch Lelio Campanile per Pycon Otto
  3. UN IDE COMPLETO > Un editor python potentissimo > Tastiera

    estesa > Completamento del codice > Sintassi evidenziata > Temi diversi per l'ide Lelio Campanile per Pycon Otto
  4. L'USO - SCHERMATA PRINCIPALE > swipe verso destra si apre

    il file browser oppure premete il tasto hamburger in alto a sinistra > swipe verso sinistra si apre la console > tieni premuto il tasto play e decidi quale interprete python utilizzare e i parametri dello script (sysv.arg) Lelio Campanile per Pycon Otto
  5. LA CONSOLE > scrivi direttamente > fai debug > visualizza

    i risultati > accedi alla completissima documentazione > object inspector > dividi lo schermo Lelio Campanile per Pycon Otto
  6. NUMPY E MATPLOTLIB E SYMPY Puoi utilizzare Numpy e Matplotlib

    i risultati vengono visualizzati nella console e i grafici possono essere salvati. Lelio Campanile per Pycon Otto
  7. I MODULI AGGIUNTIVI Oltre la libreria Python: > bs4 —

    BeautifulSoup 4 > Bottle: Python Web Framework > Dropbox for Python > evernote > feedparser — Universal Feed Parser > markdown2 — A fast and complete implementation of Markdown in Python > paramiko > Python Imaging Library > qrcode — Pure python QR Code generator > Requests – HTTP for Humans > xmltodict Lelio Campanile per Pycon Otto
  8. I MODULI PER IOS/1 > appex — Using the Pythonista

    Sharing Extension > canvas — Vector Graphics > cb — Connecting to Bluetooth LE Peripherals > clipboard — Copy and paste > console — Utilities for Console Output and Various System Services > dialogs — Easy-to-use UI Dialogs > contacts — Access the iOS Contacts Database > editor — Functions for scripting Pythonista’s text editor > keychain — Secure Password Storage Lelio Campanile per Pycon Otto
  9. I MODULI PER IOS/2 > linguistictagger — Linguistic analysis >

    location — Geo-Location Services on iOS > motion — Motion Sensor Data on iOS > notification — Notifications on iOS > objc_util — Utilities for bridging Objective-C APIs > photos — Photo Library Access on iOS > reminders — Access to the iOS Reminders Database > scene — 2D Games and Animations > sound — Sound effects and music playback > speech — Text-to-Speech on iOS > twitter — iOS Twitter Accounts and API Access > ui — Native GUI for iOS Lelio Campanile per Pycon Otto
  10. I MODULI IOS: UI NATIVE BINDING Il modulo ui consente

    di sviluppare interfacce grafiche (native) per ios direttamente in python e dall'iPad! è un binding abbastanza fedele dell'apple UIKit, anche se non è un wrapper completo Lelio Campanile per Pycon Otto
  11. LA COMMUNITY E poi c'è una comunità intorno, molto attiva.

    Forum: https://forum.omz-software.com/ Lelio Campanile per Pycon Otto
  12. UN PACKAGE MANAGER !!! https://github.com/ywangd/pythonista-tools-installer import requests as r; o=open('ptinstaller.py','w');

    o.write(r.get('http://j.mp/ pt-i').text); o.close() Lelio Campanile per Pycon Otto
  13. ED ORA QUALCHE COSA DI AVANZATO (COMMAND LINE POWER) STASH

    https://github.com/ywangd/stash import requests as r; exec(r.get('http://bit.ly/get- stash').text) Lelio Campanile per Pycon Otto
  14. STASH : COMANDI PRINCIPALI Stash ha davero tante funzionalità! Cerca

    di imitare una vera shell: cp, mv, cd, ls, un server web, ssh ecc.. Lelio Campanile per Pycon Otto
  15. STASH: GIT, SSH, PIP quello che è irrinunciabile di stash:

    > git: un client per git cui fare clone, commit, push, pull > ssh: per collegarti ai tuoi serve remoti (qualcuno ha detto devops??) > pip: l'installer di python!! Lelio Campanile per Pycon Otto
  16. WORKING COPY WORKING COPY È UN CLIENT GIT COMPLETO PER

    IOS Lelio Campanile per Pycon Otto
  17. WORKING COPY -> PYTHONISTA -> WORKING COPY https://github.com/cclauss/Pythonista-and-Working- Copy 1.

    da working copy seleziona il file o il repository intero che vuoi clonare 2. nella share sheet esegui lo script python di sopra 3. vai in pythonista e fai le modifiche che servono 4. da pythonista dallo share sheet utilizza il save in working copy 5. in working copy fai i commit, push, merge, ecc.. Lelio Campanile per Pycon Otto
  18. PYTHONISTA IS NOT A TOY! Hai fatto uno script molto

    utile che utilizzi spesso?? Hai fatto una vera e propria applicazione?? RENDILO DISPONIBILE NELLA HOME DEL TUO DEVICE! Lelio Campanile per Pycon Otto
  19. ANCORA NON VI BASTA? METTETE LE VOSTRE APPLICAZIONE FATTE CON

    PYTHONISTA NELL'APP STORE!! https://github.com/omz/ PythonistaAppTemplate Lelio Campanile per Pycon Otto