python3.5.4 does not start with pythonw, but does it run with the IDLE?

0
#!/usr/bin/env python3.5.4
## -*- coding: utf-8 -*-

#from tkinter import *                  # Gestor grafico tkinter
import sqlite3                          # Motor de Base de datos

clv_bd = sqlite3.connect('cddpbd.db')   # Abrir Base de Datos SQLite3
cur_bd = clv_bd.cursor()

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
import time

canvas = canvas.Canvas("D:\Proyectos\ComunaDDP\ImpresionPdf\Ejemplo-Reportlab-canvas.pdf", pagesize=letter) # Tamaño de la pagina
canvas.setLineWidth(.1)

def encabezado(pag):
    canvas.setFont('Helvetica', 10)                                                                         # Tipo de letra
#   canvas.drawImage("ag00130.gif", 0, letter[1]/2, width=400, height=400)                                  # Insertar imagen
    canvas.drawString(210,760,'Republica Bolivariana de Venezuela')
    date = (time.strftime('Fecha: '+"%d/%m/%Y"))
    canvas.drawString(500,760,date)

    canvas.drawString(220,748,'Pavia, Barquisimeto, Estado Lara')
    canvas.drawString(500,748,'Pagina: '+str(pag))

    reporte='Reporte de Habitantes por Comuna'
    canvas.drawString(217,736,reporte)

    canvas.drawString(30,710,"Apellido              Nombre            C. Identidad    Nro. Telefono    Sector                           Consejo Comunal")
    canvas.line(30,705,580,705)

pag=1
encabezado(pag)

lpp=0
x=0
y=705
cur_bd.execute("SELECT * FROM habitantes ORDER BY apellido ASC")

for i in cur_bd:
    ced_HAB=(i[0])
    voe_HAB=(i[1])
    nom_HAB=(i[2])
    ape_HAB=(i[3])
    dir_SEC=(i[10])
    tel_MOV=(i[12])
    con_COM=(i[15])

    x=30
    y=y-10
    canvas.drawString(x,y,ape_HAB)
    canvas.drawString(x+75,y,nom_HAB)
    v=len(ced_HAB)
    if v==7:
        canvas.drawString(x+156,y,ced_HAB)
    else:
        canvas.drawString(x+150,y,ced_HAB)
    canvas.drawString(x+202,y,tel_MOV)
    canvas.drawString(x+282,y,dir_SEC)
    canvas.drawString(x+382,y,con_COM)
    lpp=lpp+1

    if lpp>65:
        canvas.showPage()
        lpp=0
        x=0
        y=705
        pag=pag+1
        encabezado(pag)

canvas.drawString(x,30,str(y))
canvas.save()
    
asked by Roberto Honori 17.07.2018 в 03:30
source

1 answer

0

We simply enter the search engine "Search Windows System (C):" Right side and register pythonw. Several appeared (pythonw.exe), in several directions, in our case we left only the one that was in the python directory with which we are working. "pyton3.5.4", the others we eliminated and ready. At least the debbuguer was executed. pdb python.

    
answered by 22.07.2018 в 12:55