Questions tagged as 'python'

1
answer

Problem with relative links in Scrapy [closed]

I want to raise the complete news of the links that appear on the cover of an informative site. But the links are relative The site is link And the links look like this <div class="article-title"> <a href="/v2/arti...
asked by 10.07.2016 / 01:26
1
answer

Doubt with Pyserial on Mac

My problem is this, I just bought a MacBook Pro computer, I used to use Windows 10 to do Python practices, connecting it to Arduino using the Pyserial which was included in the Pycharm program. Now that I am suando Mac the program...
asked by 15.07.2016 / 04:17
1
answer

Storing ManyToMany fields in a forms.ModelForm form

I am building a form based on some models in one of which I have attributes with ManyToMany relationships to others. The situation is as follows: Model CorporalSegment class CorporalSegment(models.Model): SEGMENTO_HOMBRO = 'Hombr...
asked by 19.07.2016 / 04:47
1
answer

How can I store a data from a column of a sqlite database in a variable using Python?

I have a problem I am trying to get a value from a database in sqlite3 using python: import sqlite3 #Conexion a la base de datos con = sqlite3.connect("basededatos.db") cursor = con.cursor() #Comprobar conexion a base de datos cursor.execute...
asked by 23.08.2018 / 12:54
0
answers

Django required () got an unexpected keyword argument 'username'

Urls.py: from django.urls import path from .views import login, logout, signup, edit_profile, profile_view app_name = 'accounts' urlpatterns = [ path('login/', login, name='login'), path('logout/', logout, name='logout'), path('s...
asked by 29.09.2018 / 15:47
0
answers

Random map with Python3 pygame module

I'm creating a Roguelike style game with the pygame module. The problem I have is that I do not know how to continue the code, the maps are drawn in a txt file with characters (# = door,. = Empty, 1 = wall and p = character) I only managed to pu...
asked by 30.09.2018 / 00:15
1
answer

Collect value from Gtk Dialog with Python

You see, I'm doing an indicator for Ubuntu and I wanted to implement a Preferences window. Since I have no idea about Python, after a lot of effort and a lot of reading of documentation I have managed to create a small window such that:...
asked by 20.05.2016 / 12:12
1
answer

Locate a service through python nmap

I need to obtain from a certain subnet, for example 10.0.0.0/24, the ip's that are running a specific service: Ex: I need to know what the 'telnet' service is running, and he will return the ip that service is running. this through python-nmap,...
asked by 19.05.2016 / 09:07
3
answers

How to capture parameters sent by the GET method?

This is the way I use but I do not get to capture the parameter in the controller enters the else but does not capture: def get(self, request, *args, **kwargs): if request.method=='POST': print "rrr" * 99 else:...
asked by 19.05.2016 / 01:04
2
answers

Replace commas with points in a dataframe (comma as decimal separator)

I'm new to pandas and I have a question about changing points by commas in Python 2. The numbers in the csv are presented this way: As you can see in the image, the floats have different number of decimals. First I tried to change...
asked by 22.07.2018 / 06:07