Questions tagged as 'python-3.x'

1
answer

how do I focus on the open tkinter toplevel?

In the Help menu, I'm opening how many windows I click to open, this was not supposed to happen. I tried to adapt something from this post: Tkinter focus on a window bypassing the behind? , but I could not, it's the same problem practically....
asked by 25.01.2018 / 20:21
1
answer

Writing codes with python 3

I am currently working on a project, where in one of the functions the script has to write a certain code that was generated from parameters chosen by the user, however after having generated such a code and added the same code file, I noticed t...
asked by 27.01.2018 / 11:01
1
answer

Using variable in the chdir function (OS module)

Is it possible to use the data given in a variable in some other function other than the chdir () of the Python OS module? I noticed that it is not possible to use variables in directory exchange using this method. Was there another of the...
asked by 28.01.2018 / 05:43
0
answers

Doubt tkinter python

   This code creates a button for each image in the list, how do I create a command that opens a file for each button. coluna=0 linha=0 lista = ["coisa.png", "guerra.png", "mundo.png", "universo.png", "impacto.png", "guerra2.png"] for...
asked by 21.01.2018 / 00:08
0
answers

I need to include data from a list in a Django form as Default

I want to display a form in the template already with the variables {{n}} of a list. How to do? {% if forloop.counter == 3 %} {% for n in campos %} {% if forloop.counter == 3 %} <div class="form-group{% if field.error...
asked by 20.01.2018 / 20:28
0
answers

IndexError: list index out of range

I've looked in other questions, and apparently none have the answer, sorry if something is wrong or if you need more information, I'm new. def seleciona(self): self.posicao = self.mostrar.curselection() if self.posicao[0] == '':...
asked by 20.01.2018 / 23:24
1
answer

Forms in Python

I needed a help with cgi forms in python. This code works normally when I do not enter accents: # !/Programas/Python36-32/python # -*- coding: utf-8 -*- import cgi print("Content-Type: text/html; UTF-8\n") form = cgi.FieldStorage() web_page=""...
asked by 21.01.2018 / 14:26
1
answer

OpenCV problems (python3 and ROS)

I'm using ROS for a project in college, but when I try to use python 3 to call opencv, this problem occurs "ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type"  I've been trying to resolve for almo...
asked by 13.01.2018 / 22:40
1
answer

Create a file in Python 3

I want to build a function in Python 3, which gets a name from a text file as a parameter and creates a new .txt file, named double.txt, which is the copy of the first one. How do I do this?     
asked by 10.01.2018 / 16:03
1
answer

Input in lists

I have to receive input (10 integers) from the user and put them in a list but not allow repeated numbers to be entered. I tried but the program if you see that the numbers are repeated does not enter any number v = [ ] for i in range(0,10):...
asked by 08.01.2018 / 19:56