text stringlengths 226 34.5k |
|---|
Euler's method in python
Question: I'm trying to implement [euler's
method](http://en.wikipedia.org/wiki/Euler_method) to approximate the value of
e in python. This is what I have so far:
def Euler(f, t0, y0, h, N):
t = t0 + arange(N+1)*h
y = zeros(N+1)
y[0] = y0
for n in ... |
python lazy translation - add line break to translation string
Question: How do I add line breaks to a lazy translation? I have searched
[django](https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#), SO
& Google, but no information is found.
I have my lazy translation working with multiline below, but the ... |
My life calculater project
Question: I'm currently working on a life calculator that i have programmed in python. I
need ideas of what to add to it and examples on how to add it and also how do
i add a end control so i can just input end and the program stops. I'm trying
to make this better because i plan to take it to... |
Using class/function in another module
Question: I come from a mostly Java background, but have recently been delving into some
Python. I've been mostly getting it, but there's some syntax that seems really
weird to me. I have this project I'm working on that contains multiple files/
classes. I have one class, Mesh.py:... |
How to "join" two text files with python?
Question: I have two txt files like this: txt1:
Foo
Foo
Foo
Foo
txt2:
Bar
Bar
Bar
Bar
How can I concatenate them in a new file by the left and the right side let's
say like this:
Bar Foo
Bar Fo... |
PYTHONPATH sys.path difference
Question: I am having trouble adding a directory to my `PYTHONPATH` The directory is
`/usr/local/lib/python2.7/dist-packages`
When I run
PYTHONPATH=/usr/local/lib/python2.7/dist-packages python -c 'import sys; print sys.path'
I can't find it in the result. Trying thi... |
How to setup rethinkdb with django?
Question: I have followed various posts and tutorials but couldn't find anything that is
relevant. I found a ORM for rethinkdb
"<https://github.com/dparlevliet/rwrapper>" but don't know how to use it? I am
new to to django and python.
Answer: It depends on what you want to do.
*... |
Flask import error: No module named app. While creating the database with Sqlite
Question: Hi I am very new to flask and I am trying to set up a database using sqlite
with my app. I have the file structure like this
app
|--Static(folder)
|--Templates(folder)
|--__init__.py (empty python file)... |
How do I debug a python multiple-sentence generator?
Question: I made my own Python code like this:
import random
# nouns-----------------------------------------------------------------------------------------------------------------
nouns = 'noun1 noun2 noun3 noun4 noun5 noun6 noun7 noun8 ... |
Bottle py and Jinja2 global variable
Question: I am using bottle.py framework along with Jinja2 templates in a new
application.
Whenever a user logs into the application I would like to add a new global
Jinja2 variable with the name of the active user, so in a partial template
(the header) I can display this name.
In... |
Django app crashing on Heroku
Question: I am trying to port an app that runs fine on my computer using runserver to
Heroku. I am new to Django and have never deployed an app on Heroku before. I
am not sure what I am missing.
Here is the heroku error:
2015-01-18T00:59:22.855761+00:00 app[web.1]: File "... |
PythonAnywhere Django 404 Page Not Found for Homepage
Question: I know there is a similar post like this one. I've reviewed it and it is quite
different from what I'm experiencing at the moment on
[Pythonanywhere.com](http://www.pythonanywhere.com)
I'm trying to deploy my rango tutorial project that I completed throug... |
How to to make a file private by securing the url that only authenticated users can see
Question: I was wondering if there is a way to secure an image or a file to be hidden
when it is not authenticated.
Suppose there is an image in my website which can only be seen if that user is
authenticated. But the thing is I ca... |
how to disable all webkit browser plugins?
Question: I'm using Ubuntu 14.04.
I have [Pipelight](https://launchpad.net/pipelight) installed - this NPAPI
browser plugin allows me to view Silverlight & new Flash based stuff in
Firefox.
However this has an unfortunate side effect - all web-browsers that support
NPAPI plu... |
asyncio.run_until_complete block after future is set
Question: I'm learning asyncio in python3, I wrote a simple RPC server and client for
study, but when i test it with asyncio.run_until_complete, it blocks after the
future is already set, the code is as below, checkout the **main** part. i'm
using python 3.4.2
... |
Are Mixin classes abstract base classes
Question: Are Mixin classes abstract base classes? In the example below, the calls to
test_base would fail because python wouldn't be able to resolve
self.assertEqual for example.
Also, is PyCharm incorrect as flagging Mixin classes like the one below has
having unresolved attri... |
reading middlebury 'flow' files with python (bytes array & numpy)
Question: I'm trying to read a .flo file as a numpy 2Channels image.
The format is described like this:
".flo" file format used for optical flow evaluation
Stores 2-band float image for horizontal (u) and vertical (v) flow compon... |
Python Checking if prime number
Question: so...this is my code down below. I altered it all ways I can think of, but
regardless of what I do it will ether say all the numbers are prime or all the
numbers are not prime. I was hoping someone can point out the obvious error.
Currently this code says all numbers are not pr... |
running django python 3.4 on mod_wsgi with apache2
Question: Hi I am getting the error below when going to the website url on ubuntu server
14.10 running apache 2 with mod_wsgi and python on django.
My django application uses python 3.4 but it seems to be defaulting to python
2.7, I am unable to import image from PIL ... |
Understanding Python documentation: how to know what a function returns?
Question: I am having trouble understanding the background assumptions for reading
Python documentation.
An example: Documentation for the `importlib.import_module` function can be
found at
<https://docs.python.org/3/library/importlib.html#import... |
Calling a python script which has input Fields
Question: I am writing a Python script that has to call a second python script which has
input fields. The normal way to call the second script in Linux command window
is:
python 2ndpythonscript.py input_variable output_variable
Now, I want to call thi... |
Python-Selenium won't wait for my website to refresh?
Question: I am trying to test that logged in users can logout.
To tell Selenium I am logged in I [cookie-jack the
sessionid](http://stackoverflow.com/a/27990317/1075247), like so:
@step(r'I am logged in as "(\w*)"')
def log_in(step, name):
... |
wxPython in Python 3.4.1
Question: I'm relatively new to Python programming, so apologies in advance if this
question seems stupid. I'm trying to download a new Python editor (drpython)
that is written with wxpython. I have Python 3.4.1 64-bit on a Windows 8.1
machine.
I was under the impression that wxpython was bund... |
What is the simplest way to get from MIDI to real audio coming out my speakers (sound synthesis) in Python?
Question: I'm starting work on an app that will need to create sound from lots of pre-
loaded ".mid" files.
I'm using Python and Kivy to create an app, as I have made an app already with
these tools and they are... |
python global name 'collections' is not defined even I imported collections
Question: The following is config.py:
from collections import OrderedDict
def test_config(fileName):
tp_dict = collections.OrderedDict()
with open("../../config/" + fileName, 'r') as myfile:
file_s... |
What is wrong with this python calculator program? (tkinter)
Question: The error reads as:
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1533, in __call__
return self.func... |
In Python, How can I get the next and previous key:value of a particular key in a dictionary?
Question: Okay, so this is a little hard to explain, but here goes:
I have a dictionary, which I'm adding content to. The content is a hashed
username (key) with an IP address (value). I was putting the hashes into an
order b... |
My python in virtual-env is 2.7 but the Django debug screen shows the system's 2.6.6
Question: So inside of my virtual env, if I activate it and type `python`, version 2.7
is opened, as it should.
When an error arises in Django, it shows version 2.6 which is the system
default. Here is what my Apache configuration loo... |
Python & Tkinter - Interface freezes by clicking on a button
Question: I'm working on a project where I must create a Mastermind game interface using
Python language, so I use Tkinter.
The program itself seems to work fine: you can choose the length of the color
code to find and the number of turns you have to find th... |
Python import warning
Question: Let's say I want to use scipy in my program, giving it the alias sp. I also
want to use the linalg module from scipy. Unlike what happens with numpy, the
module is not automatically imported. So I have to write:
import scipy as sp
import scipy.linalg
This achieve... |
How to check how many emails were sent between dates?
Question: I want to count how many emails were sent between certain dates. The date
header looks like this:
Date: Tue, 20 Jan 2015 15:00:37 +0000
When counting other things, I code like this which adds one to the count:
if msg['From'] ... |
Memory overflows when streaming data using Bokeh push_notebook()
Question: It seems that there is a memory leak when calling push_notebook() for
streaming data to a Bokeh plot in an IPython notebook. You can reproduce it
with the following code in an IPython notebook cell:
from bokeh.plotting import *
... |
Python: how to install a pass-through copy/deepcopy hook
Question: I have a library which stores additional data for foreign user objects in a
WeakKeyDictionary:
extra_stuff = weakref.WeakKeyDictionary()
def get_extra_stuff_for_obj(o):
return extra_stuff[o]
When user object is copied, I... |
Can't Open Python IDLE
Question: Getting the following message after the program opening 9 separate screens.
Any ideas? Tried uninstalling and reinstalling but no luck:
try:
import idlelib.PyShell
except ImportError:
# IDLE is not installed, but maybe PyShell is on sys.path:
t... |
error on installation of opencv does not make sense
Question: when I run `brew install opencv` I get the following error:
Error: undefined local variable or method `which_python' for #<Formula opencv (stable) /usr/local/Library/Formula/opencv.rb>
naturally I went to check this out by opening up
`/u... |
python convert unicode into it's "print" form
Question: I grabbed this paragraph in a webpage:
> It doesn’t look like a controversial new case management system is going
> anywhere. So the city plans to spend the next few months helping local
> social assistance workers learn to live with it.
and in my downloaded htm... |
cross domain call using using python and make ajax call to the python to read data
Question: I am trying to make an ajax request to a python script running in the same
webserver. The call happens fine. I am using python to make the cross domain
call to return some data back. with .success() i get back all the content o... |
cannot solve my flask bluprint assertion error
Question: I'm trying to split my app with using Bluprint in flask, but i got
AssertionError though there's no funtions having same names. i thought if the
function name is different, the default endpoint will be different too. I've
searched for it, but still i couldent get... |
Attempt at Infinite Monkey theorem using Python
Question: So , I've been trying to implement the infinite monkey theorem using
python.The problem statement is something like this.
The theorem states that a monkey hitting keys at random on a typewriter
keyboard for an infinite amount of time will almost surely type a g... |
How do I extract all the numbers (integers) from a text file using python?
Question: How do I extract all the numbers (integers) from a text file using python? I
am only using them in the def part to make a function of a button. I should be
able to calculate them after extracting them.
Answer: You could use `re.finda... |
scikit-learn: Get selected features for prediction data
Question: I have a training set of data. The python script for creating the model also
calculates the attributes into a numpy array (It's a bit vector). I then want
to use `VarianceThreshold` to eliminate all features that have 0 variance (eg.
all 0 or 1). I then ... |
How to return value for different layers of (x,y) levels
Question: My problem is the following. I a functional requirement where the user can
choose between 3 or 5 levels and a value will be returned according to which
level (x,y) belong.
for example in 3 levels we have
def f(x,y):
if (0 <= ... |
Int vs Double on Python
Question: I'm in stats class right now and I wanted to know if it makes a difference if
you generate a number each digit at a time vs every digit at once, so I wrote
some code...
from random import randint
import math
total1 = 0
total2 = 0
for i in range(10000... |
How does variable scoping work with python imports
Question: I am having difficulty understanding how global variables from a module are
actually imported in another module. Suppose we have a module mod1.py coded as
below:
#mod1.py
var1 = None
def test():
global var1
var1=1
... |
In python module troposphere I am getting an error "AttributeError: 'module' object has no attribute 'EBSBlockDeviceMapping'"
Question: I'm following the example of some other code that has been written. The code
in question looks like this:
if virtualname == "ebs":
if deviceSize == None:
... |
How to change the value of a local variable (python) each time the code loops?
Question: I have to create an ATM style program wherein the code looks something like
this:
import sys
def ATM():
bank = 0
coins = int (input ("Enter coins: "))
bank = coins+bank
o = input("... |
Gap Filling Contours / Lines
Question: I have the following image:

and I would like to fill in its contours (i.e. I would like to gap fill the
lines in this image).
I have tried a morphological closing, but using a rectangular kernel of size
`3x3` wit... |
How to write two python dictionaries to a single csv?
Question: Can anyone please tell me how to write two `dict`s to a single csv? I tried
with one dict:
import csv
my_dict = {"test": 1, "testing": 2}
with open('mycsvfile.csv', 'wb') as f: # Just use 'w' mode in 3.x
w = csv.Di... |
Python - Printing an HTML page give empty response for some sites
Question: I want to print a html page from a site (whoscored.com). I can print, but if I
try a sub-domain, gives an empty response:
import urllib2
htmlfile =urllib2.urlopen("http://whoscored.com/Matches/829663/Live/")
html = htmlfi... |
Python - How to pass global variable to multiprocessing.Process?
Question: I need to terminate some processes after a while, so I've used sleeping
another process for the waiting. But the new process doesn't have access to
global variables from the main process I guess. How could I solve it please?
Code:
... |
Tornado. How get raw request.body?
Question: guys. I can't get raw body data with Tornado. I do request `curl -i
localhost:8888 -d '{"a":12}'` and expect to get a string `'{"a":12}'` in
request.body, but received `'{a:12}'`. Source code:
import tornado.web
import tornado.ioloop
class MainHan... |
Adding filename variable into HTML string in Python
Question: I've searched and can't find a solution to this. I'm trying to have the python
code loop through a directory for .mht files. Upon finding files it will write
an iframe html code to a file pointing to the .mht's. I'm having trouble
defining the iframe code to... |
Python - drawing randomly n numbers integer from range
Question: I would like get the same effect as when I use `getn`, but it should be
integers numer from interval `[1...100]`
Answer:
from random import randint
randint(1, 100) # => 86
If you want a bunch of numbers,
def getn_ra... |
Using Windbg PyKD Python Extension to Print/Break at Only Call Instructions
Question: Using WinDBG's python extension I want to print only call instructions in
console. [A kind of one step debugging ]
**My Code:**
from pykd import *
pid = raw_input ('pid >>> ')
id=attachProcess(int(pid))
pri... |
multiprocessing : why are my processes not running in parallel?
Question: I am having a little bit of trouble understanding what is going on here. I
want to run some subprocess calls in parallel using the multiprocessing
module.
My simple example is basically calling a function that waits for 5 seconds,
prints an outp... |
wxPython fails to quit
Question: My wxPython GUI either quits with a Segmentation Fault or fails to quit at all
using the standard options. The only successful quit option (no errors) is
wx.Exit, which I understand is not a great practice. I've traced the issues
down to a few factors, but I'm scratching my head as to w... |
Adding up a value after matching a line using append from a text file using python 3.x
Question: I have a text file which contains lines as followed
Data_1 (2): 01 sec
Data_1 (1): 01 sec
Data_1 (1): 02 secs
Data_2 (2): 04 secs
Data_1 (3, 1, 2): 2 hrs 40 mins 02 secs
Data_2 (1): 03 sec... |
Run SimpleOBEXClient/Server LightAquaBlue on OS X Yosemite 10.10
Question: I have managed to install LightAquaBlue 0.4
(<http://lightblue.sourceforge.net/LightAquaBlue/>) through the command
python setup.py install
However, I have tried to build with Xcode 6.0 both projects
SimpleOBEXClient/Server ... |
Write a for loop in Abaqus Macro (Python)
Question: I've been using Abaqus for a while but I'm new to macros and python script.
I'm sorry if this kind of question has already been asked, I did search on
google to see if there was a similar problem but nothing works..
My problem is the following :
I have a model in Ab... |
Python with selenium: rerun on pre-existing browser
Question: I'm using Python with Selenium 2.44. When the test fails, I can't just
uncomment all the code before the failure when debugging it, because the
driver will not be declared for the browser. Therefore, whenever I try fixing
something, I always have to open a n... |
Statsmodel multivariate OLS error "matrices are not aligned"
Question: I am trying to solve multivariate regression. Here is the code attached for
the regression. The model builds fine, but when I try to retrieve the summary,
it gives following error
**ValueError: matrices are not aligned**
Here is the traceback:
... |
bad zip file error in POS tagging in NLTK in python
Question: I am new to python and NLTK ..I want to do word tokenization and POS Tagging
in this.I installed Nltk 3.0 in my Ubuntu 14.04 having a default python
2.7.6.First I tried to do tokenization of a simple sentence.But I am getting
an error,telling that "BadZipfil... |
ImportError: cannot import name pynestkernel
Question: So I spend last night trying to install nest (and pynest) to use with PyNN,
and I am currently stuck. When I try to import nest I get:
>>> import nest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/l... |
BeanShell command line interpreter features
Question: I'm trying to test BeanShell's command line interpreter in how it processes
basic Java commands and syntax on my machine, and see if I can customise its
behavior in any way. I've installed version 2.0b4 on my machine running OS X
10.10.1 (the JAR file is in `/Librar... |
Python sqlite3.OperationalError: no such table:
Question: I am trying to store data about pupils at a school. I've done a few tables
before, such as one for passwords and Teachers which I will later bring
together in one program.
I have pretty much copied the create table function from one of these and
changed the val... |
Python Django json serialise
Question: I have a mysql objects.filter that I was trying to serialise to json. My
fields are `domain, generated_on, id, priority_mx, record, record_points_to,
ttl`
However, after I serialise the data like
from getdata.models import record_search
query_data = record_sear... |
CGI with Python
Question: I'm beginning to use CGI with Python.
After running the following piece of code:
#!c:\python34\python.exe
import cgi
print("Content-type: text/html\n\n") #important
def getData():
formData = cgi.FieldStorage()
InputUN = formD... |
Using functions as input
Question: I've written a program (A) that takes, as input, the names of functions I
wrote in a separate program (B). I want to use these functions in program (A),
so I am trying to run (A) by doing this: A(f1, f2, f3, f4)
At the top of (A), I imported program (B) using import B. In (A) there i... |
List being altered while working on copy in Python 2.7
Question: I made a copy of a list in python so that I could analyze the old matrix
without affecting it during calculation, however the original list is being
altered, as shown by my output. Here is my code:
def golevolve():
global world
... |
When I'm plotting a colorbar in python using matplotlib I'm getting an error
Question: I am using python 2.7 and want to make a simple colorbar. What I'm doing is
this:
import matplotlib.pylab as plt
import matplotlib as mpl
redgreendict = {'red':[(0.0, 1.0, 1.0), (0.5, 1.0, 1.0) ,(1.0, 0.0,... |
django os.path.dirname(__file__)
Question: I am doing exercises from book:
<http://www.tangowithdjango.com/book17/chapters/templates_static.html>
and I have problem with this code:
import os
print __file__
print os.path.dirname(__file__)
print os.path.dirname(os.path.dirname(__file__))
... |
How to define/install Scala facet in IntelliJ IDEA 14.0.x?
Question: In [How to fix IntelliJ IDEA's SDK after it got "corrupted" that leads to
"{class} cannot be found"?](http://stackoverflow.com/q/28132765/1305344) I
found screenshots with Scala facet (and Python one). I don't have it nor can I
define one myself.

And when I want ... |
Plotting planet speed in Python using matplotlib and quantities: RuntimeError
Question: I am writting a program in python to plot planet's distances to the Sun vs
orbital velocity. No problem with that. Then I have to plot in the same graph,
a line with the function: v = GMsun/r, where v is orbital speed, G is Newton's... |
Unable to parse Url with python urlparse
Question: I am trying to write a small script that will take url as input and will parse
it.
Following is my script
#! /usr/bin/env python
import sys
from urlparse import urlsplit
url = sys.argv[1]
parseUrl = urlsplit(url)
print 'sch... |
wxPython conditionally display and hide
Question: I am new to wxPython and would like to use it to build a simple dynamic UI
which conditionally show and hide some drop-down boxes, which can be done
easily in jQuery.
So from my first level combo-box, if a user choose 'Op1_1', a second level
combo-box A will appear. On... |
Writing the Content-Length header to the client from the server in Tornado
Question: I have a tornado server, that simply prints the headers that the client sent.
server.py :
import tornado.httpserver
import tornado.ioloop
import tornado.httputil as hutil
def handle_request(request):
... |
I cannot get the restart button to work on my stopwatch. Using Pythonista on iPhone
Question:
import ui
from time import *
start = int(time())
def stop_time(sender):
finish = int(time())
total_time = int(finish - start)
button1 = str("Your time is %i seconds." % (total_time))
... |
Extracting text following a specific a-tag
Question: i have a problem extracting text from a html-code with python. The code looks
as followed:
<div class="...">
<br/><a href="link1.html" title="title1">anchor1</a>text1
<br/><a href="link2.html" title="title2">anchor2</a>important text to extract... |
How to add a colorbar properly in python 2.7.2?
Question: I am affraid this sounds like a noobish question, but I am in trouble coding a
colorbar around my figures.
I took some time reading the documentation and these kind of examples :
colorbar(mappable, cax=None, ax=None, use_gridspec=True, **kw)
and I can not unde... |
Writing and reading namedtuple into a file in python
Question: I need to write a datastructure stored as namedtuple to file and read it back
as a namedtuple in python.
Solutions here suggest using Json.load/s or pickle which write the variable as
json key-value pair in the form of strings.However, all my field
accesse... |
Using Regex to Change Filenames with Python
Question: I'm trying to use change a bunch of filenames using regex groups but can't
seem to get it to work (despite writing what regexr.com tells me should be a
valid regex statement). The 93,000 files I currently have all look something
like this:
Mr. McCONNE... |
working with NMEA data sent to URL/IP
Question: i have a bunch of devices that send NMEA sentences to a URL/ip. that look like
this
"$GPGGA,200130.0,3447.854659,N,11014.636735,W,1,11,0.8,41.4,M,-24.0,M,,*53"
i want to read this data in, parse it and upload the key parts to a database.
i know how to parse it and uploa... |
Read output and input each line separately - Python/SecureCRT
Question: I am trying to get a Python script to read the output of a command, then to
run multiple commands based on the list it receives. I don't generally write
VBS or Python, so I'm getting stuck. (it's ugly)
def Main():
objTab = cr... |
Python Numpy mask NaN not working
Question: I'm simply trying to use a masked array to filter out some `nan`entries.
import numpy as np
# x = [nan, -0.35, nan]
x = np.ma.masked_equal(x, np.nan)
print x
This outputs the following:
masked_array(data = [ nan -0.335572... |
how do i take unlimited sys.argv[] arguments?
Question: To elaborate, I am interested in learning how to code out in python a
sys.argv[] function that allows the user to supply as many arguments as the
user wants. I am unsure on if there is a better way to do this or if it can be
done at all.
The point to this is to d... |
Python multiple read on stdin cause it to block
Question: I am a student in programming school and need to complete a project playing
with financial stock's data.
I chose to do it in Python as it's the only language I played few days with
which is not taught in my school, I must be able to read on the standard input
a... |
Python - sum an array imported from a CSV file
Question: I am trying to sum up the values from a csv file after being placed into a
list, i want to add them all together. The list as it goes:
'50', '51', '53', '55', '56', '56', '56', '61', '64', '67', '68', '71', '79', '81', '86', '86', '87', '94', '96',... |
Compiling .pyx to .so using setup.py
Question: I have a module that contains .pyx and their equivalent .cpp.
When I run, `python setup.py develop`, only the `.cpp` files get converted to
`.so`. However, since only the `.pyx` file are readable enough for me to
change them, I would like them to be converted to `.so` ins... |
Serial communication with Tkinter
Question: I'm writing some code in Python to make a GUI that controls an electronic
board. I put buttons on the GUI and send commands by clicking on it. This part
works. But I need to receive information that comes from the board to change
some stuff in the GUI. It is this part that I ... |
Can version control tool deal with rich text document?
Question: Here the "rich text" may be a regular Word document, or a notebook of
Mathematica.
By now, I use git to control my Matlab code and a few python code. But it
looks like the rich text file cannot be control by git.
Is there a solution to accomplish this t... |
Plotting second figure with matplotlib while first is still open
Question: K here's a more precise example of what I am trying to do. I am using
WXBuilder for Python as my user interface with multiple plotting functionality
i.e. the user must be able to plot a graph based on their chosen parameters.
After a graph is pl... |
Why aren't my consumers consuming?
Question: **EDIT: I have tracked down the problem to be the part of my program where I
download the Zip file and parse it. If I comment that out and replace it with
a default line, it parses 10,000 times with no problem.**
Not sure how much of this question should be edited to reflec... |
ImportError: No module named 'paramiko'
Question: I have done through the other questions online here, and I feel that mine is
different enough to warrant a new question.
So I have a `Centos 6 box`, which is running a small website for me, acts as
an office git server and I am trying to configure `Python3` on it.
So ... |
IOError: [Errno Input overflowed] -9981
Question: I am trying to execute a PyAudio python capturing program on Rasbian in my
RaspberryPi model B board, but getting error:
Traceback (most recent call last):
File "/home/pi/pythonsound/record.py", line 35, in <module>
data = stream.read(CHUNK)... |
Graph.get_adjacency() is slow and the output is strange
Question: Consider a graph object G in python-igraph 0.7. If I want the adjacency matrix
A of G, I have to write `A=G.get_adjacency()`, but there are two problems:
1. Even if G is sparse with 3000 nodes, A is generated in a long time on my commercial laptop. Is... |
Python syntax error with If/Else statement
Question: hey I need help with a stupid syntax error using the if and else statement.
GNU nano 2.2.6
#!/usr/bin/python
print 'ACTIVATED'
import RPi.GPIO as GPIO ## Import GPIO library
GPIO.setmode(GPIO.BO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.