Questions tagged as 'python'

2
answers

Inserting a string into a list of ints

I have the following rule: Create a function that receives a list of integers, and replace the items as below: If Multiple of 3 = 'Fizz' if multiple of 5 = 'Buzz' if multiple of 3 and 5 = 'Fizzbuzz' I created the program below:...
asked by 17.10.2016 / 15:48
1
answer

TypeError in python: source code string can not contain null bytes

Good morning / afternoon / evening. I'm trying to create a simple python calculator in the Visual studio IDE. The following is the script (sorry for being in English): import os,sys #from colored import fg,bg,attr print("\n\n==>This is...
asked by 03.11.2016 / 22:34
0
answers

Python - PYQT5 - QT DESIGNER - How to add, multiply etc.

I know the basics and the whole structure of calculations in Python. I decided to take a bigger step and create a graphical interface for these calculations. Well, creating the interface in QT DESIGNER and then converting to Python is easy, the...
asked by 13.10.2016 / 04:15
0
answers

Error executing python

I'm testing a python code and I have the libraries it uses, but when I run, it gives this error:    ImportError: DLL load failed:% 1 not a valid Win32 application. The version is 64-bit. Code: import pyHook, pythoncom, sys, logging...
asked by 08.10.2016 / 18:01
1
answer

How to receive a PDF file in Django and save to a directory?

I get a file by html using type="file". <form action="/docs/enviado/" method="post">{% csrf_token %} <input type="file" accept="pdf" name = "projeto"/><br /><br /> <input type="submit" value="enviar" /> </f...
asked by 20.10.2016 / 20:43
1
answer

Sorting relationship results "ManyToManyField" with the same table in Django

I have the Many to Many relationship with the same table, and I need to sort the result with the same creation sequence. ex: add Django basics, Django intermediate, Django advanced; You have this q appears in the preview. I've already tried {% f...
asked by 28.09.2016 / 15:21
1
answer

error while using django.setup ()

I'm trying to call the django.setup() function in the django version. 1.4, I saw that it was only implemented in 1.7. Is there any function similar to the one I can update, would the solution just update django?     
asked by 13.09.2016 / 15:15
1
answer

Problems copying the package "dns" in Python

I have a problem in a script where I need to use the dns package in Python. import dns.resolver And to perform a simple DNS check: my_resolver = dns.resolver.Resolver() my_resolver.nameservers = ['8.8.8.8'] records = my_resolver.query(dom...
asked by 12.09.2016 / 22:37
1
answer

print QRcode directly printer Zebra by python

I am generating qrcodes by python, so I want to print directly to the label printer zebra, I can already print words contained in an entry, but when I try to print the qrcode of the error: code: def printQrCode(self): img = os.path...
asked by 27.09.2016 / 18:29
1
answer

Python / Django: sending emails resulting in 535 (gmail working)

I have a contact form where I send the message to the system administrator informing you about it. The email configuration information is fully verified and correct. EMAIL_HOST='mail.xxx.net' EMAIL_HOST_USER='[email protected]' EMAIL_HOST_PASSW...
asked by 26.09.2016 / 22:19