Posts by Renato Cruz • 483 points
22 posts
-
1
votes1
answer308
viewsA: I have a Scrolledtext with Tkinter, and would like a command to fetch words that would be inside it
The "commando" that you are looking for is the method search() which has the parameters: search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None,…
-
0
votes1
answer354
viewsA: Importing values from other codes in Tkinter - python
Based on your example code one of the possibilities would be: First screen: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """teste_interface1.py""" import tkinter as tk import teste_interface2 def…
-
2
votes1
answer8005
viewsA: How to create a python function to connect sql server?
I did some more tests and I really only managed to simulate the same mistake you did when I installed the ODBC Driver for SQL Serve in the wrong version: When I install the driver in the latest…
-
0
votes1
answer1528
viewsA: Python 3 Tkinter: How to get a value/string from a Radiobutton inside a function?
Hello @Mikalayla, the problem is that when creating the new screens used Tk(). By concept Tk() sets its main window, for other screens it is interesting to use Toplevel(). I didn’t make any major…
-
1
votes1
answer830
viewsA: Python: Tkinter + SQLITE. Save records to database and clear field
You just need to add a method to perform these operations: def salvar(): email = cxtexto1.get() senha = cxtexto2.get() usuarios.cria_bd(email, senha) cxtexto1.delete(0, END) cxtexto2.delete(0, END)…
-
2
votes1
answer293
viewsA: Python Error SQLACHEMY
Maybe you should use the SQL Server ODBC driver in place of sql Native client. To know if you have the driver installed run: print([x for x in pyodbc.drivers() if x.startswith('ODBC Driver 17 for…
-
1
votes2
answers926
viewsA: limit the number of digits Entry - Tkinter
An example using the parameters validate and validatecommand widget Entry(): #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Limitar quantidade de caracteres do entry().""" from tkinter import *…
-
2
votes1
answer267
viewsA: Manage Gtk+ window swapping
Analyzing your code and making no major changes, I believe that one of the ways to switch between the screens is. Filing cabinet Loginwin.py: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Python…
-
1
votes1
answer23
viewsA: Coding problem A u015bvagho u1e63a (Python3)?
Some modules that can perform this encoding: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """html encoding (Escaping HTML)""" import cgi import html from urllib.parse import quote_plus string =…
-
1
votes1
answer698
viewsA: Python Connect Sql With user and "token"
I perform the connection between Sqlalchemy and MS SQL Serve with the following string: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """SQLAlchemy + MS SQL Server. - {SQL Server} - SQL Server…
-
1
votes1
answer329
viewsA: How do I make a button draw something new on a screen with Tkinter?
The way your code is structured the canvas widget is being passed to the method as argument, in this case you will have to use an anonymous function (lambda) in the parameter command (callback)…
-
0
votes1
answer324
viewsA: How to use Sleep for a Tkinter graphical interface loading effect
Basically the Python interpreter is reading line by line of your code, when it reaches the line of sleep() it stands still until the time that has been spent is over (notice that the window does not…
-
0
votes2
answers1130
viewsA: Problems with using include in Django
In your file cliente.urls create a variable app_name='cliente'. Example: """Arquivos urls.py que está em cliente""" from django.urls import path from . import views app_name='cliente' urlpatterns =…
-
1
votes1
answer1976
viewsA: Create a mini CRUD (basic) in Python Tkinter
An example code based on the image you posted, however I didn’t follow your base code. It is worth noting that I sought the simplest solution and not the most optimized. All the code is in one…
-
1
votes1
answer1152
viewsA: Python webdriver Selenium does not find the item on the page after loading
The way you are creating the element with Jquery is not creating the attribute id. If you give a inspect element or display page source code you will see that the new element is without id. Example:…
-
2
votes1
answer177
viewsA: Draw picture centered vertical line
Example using Pillow: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Desenhar linha em uma imagem. Utilizando o Pillow: .. code-block: pip install pillow Os valores que devem ser passados para…
-
0
votes1
answer908
viewsA: How to generate a python executable program
Depending on the application programs like cx_Freeze and PyInstaller are usually good options to generate executables: Cx_freeze http://cx-freeze.readthedocs.io/en/latest/ Pyinstaller…
-
1
votes2
answers2891
viewsA: Python and Access
Start by checking if you have the Access driver installed: #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Verificando se o driver está instalado""" import pyodbc print([x for x in…
-
0
votes1
answer441
viewsA: How to clear the fields of a form in Django
I believe that after the POST is departing from his index and redirecting to itself index (type one single page application). If that’s it you should be sending the form you received the…
-
0
votes1
answer127
viewsA: Problem presenting date in Qtablewidget in python with Pyqt5
Use the toString() to display. Ex: #!/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5.QtCore import QDate # Exibindo a data que foi passada para o QDate(). print(QDate(2018, 7, 7).toString())…
-
0
votes1
answer419
viewsA: PYMSSQL - error
It is a disuse warning (Deprecationwarning) of the collections, this alert has now started in version 3.7 of Python. https://docs.python.org/3.7/whatsnew/3.7.html#id3 Collections In Python 3.8, the…
-
0
votes2
answers941
viewsA: help with storing value of a local variable in python
The way it is structured does not facilitate consultations at the bank. As I do not know the structure of your table we will try to simulate. Following as an example the following table: BEGIN…