Questions tagged as 'python-3.x'

1
answer

TypeError: not all arguments converted during string formatting

def reduce(self,a,b): self.dividend =a self.divisor = b if(a != 0 and b != 0 ): if(a > b): self.dividend = a self.divisor = b else: self.dividendo = a self.divisor = b while(a %...
asked by 29.04.2017 / 23:24
1
answer

How to set email as username in django

I have the following code to create a custom User: from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,UserManager class User(AbstractBaseUser,PermissionsMixin): username = models.CharField('Nome de Usuário',max_len...
asked by 28.03.2017 / 14:11
1
answer

String Equivalent Using Variables - Python 3.x

What would be the equivalent of the string: values = """ { "exchange_code": "PLNX", "exchange_market": "BTC/USDT" } """ What the result is:   \ n "\ n" \ n "\ n" \ n "\ n" \ n " Entering "PLNX" and "BTC / USDT" as variables,...
asked by 23.03.2017 / 21:40
0
answers

Table of distances google maps api and python

Hello, I'm using the Maps API to check the distance between two points, so I have two local.csv files and .csv coordinates. The final goal is to know the distance of the locations for each of the coordinates. If there are 3 locations an...
asked by 28.04.2017 / 17:55
0
answers

Extracting source and destination IP to verify that the server has become dead after attack

from scapy.all import * from collections import deque def print_attack_measure(pcap_file): plist = rdpcap(pcap_file) server_ip = "192.168.1.5" n = 300 d = deque(maxlen=n) # If you want source/destination IP addresses get...
asked by 15.03.2017 / 03:33
2
answers

How to separate the digits of an integer and add them to each other? - Python

How to separate the digits of a number and add them, for example: 123 - > 1 + 2 + 3 = 6 How to do this, however, do this using arithmetic operators. I saw a case where it was separated using operations with "//" and "%", but I did not quit...
asked by 21.04.2017 / 04:25
0
answers

Converting Web Scraper from Python 2.7 to 3.5

Good afternoon everyone! It is as follows: I found a script in Python 2.7 but I have version 3.6. As I am new in this scope, I wanted to work manually to convert this script. Here is the code below: ### Modified for naming pics by tag impor...
asked by 28.03.2017 / 21:18
0
answers

Error installing a library in Python 3.6 on windows

Good evening. My question is very objective and direct. I'm trying to install a library in python 3.6 on windows 10 64 bit. However, the following error is occurring: To install I'm using pip install pocketsphinx the library is the pockets...
asked by 26.07.2017 / 23:00
0
answers

How to establish a P2P connection?

In a normal connection, it is necessary that whoever is going to receive the connection has an open port on the router (transmitting to a computer on the internal network). But in a P2P connection this does not happen. How do P2P programs wor...
asked by 03.03.2017 / 01:57
1
answer

Problem in the sublime to run code in python

Decode error - output not utf-8] [cmd: [u'python', u'-u', u'C:\Users\Rosangela\Desktop\Leo\Estudo\Exercicios_Python\teste14.py']] [dir: C:\Users\Rosangela\Desktop\Leo\Estudo\Exercicios_Python] [path: C:\Program Files (x86)\CollabNet;C:...
asked by 12.06.2014 / 04:15