Questions tagged as 'python'

1
answer

Error in pycharm

Good morning, In the following example, And I'm experiencing the following error in pycharm: /home/brito/projetos/venv/saj_projects/bin/python /home/brito/projetos/saj_projects/exemplos/me/impressao_tratamento.py Traceback (most recent...
asked by 10.07.2018 / 17:09
0
answers

Is the SSL Direct Request Text CONNECT or GET? (Python + Socket + SSL)

# -*- coding: utf-8 -*- import socket, ssl, threading, select def conecta(c, a): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('123.456.789.123', 444)) s = ssl.wrap_socket(s, ssl.PROTOCOL_SSLv23) c.recv(8192)...
asked by 05.07.2018 / 05:47
1
answer

help with storing value of a local variable in python

Hello, well, I'm writing an application using SQLite and Python, everything was running fine until I had a problem that I can not solve, I happen to have a db of fipe, so I need to load 3 combobox with brand, model and year , then I decided to do...
asked by 02.07.2018 / 04:43
1
answer

___ ___ erkimt Python - Tkinter - Dynamic CheckButton not take the value of the variable when referenced from another file / screen ______ qstntxt ___

I'm having the following problem: I can get the value of a dynamic variable (checkbutton) when the whole program is in a single file with only one function:

%pre%

However if I separate the code into two files, each one on a screen and two modules, I can only get the 0 values of the checkboxes:

File 1: TwoWindows2

%pre%

File 2: TwoWindows2

%pre%

Can anyone help me with this?

    
______ azszpr313528 ___

Variables from the other file can be accessed normally if you import the other file - but not with the %code% syntax, and use the filename as a prefix:

For example, you could put all the variables in a file name %code% and use a line like this

%pre%

And inside that file you can access the variables with %code% and so on.

Your code is pretty messy, but sometimes doing is the only way to learn - I recommend a third file, why else can you to fall into a problem of circular import dependency, the way it is working.

Another note: The keyword "global" only makes sense within functions - and says that those variables within the function will be visible in that module (file) - (and thus will be visible from the other files using the form prefix, as I showed above): using "global" inside classes and outside functions does not make sense. (It would even make a difference, but one has to know a lot Python to know exactly what it is doing, and even then, it would hardly be the right way to do anything.)

    
___

I'm having the following problem: I can get the value of a dynamic variable (checkbutton) when the whole program is in a single file with only one function: import string from tkinter import * import tkinter as tk qtdvinhos = 3 linhacheck = 1...
asked by 11.07.2018 / 03:02
0
answers

Use of the term Exit () in Python [duplicate]

As I still have little knowledge in Python, I would like to know what is the use of exit () in a program? If possible, give me an example so that you could test in practice.     
asked by 28.06.2018 / 06:13
1
answer

Importing Module Inside Python3 Module

There are the following folders: └── Programa/ ├── main.py <----- Inicio esse... ├── bin/ | └── config.py <----- esse importa o db.py └── database/ ├── __init__.py └── db.py In t...
asked by 06.07.2018 / 08:57
1
answer

Using screens in Tkinter-Python

Is everything okay with you? So, I'm doing a screenshot program, its function would just be a test consisting of: Open a screen (called by a button) and close the one that was open. I do not know how to do this, I have tried to use repetition lo...
asked by 06.07.2018 / 04:35
0
answers

What does transition band mean in bandpass filters?

Hello, I'm working on a bandpass filter in python, and while searching I found this link , in which it states a code variable: "b is the transition band also as a function of the sampling rate" What does this mean? And how would one for a...
asked by 28.06.2018 / 00:48
0
answers

I can not execute the code because PyCharm says that the App class was not created

PyCharm says that the App class has not been defined, but that does not make sense since I created the App class. from tkinter import * class App: def __init__(self,master): frame = Frame(master) frame.pack() Label(...
asked by 27.06.2018 / 04:41
2
answers

Flask SqlAlcheny TypeError: 'Fermentables' object is not iterable

In model FermentableTypes : class FermentableTypes(db.Model): __tablename__ = "fermentable_types" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(50)) desc = db.Column(db.String(255)) def __s...
asked by 25.06.2018 / 15:36