I'm trying to find a method for logging user actions in my python application (not keylogging a user's entire machine at all times). Is there a python library for this?
In my previous post I stated that my variable would not change whenever I added something to it. Here is my current code and my problem will be below it. #creates random monsters with xp points, leveling up player, and adding upgrades #imports from c
I am creating a csr sparse array (because I have a lot of empty elements/cells) that I need to use forwards and backwards. That is, I need to input two indices and get the element that corresponds to it ( matrix[0][9]=34) but I also need to be able t
I am not seeing an answer to this out there, so apologies if this is a duplicate. Basically, I am trying to understand how to force my interpreter (2.7) to import a module from site packages if there is a conflict. For example imagine you are running
I am trying to figure out why sympy.diff does not differentiate sympy polynomials as expected. Normally, sympy.diff works just fine if a symbolic variable is defined and the polynomial is NOT defined using sympy.Poly. However, if the function is defi
I'm new to Python coming from excel. I want average for a list but for each new item. For a list: x = [-3.2, 2.7, -8.5, -1.4] I've tried: avg = sum(col)/len(col) And that gives a result of -2.6, which is the whole column divided by whole count. I wan
I'm trying to solve a large number (50) of non-linear simultaneous equations in Julia. For the moment I'm just trying to make this work with 2 equations to get the syntax right etc. However, I've tried a variety of packages/tools - NLsolve, nsolve in
I have a python program that processes serial data as it comes in and sends data back out. I now need a separate python program that only monitors needs to use the same serial port as the other program, and it will not respond only monitor. Any idea
I have started using Scikit-learn and I am trying to train and predict a Gaussian Naive Bayes classificator. I don't know what I'm doing very well and I would like if someone could help me. PROBLEM: I enter X quantity of items of type 1 and i have as
This question already has an answer here: All combinations of a list of lists 3 answers Is there a math nCr function in python? [duplicate] 2 answers I have two tuples: t1 = ('A', 'B') t2 = ('C', 'D', 'E') I wonder how to create combinations between
I'm new to the Django development platform. I have been struggling to create a basic file upload app in Django 1.8.2 (latest version). I could not find any up-to-date example/snippet. So I appreciate if you could post here or refer me to a minimal bu
I have tried to create a 2 row, 3 column grid of plots (each having multiple data plotted on it) using matplotlib. However, no matter what I try, the final saved figure is just one of the plots, with the rest blank. I know the other were produced, bu
I have some code containing an iterator, which works well: import multiprocessing m = [0,1,2,3] class gener(object): def __init__(self, m): self.m = m self.c = 0 def __iter__(self): return self def next(self): time.sleep(1) ret = self.m[self.c] self.
actually my problem is the same as this one and the answer already brought me very much forward. (Summary: I want my python script running on every incoming email with a certain subject and extract data from the content.) Anyways I'm a complete newby
import copy class ListNode: def __init__(self, x): self.val = x self.next = None class Stack: def __init__(self): self.data =[] def push(self,x): self.data.append(x) def pop(self): if not self.isEmpty(): val=self.data.pop() return val def isEmpty(sel
import random score = int(0) q1 = ("Work out the answer. 45 + 46 = ") q2 = ("Kai buys a pair of shoes for £31 and a shirt for £67. Altogether, he spends £") q3 = ("Work out the answer. 68 - 29 = ") q4 = ("A bike normally
My problem is when I query my database like so upperBound.extend(cursor.execute(queryUpper, ['SN00010', '2015-05-07 22:16:00.810']).fetchall()) Where queryUpper grabs the upper bounds column from the database and ['SN00010', '2015-05-07 22:16:00.810'
So I'm trying to write a python function that takes in two arguments, n and num, and counts the occurrences of 'n' between 0 and num. For example, countOccurrences(15,5) should be 2. countOccurrences(100,5) should be 20. I made a simple iterative sol
For example, I've got a string like: 'blah blah 1.344 blah 1.455' and a list like: [2.888, 4.033] I know that the string and the list contain an equal quantity of numbers and want to replace all the numbers in the string with the numbers from the lis
This question already has an answer here: Getting computer's utc offset in Python 4 answers I need to discover the timezone offset in seconds from UTC. Here's what I am trying now: timeZoneSecondsOffset = calendar.timegm(time.gmtime()) - calendar.tim