<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://pythonlab.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pythonlab.wordpress.com</link>
	<description>python in tutte le sue forme...</description>
	<lastBuildDate>Thu, 03 Nov 2011 19:36:27 +0000</lastBuildDate>
	<language>it</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='pythonlab.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://pythonlab.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pythonlab.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://pythonlab.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Trasferimento</title>
		<link>http://pythonlab.wordpress.com/2008/01/05/trasferimento/</link>
		<comments>http://pythonlab.wordpress.com/2008/01/05/trasferimento/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 17:48:02 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2008/01/05/trasferimento/</guid>
		<description><![CDATA[Il blog si trasferisce su un nuovo spazio :  http://www.akus85.netsons.org/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=91&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Il blog si trasferisce su un nuovo spazio :  <a href="http://www.akus85.netsons.org/" target="_blank">http://www.akus85.netsons.org/</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=91&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2008/01/05/trasferimento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Generatore playlist&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/03/21/generatore-playlist/</link>
		<comments>http://pythonlab.wordpress.com/2007/03/21/generatore-playlist/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 23:14:06 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/03/21/generatore-playlist/</guid>
		<description><![CDATA[Oggi vi presento la mia ultima &#8220;creazione&#8221;,in pratica crea un file playlist (m3u) contenenti gli mp3 che si trovano in una certa directory: import os import sys def menu(): print "1-Locale" print "2-Globale" print "0-Esci" return raw_input("Cosa vuoi fare?: ") def locale(): a=False path=os.getcwd() lista_file=os.listdir(path) file=open('playlist.m3u','w') file.close() for i in lista_file: if (i[-4:]==".mp3"): a=True file=open('playlist.m3u','a') [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=90&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oggi vi presento la mia ultima &#8220;creazione&#8221;,in pratica crea un file playlist (m3u) contenenti gli mp3 che si trovano in una certa directory:<br />
<code><br />
import os<br />
import sys</code></p>
<p><code>def menu():<br />
print "1-Locale"<br />
print "2-Globale"<br />
print "0-Esci"<br />
return raw_input("Cosa vuoi fare?: ")</code></p>
<p><code>def locale():<br />
a=False<br />
path=os.getcwd()<br />
lista_file=os.listdir(path)<br />
file=open('playlist.m3u','w')<br />
file.close()<br />
for i in lista_file:<br />
if (i[-4:]==".mp3"):<br />
a=True<br />
file=open('playlist.m3u','a')<br />
percorso=path+'\\'+i<br />
file.writelines(percorso)<br />
file.write('\n')<br />
if (a==True):<br />
print "Playlist creata...!!!"<br />
else:<br />
print "Non ci sono file mp3 nella directory corrente..."<br />
percorso=path+'\\'+'playlist.m3u'<br />
os.remove(percorso)</code></p>
<p><code>def globale():<br />
a=False<br />
path=raw_input("Inserisci il path contenete i file da mettere in playlist: ")<br />
lista_file=os.listdir(path)<br />
file=open('playlist.m3u','w')<br />
file.close()<br />
for i in lista_file:<br />
if(i[-4:]==".mp3"):<br />
a=True<br />
file=open('playlist.m3u','a')<br />
percorso=path+'\\'+i<br />
file.write(percorso)<br />
file.write('\n')<br />
if (a==True):<br />
print "Playlist creata...!!!"<br />
else:<br />
print "Non ci sono file mp3 nella directory corrente..."<br />
percorso=os.getcwd()+'\\'+'playlist.m3u'<br />
os.remove(percorso)</code></p>
<p><code>#MAIN<br />
scelta=menu()<br />
if (scelta=="1"):<br />
locale()<br />
elif (scelta=="2"):<br />
globale()<br />
raw_input()</code></p>
<p>In pratica scegliendo l&#8217;opzione1 (locale) viene generata la playlist degli mp3 che si trovano nella stessa directory del nostro script python,se invece scegliamo l&#8217;opzione2 (globale) inseriamo noi la directory che contiene gli mp3.</p>
<p>Se volete il file eseguibile(exe) cliccate <a href="http://dodownload.filefront.com/6948420//23d2c7c0b3a13ae5a897e120b0140350a9dfbf3d536300e8b6f1927638f9aef25de756b6ecc445de">qui</a></p>
<p>Per ogni suggerimento,consiglio per migliorarlo o altro postate un commento in questo post oppure al forum di discussione di questo programma <a href="http://pythonlab.forumgratis.biz/viewtopic.php?t=106">qui</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=90&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/03/21/generatore-playlist/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione17-Creare Eccezioni&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/03/13/lezione17-creare-eccezioni/</link>
		<comments>http://pythonlab.wordpress.com/2007/03/13/lezione17-creare-eccezioni/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 12:02:44 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/03/13/lezione17-creare-eccezioni/</guid>
		<description><![CDATA[Per seguire questa lezione bisogna avere chiaro il concetto di eccezione e della sua gestione tramite try&#8230;except&#8230;else&#8230;finally che se né è parlato nella lezione 11 Questa volta parleremo di come creare delle eccezioni per le nostre applicazioni. Python stesso ha una serie di eccezioni &#8220;già pronte&#8221;,per visualizzare l&#8217;elenco completo cliccare qui Ogni eccezione che dobbiamo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=89&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Per seguire questa lezione bisogna avere chiaro il concetto di eccezione e della sua gestione tramite try&#8230;except&#8230;else&#8230;finally che se né è parlato nella <a href="http://pythonlab.wordpress.com/2007/01/28/lezione11-le-eccezioni/">lezione 11</a><br />
Questa volta parleremo di come creare delle eccezioni per le nostre applicazioni.<br />
Python stesso ha una serie di eccezioni &#8220;già pronte&#8221;,per visualizzare l&#8217;elenco completo cliccare <a href="http://www.python.it/doc/Python-Docs/html/lib/module-exceptions.html">qui</a></p>
<p>Ogni eccezione che dobbiamo creare deve derivare dalla classe Error o Exception.<br />
Quindi definiamo una nuova classe con il nome della nostra eccezione che deriva dalla classe madre <em>Excepition</em> o <em>Error</em> in questo modo:</p>
<p><em>class NomeLinguaggio(Exception):<br />
def __init__(self,name):<br />
Exception.__init__(self)<br />
self.name=name<br />
try:<br />
nome=raw_input(&#8216;Inserisci nome di un linguaggio: &#8216;)<br />
if (nome==&#8221;python&#8221;):<br />
raise NomeLinguaggio(nome)<br />
except NomeLinguaggio,name:<br />
print &#8220;NomeLinguaggio: Non puoi utilizzare la parola python&#8221;<br />
else:<br />
print &#8220;Non e&#8217; stata sollevata alcuna eccezione&#8221;</em></p>
<p>In questo modo se inseriamo la parola python verra sollevata l&#8217;eccezione NomeLinguaggio e stamperà a video il messaggio che ci avverte che non possiamo utilizzare quella parola,altrimenti verrà stampato che non  è stata sollevata alcuna eccezione.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/89/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/89/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=89&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/03/13/lezione17-creare-eccezioni/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Inserita la chat..</title>
		<link>http://pythonlab.wordpress.com/2007/03/01/inserita-la-chat/</link>
		<comments>http://pythonlab.wordpress.com/2007/03/01/inserita-la-chat/#comments</comments>
		<pubDate>Thu, 01 Mar 2007 10:41:11 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/03/01/inserita-la-chat/</guid>
		<description><![CDATA[PythonLab-Chat<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=88&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://go.yaplet.com?url=http://www.pythonlab.wordpress.com" target="_top">PythonLab-Chat</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/88/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/88/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=88&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/03/01/inserita-la-chat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione16-Creare eseguibili&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/02/21/lezione16-creare-eseguibili/</link>
		<comments>http://pythonlab.wordpress.com/2007/02/21/lezione16-creare-eseguibili/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 17:32:44 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/02/21/lezione16-creare-eseguibili/</guid>
		<description><![CDATA[Per distribuire le nostre applicazioni il più delle volte risulta “scomodo” dare il file .py anche perchè per poter funzionare l&#8217;utente deve aver installato python. Se specialmente l&#8217;utente a cui dobbiamo dare a nostra applicazione usa Windows è più comodo passargli un file .exe Per creare un eseguibile(exe) scarichiamo il modulo py2exe. una volta installato [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=85&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Per distribuire le nostre applicazioni il più delle volte risulta “scomodo” dare il file .py anche perchè per poter funzionare l&#8217;utente deve aver installato python.<br />
Se specialmente l&#8217;utente a cui dobbiamo dare a nostra applicazione usa Windows è più comodo passargli un file .exe<br />
Per creare un eseguibile(exe) scarichiamo il modulo <a href="http://www.py2exe.org">py2exe</a>.<br />
una volta installato apriamo il programma che dobbiamo convertire in eseguibileed all&#8217;inizio del file aggiungiamo queste righe:</p>
<p><em>from distutils.core import setup<br />
import py2exe<br />
setup(console=['NomeFile.py'])</em></p>
<p>salviamo il nostro file con il nome setup.py e dal terminale(per utenti unix) o da cmd.exe(per utenti Windows) ci portiamo nella directory dove si trova il nostro file e scriviamo:</p>
<p><em>python setup.py py2exe</em></p>
<p>compariranno un po di scritte ed alla fine se abbiamo fatto tutto correttamente  dentro la directory del nostro file dovremmo avere due cartelle build e dist ,il nostro eseguibile si troverà all&#8217;interno della cartella dist.<br />
Per testare il funzionamento dell&#8217;eseguibile appena creato sempre da terminale ci portiamo dentro la cartella dist e digitiamo:</p>
<p><em>NomeEseguibile.exe</em></p>
<p>Se invece vogliamo creare dei veri e propri installer con installazione guidata possiamo usare <a href="http://nsis.sourceforge.net/Main_Page">NSIS</a> oppure <a href="http://www.jrsoftware.org/isinfo.php">InnoSetup</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/85/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/85/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=85&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/02/21/lezione16-creare-eseguibili/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>aggiunta nuova sezione&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/02/20/aggiunta-nuova-sezione/</link>
		<comments>http://pythonlab.wordpress.com/2007/02/20/aggiunta-nuova-sezione/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 12:54:21 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/02/20/aggiunta-nuova-sezione/</guid>
		<description><![CDATA[E&#8217; stata aggiunta una nuova pagina che riguarda la programmazione in python per i dispositivi mobili (s60) gli aggiornamenti li trovate nella side-bar a destra.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=69&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>E&#8217; stata aggiunta una nuova pagina che riguarda la programmazione in <a href="http://pythonlab.wordpress.com/tutorial-python-s60/">python per i dispositivi mobili (s60) </a> gli aggiornamenti li trovate nella side-bar a destra.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/69/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/69/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=69&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/02/20/aggiunta-nuova-sezione/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione15-Le classi in python&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/02/08/lezione15-le-classi-in-python/</link>
		<comments>http://pythonlab.wordpress.com/2007/02/08/lezione15-le-classi-in-python/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 14:24:54 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/02/08/lezione15-le-classi-in-python/</guid>
		<description><![CDATA[Dopo aver introdotto i punti principali della programmazione ad oggetti,vediamo come implementarla in python tramite l&#8217;utilizzo delle classi. Per creare una classe in python scriviamo: class NomeDellaClasse : se è una “classe madre”(cioè non deriva da altre classi) class NomeDellaClasse(NomeClasseMadre): se è una “classe figlia” dopo la dichiarazione del nome della classe,inizializzaremo le variabili(i dati [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=63&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom:0;" align="left"><font size="4">Dopo aver introdotto i punti principali della programmazione ad oggetti,vediamo come implementarla in python tramite l&#8217;utilizzo delle classi.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">Per creare una classe in python scriviamo:</font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><strong><em>class NomeDellaClasse :</em></strong>  se è una “<em>classe madre”</em>(cioè non deriva da altre classi)</font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><strong><em>class NomeDellaClasse(NomeClasseMadre): </em></strong> se è una <em>“classe figlia”</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">dopo la dichiarazione del nome della classe,inizializzaremo le <em>variabili</em>(i dati membro) che utilizzaremo nella classe,ed infine sotto i <em>metodi</em>(funzioni) della classe.</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">Ottenendo una struttura di questo tipo:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>class NomeClasse:</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>{variabili}</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>{metodi}</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">oppure</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>class NomeClasse(ClasseMadre):</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>{variabili}</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>{metodi}</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">Per visualizzare meglio questi concetti passiamo subito ad un&#8217;esempio, implementando l&#8217;esempio dei computer di un ufficio che abbiamo visto nella<a href="http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/"> lezione precedente:</a></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4"><a href="http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/"></a></font><a href="http://pythonlab.files.wordpress.com/2007/02/17.JPG" title="17"><img src="http://pythonlab.files.wordpress.com/2007/02/17.JPG?w=455" alt="17" /></a></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">Adesso scriviamo un&#8217;altro esempio dove la classe computer è la <em>classe madre</em> :</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><a href="http://pythonlab.files.wordpress.com/2007/02/181.JPG" title="18"><img src="http://pythonlab.files.wordpress.com/2007/02/181.JPG?w=455" alt="18" /></a></p>
<p style="margin-bottom:0;font-style:normal;" align="left">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=63&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/02/08/lezione15-le-classi-in-python/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>

		<media:content url="http://pythonlab.files.wordpress.com/2007/02/17.JPG" medium="image">
			<media:title type="html">17</media:title>
		</media:content>

		<media:content url="http://pythonlab.files.wordpress.com/2007/02/181.JPG" medium="image">
			<media:title type="html">18</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione 14-Introduzione alla programmazione ad oggetti&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/</link>
		<comments>http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 22:38:49 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/</guid>
		<description><![CDATA[Python come i linguaggi ibridi(tipo C++) ci permette di implementare sia la programmazione procedurale che quella ad oggetti. Quando scriviamo un programma con la programmazione procedurale ci serviamo di funzioni,procedure e strutture dati come liste,dizionari,etc..se decidiamo di modificare una parte del programma probabilmente dovremmo apportare delle modifiche strutturali ad una buona parte di esso perchè [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=58&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom:0;" align="left"><font size="4">Python come i linguaggi ibridi(tipo C++) ci permette di implementare sia la programmazione <em>procedurale</em> che quella ad <em>oggetti</em>.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">Quando scriviamo un programma con la programmazione procedurale ci serviamo di funzioni,procedure e strutture dati come liste,dizionari,etc..se decidiamo di modificare una parte del programma probabilmente dovremmo apportare delle modifiche strutturali ad una buona parte di esso perchè funzioni.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">La programmazione ad oggetti invece ci permette un riutilizzo di codice senza apportare alcuna modifica,vediamo in che senso.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">Un programma scritto tramite la programmazione orientata ad oggetti,è costituito da un&#8217;insieme di oggetti che interagiscono tra loro ognuno avente una propria struttura dati,siccome ogni oggetto funziona in “modo autonomo”,la programmazione ad oggetti si presta per lo sviluppo di software in team,in quanto ognuno può sviluppare un componente(oggetto)del programma senza preoccuparsi della struttura degli altri oggetti che ne faranno parte.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">Per creare un&#8217;oggetto dobbiamo definire la <em>classe</em> d&#8217;appartenenza,definendo le funzioni dell&#8217;oggetto(metodi)e le variabili contenute in esso.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">Supponiamo di volere scrivere un&#8217;archivio dei computer di un&#8217;uffico:</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">variabili:<br />
</font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> nome computer</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> sistema operativo</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> ram</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> hard disk</em></font></p>
<p style="margin-bottom:0;" align="left">
<p style="margin-bottom:0;" align="left">
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">metodi:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>  modifica sistema operativo</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> modifica ram</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em> modifica hard disk</em></font></p>
<p style="margin-bottom:0;" align="left">
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">Una delle funzioni più importanti delle classi è <strong><em>l&#8217;ereditarietà </em></strong>, cioè se già abbiamo una classe con dei metodi che ci possono servire per un&#8217;applicazione possiamo prendere la classe che abbiamo già e creare una <em>classe figlia </em>che ha gli stessi metodi della <em>classe madre</em> a cui poi possiamo aggiungere altri metodi.</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">Ad esempio supponiamo che la classe madre sia la classe computer scritta sopra ,creiamo un&#8217;altra classe (chiamata <em>computer2</em>)che oltre ad avere le variabili ed i metodi sopra citati abbia:</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">variabili:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>processore</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>scheda video</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>scheda audio</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">metodi:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>cambia scheda video</em></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=58&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/02/07/lezione-14-introduzione-alla-programmazione-ad-oggetti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione 13-I Moduli&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/02/01/lezione-13-i-moduli/</link>
		<comments>http://pythonlab.wordpress.com/2007/02/01/lezione-13-i-moduli/#comments</comments>
		<pubDate>Thu, 01 Feb 2007 16:28:59 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/02/01/lezione-13-i-moduli/</guid>
		<description><![CDATA[Quando i programmi diventano più grossi non è buona scelta lasciare tutto su un&#8217;unico file,in quanto la gestione risulta più complicata. Allora in questi casi conviene dividere il programma in sotto-programmi salvati in script e richiamarli nel corpo principale del nostro programma.Questi script esterni vengo chiamati moduli,già di essi ne esistono moltissimi per risolvere svariati [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=53&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">Quando i programmi diventano più grossi non è buona scelta lasciare tutto su un&#8217;unico file,in quanto la gestione risulta più complicata.</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">Allora in questi casi conviene dividere il programma in sotto-programmi salvati in script e richiamarli nel corpo principale del nostro programma.</font><font size="4">Questi script esterni vengo chiamati <strong>moduli</strong>,già di essi ne esistono moltissimi per risolvere svariati problemi.</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">La sintassi per richiamarlo all&#8217;interno del nostro programma è:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>import NomeModulo</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">per sapere i metodi che ha un determinato modulo direttamente dalla consolle interattiva scriviamo:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>import NomeModulo</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>dir(NomeModulo)</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">ad esempio:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>&gt;&gt;import time</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>&gt;&gt;dir(time)</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>['__doc__', '__name__', 'accept2dyear', 'altzone', 'asctime', 'clock', 'ctime', 'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'timezone', 'tzname']</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">usando il comando import,in pratica importiamo nel nostro programma tutte le funzioni(quelle elencate tramite il comando <em>dir</em>),e per richiamarne una dobbiamo utilizzare la sintassi:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>NomeModulo.NomeFunzione</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">ad esempio se vogliamo stampare che giorno è oggi basta scrivere:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>&gt;&gt;&gt;import time</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>&gt;&gt;&gt;lista=time.localtime()  #ci crea una lista con giorno,mese,anno e l&#8217;orario</em></font></p>
<p style="margin-bottom:0;" align="left">&nbsp;</p>
<p style="margin-bottom:0;"><em><font size="4">&gt;&gt;&gt;giorno=lista[2]    #estrapolo dalla lista il valore del giorno<br />
</font></em></p>
<p style="margin-bottom:0;" align="left">&nbsp;</p>
<p style="margin-bottom:0;" align="left">
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">se invece vogliamo importare nel nostro programma solo una funzione di un determinato modulo scriviamo:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>from NomeModulo import NomeFunzione</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4">scriviamo così:</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>&gt;&gt;&gt;from time import daylight</em></font></p>
<p style="margin-bottom:0;" align="left"><font size="4"><em>&gt;&gt;&gt;daylight</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">In questo caso dato che abbiamo importato solo una specifica funzione del modulo per richiamarla basta solo il nome della funzione.</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">Come potete capire non è possibile presentare tutti i moduli che sono disponibili perchè sono in numero elevato,per trovare l&#8217;elenco completo vi rimando all&#8217;indice ufficiale:<a href="http://docs.python.org/modindex.html">http://docs.python.org/modindex.html</a></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=53&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/02/01/lezione-13-i-moduli/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
		<item>
		<title>Lezione12-Le stringhe&#8230;</title>
		<link>http://pythonlab.wordpress.com/2007/01/30/lezione12-le-stringhe/</link>
		<comments>http://pythonlab.wordpress.com/2007/01/30/lezione12-le-stringhe/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 12:51:25 +0000</pubDate>
		<dc:creator>akus85</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pythonlab.wordpress.com/2007/01/30/lezione12-le-stringhe/</guid>
		<description><![CDATA[Oggi impariamo ad usare al meglio le stringhe che come ogni altro elemento in Python è in oggetto,quindi ha dei metodi che ne facilitano l&#8217;utilizzo. I caratteri della stringa vengono indicizzati da 0 ad (n-1). -Lunghezza: supponiamo di avere una stringa(frase): frase =&#8221;supercalifragilissichespiralitoso&#8221; se vogliamo sapere la lunghezza della stringa,basta scrivere &#62;&#62;&#62;len(frase) &#62;&#62;&#62;33 -Lo slicing: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=52&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom:0;" align="left"><font size="4">Oggi impariamo ad usare al meglio le stringhe che come ogni altro elemento in Python è in oggetto,quindi ha dei metodi che ne facilitano l&#8217;utilizzo.</font></p>
<p style="margin-bottom:0;" align="left"><font size="4">I caratteri della stringa vengono indicizzati da 0 ad (n-1).<br />
</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"><font size="4"><em>-Lunghezza:</em><br />
supponiamo di avere una stringa(<em>frase</em>):</font></p>
<p style="margin-bottom:0;" align="left"> <font size="4"><em>frase =&#8221;supercalifragilissichespiralitoso&#8221;</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">se vogliamo sapere la lunghezza della stringa,basta scrivere</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>len(frase)</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>33</em></font></p>
<p style="margin-bottom:0;" align="left">
<font size="4"><em>-Lo slicing:</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">Tramite lo slicing possiamo estrapolare dalla stringa una parte di essa,ad esempio</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">&gt;&gt;&gt;<em>frase[:10] </em>   #stampa i primi 10 caratteri</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>supercalif</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">&gt;&gt;&gt;<em>frase[-10:] </em>   #stampa gli ultimi 10 caratteri</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>piralitoso</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">&gt;&gt;&gt;<em>frase[2:8]</em>    #stampa dal terzo carattere al numero 8</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>percal</em></font></p>
<p style="margin-bottom:0;font-style:normal;" align="left">
<font size="4">&gt;&gt;&gt;<em>frase[::10]</em>    #stampa ogni 10 caratteri</font></p>
<p style="margin-bottom:0;font-style:normal;" align="left"> <font size="4">&gt;&gt;&gt;<em>srh</em></font></p>
<p style="margin-bottom:0;" align="left">
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pythonlab.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pythonlab.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pythonlab.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pythonlab.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pythonlab.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pythonlab.wordpress.com&amp;blog=667862&amp;post=52&amp;subd=pythonlab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pythonlab.wordpress.com/2007/01/30/lezione12-le-stringhe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/07bf98dffdc43d234a139a8d55987767?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akus85</media:title>
		</media:content>
	</item>
	</channel>
</rss>
