text stringlengths 226 34.5k |
|---|
How to encrypt a python module asuming the decryption key is well hidden
Question: I have been seaching the internet for solutions of how to encrypt a python
script file and the answer is pretty much the same: "You can't". They all
refer to fact that the key will be exposed somehow.
I am developing a standalone electr... |
Can not import modules from gi.repository
Question: I can not import modules from gi.repository. Specifically not Gtk and GObject.
I experienced this error both on Ubuntu 14.04 LTS and after reinstall also on
Linux Mint 17.
from gi.repository import Gtk, GObject
Results in the 'unresolved referenc... |
pythonic way to try (repeatedly) to catch exceptions
Question: I have a script that runs on an unattended machine. If the script throws an
error, I want to log the error and keep running as long as it's practical.
Here's my first draft of the code, but it doesn't work for reasons explained
below. (As a note: a more rea... |
Python optomise nearest neighbour for large arrays
Question: I have an array of points in 4D space (my array is roughly 1,000,000 long).
For each value in my array I need to find the kth (where k = 81) nearest
neighbours
I then do some further code based on that..
_[in brief, I'm effectively trying to extend the SSIM... |
Python script to alert on empty/missing logs
Question: I am working on a project to check a file directory and automatically add log
files as they are created. A file is being generated every five minutes, but
some of the files are being created with a "0" filesize and I would like to
alert when this happens.
So the s... |
Image sorter by created date in python
Question: I need to make a program that sort all the .jpg files in a directory, or
simply all the files in the directory(because they are all jpg, so it doesnt
have to be specifically fro jpgs) and that depending on the date they were
made, puts them in two separate folders: say f... |
GNU Radio filter design tool (gr_filter_design)
Question: I am having some trouble getting the filter design tool to even start. When
starting the application I get
"This example requires a Numerical Python Extension, but
failed to import either NumPy, or numarray, or Numeric.
NumPy is availabl... |
Python.h not found using swig and Anaconda Python
Question: I'm trying to compile a simple python/C example following this tutorial:
<http://www.swig.org/tutorial.html>
I'm on MacOS using Anaconda python.
however, when I run
gcc -c example.c example_wrap.c -I/Users/myuser/anaconda/include/
I get... |
Error in .vdisplay.start() - xvfbwrapper is not working
Question: installed xvfbwrapper python module.provided display start in python selenium
test in MAC
from xvfbwrapper import Xvfb
class San(unittest.TestCase):
def setUp(self):
#display = Display(visible=0, size=(1480, 20... |
Appending np.arrays to a blank array in Python
Question: I am trying to save the results from a loop in a np.array.
import numpy as np
p=np.array([])
points= np.array([[3,0,0],[-1,0,0]])
for i in points:
for j in points:
if j[0]!=0:
... |
Store IP address in a variable in python
Question: Can an IP address be stored in a variable in python? As,
ip = "123.45.67.89"
Answer: The Python 3.x stdlib has an
[ipaddress](https://docs.python.org/3.4/library/ipaddress.html) module that
provides support for IP addresses.
**Unfortunately this ... |
Scipy stats.skew -- IndexError: tuple index out of range
Question: I am getting a wierd error.... this doesn't happen if I use np.random.random
instead of np.random.randint
>>> import numpy as np
>>> import scipy.stats as stats
>>> rdata = np.random.randint(5000)
>>> skew = stats.skew(rdata)
... |
Python - urllib2 how to know if our authorization is successful
Question: When you would normally login to a website we can use urllib2.Request as so.
import urllib2, base64
req = urllib2.Request("http://www.facebook.com/")
base64string = base64.encodestring("%s:%s" % ("username", "password")).re... |
python urllib2 can't get correct webpage
Question: I'm writting a spider using urllib2 and beautifulsoup. But I come across some
problems.
1. I can't download the webpage correctly. I tried
`GET 'http://thesite.html'`,
`wget 'http://thesite.html'`,
`curl -O 'http://thesite.html'`,
on linux terminal, but got a l... |
Dissable boundaries in a python snake game
Question: > My problem is hard to explain so please run the code to see what's going on
I'm trying to adapt the code of a snake game so that the snake cannot collide
with the screen boundaries. I'm using existing code that can be found here
[code on
stackexchange](http://code... |
Beginner issues with python script output
Question: The below Python code isn't acting as intended.
The final output is missing all lines that I'd expect to be outputted where
`output_data[1] == "S"`.
It also appears my lazy attempt to obfuscate client ID is failing.
import csv
TID = 0
ACC... |
Selecting a column from an array in Python
Question: In trying to select the first (when counting from zero) column in a 2D 4x4
array, I wrote the following script:
import numpy
a4x4=[list(range(4*i,4*(i+1))) for i in list(range(4))]
print(a4x4)
print(a4x4[:,1])
The array seems to be al... |
How to catch the clipboard event (onChangeClipboard equivalent) from any application in Python
Question: I am working on a clipboard manager. My current issue is to succeed in
catching modification of the clipboard from any applications. For instance :
* From a ctrl - c
* From a right click and copy to clipboard
... |
cant import/install python libraries for another python package
Question: I got python 3.3.3 package as part of binary package.
(<http://siremol.org/Sire/Download.html>) I tried lot of things but could not
import or install additional libraries for this python package. I installed
anaconda as well but nothing help me. ... |
ImportError: No module named 'Tkinter'
Question: For some reason I can't use the `Tkinter` module.. I have no idea what could
cause it, and it's so annoying, is there anything wrong with this line?
import Tkinter
Also tried running it, in the python terminal, still don't work..
Answer: I have bee... |
Marketo "Import Lead" fails with error 610 Requested resource not found
Question: I'm trying to batch **update a bunch of existing records** through Marketo's
REST API. According [to the
documentation](http://developers.marketo.com/documentation/rest/import-lead/),
the Import Lead function seems to be ideal for this.
... |
parallel generation of random forests using scikit-learn
Question: Main question: How do I combine different randomForests in python and scikit-
learn?
I am currently using the randomForest package in R to generate randomforest
objects using elastic map reduce. This is to address a classification problem.
Since my in... |
Curve fitting in Python using a data sets
Question: I am really new in Python, hence I am asking a simple question:
I have a sets of data (x1, x2, x3, x4, x5) and corresponding (y1, y2, y3, y4,
y5). Now, how can I use Python to find a y value for a given x value? (x lies
in between x1 to x5)
As an example: Let say, I... |
Seeing or filtering using indexed columns in pandas?
Question: Using Python's pandas library, I imported a csv and set multiple columns as my
index. Unexpectedly, the indexed columns are no longer present when I display
the dataframe and I can't use the index columns as filter option. Google tells
me that when I set my... |
ElementTree parallel node creation
Question: I'm writing a graph object to an xml representation. My monolithic code works
well, but it's too slow on my large graph. I'm trying to parallelize it, but
I'm not getting the `SubElement` back from the pool. I'm sure that I'm missing
something obvious, but I'm new to python.... |
The lxml 'None' type is not None
Question: I want to compare a variable I set to `None`, which was a string element
before, with `is` but it fails.
When I compare this variable to `None` with `==`, it works.
This is the variable I'm talking about:
print type(xml.a) -> <type 'lxml.objectify.StringElemen... |
At what point is MySQL primary key error thrown?
Question: If I have a batch insert statement like:
INSERT INTO TABLE VALUES (x,y,z),(x2,y2,z2),(x3,y3,z3);
And `x2` violates a primary key, is the error thrown before or after the
processing of `x3`?
Specifically, I have a bunch of batch inserts in ... |
Copy files to a different directory based on their extension using Python
Question: I have a list named source where I store the file names. Now based on the
extension of each file I want it to copy to different folders. I know it is a
very simple task but somehow i am not getting it. Her is my code:
imp... |
Python matplotlib not importing due to failure to import unichr
Question: I'm running Ubuntu 13.10 with Python 2.7.5+, and whenever I try to import the
`matplotlib` package, I get an error. Specifically, my test script has only
the following code:
#!/usr/bin/python
import matplotlib.pyplot as plt
... |
Open right button menu then selec one item from the menu by using Selenium+Python
Question: I try to open the right button menu from web then select one of the
option(e.g. print... )? I'm using selenium and python.Does anyone know how to
do this? Thanks a lot!
Answer: I don't know if I understood you well.
For examp... |
Improving performance of python multithreading for downloading webpages
Question: I am trying to write python code that downloads web pages using separate
threads. Here is an example of my code:
import urllib2
from threading import Thread
import time
URLs = ['http://www.yahoo.com/',
... |
FileNotFoundError: [Errno 2]
Question: Synopsis: How do I read a file in Python? why must it be done this way?
My problem is that I get the following error:
Traceback (most recent call last):
File "C:\Users\Terminal\Desktop\wkspc\filetesting.py", line 1, in <module>
testFile=open("test.txt... |
Character encoding in python to replace 'u2019' with '
Question: I have tried numerous ways to encode this to the end result `"BACK RUSHIN'"`
with the most important character being the right apostrophe `'`.
I would like a way of getting to this end result using some of the built in
functions Python has where there is... |
Urllib Python is not providing with the html code I see with with inspect element
Question: I'm trying to crawl the results in this link:
url =
"<http://topsy.com/trackback?url=http%3A%2F%2Fmashable.com%2F2014%2F08%2F27%2Faustralia-
retail-evolution-lab-aopen-shopping%2F>"
When I inspect it with firebug I can see the... |
Popen and stdin to automate input to .exe
Question: I have a simple windows executable that asks for user input and I'm trying to
make a python script to automate the input. What I've done:
from subprocess import Popen, PIPE
p = Popen([r'myprgm.exe'], stdin=PIPE)
p.communicate(input=bytes(input("... |
Capistrano deployment error Can't activate jruby-openssl-0.9.5-java
Question: I have developed a new Rails (4.1.4) app in JRuby (1.7.10) and I am trying to
deploy it with Capistrano v3 on a remote vps. The error I am getting looks
like:
INFO[551a80fb] Running ~/.rvm/bin/rvm default do bundle install --bi... |
Streaming camera feed from mjpeg-streamer with Flask (Python)
Question: I'm trying to stream a webcam feed from mjpeg-streamer through flask in a
simple web app. My flask code has a simple piece of html, which otherwise
works, which I insert the following line into:
<img src=”/?action=stream”/>
But... |
unable to use library build with gobject-introspection in python
Question: It's my first question on stackoverflow. Before I start I'm sorry for my poor
english
I'm currently developing a library "Pocketvox". it's aim is to provide an easy
way to use pocketsphinx (voice recognition) on linux system to control it.
The... |
How Can I deploy OVA file on Vsphere Client with python
Question: I want to automate deploying OVA image on VSphere with python. I looked up at
some packages viz. Pysphere, psphere but didn't find direct method to do so.
is there any Library I'm missing or is there any other way to deploy OVA/OVF
files/templates on VSp... |
Filtering another filter object
Question: I am trying to generate prime endlessly,by filtering out composite numbers.
Using list to store and test for all primes makes the whole thing slow, so i
tried to use generators.
from itertools import count
def chk(it,num):
for i in it:
if ... |
Images not displaying html <img />
Question: I have been at this for hours trying to get these images to display. I didn't
want to resort to posting a question on stackoverflow but it seems like the
best option right now. I have read a several posts on stackoverflow and even a
couple others on different sites. I have t... |
Python - Benchmarking Disk - Write exactly x bytes in a file
Question: I am trying to benchmark my Hard drive, this is to say calculate its latency
(ms) and throughput (MB/s). To do that, I want to measure the execution time
of the function f.write of Python. What I need is to write exactly x bytes to
my files. I under... |
What is the fastest way to find the exact value of the factorial of a large number in python?
Question: I'm aiming at particularly large values of the number whose factorial is to be
found for example- 12345678!. Even `math.factorial(12345678)` in python takes
a lot of time to compute the factorial of such a number.
I... |
Repeat same method on multiple objects in python
Question: This is very basic but I am having trouble finding an answer through google. I
have a loop that imports a number of text files into pandas dataframes.
I have written the names to a list.
onlyfiles = [ f for f in listdir(mypath) if isfile(join(my... |
ImportError: No module named config on Travis-CI build
Question: I'm having an import error on [Travis builds](https://travis-
ci.org/dzlab/sentimentpy), the error is related to the configuration of flask:
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
O... |
Using Functions from Other .py Files
Question: So I'm very new to Python and programming in general. I've run into an issue
with my text game. I'm trying to create a function (pretty sure 'def (name) is
a function, right?)in a .py called 'locationMenu' and use it in my main game
file. Here is the start of my locationMe... |
Parse log text in Python using Regex
Question: I've a format like this:
att1="value 1" att2="value 2" att3="value 3"
for example
level="Information" clientAddr="127.0.0.1" action="GetByName" message="Action completed" url="/customers/foo" method="GET"
Can I use regex to parse... |
Python - Using Cookies Successfully
Question: When I would try facebook cookies to open a logged account on facebook...
import urllib2, urllib, cookielib
jar = cookielib.CookieJar() ... |
interactive mode doesn't switch on from script (matplotlib 1.4.0 python 2.7.5 on mac osx 10.8.5)
Question: Using python 2.6 on my mac the following works fine (i.e. a plot window
opens):
import matplotlib.pyplot as plt
from numpy import linspace, sin, pi
plt.ion()
print "Is interactive:?", pl... |
GraphLab Create "ImportError: No module named graphlab"
Question: I followed [these instructions](http://graphlab.com/products/create/quick-
start-guide.html) to set up GraphLab on my Ubuntu machine. At the end, I
opened Python 2.7.6 and ran the first of the test lines `import graphlab as
gl`. This gave me
... |
Fastest way to extract tar files using Python
Question: I have to extract hundreds of tar.bz files each with size of 5GB. So tried the
following code:
import tarfile
from multiprocessing import Pool
files = glob.glob('D:\\*.tar.bz') ##All my files are in D
for f in files:
tar... |
Loading initial data with Django 1.7 and data migrations
Question: I recently switched from Django 1.6 to 1.7, and I began using migrations (I
never used South).
Before 1.7, I used to load initial data with a `fixture/initial_data.json`
file, which was loaded with the `python manage.py syncdb` command (when
creating t... |
how to properly use try/except/with inside functions and main
Question: I am a relative python newbie and I am getting confused with how to properly
handle exceptions. Apologies for the dumb question.
In my main() I iterate through a list of dates and for each date I call a
function, which downloads a csv file from a ... |
Error while testing postgresql database with python
Question: I wanted to start into using databases in python. I chose postgresql for the
database "language". I already created several databases, but now I want
simply to check if the database exists with python. For this I already read
this answer: [Checking if a post... |
ValueError: Inconsistent Shapes Error in Scikit Learn Train_Test Split
Question: I'm preparing to run some predictions on a csv document comparing job
descriptions to salary outcomes. I've split the data set into training and
test where features is what I'm working with and target is what I'm
predicting. When I go to p... |
PyCharm show graphics
Question: I am trying to have PyCharm show my graphics, but when I run this script
nothing appears on the screen.
from pylab import *
def main():
ion()
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s)
xlabel('time (s)')
... |
scrapy startproject tutorial: Error when I execute this command
Question:
C:\Windows\system32>scrapy startproject tutorial
Traceback (most recent call last):
File "C:\Python34\Scripts\scrapy-script.py", line 9, in <module>
load_entry_point('Scrapy==0.24.4', 'console_scripts', 'scrapy')()
File "C:\P... |
manage.py works but foreman start errors out
Question: This question is Heroku and django specific.
When I start my application using the command "python manage.py runserver",
the webserver starts without error. I can then go and retrieve the homepage my
visiting localhost:8000 in my browser. Great.
When I start my a... |
SQLAlchemy proper Model definition and Selecting / Inserting
Question: I'm having trouble with SQL Alchemy with both setting up the models and
selecting / inserting
If I setup the model as follows and insert in item into a table, it works:
#!/usr/bin/python
import pymysql
import sqlalchemy
... |
How to print/display the output of a telnet session in terminal window (Python)
Question: Can someone help to understand how print in the terminal window works? Here is
a test script
test_script.py
import telnetlib
HOST = "10.1.1.151"
tn = telnetlib.Telnet(HOST)
tn.open(HOST)
test_var = ... |
printing json value to file
Question:
#!/usr/bin/python
import os
import json
import urllib
import urllib2
url = "https://www.example.com"
parameters = {'resource': 'aaaa',
'apikey': '1111'}
data = urllib.urlencode(parameters)
req = urllib2.Re... |
Performance of Java API versus Python with Cypher for Neo4J
Question: I am working with an application that uses a Neo4J graph containing about 10
million nodes. One of the main tasks that I run daily is the batch import of
new/updated nodes into the graph, on the order of about 1-2 million. After
experimenting with Py... |
Timeout for each thread in ThreadPool in python
Question: I am using Python 2.7.
I am currently using ThreadPoolExecuter like this:
params = [1,2,3,4,5,6,7,8,9,10]
with concurrent.futures.ThreadPoolExecutor(5) as executor:
result = list(executor.map(f, params))
The problem is that `f` ... |
googleappengine install pudb
Question: I'm want to debug my python application on google app engine with pudb. I've
installed buildout without of using virtualenv and created config file for it
buildout.cfg:
[buildout]
develop = .
parts =
python
app
pudb
nosetests
... |
Append CSVs without column names
Question: I have a list of CSVs , but they don't have column names. With my code in
Python 2.7 it appends but the first row in each CSV is recognized as the
column names. How can I append the CSVs without column names. For example:
1 2 3
a b 3
2 4 1
a e r... |
Python, numpy, einsum multiply a stack of matrices
Question: For performance reasons,
I'm curious if there is a **way to multiply a stack of a stack of matrices**.
I have a 4-D array (500, 201, 2, 2). Its basically a 500 length stack of
(201,2,2) matrices where for each of the 500, I want to multiply the adjacent
matr... |
Reading files using raw_input or argv
Question: I am [Learning Python the Hard
Way](http://learnpythonthehardway.org/book/ex15.html). How could I edit this
code to work with a file named `'bobsDetails.txt'`?
from sys import argv
script, filename = argv
txt = open(filename)
print "Here's your ... |
Change Position MouseListener in Python 3.4.1
Question: Simple question. Can anyone translate this peusdocode into Python code??
import tkinter
object circle
if circle positions contains event.x and event.y:
change position
Answer: You should read tutorials on the canvas widget if you have not already. I
suspect ... |
Python openpyxl load_workbook Errors: TypeError (NoneType not Iterable) and ValueError (Max. Value is 180)
Question: So I had Python 3.4.1 installed on a Windows XP laptop. I got the openpyxl
package (don't remember now which version, I think 2.1) and I was chugging
along fine, writing custom code to modify Excel docum... |
Replace lines in a protobuf file using python
Question: I have an existing proto file that I would like to change. What I would like
to do is read the file in, change a value or two, and then write it back out
to disk as a .proto file, to be read by another program. According to [this
documentation](https://developers.... |
A date doesn't match the format
Question: Why doesn't a date match the format?
>>> import datetime
>>> dt1 = "9/1/2014 0:00"
>>> datetime.datetime.strptime(dt1, "%m/%d/%y %H:%M")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Framework... |
Changing a variable created outside a function within a function using Python
Question: I am trying to change the value of player_score, cpu_score, and ties which
were created outside the function determineWinner but I get an error such as
this: UnboundLocalError: local variable 'cpu_score' referenced before
assignment... |
Perl library path/s
Question: I need to find the location of my perl library/libraries how can I do this?
Something similar to what this gives you for python...
python -c "import sys; print sys.path"
Thanks
Answer: The physical location of loaded modules are in the
[`%INC`](http://perldoc.perl.or... |
Unable to pass an lxml etree object to a separate process
Question: I'm working on a project to parse multiple xml files concurrently in python
using lxml. When I initialize the process I want my main class to do some work
on the XML before it passes the etree object to the process, but I am finding
that when the etree... |
Combining a parsed time with today's date in Python
Question: This should be easy, but as ever Python's wildly overcomplicated datetime mess
is making simple things complicated...
So I've got a time string in HH:MM format (eg. '09:30'), which I'd like to
turn into a datetime with today's date. Unfortunately the defaul... |
Python execute remote application using server resource
Question: I am trying to ran a matlab executable application from Python on a remote
server.
I used following code:
os.system("\\Server-01\\D$\\matlab_t.exe 7.25 16") # 7.25 and 16 are input arguments of matlab_t.exe
The above code is runn... |
Twisted Python, TLS and client/server certificate authentication error
Question: I've been learning Twisted as best I can, but together with limited TLS
knowledge it's proving challenging. I'm trying to write (ultimately) an SMTP
server that can send and receive messages both as plain text, or via TLS
depending on requ... |
Calculating sales taxes using functions in python
Question: I can't get this program in Python 3.3.5 to run and not sure what I did wrong.
The program is to ask the user to enter the total sales for the month, then
calculate and display the the following, the amount of county sale (county
sales tax is 2.5percent) and a... |
python audio player filtered without jitter
Question: For a project I need to
* read WAV file
* filter
* play WAV file
The code below is "working" except that the sound crackles, and that is
because I can't guarantee a continue data stream to the audio output.
Filtering takes some time and that's where the soun... |
How do I pull all image links from a Wikimedia page?
Question: I am trying to pull all links from a Wikimedia page for famous painters such
as Caravaggio with the [Python Wikipedia
module](https://pypi.python.org/pypi/wikipedia).
import wikipedia
page = wikipedia.page("caravaggio")
links = page.l... |
Python REST mysql db.commit() error
Question: I am having the same error in python no matter where I put the db.commit()
statement.
Here is my code:
from bottle import route, run
import json
import collections
import MySQLdb as db
@route('/register/<COD>/<NOMBRE>/<APELLIDO>/<DIRECCI... |
Django admin model add_view: how to remove "save and add another" buttons?
Question: I was able to remove the "save and add another" and "save and continue
editing" buttons by implementing the following code:
# At the start of my admin.py file I have:
from django.contrib.admin.templatetags.admin_modi... |
API 'QString' has already been set to version 1 on Eclipse
Question: I'm getting following error **on starting debug session** in Eclipse for my
code which uses Enthought Mayavi and PyQt as well. Here is the error log in
the console.
>
> pydev debugger: starting (pid: 2208)
> Traceback (most recent call last):... |
Do calculation for array of values - Python
Question: I am trying to calculate and plot the amplitude `amp` of the solution of a
time dependent `t` differential equation of motion (see `rhs6`) as a function
of `wd` for multiple values of the force coefficient `f` found in `f_array`.
So far I have got the code working ... |
Python: How to get absolute path of file in imported module
Question: I have imported a module as:
from source.x.ReviseOnOrder import reviseOnX, x
The method `reviseOnX` runs another python script, say `y.py` which is in the
same location i.e `/source/x`. So, when executing `reviseOnX`, I'd like to... |
Deploy Django on Amazon Elastic Beanstalk. LOGGING_INFO environment variable not set
Question: I am successfully deploying my Django (1.7) on Elastic Beanstalk, but I get
500 when I load it in the browser. In the logs I find this:
[Wed Sep 24 12:56:11.434509 2014] [:error] [pid 27030] [remote 172.31.6.17... |
Calculate 9:00 PM in between two dates in python
Question: How can I calculate how many times 9:00 PM can come in between two dates?
dt_start_time = "2014-09-23 11:00:00"
dt_end_time = "2014-09-24 12:00:00"
Expected Output is 1
dt_start_time = "2014-09-24 09:00:00"
dt_end_t... |
Unable to import undirected graph from EdgeList file in igraph-python
Question: I am using the igraph-python's `Graph.Read_Ncol` function. Below is my code
for reading the data.
def loadData(filename):
data = None
data = ig.Graph.Read_Ncol(filename, directed=False)
return data
... |
What's a Pythonic way to make a non-blocking version of an object?
Question: I often use python objects with methods that block until finished, and want to
convert these methods to non-blocking versions. I find myself executing the
following pattern quite frequently:
1. Define the object
2. Define a function which... |
Genshi for loop not working...?
Question: I'm having trouble using a Genshi `py:for` attribute. What have I done wrong?
Code written out below; to run, make a virtualenv with Python 2, do `pip
install genshi flask`, copy the files as listed in an isolated directory, and
run `python hello.py`
## The code
Contents of `... |
Python kivy link checkbox from application to .kv
Question: I am a new user to kivy.
I need to link a checkbox from the .kv interface so that it have an impact on
the underlying python application.
I tried the following code for my application:
from kivy.app import App
from kivy.uix.floatlayout imp... |
Python script using Glade code produces glib error about old version of GTK
Question: I am trying to create my first Glade GUI using Python as the back-end. I
created the GUI in Glade and saved the file as a .glade. I then created my
Python code and saved it in the same directory as the glade file. Upon running
the Pyt... |
Google Push-To-Deploy Pipelines - Unit tests fail with module import error
Question: I get the following error when I try to execute a build on the Google
provisioned Jenkins servers in Compute Engine.
[deployment_5371449468518400_1411607125060] $ /bin/sh -xe /tmp/hudson807438832151987098.sh
+ nosete... |
Changes made using pymysql don't "persist" to database
Question: I am trying to Insert Into a mysql database using pymysql. After the Insert
and calling commit, as a demo, I Select and print all rows. The new row is
printed, but - only the last added row is displayed (printed) and the
auto_incremented Id field incremen... |
Installing MySQLdb on Mac OS X 10.9.5
Question: From this [link](https://pypi.python.org/pypi/MySQL-python/1.2.4) I downloaded
MySQLdb and run following two commands
sudo python setup.py build
sudo python setup.py install
I also define the environment path in .bash_profile as follows
... |
Lost on part with Python loops with a function to roll combined value of dice
Question: I have to create a function of two randomly rolled dice the return the
combined value. Then I have to use a loop to to roll it to give me five
different combined values.
The point I keep getting stuck at is defining the loop in ter... |
unable to install PIL on ubuntu 13.04
Question: I am trying to install PIL ( not pillow ) on ubuntu 13.04.
I installed all the dependency libs for jpeg, tiff, png, and lcms support.
I used the following command to install PIL:
$ sudo pip install --allow-external PIL --allow-unverified PIL PIL
How... |
Error while importing paramiko in python script
Question: I'm trying to build a python script which has the line "import paramiko" and I
get this error:
Traceback (most recent call last):
File "script.py", line 3, in <module>
import paramiko
File "/home/FBML7HR/.local/lib/python3.4/si... |
Read from a .csv file containing exported pcap packet info using Tshark and count particular instances in Python
Question: I want to read from a .csv file(created from a .pcap file) and count the no.
of instances for certain network packets in python under info column in
python. I am using python 2.7 on Windows 7 OS.Is... |
get specific text such as "Something new" using BeautifulSoup Python
Question: I am making a focused crawler and facing an issue while find a for a key
phrase in the document.
Supposing the key phrase I want to search in the document is "Something new"
using BeautifulSoup with python I do the following
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.