Questions tagged as 'python-3.x'

0
answers

How to access the elements of Tupla?

How to access the elements of this tuple: StringElement('24929426', attributes={'IdType': 'pubmed'}) I want to extract the attributes: '24929426' 'IdType': 'pubmed' The snippet of code that generates this output: >>> from Bi...
asked by 21.11.2016 / 15:42
1
answer

Two or more ScrollViews with background in same BoxLabel with Kivy

I'm creating a simple GUI with Kivy in Python 3x and I've had trouble putting two ScrollViews on the same BoxLabel. The way I put it, in the attached code, the items look like this: With ScrollViews But it was expected that they would lo...
asked by 24.11.2016 / 04:44
2
answers

Know the type of return of a given

I have a problem with the return type of a data in python. First I was trying: >>> type(record[0][keys[2]]) <class 'Bio.Entrez.Parser.StringElement'> I tried to check for if >>> type(record[0][keys[2]])i...
asked by 04.12.2016 / 14:28
2
answers

How to find a "div" with text "Age:" and only bring the number with bs4 and regex python3

I'm trying to extract the age value from the following tag, but from several html files with the same structure. <div class="col-md-12"> <div class="section-title line-style"> <h3 class="title...
asked by 31.10.2016 / 15:39
1
answer

Import model class attributes from another app

Good afternoon guys, I'm good, a doubt! I'm using 2 Apps in django admin App1 = Registration App2 = Controllers control I imported the app1 model, the "Person" class into the "Scholarship" class, but it only takes the "Name" attribute a...
asked by 27.01.2017 / 05:57
2
answers

How to use "for" and "while" to capture cell tags from multiple tables in an html file?

I have several HTML files that I need to capture the data inside the tables, to launch in the database, but I can not navigate the html tree to find the tags that are cells, the html is this: <div class="details"> <div class="title...
asked by 03.11.2016 / 22:10
1
answer

Implementing a TCP traceroute

I'm trying to understand the code below (found on the internet): #!/usr/bin/python3 from scapy.all import * target = input("Informe um alvo: ") destport = input("Porta de destino: ") port = int(destport) ans,unans=sr(IP(dst=target,ttl=(1,3...
asked by 11.08.2016 / 01:18
1
answer

make string append and looping 'for'

def conf_dir_exist(lines): temp = '' print(lines) #isso é uma tuple. for line_a in lines: for line_b in line_a: if(os.path.exists(line_b) != False): pass else: temp += ''...
asked by 25.07.2016 / 21:37
1
answer

Python OpenCV - Error while using drawing function

I've been able to run this code before, but now it does not work. He needs to draw a square on the video screen. Error:    Traceback (most recent call last):      File "/home/ggoulart/PycharmProjects/INTPYT_HandTracker/Main.py", line 13, i...
asked by 20.06.2016 / 18:44
1
answer

How to have Boolean results from the interaction of two lists?

How to have Boolean results from the interaction of two lists? That is: a = [1,2,3,4,5] b = [2,4] for each item in a that belongs to b return true     
asked by 13.06.2016 / 16:29