Programmare in Python su Ubuntu

Configurazione e uso di IDE, editor, compilatori, in fase di programmazione.
Chiusa
Matt986
Prode Principiante
Messaggi: 31
Iscrizione: domenica 27 novembre 2016, 12:01
Desktop: Ubuntu Mate
Distribuzione: Ubuntu 16.10 x64
Sesso: Maschile

Programmare in Python su Ubuntu

Messaggio da Matt986 »

Ciao a tutti, per questioni lavorative ho bisogno di installare un compilatore per imparare e approfondire il linguaggio di programmazione Python, cosa dovrei installare per iniziare a compilare? Guida per principianti?

Grazie a chi mi risponderà
Avatar utente
Massimog
Rampante Reduce
Rampante Reduce
Messaggi: 7342
Iscrizione: martedì 2 dicembre 2008, 18:17
Desktop: GNOME 3.16
Distribuzione: Gentoo x86_64
Sesso: Maschile
Località: Osimo(AN)

Re: Programmare in Python su Ubuntu

Messaggio da Massimog »

Python è un linguaggio interpretato, non compilato.In Linux c'è già installato e ti basta dare python nel terminale per avviarlo
Acer 5920G con Gentoo 64bit + Ubuntu 12.04 LTS Precise Pangolin 64bit + Windows 7 64 bit | Stampante Epson PX710W | Router Netgear DGN2000
Matt986
Prode Principiante
Messaggi: 31
Iscrizione: domenica 27 novembre 2016, 12:01
Desktop: Ubuntu Mate
Distribuzione: Ubuntu 16.10 x64
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Matt986 »

ok, grazie. Scusatemi :o ;)
Avatar utente
telperion
Rampante Reduce
Rampante Reduce
Messaggi: 5407
Iscrizione: lunedì 10 luglio 2006, 18:20

Re: Programmare in Python su Ubuntu

Messaggio da telperion »

