<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>https://cacauet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Python_prompt</id>
	<title>Python prompt - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="https://cacauet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Python_prompt"/>
	<link rel="alternate" type="text/html" href="https://cacauet.org/wiki/index.php?title=Python_prompt&amp;action=history"/>
	<updated>2026-05-04T13:35:38Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://cacauet.org/wiki/index.php?title=Python_prompt&amp;diff=1389&amp;oldid=prev</id>
		<title>Enric: Es crea la pàgina amb «Amb aquest script podem millorar el treball sobre la línia de comandes de Python. Ens afegirà &quot;autocompletion&quot; de les comandes amb la tecla &lt;TAB&gt; a l'estil de la ''shel…».</title>
		<link rel="alternate" type="text/html" href="https://cacauet.org/wiki/index.php?title=Python_prompt&amp;diff=1389&amp;oldid=prev"/>
		<updated>2012-09-18T20:03:49Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «Amb aquest script podem millorar el treball sobre la línia de comandes de Python. Ens afegirà &amp;quot;autocompletion&amp;quot; de les comandes amb la tecla &amp;lt;TAB&amp;gt; a l&amp;#039;estil de la &amp;#039;&amp;#039;shel…».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Amb aquest script podem millorar el treball sobre la línia de comandes de Python. Ens afegirà &amp;quot;autocompletion&amp;quot; de les comandes amb la tecla &amp;lt;TAB&amp;gt; a l'estil de la ''shell''.&lt;br /&gt;
&lt;br /&gt;
El següent script s'ha de guardar a .pythonstartup i després incloure el path a l'arxiu dins la variable d'entorn PYTHONSTARTUP. Ho podem fer afegint la línia a l'arxiu .profile o .bashrc (si utilitzeu bash):&lt;br /&gt;
 export PYTHONSTARTUP=~/.pythonstartup&lt;br /&gt;
&lt;br /&gt;
El ''script'' es basa en utilitzar les [http://docs.python.org/library/rlcompleter.html llibreries Python rlcompleter i readline].&lt;br /&gt;
&lt;br /&gt;
== Arxiu .pythonstartup ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# python startup file&lt;br /&gt;
&lt;br /&gt;
import readline&lt;br /&gt;
import rlcompleter&lt;br /&gt;
import atexit&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
# tab completion&lt;br /&gt;
readline.parse_and_bind(&amp;quot;tab: complete&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# history file&lt;br /&gt;
histfile = os.path.join(os.environ['HOME'], '.pythonhistory')&lt;br /&gt;
try:&lt;br /&gt;
	readline.read_history_file(histfile)&lt;br /&gt;
except IOError:&lt;br /&gt;
	pass&lt;br /&gt;
atexit.register(readline.write_history_file,histfile)&lt;br /&gt;
del os, histfile, readline, rlcompleter&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Enric</name></author>
		
	</entry>
</feed>