Questions tagged as 'python'

1
answer

Perform x simulations and collect the data in a CSV file

I would like to know how to perform 1000 simulations of the following code and collect all the output data in a CSV file containing two columns (l1, l2) and eight rows (ABCDEFGH) with the respective frequency of appearance of the letters a lengt...
asked by 03.01.2017 / 12:02
1
answer

Overwriting rows with python

Someone who knows how ???? I share with you the code au revoir . import csv def leer(): m1=open("archivo1.csv","rb") m1_csv=csv.reader(m1) var = "" for i,x in enumerate(m1_csv): lista0 = x[0:1] lista1 = x[1:...
asked by 22.07.2016 / 22:03
1
answer

Error when trying to filter data in Django?

The problem that shows me when trying to filter data with django I get this error: my view is as follows: # -*- coding: utf-8 -*- from functools import reduce from django.contrib.messages.views import SuccessMessageMixin from django.c...
asked by 11.04.2016 / 07:27
1
answer

Error method name not found

Error:    Traceback (most recent call last): File   "C: \ Python27 \ data \ listener.py", line 94, in       back_dir (os.getcwd ()) NameError: name 'back_dir' is not defined Class that I am using: class back(): def back_dir(self,cur...
asked by 01.08.2016 / 22:20
1
answer

Error installing Pyhook module

By using the following command: py ok.whl install I get this error:    C: \ Python27 \ python.exe: can not find ' main ' module in 'ok.whl'     
asked by 31.07.2016 / 03:27
1
answer

Show errors when you run a Python script from php with system, in a shared hosting

I'm running a Python script from php like this,    $ mystring = system ('python test.py', $ retval); and it works, only that I would like to be able to see the errors of the Python script. It's possible? The "print" of Python for example...
asked by 04.08.2016 / 15:43
1
answer

Fix spaces and uppercase

I continue with my problem. I have to correct a text, first count the words and all that, that I have it well done (thank goodness) but now comes the part of: -more than two spaces is not allowed, it can be tabulated if desired, but two spaces,...
asked by 05.01.2019 / 12:05
0
answers

Scrapy extracts the url partially

My Scrapy spider works on everything, but extracting the url through xpath @href does not extract the complete url, always missing the final part of the url from the "? ......." sign which marks the variable GET of the url. Does anyone know if S...
asked by 05.01.2019 / 20:14
0
answers

How do I send a ssh script on my html page?

I have an HTML page that I want one of the buttons to send a ssh script to a mikrotik team, my questions are the following language I use, in case python is how I add that code to that button that I already created or if I have to rewrite my cod...
asked by 01.01.2019 / 18:53
0
answers

How to make a remote command console

I am trying to make a command console from a website that when writing a command in the console (Windows) returns what is printed on the screen but in the same website, what I need is that it is interactive, that when pressing enter or some butt...
asked by 03.01.2019 / 16:19