I have a function that takes a code from the postgreSQL database and displays it set to QLabel with the function setText() .
The problem is that this code comes from the database in odd format, between parentheses and comma. Exam...
I want to generate a service order number, I have the code, but I do want it to query the last number of the service order that was generated in the database.
Follow the code:
def rangeOrdemServ(self):
db = self.conexaoBanco()...
I want to add 1 to a counter that is represented as a string. the goal is to get the sequence of numbers later. For example: from 000570370 to 000570371.
part of the code:
def rangeOrdemServ(self):
db = self.conexaoBanco()...
I'm using sqlite3 to write some data. However, by default, when a select is made, it returns the information as a list of tuples, which is considerably more difficult to work than if they were dictionaries. Example:
>>> import sqlite3...
For a school job, you need to have a menu with several submenus. What is the best way to approach this?
I can put the menus inside whiles and go giving break to those whiles when you want to go back to the previous one or separate the...
If I'm going to create a python package, I'll define a setup.py file that has something like this:
from setuptools import setup
setup(name='funniest',
version='0.1',
description='The funniest joke in the world',
url='...
I'm watching a video of python but I do not understand one thing.
I have the file utils.py
def code_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def create...
I have the following code:
import random
import socket
import time
import ipaddress
import struct
from threading import Thread
def checksum(source_string):
sum = 0
count_to = (len(source_string) / 2) * 2
count = 0
while coun...
My code is always giving "port is opened". My idea is: if the destination responds, the door is open. Otherwise, it may be filtered ...
#####################################
# Portscan UDP #
# #
#####################################
# -...
I am learning to send email in python and am encountering several problems. One of them is already in importing the smtplib module. My code is as follows:
from smtplib import SMTP
smtp=SMTP('smtp.live.com',587)
smtp.starttls()
smtp.login('my@h...