Questions tagged as 'python'

4
answers

Find and delete different characters between strings

lst1 = ["carro"] lst2 = ["carroa", "carrooao"] How do I check if the word in lst1 exists in some substring of lst2. If there is a delete of the surplus characters of the word that has the substring, making the string in lst2 equal to that of l...
asked by 05.07.2017 / 22:12
2
answers

How to transfer table data to python?

Hello, I have a table with lots of data, a lot of Astrophysics data, tables with approximately 20 columns and more than 1000 rows. I need to send this table with this data (contained in the columns and rows) to python 2.7 in my linux but I can n...
asked by 13.10.2016 / 21:53
1
answer

How to read two integer variables on the same line? [closed]

How to read two integer variables on the same line with Python? a= int(input()) b = int(input())     
asked by 08.08.2016 / 03:42
1
answer

Given two IP's can you check if it comes from the same network?

I'm starting with Python now and I'm developing a project to find users with multiple accounts on a given site. The IP's are already obtained, but it is still not possible to verify if, comparing the IP's, two or more IP's come from the same com...
asked by 05.01.2018 / 23:38
1
answer

Time between two dates [duplicate]

How do I know the amount of time in days, hours, and months between two dates using Python? For example, to know how many days, months and years there are between 11/22/213 and 3/25/2014.     
asked by 07.08.2018 / 02:47
4
answers

Finding certain text in a string

Hello, I have a question. nome=str(input('Qual o seu nome completo?')) print('Seu nome tem Enzo?{}'.format('Enzo' in nome.lower())) I have this code that it checks without having a certain string inside the other, the problem is I want it t...
asked by 04.05.2018 / 20:05
4
answers

Turning a numeric string into a list of numbers in python

I need to turn an entry into a list. The entry has the following form: ['[11, 14]', '[8, 17, 18, 24, 29, 37, 44, 49, 51, 55, 62, 63, 64, 76, 82, 84, 93, 97]'] is read from a csv file. Note that it is composed of two strings...
asked by 03.09.2018 / 02:31
2
answers

Python prefix in string

I made a script to download an attachment from an email, this attachment is an XML file, and I want to save it to a database. But when I get the body of the XML, it comes with the prefix 'b' and therefore the error when saving the XML in the dat...
asked by 09.04.2018 / 20:49
1
answer

Routes with flask

I'm trying to separate the functions of your routes, creating only one file for the routes and one file for each function, but when I try to call that function file on routes it does not find it: routes.py: from controllers.index import ind...
asked by 02.05.2018 / 15:03
1
answer

how to make the function follow a sequence?

def fnum_aleatorio(): a=22695477 b=1 m=2**32 semente=3 num= semente num_aleatorio = (num*a + b)%m if num_aleatorio <= m//2: return 0 else: return 1 I have this function, I want it to retur...
asked by 26.03.2018 / 20:41