Questions tagged as 'python'

1
answer

How to transform a String list into a Float list?

If I run this code, it will give a list in string: SothatIcannotdotheaverageofthenumberscorrectly(sinceitisinstring).WhatcanIdotogetthenumberprintedinfloat/int?Doesthis"error" happen only with Python.3x? What would happen if I migrated to 2x...
asked by 23.02.2017 / 04:47
1
answer

Runtime Error in Python

I made a backtracking program in Python to find an M-size set of binary strings where any string has a distance greater than d for any other string in the set. But it does not work well when testing for n = 8. The message:    "Runtime erro...
asked by 03.03.2017 / 03:30
2
answers

Python - Module: Tkinter - window manipulation

Like every good new programmer, a lot of ideas come up in the beginning, and one of them was this: how do I manipulate the windows? How so? Remove rounded corners when running under Windows 7. change the background where the name, icon, an...
asked by 19.03.2017 / 01:59
1
answer

Problem creating the environment with django

I'm trying to create a project in virtualized environment with the virtualwrapper tool, in this environment I installed django but when trying to create a project with the command django-admin startproject meu-projeto it does not create t...
asked by 07.12.2016 / 19:14
1
answer

Help with a simple game

Well, I'm trying to make a "ball" follow the playing rectangle, however it does not seem to be happening as the "ball" kind of blurs the screen when I move the player. I already tried to solve the problem and found nothing. Previously I had t...
asked by 27.11.2016 / 20:31
1
answer

Error sending simple email with python

I'm learning to send emails with python. Right at the beginning, I came across error importing the smtplib module methods, which generated this question: Import error when sending simple email with python Then I saw that it did not give...
asked by 29.12.2016 / 16:38
1
answer

Reverse error: [closed]

in eat.txt there is the following content: 02:26:31 14:44:45 09:53:27 14:17:35 12:33:44 09:30:12 I'm reversing the order of the elements in the following way: import sys with open 'eat.txt as f: lines = f.read().strip().splitlines()...
asked by 02.12.2016 / 14:43
1
answer

Redirect and Render in Django

I have a views.py file that has the following method: def alterar(request, pk): cliente = get_object_or_404(Cliente, pk=pk) if request.method == 'POST': form = ClienteForm(request.POST, instance = cliente)...
asked by 02.11.2016 / 16:19
1
answer

TypeError: can not multiply sequence by non-int of type 'str'

My problem is this: when I run the code of an exercise it gives me an error that I do not understand why it happens.    TypeError: can not multiply sequence by non-int of type 'str' produtos = input('Lista com produtos:') quantidade = inpu...
asked by 07.11.2016 / 21:19
1
answer

Problems with accentuation - Python

Hello, I have problems with accentuation in Python. In the code I put this: # - - coding: UTF-8 - - But the accents are not recognized in cmd. Follow the print for better understanding. Thanks in advance!     
asked by 20.11.2016 / 01:09