Questions tagged as 'python'

2
answers

Icon for windows with TopLevel

Within a kind of application of the style of a Text Editor, I open the typical "Help" and "About" windows. Both windows are made using the Toplevel Tkinter widget. And I would like to put an icon that appeared in the taskbar as I have done fo...
asked by 20.05.2018 / 22:32
4
answers

I need to remove some items from this list PYTHON

I need to remove from the list ( listaCoefX ) defined below the values in this format: lista=[[-2,+1,-1,+2],[-2,+2,-1,-0],[0,+0,+2,+2],[0,+0,+0,+4] This I take of the code to do what I request: listaCoefX=['-2X1+1X2-1X3+2X4', '-2X...
asked by 22.11.2016 / 21:47
1
answer

Create and plot fix of slopes between points

Good afternoon everyone, I'm trying to create an array with numpy that contains the slope between each of the points made with the arrays x e y to finally graph them with matplotlib . These are the steps that I am c...
asked by 24.01.2016 / 23:33
2
answers

Define type of variable in a function

Good, I am learning Python and I was curious, since I am new in this programming, when declaring a variable in a function, can not you specify the type of variable as if you did it normally? I want to do this but you can see that the program doe...
asked by 12.12.2017 / 10:22
1
answer

AtributeError in Pygame

In the process of executing this Pygame code, the following error appears on my terminal regardless of the corrections made to the code: AttributeError: 'naveEspacial' object has no attribute 'dibujar' How can I correct my code of this erro...
asked by 08.02.2016 / 13:06
3
answers

Django REST Framework Serializing models that have fields / relationships ForeignKey and ManyToManyFields

The challenge of this question is clear from the update 2 which is the current state of it, you can read it full to understand its context if you want :) I have the following model that I want to serialize to expose via REST class Rehab...
asked by 08.03.2016 / 16:25
1
answer

How to access the structure of this Twitter result?

I have this portion of code: use (Tweepy) firstTweet = api.user_timeline('twitter')[0] print(firstTweet.text) print(firstTweet.id) results = api.retweets(firstTweet.id) print(results) When I get the result I get the following:    [Status...
asked by 02.02.2016 / 13:56
2
answers

Extract XML data using Python

I have this code and I need to extract the comment counts from the XML data, calculate ( link ) the sum of the numbers in the file and write the sum. I would like to know which part of the code I need to enter because I had already used diffe...
asked by 25.01.2016 / 21:37
1
answer

How to use tensorflow from a docker container in a container with django? Link Containers?

I need to link two containers, my main container contains django and the secondary tensorflow, I am creating the two containers with docker-compose, both are created correctly, but I need to enter the container with django and when running pytho...
asked by 06.08.2018 / 18:37
1
answer

datetime.strptime returns 'NoneType' objects

I am trying to write a simple module to store date data from the information entered by the user: import datetime formato_dia = ("%Y%m%d","%Y/%m/%d", "%Y-%m-%d") def dia_manual(): while True: entrada_dia = input("""Escriba la fec...
asked by 06.08.2018 / 12:45