28.06.2017 Views

Python para todos

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Python</strong> <strong>para</strong> <strong>todos</strong><br />

a los usuarios. Para crear archivos con el código fuente se utiliza la opción<br />

sdist de setup.py, que crea por defecto un archivo tar.gz en Unix<br />

y un zip en Windows.<br />

python setup.py sdist<br />

Sin embargo se puede utilizar --formats <strong>para</strong> especificar el formato o<br />

formatos que queramos generar<br />

bztar<br />

gztar<br />

tar<br />

zip<br />

ztar<br />

.tar.bz2<br />

.tar.gz<br />

.tar<br />

.zip<br />

.tar.Z<br />

Para crear un archivo tar.bz2, un tar.gz y un zip, por ejemplo, se utilizaría<br />

la siguiente orden:<br />

python setup.py sdist --formats=bztar,gztar,zip<br />

Para generar un archivo de distribución binaria, se usa la opción bdist:<br />

python setup.py bdist<br />

Los formatos que soporta bdist son los siguientes:<br />

rpm<br />

gztar<br />

bztar<br />

ztar<br />

tar<br />

wininst<br />

zip<br />

RPM<br />

.tar.gz<br />

.tar.bz2<br />

.tar.Z<br />

.tar<br />

Instalador Windows<br />

.zip<br />

Para crear un archivo rpm y un instalador de Windows, por ejemplo,<br />

escribiríamos:<br />

146

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!