Matt986 [url=http://forum.ubuntu-it.org/viewtopic.php?p=4957620#p4957620][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:Ciao a tutti, per questioni lavorative ho bisogno di installare un compilatore per imparare e approfondire il linguaggio di programmazione Python, cosa dovrei installare per iniziare a compilare? Guida per principianti?

Grazie a chi mi risponderà
https://www.tutorialspoint.com/python/index.htm
Matt986
Prode Principiante
Messaggi: 31
Iscrizione: domenica 27 novembre 2016, 12:01
Desktop: Ubuntu Mate
Distribuzione: Ubuntu 16.10 x64
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Matt986 »

mi sa che ho combinato un casino..allora digitando python compare la versione 2.7 aggiornata a settembre 2016, come indicato da libro "beninning programming with python" ho installato la versione più aggiornata che è la 3.4.6 scaricata da qui https://www.python.org/downloads/ i passi sono i seguenti.
1. Navigate to http://www.python.org/download/releases/3.3.4/
with your browser.
You see information regarding the latest version of Python, as shown in
Figure 2-1.
2. Click the appropriate link for your version of Linux:
a. Python 3.3.4 compressed source tarball (any version of Linux)
b. Python 3.3.4 xzipped source tarball (better compression and faster
download)
3. When asked whether you want to open or save the file, choose Save.
The Python source files begin downloading. Be patient: The source files
require a minute or two to download.
4. Double-click the downloaded file.
The Archive Manager window opens. After the files are extracted, you
see the Python 3.3.4 folder in the Archive Manager window.
5. Double-click the Python 3.3.4 folder.
The Archive Manager extracts the files to the Python 3.3.4 subfolder
of your home folder.
6. Open a copy of Terminal.
The Terminal window appears. If you have never built any software on
your system before, you must install the build essentials, SQLite, and bzip2
or the Python installation will fail. Otherwise, you can skip to Step 10 to
begin working with Python immediately.
7. Type sudo apt-get install build-essential and press Enter.
Linux installs the Build Essential support required to build packages
(see https://packages.debian.org/squeeze/build-essential
for details).
8. Type sudo apt-get install libsqlite3-dev and press Enter.
Linux installs the SQLite support required by Python for database
manipulation (see https://packages.debian.org/squeeze/
libsqlite3-dev for details).
9. Type sudo apt-get install libbz2-dev and press Enter.
Linux installs the bzip2 support required by Python for archive manipu-
lation (see https://packages.debian.org/sid/libbz2-dev for
details).
10. Type CD Python 3.3.4 in the Terminal window and press Enter.
Terminal changes directories to the Python 3.3.4 folder on your system.
11. Type ./configure and press Enter.
The script begins by checking the system build type and then performs
a series of tasks based on the system you’re using. This process can
require a minute or two because there is a large list of items to check.
12. Type make and press Enter.
Linux executes the make script to create the Python application software.
The make process can require up to a minute — it depends on the pro-
cessing speed of your system.
13. Type sudo make altinstall and press Enter.
The system may ask you for your administrator password. Type your
password and press Enter. At this point, a number of tasks take place as
the system installs Python on your system.
adessi digitando python mi compare la 2.7, come faccio a sostituire la 2.7 con la 3.4.6?
Avatar utente
nuzzopippo
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1620
Iscrizione: giovedì 12 ottobre 2006, 11:34

Re: Programmare in Python su Ubuntu

Messaggio da nuzzopippo »

prova a dare "python3" ... coesistono tranquillamente sul sistema.

Una curiosità, nella mia 16.04 la versione dei repo ufficiali è la 3.5, come mai hai installato la 3.3 ? Oltre tutto, sulla home di python.org (dove hai scaricato) è disponibile la 3.6 ... non che faccia troppa differenza.
Fatti non foste a viver come bruti ...
Avatar utente
BlueEyes
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1330
Iscrizione: giovedì 15 marzo 2012, 14:08

Re: Programmare in Python su Ubuntu

Messaggio da BlueEyes »

Da terminale prova questo comando:

Codice: Seleziona tutto

~$ whereis python
Otterrai sicuramente qualcosa del genere:

Codice: Seleziona tutto

python: /usr/bin/python3.5 /usr/bin/python3.5m /usr/bin/python2.7 /usr/bin/python /usr/lib/python3.5 /usr/lib/python2.7 /etc/python3.5 /etc/python2.7 /etc/python /usr/local/lib/python3.5 /usr/local/lib/python2.7 /usr/include/python3.5m /usr/share/python /usr/share/man/man1/python.1.gz
visto che la tua versione di Ubuntu è recente (16.10). Ti confermerà che puoi utilizzare sia Py2 che Py3. Ciao
Matt986
Prode Principiante
Messaggi: 31
Iscrizione: domenica 27 novembre 2016, 12:01
Desktop: Ubuntu Mate
Distribuzione: Ubuntu 16.10 x64
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Matt986 »

nuzzopippo [url=http://forum.ubuntu-it.org/viewtopic.php?p=4957812#p4957812][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:prova a dare "python3" ... coesistono tranquillamente sul sistema.

Una curiosità, nella mia 16.04 la versione dei repo ufficiali è la 3.5, come mai hai installato la 3.3 ? Oltre tutto, sulla home di python.org (dove hai scaricato) è disponibile la 3.6 ... non che faccia troppa differenza.
veramente è la prima volta che uso python, per controllare se non ci sono pacchetti "doppi" installati sul sistema?
Avatar utente
nuzzopippo
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1620
Iscrizione: giovedì 12 ottobre 2006, 11:34

Re: Programmare in Python su Ubuntu

Messaggio da nuzzopippo »

Il comando postato da @BlueEyes nel post precedente Ti darà le indicazioni che chiedi, leggere la risposta dovrebbe bastare a chiarirsi le idee.
Fatti non foste a viver come bruti ...
Matt986
Prode Principiante
Messaggi: 31
Iscrizione: domenica 27 novembre 2016, 12:01
Desktop: Ubuntu Mate
Distribuzione: Ubuntu 16.10 x64
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Matt986 »

ok, ok. Eventualmente conoscete qualche libro per studiarlo o non serve?
Avatar utente
nuzzopippo
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1620
Iscrizione: giovedì 12 ottobre 2006, 11:34

Re: Programmare in Python su Ubuntu

Messaggio da nuzzopippo »

Versione 2.x :

Pensare da informatico mi è stato consigliato di partire con questo e ritengo sia stato un buon consiglio.

potresti integrare con il tutorial di python

e proseguire con Dive into python, per la versione 2 del linguaggio

Oppure, per la versione 3

"dive into python 3" che puoi raggiungere partendo da questa pagina (è gratuito)

Questo limitandosi ai soli testi in italiano se, poi, conosci bene l'inglese la scelta migliore credo sarebbe seguire tutorial e documentazione dal sito ufficiale di python
Fatti non foste a viver come bruti ...
Avatar utente
Eresia
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 362
Iscrizione: venerdì 30 giugno 2006, 1:20
Distribuzione: gentoo
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Eresia »

emerge --auD --oneshot life/lucky-*
Follia
Prode Principiante
Messaggi: 19
Iscrizione: sabato 9 gennaio 2021, 16:57
Desktop: Ubuntu
Distribuzione: Ubuntu 20.04.1 LTS
Sesso: Maschile

Re: Programmare in Python su Ubuntu

Messaggio da Follia »

Ciao a tutti, mi accodo

sto iniziando ad usare il python seguendo delle linee guida. Queste mi hanno portato ad installare atom, da qui ho salvato le sequenze di istruzioni su un file, ma non so come accedervi dal terminale, e nemmeno il comando "cd Desktop/" sembra piacerli, sapreste aiutarmi? (sto usando python3)
Avatar utente
trekfan1
Moderatore Globale
Moderatore Globale
Messaggi: 23359
Iscrizione: domenica 21 maggio 2006, 10:51
Desktop: Gnome
Distribuzione: Ubuntu 23.10 e 24.04 (dev)
Sesso: Maschile
Località: Formigine (MO) | Accecante Asceta

Re: Programmare in Python su Ubuntu

Messaggio da trekfan1 »

Apri un tuo topic in quanto l'ultimo post risale al 2017, chiudo per necroposting
Chiusa

Ritorna a “Strumenti per la programmazione”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 2 ospiti