Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Python highlighting en LaTeX
- %% Sniferl4bs www.sniferl4bs.blogspot.com
- %% Follow me: @sniferl4bs
- \documentclass[12pt,a4paper]{article}
- \usepackage[latin1]{inputenc}
- \usepackage{amsmath}
- \usepackage{amsfonts}
- \usepackage{amssymb}
- % El paquete que hemos instalado y debemos usar para que quede bonito =)
- \usepackage{pythonhighlight}
- \usepackage{listings}
- %%
- \author{Jose Moruno Cadima}
- \title{Ejemplo de documento con codigo en Python}
- \begin{document}
- \bf { Ejemplo de Codigo de Python en \LaTeX.}
- %%Para meter el codigo solamente debemos realizar un \begin{python}
- \begin{python}
- # -*- coding: utf-8 -*-
- from PyQt4 import QtCore, QtGui
- import sys
- class Mi_Programa(QtGui.QWidget):
- def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.resize(200,200) #Dimensiones del formulario
- aplicacion = QtGui.QApplication(sys.argv)
- formulario = Mi_Programa() # Instanciamos la clase
- #de nuestro programa
- formulario.show() # Mostramos el Formulario
- aplicacion.exec_() # Ejecutamos
- \end{python}
- %%Una vez hemos acabado el codigo en Python introducimos un \end{python}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement