Questions tagged as 'python'

1
answer

Error using socket.recv ()

I'm learning about servers in python and I'm using the socket library. But when I use the socket.recv(1024) command for the server to read what the client sent, IDLE gives the following error:    'socket' object has no attribute 'recv'...
asked by 05.01.2018 / 18:18
1
answer

C pointers handled in python

#include <stdio.h> #include <stdlib.h> #include <locale.h> int main() { setlocale(LC_ALL,""); int *x,valor,y; valor = 35; x = &valor; y = *x; printf("o endereço da variavel valor: %p\n", &valor...
asked by 09.01.2018 / 19:04
1
answer

Remove duplicate elements from a threaded list in python

My code returns error when trying to run: class No: def __init__(self,inidado): self.dado = inidado self.proximo = None def pegaDado(self): return self.dado def pegaProximo(self): return self.proxi...
asked by 01.12.2017 / 16:10
2
answers

Doubt about the slice function

At reply this question that Guilherme Nascimento P. did, there was a question about using the slice , so far I was unaware of it, and found it at documentation I was confused. Searching here in SOpt did not find anything about...
asked by 28.12.2017 / 01:09
2
answers

Create csv table in python

I'm trying to build a table from information collected on a website. The problem is that although print comes out as expected, at the time of saving in csv file only the last record is going. Below the code snippet that is giving me a head...
asked by 26.11.2017 / 05:56
1
answer

Finalizing a project in python [duplicate]

I have some doubts about the projects created in python. If I create a program and need to pass it to someone else, will I need the other computer to have python installed and all the libs I got from outside? How do I leave the program a...
asked by 01.12.2017 / 00:21
1
answer

Creation of variables

How do I create a variable and add the type as an integer but with no value set? I need this variable to do this: a = int(input()) b = int(input()) x = int # tentei colocar o tipo da variável como inteira dessa forma, mas dá erro. if a * x ==...
asked by 17.12.2017 / 15:47
1
answer

Information exchange between Python classes

How can I exchange information between two different classes? I need to move data from one to the other. Each class is running in a different process. An example of the structure, the code is too large, so there goes an example, the only diff...
asked by 15.12.2017 / 19:20
1
answer

Dictionary running all keys instead of just one

I have in the following code I have a function that performs certain operation according to the passed parameters. Then I have a dictionary serving as a switch case, which will serve to define which parameters will be passed to the function. d...
asked by 03.11.2017 / 16:53
1
answer

Iterator should return a String

Hello, I have the following code: import csv def carregar_acessos(): X = [] Y = [] arquivo = open('acesso_pagina.csv', 'rb') leitor = csv.reader(arquivo) next(leitor) for home,como_funciona,contato,comprou in leito...
asked by 13.11.2017 / 23:52