text stringlengths 226 34.5k |
|---|
Sublime Text 3-Anaconda openCV docstring not working?
Question: I'm using the Anaconda plugin in Sublime Text 3. Everything was working
exactly as I expected. I love Docstring. It worked great and saved me a lot of
time.
But when I tried `import cv2`, cv2 was not on the autoComplete list.
AutoComplete and docstring wo... |
How to install firefoxdriver webdriver for python3 selenium on ubuntu 16.04?
Question: I installed python3-selenium apt package on Ubuntu 16.04. While installing,
got a message:
Suggested packages:
chromedriver firefoxdriver
The following NEW packages will be installed:
python3-selenium
... |
cairosvg installed but ImportError
Question: I just installed cairosvg and it seems to have worked. If i try to install
again it says:
> $ pip install cairosvg
> Requirement already satisfied(...)
But if I try to import it in python3, it delivers an ImportError:
> >>>import cairosvg
> Traceback(most recent cal... |
Do locally set Cython compiler directives affect one or all functions?
Question: I am working on speeding up some Python/Numpy code with Cython, and am a bit
unclear on the effects of "locally" setting (as defined
[here](http://docs.cython.org/en/latest/src/reference//compilation.html) in
the docs) compiler directives.... |
Python Flask Login login_required redirecting
Question: I am working on a Flask app and using Flask-Login for authentication.
Everything is set up and running. However when the user logins in and attempts
to visit a page that requires login, they are redirected to the login page.
When watching the console, I get a 200... |
regex - swap two phrases around
Question: Python 3. Each line is constructed of a piece of text, then a pipe symbol,
then a second piece of text. I want to swap the two pieces of text around and
remove the pipe. This is the code so far:
p = re.compile('^(.*) \| (.*)$', re.IGNORECASE)
mytext = p.sub(r... |
Python3 always shows ImportError message
Question: Whenever I try to run a script the python interpreter always shows an
`ImportError` message such as (e.g.) `No module named 'setuptools'`. So, I
tried install (or to satisfy this requirement) with `apt-get`... I do this for
both Python 2.7 and Python 3.5 until `Require... |
import hooks (custom module loaders) for pypy do not work
Question: I'm successfully able to create import hooks to load files directly from
memory in python2.7. The example I used was the accepted response to this
question:
[python:Import module from
memory](http://stackoverflow.com/questions/14191900/pythonimport-mo... |
python multi inheritance with parent classes have different __init__()
Question: Here both `B` and `C` are derived from `A`, but with different `__init__()`
parameters. My question is how to write the correct/elegant code here to
initialize self.a,self.b,self.c1,self.c2 in the following example? Maybe
another question ... |
How do I configure Read the Docs to use sphinx-autodoc-annotation?
Question: I'm using sphinx-autodoc-annotation to read the function annotations in my
Python code and use that to generate the appropriate expected argument types
and return types. It's working great on my local machine, but I had to `pip
install sphinx-... |
Python code won't run?
Question: Hello i was wondering why this code will not run,thanks.
count = 0
finished = False
total = 0
while not finished:
number = int(input("Enter a number(0 to finish)"))
if number == 0:
finished = True
else:
t... |
Under what condition does a Python subprocess get a SIGPIPE?
Question: I am reading the the Python documentation on the Popen class in the subprocess
module section and I came across the following code:
p1 = Popen(["dmesg"], stdout=PIPE)
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
p... |
Python Pandas subsetting based on Dates
Question: I got a dataframe (using pandas) which contains the following fields:
1. Datesf-----------Price
2. 02/08/16 17:28--10
3. 02/08/16 17:29--20
4. 02/08/16 17:30--30
5. 03/08/16 09:00--40
6. 04/08/16 09:00--50
I am trying to subset the data frame into new data... |
Run unit test code from zip file
Question: I followed this tutorial to create a self contained python application.
<http://blog.ablepear.com/2012/10/bundling-python-files-into-stand-alone.html>
What I would like to do is create a unit test application within a similar
self contained application and, in addition, have ... |
Splitting strings in python using import re
Question: Why does this work:
string = 'N{P}[ST]{P}'
>>> import re
>>> re.split(r"[\[\]]", string)
>>> ['N{P}', 'ST', '{P}']
But this don't?
>>> re.split(r"{\{\}}", string)
Answer: You have to do this:
... |
Python/Requests: Correct login returns 401 unauthorized
Question: I have a python application logs in to a remote host via basic HTTP
authentication. Authentication is as follows:
def make_authenticated_request(host, username, password):
url = host
r = requests.get(url, auth=(username, pa... |
Python automate key press of a QtGUI
Question: I have a python script with the section below:
for index in range(1,10):
os.system('./test')
os.system('xdotool key Return')
What I want to do is to run the executable ./test, which brings up a QtGUI. In
this GUI, a key press prompt buto... |
Python Mathematical signs in function parameter?
Question: I would like to know if there is a way to add math symbols into the function
parameters.
def math(x, y, symbol):
answer = x 'symbol' y
return answer
this is an small example what I mean.
**EDIT: here is the whole proble... |
How to refresh multiple printed lines inplace using Python?
Question: I would like to understand how to reprint multiple lines in Python 3.5.
This is an example of a script where I would like to refresh the printed
statement in place.
import random
import time
a = 0
while True:
... |
Import Winreg in a Python Script
Question: I am currently working on a Jenkins freestyle job and one of the build steps
is to run a Python script. I have been working on this job for a couple of
days now and this is one of the last build steps needed to finish it off. I
have reached a point where I get an error letting... |
setup.py console_scripts entry point does not resolve import
Question: I have following setup.py:
from setuptools import setup
from distutils.core import setup
setup(
name="foobar",
version="0.1.0",
author="Batman",
author_email="batman@gmail.com",
packages... |
Basic Bar Chart with plotly
Question: I try to do a bar charts, with this code
import plotly.plotly as py
import plotly.graph_objs as go
data = [go.Bar(
x=['giraffes', 'orangutans', 'monkeys'],
y=[20, 14, 23]
)]
py.iplot(data, filename='basic-... |
python google app engine stripe integration
Question: I am working on a project in which i want to integrate stripe for payments. I
am following their documentation to integrate it in python [Stripe
Documentation](https://stripe.com/docs/charges). In documentation they
downloaded the stripe library to use it. The code ... |
Change the width of the Basic Bar Chart
Question: I create a Bar Chart with matplotlib with :
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
objects = ('ETA_PRG_P2REF_RM', 'ETA_PRG_VDES_RM', 'ETA_PRG_P3REF_RM', 'Python', 'C++', 'Java'... |
Python classes: method has same name as property
Question: I'm constructing a class Heating. Every instance of this class has the
property 'temperature'. It's mandatory that Heating also supports the method
temperature() that prints the property 'temperature' as an integer.
When I call the method temperature() I get t... |
Function within while loop not running more than once
Question: I am writing a small game as a way to try and learn python. At the bottom of
my code, there is a while loop which asks for user input. If that user input
is yes, it is supposed to update a variable, encounter_prob. If encounter_prob
is above 20, it is supp... |
How do I connect a PyQt5 slot to a signal function in a class?
Question: I'm trying to set up a pyqt signal between a block of UI code and a separate
python class that is just for handling event responses. I don't want to give
the UI code access to the handler (classic MVC style). Unfortunately, I am
having difficulty ... |
Scrapy spider does not store state (persistent state)
Question: Hi have a basic spider that runs to fetch all links on a given domain. I want
to make sure it persists its state so that it can resume from where it left. I
have followed the given url <http://doc.scrapy.org/en/latest/topics/jobs.html>
.But when i try it t... |
Querying postgresql for DateTime values between two dates
Question: I have the following dateTime text type variable in Postgres table
"2016-05-12T23:59:11+00:00"
"2016-05-13T11:00:11+00:00"
"2016-05-13T23:59:11+00:00"
"2016-05-15T10:10:11+00:00"
"2016-05-16T10:10:11+00:00"
... |
SyntaxError: python Arabic encoding
Question: I have this Code -I am using Python 2.7- :
#!/usr/bin/python
# -*- Coding: UTF-8 -*-
import nltk
from nltk.tokenize import StanfordTokenizer
sentence = u"السلام عليكم و رحمة الله و بركاته"
print StanfordTokenizer().tokenize(sentence)
... |
zip unknown number of lists with Python for more than one list
Question: I need to do something very similar to what was asked here [How would you zip
an unknown number of lists in
Python?](http://stackoverflow.com/questions/5938786/how-would-you-zip-an-
unknown-number-of-lists-in-python), but in a more general case.
... |
Subprocess.Popen vs Subprocess.call
Question: Using subprocess.Popen is producing incomplete results where as
subprocess.call is giving correct output
This is related to a regression script which has 6 jobs and each job performs
same task but on different input files. And I'm running everything in parallel
using SubPr... |
Feature Importance for Random Forest Regressor in Python
Question: I'm trying to find out which features have the most importance for my
predictive model.
Currently I'm using sklearn's inbuilt attribute as such
Model = Model.fit(Train_Features, Labels_Train)
print(Model.feature_importances_)
I... |
troubles with pandas anaconda package
Question: I got a new mac and just installed anaconda. When I use `ipython` and
`spyder`, I can `import pandas` without any problem. However, when I use
`sublime`, I get the error
ImportError: No module named pandas
`which python` gives `//anaconda/bin/python`.... |
Python KMax Pooling (MXNet)
Question: I'm trying to recreate the char-level CNN in [this
paper](https://arxiv.org/pdf/1606.01781v1.pdf) and am a bit stuck at the final
step where I need to create a k-max pooling layer, because I am using MXNet
and it does not have this.
> An important difference is also the introducti... |
Compute Cost of Kmeans
Question: I am using this
[model](https://github.com/yahoo/lopq/blob/master/python/lopq/model.py), which
is not written by me. In order to predict the centroids I had to do this:
model = cPickle.load(open("/tmp/model_centroids_128d_pkl.lopq"))
codes = d.map(lambda x: (x[0], mod... |
Python dictionary converting to json or yaml
Question: I have parsed a string and converted into a dictionary. however I would like
to be able to get more information from my dictionary and I was thinking
creating a son file or yaml file would be more useful. please feel free to
comment on another way of solving this p... |
Grouping of documents having the same phone number
Question: My database consists of collection of a large no. of hotels (approx 121,000).
This is how my collection looks like :
{
"_id" : ObjectId("57bd5108f4733211b61217fa"),
"autoid" : 1,
"parentid" : "P01982.01982.110601173548.... |
pdf_multivariate_gauss() function in Python
Question: Which are the necessary modules for execution of the function
pdf_multivariate_gauss() in IPython?
I try to execute the below code but i get errors like "Import Error" and "Name
Error".
**_Code:_**
import numpy as np
from matplotlib import pyplo... |
How to execute set of commands after sudo using python script
Question: I am trying to automate deployment process using the python. In deployment I
do "dzdo su - sysid" first and then perform the deployment process. But I am
not able to handle this part in python. I have done similar thing in shell
where I used follow... |
Python Import Text Array with Numpy
Question: I have a text file that looks like this:
...
5 [0, 1] [512, 479] 991
10 [1, 0] [706, 280] 986
15 [1, 0] [807, 175] 982
20 [1, 0] [895, 92] 987
...
Each column is tab separated, but there are arrays in some of the column... |
Retrieve geocodes from Google API and append to original table - python
Question: I am trying to retrieve the geocodes of a bunch of addresses through the
Google geocoding API and append them to my table with addresses.
After spending two days reviewing the internet I coulnd´t find any simple way
of doing while it sho... |
Why my Element not in view when page scrolls by itself in selenium?
Question: Now, suppose my page have 10 clickable links with same class, one below
another at some distance, such that only 1st 3 links are shown in current
view, others are seen when i scroll down. Now, i have written a code to click
on all of them. It... |
Python speech recognition error converting mp3 file
Question: My first try on audio to text.
import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile("/path/to/.mp3") as source:
audio = r.record(source)
When I execute the above code, the following error occurs,
... |
Python - insert HTML content tp WordPress using xmlrpc api
Question: I'm trying to insert HTML content in my WordPress blog via XMLRPC but if i
insert HTML - i got an error:
> raise TypeError, "cannot marshal %s objects" % type(value) TypeError: cannot
> marshal objects
If i use bleach (for clean tags) - i got text w... |
How do I remove consecutive duplicates from a list?
Question: How do I remove consecutive duplicates from a list like this in python?
lst = [1,2,2,4,4,4,4,1,3,3,3,5,5,5,5,5]
Having a unique list or set wouldn't solve the problem as there are some
repeated values like 1,...,1 in the previous list.
... |
Python Highlight specific text in json document on terminal
Question: I am interested in highlighting a specific portion of the json document based
on some arbitrary matching algorithm. For example
{
"text" : "hello world"
}
I searched for "hello" and above json document has hello in it. ... |
Server responds by "text/html" to a "text/css" request
Question: **PROBLEM:** When I try to access the web page (localhost/mysite/admin), all
goes well, except the CSS files which my server can't deliver !!
[I got a **500 Internal Server Error**](http://i.stack.imgur.com/0VNcT.png)
[By investigating the problem, I fo... |
Python performance on reading files with extremely long lines
Question: I've got a file with around 6MB of data. All of the data are written in a
single line. Why is the following command taking more than 15 minutes to
finish? Is it normal?
infile = open('file.txt')
outfile = open('out.txt', 'w')
... |
python repeat list elements in an iterator
Question: Is there any way to create an iterator to repeat elements in a list certain
times? For example, a list is given:
color = ['r', 'g', 'b']
Is there a way to create a iterator in form of `itertools.repeatlist(color,
7)` that can produce the followin... |
Exit a multiprocessing script
Question: I am trying to exit a multiprocessing script when an error is thrown by the
target function, but instead of quitting, the parent process just hangs.
This is the test script I use to replicate the problem:
#!/usr/bin/python3.5
import time, multiprocessing ... |
ImportError: No module named impyla
Question: I have installed impyla and it's dependencies following
[this](https://github.com/cloudera/impyla) guide. The installation seems to be
successful as now I can see the folder **"impyla-0.13.8-py2.7.egg"** in the
Anaconda folder (64-bit Anaconda 4.1.1 version).
But when I im... |
I keep getting The below errors on my log file whenever i try to Push my django app to Heroku, Kindly assist on how i should go about in solving it,
Question: Here is my log file
$ python manage.py collectstatic --noinput
Traceback (most recent call last):
File "manage.py", line 9, in <m... |
Using strings and byte-like objects compatibly in code to run in both Python 2 & 3
Question: I'm trying to modify the code shown far below, which works in Python 2.7.x, so
it will also work unchanged in Python 3.x. However I'm encountering the
following problem I can't solve in the first function, `bin_to_float()` as
s... |
Confusion with Fancy indexing (for non-fancy people)
Question: Let's assume a multi-dimensional array
import numpy as np
foo = np.random.rand(102,43,35,51)
I know that those last dimensions represent a 2D space (35,51) of which I
would like to index **a range of rows** of a **column** Let's say... |
how to print type of keys for a list in python pdb
Question: I'm learning pdb and I can print, or pp a list of objects but how can I print
the type of key for each object? I can see it with pp, it looks like a byte
array but I'd like to know the type. I suppose I could just print debug this
but I'm curious if there's a... |
Theano crashing using cuDNN in linux
Question: I am a non-root user on a cluster computer running Scientific Linux release
6.6 (Carbon).
I am experiencing some theano crashes when running code on a GPU with CUDA 7.5
and cuDNN 5. I am using Python 2.7, Theano 0.9, Keras 1.0.7 and Lasange 0.1.
The following crash occur... |
Porting a python 2 code to Python 3: ICMP Scan with errors
Question:
import random
import socket
import time
import ipaddress
import struct
from threading import Thread
def checksum(source_string):
sum = 0
count_to = (len(source_string) / 2) * 2
count ... |
How to get "clean" match results in Python
Question: I am a total noob, coding for the first time and trying to learn by doing. I'm
using this:
import re
f = open('aaa.txt', 'r')
string=f.read()
c = re.findall(r"Guest last name: (.*)", string)
print "Dear Mr.", c
that returns
... |
Is Spark's KMeans unable to handle bigdata?
Question: KMeans has several parameters for its
[training](http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html?highlight=kmeans#pyspark.mllib.clustering.KMeans.train),
with initialization mode is defaulted to kmeans||. The problem is that it
marches quickly (les... |
Alembic not handling column_types.PasswordType : Flask+SQLAlchemy+Alembic
Question: **Background**
I'm trying to use a PostgreSQL back-end instead of Sqlite in this [Flask +
RESTplus server example](https://github.com/frol/flask-restplus-server-
example).
I faced an issue with the PasswordType db column type. In orde... |
Unable to run a basic GraphFrames example
Question: Trying to run a simple GraphFrame example using pyspark.
spark version : 2.0
graphframe version : 0.2.0
I am able to import graphframes in Jupyter:
from graphframes import GraphFrame
GraphFrame
graphframes.graphframe.GraphFrame
I get th... |
Is my adaptation of point-in-polygon (jordan curve theorem) in python correct?
Question: **Problem**
I recently found a need to determine if my points are inside of a polygon. So
I learned about [this](https://sidvind.com/wiki/Point-in-
polygon:_Jordan_Curve_Theorem) approach in C++ and adapted it to python.
However, ... |
Python 2.7 TypeError: 'NoneType' object has no attribute '_getitem_'
Question: I'm pretty new to coding and have been trying some things out. I am getting
this error when I run a python script I have. I have read that this error is
because something is returning "None" but I'm having trouble figuring out what
is causin... |
How to convert tar.gz file to zip using Python only?
Question: Does anybody has any code for converting tar.gz file into zip using only
Python code? I have been facing many issues with tar.gz as mentioned in the
[How can I read tar.gz file using pandas read_csv with gzip compression
option?](http://stackoverflow.com/qu... |
Error on Data Pickle in Python
Question: I need to save my Training Data set in Data Pickle. Here is the code. When
execute this code there was an error. How do I fix this error. I need to save
featureCounts and labelCounts variables in two pickles.
from __future__ import division
import collections
... |
Camera calibration with circular pattern
Question: I'm following [this tutorial](http://opencv-python-
tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html#calibration)
to calibrate my camera (with some lens) on Raspberry Pi, but using a [circular
pattern](http://nerian.com/suppo... |
Python / Pygame FULLSCREEN Tag Creates A Game Screen That Is To Large For The Screen
Question: **UPDATED ISSUE**
I have discovered the issue appears to be with the fact that I am using the
FULLSCREEN tag to create the window. I added a rectangle to be drawn in the
top left of the scree (0, 0), but when I run the progr... |
Python Check for decimals
Question: i'm making a program which divides a lot of numbers and I want to check if the
number gets decimals or not. I also want it to print those decimals. Example:
foo = 7/3
if foo has a 3 in the decimals: (Just an example of what I want to do there)
print("It wor... |
Issue deploying Django project to Apache via WSGI
Question: Ubuntu 14.04.4 and Django 1.10
I'm trying to deploy a simple Django app that works perfectly in development
to Apache, via WSGI. The relevant bits in my Apache config file:
<VirtualHost [my IP]>
WSGIScriptAlias /Django/MedFormUpdates /h... |
PyCharm / OS X El Capitan / Python 3.5.2 - matplotlib not working in script
Question: Python noob here, apologies if this is has an obvious answer I should know.
I'm using Python 3.5.2 via PyCharm in OSX El Capitan and I'm trying to run the
following simple script to practise with matplotlib:
import matp... |
JSON.parse without escaping
Question: Is there anyway to do this in JavaScript:
$ cat test.json
{"body":"\u0000"}
$ python3 -c 'import json; print(json.load(open("test.json", "r")))'
{'body': '\x00'}
Notice, the data above only one `\` (does not need to be escaped). So you have
th... |
Django TypeError: allow_migrate() got an unexpected keyword argument 'model_name'
Question: So I copied over my Django project to a new server, replicated the environment
and imported the tables to the local mysql database.
But when I try to run makemigrations it gives me the TypeError:
allow_migrate() got an unexpect... |
NoSuchElement exception with Selenium even after using Wait and checking page_soure
Question: I have this simple scraper that I am running. I am trying to scrape the search
results for letter q from sam.gov:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.... |
Save and reset parameters of multilayer networks in theano
Question: We can save and load object in python using `six.moves.cPickle`.
I saved and reset the parameters for LeNet using the following code.
# save model
# params = layer3.params + layer2.params + layer1.params + layer0.params
import ... |
Error tokenizing data
Question: This is my code:
import pandas
import datetime
from decimal import Decimal
file_ = open('myfile.csv', 'r')
result = pandas.read_csv(
file_, header=None,
names=('sec', 'date', 'sale', 'buy'),
usecols=('date', 'sale', 'buy'),
... |
Customize username and password field in Django?
Question: First, How can I set `min_length` for `username`?
`ChachaUser._meta.get_field('username').min_length = 2` doesn't work.
Second, How can I place `placeholder` for `password1` and `password2`?
`forms.PasswordInput(attrs={'placeholder' : "6자리 이상"}),` doesn't work... |
print current thread in python 3
Question: I have this script:
import threading, socket
for x in range(800)
send().start()
class send(threading.Thread):
def run(self):
while True:
try:
s = socket.socket(socket.AF_INET, sock... |
How to plot data from multiple files in a loop using matplotlib in python?
Question: I have a more than 1000 files which are .CSV (data_1.csv......data1000.csv),
each containing X and Y values !
x1 y1 x2 y2
5.0 60 5.5 500
6.0 70 6.5 600
7.0 80 7.5 700
8.0 90 8.5 800
9.0 100 9.... |
How can I set infinity as an element of a matrix in python(numpy)?
Question: This is the program
import numpy as n
m = complex('inf')
z=n.empty([2,2] , dtype = complex)
z=n.array(input() , dtype = complex )
but in the console when i give 'm' as an input i get the following error
massage... |
Convert bash script to python
Question: I have a bash script and i want to convert it to python.
This is the script :
mv $1/positive/*.$3 $2/JPEGImages
mv $1/negative/*.$3 $2/JPEGImages
mv $1/positive/annotations/*.xml $2/Annotations
mv $1/negative/annotations/*.xml $2/Annotations
cut -d... |
Python tkinter's entry.get() does not work, how can I fix it?
Question: I am building a simple program for university. We have to convert our code to
an interface. Ive managed to make the interface, but i cant seem to pass my
values from Entry to the actual code. Here is my code:
import sys
from tkin... |
cmd module - python
Question: I am trying to build a python shell using cmd module.
from cmd import Cmd
import subprocess
import commands
import os
from subprocess import call
class Pirate(Cmd):
intro = 'Welcome to shell\n'
prompt = 'platform> '
pass
... |
Easily editing base class variables from inherited class
Question: ### How does communication between base classes and inherited classes work?
I have a data class in my python code ( storing all important values, duh ), I
tried inheriting new subclasses from the _data base class_ , everything worked
fine except the fa... |
Python: indexing letters of string in a list
Question: I would like to ask if there is a way how to get exact letters of some string
stored in a list? I'm working with DNA strings, get them from FASTA file using
BioPython SeqIO and store them as strings in a list. In next step I will
convert it to numerical sequence (c... |
Python - Parsing Json format input
Question: I need to make a data parsing that come from another program in JSON format:
import json
input = '''
Array
(
[error] => Array
(
)
[result] => Array
(
[0] => Person Object
... |
Custom date string to Python date object
Question: I am using Scrapy to parse data and getting date in `Jun 14, 2016 ` format, I
have tried to parse it with `datetime.strftime` but
what approach should I use to convert custom date strings and what to do in my
case.
**UPDATE**
I want to parse UNIX timestamp to save i... |
Pythonic way to find if an IP in a list belongs to a different subnet
Question: I have a script that generates the configuration for some campus wireless
mobility switches. The user needs to supply a set of IP addresses for the
configuration.
Among other constraints, these IP's must all be in the same /24 subnet (alwa... |
Python Failed to Verify any CRLs for SSL/TLS connections
Question: In Python 3.4, a `verify_flags` that can be used to check if a certificate was
revoked against CRL, by set it to `VERIFY_CRL_CHECK_LEAF` or
`VERIFY_CRL_CHECK_CHAIN`.
I wrote a simple program for testing. But on my systems, this script failed to
verify ... |
missing last bin in histogram plot from matplot python
Question: I'm trying to draw histrogram based of my value
x = ['3', '1', '4', '1', '5', '9', '2', '6', '5', '3', '5',
'2', '3', '4', '5', '6', '4', '2', '0', '1', '9', '8',
'8', '8', '8', '8', '9', '3', '8', '0', '9', '5', '2',
... |
Whitenoise, Mezzanine, Django -ImportError: cannot import name ManifestStaticFilesStorage
Question: I am trying to deploy my mezzanine project on heroku. The last error gives me
an ultimate stack- ImportError: cannot import name ManifestStaticFilesStorage.
Here is my core project structure:
├── deploy
... |
How to configure a package in PyPI to install only with pip3
Question: I distributed my package written in Python 3 on PyPI. It can be installed by
both `pip2` and `pip3`. How can I configure the package to only be available
in Python 3; i.e. to install only with `pip3`?
I've already added these classifiers in `setup.... |
Trying to output the x most common words in a text file
Question: I'm trying to write a program that will read in a text file and output a list
of most common words (30 as the code is written now) along with their counts.
so something like:
word1 count1
word2 count2
word3 count3
... ...
... |
Python: Ignore case sensitivity for MYSQL column names
Question: I am querying my MySQL DB with following code.
import MySQLdb
db = MySQLdb.connect("localhost","user","password","test" )
cursor = db.cursor(MySQLdb.cursors.DictCursor)
sql = "select * from student"
try:
cursor.... |
Python background shell script communication
Question: I have 2 python scripts, `foo.py` and `bar.py`. I am running foo.py in the
background using
python foo.py &
Now I want to run `bar.py` and use the stdout from this file to trigger script
inside foo.py. Is this possible? I'm using Ubuntu 16.04 L... |
Getting the root word using the Wordnet Lemmatizer
Question: I need to find a common root word matched for all related words for a keyword
extractor.
How to convert words into the same root using the python nltk lemmatizer?
* Eg:
1. generalized, generalization -> general
2. optimal, optimized -> optimize ... |
matplotlib.use required before other imports clashes with pep8. Ignore or fix?
Question: I have a pythonscript that starts like this:
#!/usr/bin/env python
import matplotlib
matplotlib.use("Agg")
from matplotlib.dates import strpdate2num
import numpy as np
import pylab as pl
... |
Python Shellexecute windows api with Ctypes over TCP/IP
Question: I have question about running windows API's over TCP/IP protocol. For example,
I want to bring remote machine's cmd.exe to other machine (Like Netcat, fully
simulating cmd.exe over TCP/IP) . I searched online for doing it with python
but couldn't find an... |
What function should I use to fix my code?
Question: I'm an amateur trying to code a simple troubleshooter in Python but I'm sure
what function I need to use to stop this from happening... [enter image
description here](http://i.stack.imgur.com/XJsB1.png)
What should I do so the code doesnt continue running if the use... |
How do I increase the contrast of an image in Python OpenCV
Question: I am new to Python OpenCV. I have read some documents and answers
[here](http://stackoverflow.com/questions/19363293/whats-the-fastest-way-to-
increase-color-image-contrast-with-opencv-in-python-c) but I am unable to
figure out what the following cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.