Questions tagged as 'python'

1
answer

Discover link in python

I am doing a web scrapping in python and sometimes I come across some links and / or buttons that are not with the actual URL of the url so that you will be redirecting if you click. In this case, if I click, it downloads a PDF file, but I j...
asked by 27.09.2016 / 21:44
1
answer

Return the position of a word in a string

Can anyone help me with this question? def fileRead(file): txt = open(file) print(txt.read()) def index(filepath, keywords): with open(filepath) as f: for lineno, line in enumerate(f, start=1): matches...
asked by 21.09.2016 / 22:46
2
answers

how to save objects in django with quantity validation?

I'm still a beginner on Django and would like to know how I would save a certain amount of students on jobs. Example: vagas = 5 , how do I allow only 5 students to be saved? class Turma(models.Model): descricao = model...
asked by 22.11.2016 / 13:55
1
answer

Capturing date from QDateEdit

I need to get the date of a QDateEdit . I made the designer using Qt Designer, in properties enabled calendarPopup and displayFormat to dd/MM/yyyy . I want to capture this date to insert into a query. I've tried us...
asked by 25.10.2016 / 01:57
1
answer

How do I allocate a Python project (Django) to a ready and configured server? (Apache, MySQL, Python, Django OK)

I have a server ready and fully configured. Python, Django, Apache, MySQL, all OK. I would like to replicate an existing project on this server for testing. The files and database are already replicated, however, when accessing the project fo...
asked by 24.08.2016 / 15:33
1
answer

TypeError: split () missing 1 required positional argument: 'string'

One more basic question on my part. I am 'Pythonista' super basic level and am trying to simply read a text line by line and make a split each time I find a punctuation mark or a space. I tried this: import re with open('est.txt', '...
asked by 16.10.2016 / 13:03
1
answer

How do I get an argument in Web2Py

I have the following problem, I am producing an application in W2P, with a CRUD, in the part of deleting an item I am wanting to get the id through a form and that id remove the item from the DB. I'm trying through this code def off ():...
asked by 13.10.2016 / 23:41
1
answer

Problems with Frames in Python

I'm doing a college job, and I'm having a hard time messing with Frames , more precisely I need to build the graph below. In the code, you walk through it from EAST, WEST, NORTH and SOUTH commands, but for example when I am at 3 and...
asked by 12.09.2016 / 02:47
1
answer

How to identify an http (500) error via selenium web driver or javascript

I need to mount a script that will scan certain pages and find http errors, specific to 500. I thought about doing a selenium script, but I do not know a command that I can "read" this type of error. Can anyone tell me if selenium has any comman...
asked by 10.09.2016 / 05:03
1
answer

Sending a payload with scapy

from scapy.all import * ip = IP(dst = "192.168.1.1") tcp = TCP (dport = 80, flags = "S") raw = Raw(b"Olaa") pkt = ip/tcp/raw sr(pkt) ans,unans = sr(pkt) I'm learning how to use Python Scapy. I could not understand what is raw. Why to se...
asked by 12.08.2016 / 22:54