text stringlengths 226 34.5k |
|---|
CSV import with Python; incorrect "," delimiter behavior
Question: I am using the csv module in the following manner
header = '"Id","IsDeleted","MasterRecordId","Salutation","FirstName","LastName","Name","Type","RecordTypeId","ParentId","BillingStreet","BillingCity","BillingState","BillingPostalCode","Bi... |
Issue executing updatetool glassfish in Debian
Question: I have installed glassfish 4 and it works pretty well but few minutes ago I
tried to execute `updatetool` but I get this error:
./updatetool: 283: ./updatetool: /home/mazzy/glassfish4/updatetool/bin/../../pkg/python2.4-minimal/bin/python: not found... |
How to create a psd layered file from multiple image in python
Question: I need to create a psd file to merge several images into a single layered one.
I saw that the _gimp command line_ seems to be the only way to be able to do,
but I would like to make this tool-independent.
_Would there be another solution ?_
F... |
how to input a respond to prompt of a command by python?
Question: I ma running a Python code utilizing from prompt commands. It sometimes
conflicts with the existing files and says
File 'outputs/g/Charlotte_s_Web_2006_-_Trailer.avi' already exists. Overwrite ? [y/N]
where the file name is changing... |
export data from sqlite to Excel file in multiple tabs in python
Question:
......
......
ofile = open('test.csv', "wb")
writer = csv.writer(ofile)
conn=sqlite3.connect('test.sqlite')
c=conn.cursor()
c.execute("select * from emp")
mysel=c.execute("select * from emp")
for row in myse... |
Persistence of a large number of objects
Question: I have some code that I am working on that scrapes some data from a website,
and then extracts certain key information from that website and stores it in
an object. I create a couple hundred of these objects each day, each from
unique url's. This is working quite well,... |
convert ascii to integer like '\x01' inputs
Question: I get data from network in bytearray and I need to get integer value in
bytearray[i]. It is ASCII and when I try to convert integer with int() I get
exception. How can I try to convert '\x01' to get 1 in python? Thanks.
Answer: Use [`ord`](http://docs.python.org/2... |
Dictionary with tuples as values
Question: Is it possible to create a dictionary like this in Python?
{'string':[(a,b),(c,d),(e,f)], 'string2':[(a,b),(z,x)...]}
The first error was solved, thanks! But, i'm doing tuples in a for loop, so it
changes all the time. When i try to do:
d[ke... |
Sublime Text accessing view file name error
Question: I am new to Python, and Sublime Text plugin development, and I don't know what
I'm doing wrong here. I am using Sublime Text 3. I'm trying to create a plugin
that will copy the file name to the clipboard. Can anyone help me understand
this python error and/or offer ... |
why Popen can't exec python cmd?
Question: I want to exec command using Popen, see my code below:
import subprocess
p = subprocess.Popen('/usr/bin/python a.py')
p2 = subprocess.Popen('ls', stdout = subprocess.PIPE)
print p2.stdout.readlines()
while I exec this script, I get the error be... |
Opencv Python display raw image
Question: I can't figure out how to display a raw image wich conatains 640x480 pixel
information, each pixel 8 bit. (Gray image)
I need to go from an np array to Mat format to be able to display the image.
#!/usr/bin/python
import numpy as np
import cv2
import... |
Newbie Python Script - read()
Question: I am trying to learn more about python and wrote a simple script but I can't
get the read() function to work. What am I missing? The error message I am
getting is:
Traceback (most recent call last): File "ex16demo.py", line 28, in print
glist.read() IOError: File not open for re... |
Opening a JPEG Image in Python
Question: I am running into a problem opening jpeg images in Python 2.7 using the
following code.
import Tkinter as tk
from PIL import ImageTk, Image
path = 'C:/Python27/chart.jpg'
root = tk.Tk()
img = ImageTk.PhotoImage(Image.open(path))
panel... |
How to make an executable with cx_freeze?
Question: I making an executable with python 2.6. I made the setup code.
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "Aimball",
versio... |
Accessing passed data through ajax call in my python script
Question: I've been breaking my head since morning over this, but can't get it work.
Basically, what I want to do is that upon clicking 'Send' in an html page, the
account number (it's value in a textfield) should be sent to my python script.
Now, how can I ac... |
stanford corenlp not working
Question: I'm using Windows 8, and running python in eclipse with pyDev.
I installed Stanford coreNLP (python version) from the site:
<https://github.com/relwell/stanford-corenlp-python>
When I try to import corenlp, I get the following error message.
Traceback (most recent... |
Python: urwid: trying to handle different views
Question: I try to program with different views.
Therefor, i tried to make a class which handles different views with urwid,
also to separate the view code from the rest.
After a lot of different tries i don't know where to start anymore.
Which urwid objects do i need ... |
Python - strptime ValueError: time data does not match format '%Y/%m/%d'
Question: I believe I am missing something trivial. After reading all the questions
about `strptime ValueError` yet I feel the format seems right, Here is the
below error I get
Traceback (most recent call last):
File "loadScri... |
Python - need help looping a list through functions using 4 different ranges (0-25, 0-100, 0-1000, 0-10000)
Question: Python Version - 3.3.2
I am writing a Python program that sets a list equal to a range of numbers
(0-25), shuffles these numbers randomly and then sorts these numbers using
four different sorting funct... |
Python Tkinter: Embed a matplotlib plot in a widget
Question: I have already search for this, for example [Python Tkinter Embed Matplotlib
in GUI](http://stackoverflow.com/questions/4073660/python-tkinter-embed-
matplotlib-in-gui) but still can't figure it out. Basically i am trying to
plot a fancy graph for a player a... |
How to run python program as a daemon?
Question: I write the following program to run my program as a daemon but it is not
getting run; when i run the program from python debugger it works.
I am using Mac os x.
`/User/Library/LaunchDaemons/com.bobbob.osx.test.plist`:
<?xml version="1.0" encoding="UTF-8... |
Proxy Selenium Python Firefox
Question: How can I redirect the traffic of Firefox launched by Selenium in Python to a
proxy? I have used the solutions suggested on the web but they doesn't work!
I have tried:
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
p... |
Play a part of a .wav file in python
Question: Is it possible to play a certain part of a .wav file in Python?
I'd like to have a function `play(file, start, length)` that plays the
audiofile `file` from `start` seconds and stops playing after `length`
seconds. Is this possible, and if so, what library do I need?
An... |
Socket programming in python counter not working
Question: I am making a client and a sever relation ship using python. The client has a
button in which I click the button it will connect to the server and count the
clicked button by the client.
But in my situation, the server only count once and the client button is ... |
python: rstrip one exact string, respecting order
Question: Is it possible to use the python command `rstrip` so that it does only remove
one exact string and does not take all letters separately?
I was confused when this happened:
>>>"Boat.txt".rstrip(".txt")
>>>'Boa'
What I expected was:
... |
Uploading images - Google App Engine + Python
Question: I'm using this link as an example to uploading images:
<https://gist.github.com/jdstanhope/5079277>
My HTML code:
<form action="/upload_image" method="post" id="form1" runat="server">
<div class="fileButtons">
<input type=... |
In admin I see "App_name object" but not actual object name
Question: So, I learning django by this <http://mherman.org/blog/2012/12/30/django-
basics/> tutorial and I have one problem.
I added couple books to database but in admin site I see only "App_name
object". In my case I see only list of words "Books object", ... |
How to find what time is it in another country from local
Question: this time, i have questions on timezones in Python
How do i , say from anywhere in the world, convert that local time into say,
New york time? first of, I think datetime module is the one to use. Should I
use utcfromtimestamp() , then use some other f... |
Installing numpy on Amazon EC2
Question: I am having trouble installing numpy on an Amazon EC2 server. I have tried
using easy_install, pip, pip inside a virtual env, pip inside another virtual
env using python 2.7...
Every time I try, it fails with the error: `gcc: internal compiler error:
Killed (program cc1)`, and ... |
django.contrib.comments.moderation.AlreadyModerated error in zinnia django
Question: I had a django app in which i am using `django-zinnia-blog` for my blog
functionality.
**Issue One**
And now i updated `zinnia` with latest `github` version and i am getting the
below wierd error
Unhandled exception in... |
python manage.py syncdb errors
Question: I guys when run the command python manage.py syncdb i have the following
errors:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/c... |
Python console output gets overwritten in Debian 6
Question: I have a small script in python which automates installation of a few packages
like wget, git, using apt-get in Debian 6 (Python 2.6.6). the script then
installs `pip` and then using `pip`, installs _requests_ and _phpserialize_.
The following is the output g... |
Live plotting using matplotlib without hault
Question: Here is a minimum working example of my code.
I am trying to plot a live graph using matplotlib by taking some inputs from
the user via gui. For building the gui, I used the library
[easygui](http://easygui.sourceforge.net/tutorial/)
However, there is one problem... |
Efficient netCDF analysis when looping through data
Question: This is a follow up question related to [this
question](http://stackoverflow.com/questions/18665078/loop-through-netcdf-
files-and-run-calculations-python-or-r).
Thanks to previous help I have successfully imported a netCDF file (or files
with MFDataset) an... |
Python SST tests never fail
Question: I've just started looking at [SST](http://testutils.org/sst/index.html) this
morning. I've written this simple test case, which always passes:
from sst.actions import *
from sst import cases
class RootTest(cases.SSTTestCase):
def test_root_page(s... |
ssh.exec_command("shutdown -h 17:00 &")
Question: I have a Python Paramiko script that sends commands to remote hosts on out
intranet. There are times when I would like to send the shutdown command to
several hosts at once. The issue is that the shutdown command simply sits and
waits unless you background it. I have tr... |
Strange Python Module issue, just on a mac
Question: I have psutil installed, I can import it fine and use it to pull information,
if I show all the modules, I can see it is installed. However if I run the
code below
try:
imp.find_module('psutil')
pass
except ImportError:
print 'Th... |
Python module organization to make import statement cleaner
Question: I have a directory B inside directory A, which resides in a directory included
in `PYTHONPATH`.
Now lets say that within directory B i have files - B_file_1.py, B_file_2.py,
with each file defining a single function (i.e. B_file_1.py defines
`B_file... |
Python Index out of range on Cash flow
Question: Having trouble with a code that should read comma separated values out of .txt
file, sort into arrays based on negativity, and then plot data. Here is the
code, followed by 2 .txt files, the first one works, but the second one
doesn't
#check python is work... |
Reading Serial Data from Arduino with Python
Question: I'm working on a little project using the [MaxSonar EZ1 ultrasonic range
sensor](http://www.maxbotix.com/Ultrasonic_Sensors/MB1010.htm) and Arduino
Diecimila.
Using the [MaxSonar playground
code](http://playground.arduino.cc/Main/MaxSonar), I have Arduino writing ... |
Deploying Django app on Heroku: Can I manually set environment variables in the .env file? Do I need to install tools like autoenv, heroku-config...?
Question: ## My goal:
I intend to follow "The Twelve-Factor App" methodology for building my Django
app on Heroku.
## Introduction:
I'm following the "Getting Started ... |
pyxb UnrecognizedDOMRootNodeError
Question: i've got the following xml schema:
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="DataPackage">
<xsd:sequence>
<xsd:element name="ti... |
Reading lines in captured stdout in python
Question: I am trying to capture stdout and then parse it after calling a function. I am
doing so by means of a cStringIO.StringIO object but the readline call yields
nothing. I have created below test to show you what's happening:
import cStringIO, sys
... |
Unable to send notification to errbit
Question: I am using Python's <https://github.com/pulseenergy/airbrakepy> Which is a
synonym to Ruby's Airbrake gem. Now, i have installed
<https://github.com/errbit/errbit> at my end. Now, i want to send all error
notices to errbit. I have something similar to,
impo... |
Filter strings into list depending on position - Python
Question: For example, this is my string:
myString = "<html><body><p>Hello World!</p><p>Hello Dennis!</p></body></html>"
and what i am trying to achieve is:
myList = ['Hello World!','Hello Dennis!']
Using regular expressio... |
triangulation without long triangles
Question: In python, for a set of points, With
import matplotlib.tri as tri
triang = tri.Triangulation(x, y)
How I can make a mask for eliminate the triangles with long edges ?
Answer: finally I solved with this :
import matplotlib.tri as tr... |
Stuck colored filled area in bar chart, python
Question: everyone,
I want to create a bar chart but with a filled background.
For example: for 0 to 1 in y axis the background must be black for >1 to <2 in
y axis the background must be red.
In other words, i want to create bar plot with background different colored
c... |
How do I put lines into a list from CSV using python
Question: I am new to Python (coming from PHP background) and I have a hard time
figuring out how do I put each line of CSV into a list. I wrote this:
import csv
data=[]
reader = csv.reader(open("file.csv", "r"), delimiter=',')
for line in ... |
matplotlib + wxpython not sizing correctly with legend
Question: I have a matplotlib figure embedded in a wxpython frame with a few sizers.
Everything works fine until I include a legend but then the sizers don't seem
to be working with the legend.
Even when I resize the window by dragging at the corner, the main figu... |
How to use named colors in wxpython?
Question: I get named colours in `wx` this way:
import wx.lib.colourdb as wb
wb.getColourList()
Although "ORANGE" is in `wx.lib.colourdb`, i cannot set a grid cell's color to
`wx.ORANGE` because it says:
AttributeError: 'module' object has no ... |
Right-to-left Support in Python Networkx and matplotlib
Question: I have tried to draw lexicographic graphs with python33 networkx and
matplotlib running on Linux Fedora 19 KDE, 64 bits. When feeding English
script as input data, the graphs are drawn well. However, when providing
Arabic script as input data, all I get ... |
Pycurl won't import on Raspberry Pi
Question: I'm trying to use pycurl on the Raspberry Pi. I've successfully installed
pycurl using `apt-get install python-pycurl` and I've found a little script to
use to see if it's working correctly:
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'http://news... |
Converting a csv file into a list of tuples with python
Question: I am to take a csv with 4 columns: brand, price, weight, and type.
The types are orange, apple, pear, plum.
Parameters: I need to select the most possible weight, but by selecting 1
orange, 2 pears, 3 apples, and 1 plum by not exceeding as $20 budget. ... |
Data from a Python script to URL as JSON
Question: I've spent a lot of time on this but still can't seem to get it to work. The
task is - I have to send system stats to a URL and the script is supposed to
pull it, convert the namedtuple of each cpu stats of a machine and then send
them all in 1 single POST request as J... |
How to access Mac-specific file metadata?
Question: According to this page, different operating systems can return different
information from the os.stat function.
<http://docs.python.org/2/library/os.html>
I am interested in getting the type and creator.
import os
from stat import *
print(os.s... |
Python. I get an error on Multiple inheritance
Question: All I am trying to do is inherit from two different classes.
from traits.api import HasTraits
from PyQt4 import QtCore, QtGui, uic
class Main_Excel_Class(HasTraits,QtGui.QMainWindow):
pass
I had the "metaclass conflict: the met... |
Passing a C++ std::Vector to numpy array in Python
Question: I am trying a pass a vector of doubles that I generate in my `C++` code to a
`python` numpy array. I am looking to do some downstream processing in
`Python` and want to use some python facilities, once I populate the numpy
array. One of the biggest things I w... |
learnpython.org modules exercise
Question: # Hello community,
**[ Preamble ] :**
I come from a BASH scripting background _(still learning there as well)_ and
decided it might benefit my learning process by venturing into another
language. The natural choice for me seemed to be Python. I began studying a
bit and have... |
Regex match when spaces are removed, how to delete the matched chars from the original string with spaces?
Question: (disclaimer: this is my first stackoverflow question so forgive me in advance
if I'm not too clear)
**Expected results:**
My task is to find company legal identifiers in a string representing a
company... |
Parsing two different html sources and combining the output
Question: I am parsing two different html sources (one spits out "data A,B,C,D, and E"
and the other spits out "data F") with two different scripts. I want to
combine the output of both of these scripts into a simple csv format.
I am trying to run a 3rd scrip... |
Django template's context variables scope?
Question: I'm looking for a solution how to "shadow" context variables in a Django's
template.
Let's have the following structure in one of templates:
{% block content %}
{# set context variables with a custom tag #}
{% paginator_ctx products %} {#... |
Django, problems with overriding model in sites packages
Question: i got problems with overriding of model "Sites", that contains in Sites
framefork. I have a form with "Sites" on my site, i need to display names of
Sites, not Site.domain, i'm override model, route it to same DB table in
"Meta" class and get error, tha... |
How to continue he execution of python script after user change
Question: I want to execute following commands in sequence using a python script:
sudo su - postgres #login as postgres user
psql
I tried using :
import os
cmd = 'sudo su - postgres'
os.system(cmd)
... |
Random string value generator from the given list in python
Question:
sports=['CRICKET','BADMINTON','TENNIS']
bollywood=['WAQT','GULAAL','MAQBOOL']
food=['RAVA DOSA','IDLI SAMBHAR','CENTURY EGG']
print """Choose Your Field
1. SPORTS
2. BOLLYWOOD
3. FOOD"""
field=raw_input('\n Enter Fiel... |
How to read the first line of a subprocess without buffers filling up in Python
Question: From Python in Linux, I want to start a sub-process, wait until it prints one
line on it's standard out, then continue with the rest of my Python script. If
I do:
from subprocess import *
proc = Popen(my_pr... |
Python Stringvar instance has no __trunc__method
Question: For fun (and to learn...), I'm trying to write a program that takes 3 inputs,
a, b and c, and returns the solution to the quadratic formula. Right now, I'm
getting an error saying StringVar instance has no attribute '**trunc** ' I
initially had my entry variabl... |
Writing a method that I can call in a separate script in python
Question: I am trying to write a method that I can call in a different script, however,
I am not able to successfully call the script(s) with the way I have it
written. This is one of the scripts I am trying to call (the second is very
similar:
... |
Python-ldap not able to bind successfully
Question: I am not having any luck finding answers on this, so here it goes.
When I attemtp to connect to an AD server using python-ldap, it appears to
work successfully for some functions, and not for others. My connection:
>>>import sys
>>>import ldap
... |
how to get the index of numpy.random.choice? - python
Question: Is it possible to modify the numpy.random.choice function in order to make it
return the index of the chosen element? Basically, I want to create a list and
select elements randomly without replacement
import numpy as np
>>> a = [1,4,1,3... |
Python Pyplot: How to scale x-axis independant from number of list-elements?
Question: Just want to plot a list with 50 (actually 51) elements: The list indices from
0 to 50 should represent meters from 0 to 10 meters on the x-axis, while the
index of every further element increases by 0.2 meters. Example:
... |
How to write program run matrix as below in python?
Question: Thanks for everyone's reply. I will explain here. Suppose there is a given
matrix
x y B = [5,-4,5,-6]
[[0,0,0,0], [[0,1,0,1],
[0,0,0,0], [0,0,0,0],
[0,0,0,0], [0,0,0,1],
... |
Set attribute to Element in Python
Question: I am using ElementTree to build an xml. But I am getting an error at Line no:
5
AttributeError: **setattr**
1.import xml.etree.cElementTree as ET
2.summary = open(Summary.xml, 'w')
3.root = ET.Element('Summary')
4.ET.SubElement(root, 'TextSummary'... |
Connection to other side was lost in a non-clean fashion
Question:
from scrapy.spider import BaseSpider
class dmozSpider(BaseSpider):
name = "dmoz"
allowed_domains = ["dmoz.org"]
start_urls = [
"http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",
... |
python: 500 error using json.load() in cherrypy
Question: My code runs fine locally but I get a 500 error with the webhost I'm using.
The problem seems to come from the line
js = json.load(data)
in the search method. Is there something in the cherrypy config that I'm
missing? Any thoughts?
... |
Python import and reload misunderstanding
Question: The original title was: 'Numpy array: 'data type not understood''. Turns out,
the problem was my misunderstanding of Python as an interpreted language.
I have this very simple module 'rtm.py':
import numpy as np
def f():
A=np.array([[1.0,0.... |
Recursive sorting function for list in Python
Question: I want to take a list like the following:
groups = ["foo", "bar", "foo::fone", "foo::ftwo", "foo::ftwo::ffone"]
And convert it into a nested list, probably in the following format, but I'm
open to suggestions:
groups_sorted = [{... |
Finding the Coordinates of Maxima in an Image
Question: **Background:**
I'm new to using Python's PIL for photo manipulation, and have very recently
found the need for a basic photo processing function within an existing
program. My program currently imports an image (effectively a high res shot of
the night sky) in ... |
Python export csv data into file
Question: I have following code which works well but I am not able to trim and store a
data in a datafile:
import nltk
tweets = [
(['love', 'this', 'car']),
(['this', 'view', 'amazing']),
(['not', 'looking', 'forward', 'the', 'concert'])
... |
SQLAlchemy/Pyramid tutorial: attempt to write to readonly database
Question: I am banging my head over this one. I have successfully completed the
SQLAlcemy + URL Dispatch tutorial in the past. Now whatever I do, the attempts
to write to the sqlite db file all fail, throwing:
OperationalError: (Operation... |
Python Cookie Clicker: Auto Click Function?
Question: **My Background:** I have done quite a bit of programming with python, I would
say I am not bad at it. I am familiar with most of the modules, OOP
programming and stuff. You can check my pastebin profile to see what level I
am actually in: www.pastebin.com/u/GameNat... |
Python datetime add
Question: I have a datetime value in string format. How can I change the format from a
"-" separated date to a "." separated date. I also need to add 6 hours to let
the data be in my time zone.
s = '2013-08-11 09:48:49'
from datetime import datetime,timedelta
mytime = datetime... |
Writing multi-line strings to cells using xlwt module
Question: Python: Is there a way to write multi-line strings into an excel cell with
just the xlwt module? (I saw answers suggesting use of openpyxl module)
The `sheet.write()` method ignores the \n escape sequence. So, just xlwt, is
it possible? Thanks in advance.... |
Url open with username and password
Question: I have started to learn scala , the only other language I know is python. I am
trying to write a code in scala which I have written in python. In that code I
have to open a url thats in xml format which require a username and password
and then parse it and get the elements ... |
How to start a query from a static website?
Question: **The problem**
I have the following question: I need to search for some information about a
company using the following
[link](http://corp.sec.state.ma.us/CorpWeb/CorpSearch/CorpSearch.aspx).
What I need to do with it is a `search by entity name` with `search typ... |
The use of \s in replace vs regular expressions
Question: While learning python I got my first real python stumper when processing a
multi line file. It seems like `\s` in the replace method does not remove
newlines, where `\s` remove newlines when used in a regular expressions. I can
remove the newlines using replace ... |
Python 2.7 - find and replace from text file, using dictionary, to new text file
Question: I am newbie to programming, and have been studying python in my spare time for
the past few months. I decided I was going to try and create a little script
that converts American spellings to English spellings in a text file.
I ... |
Exception during groupby pandas
Question: I am just beginning to learn analytics with python for network analysis using
the [Python For Data
Analysis](http://shop.oreilly.com/product/0636920023784.do) book and I'm
getting confused by an exception I get while doing some groupby's... here's my
situation.
I have a CSV of... |
Logging ping results python?
Question: I can use the ping command and save the output using the following line:
command = os.system('ping 127.0.0.1 > new.txt')
However each time the script is run the text file is overwritten so I only
have the last ping saved. I have looked into logging but cannot ... |
terminal: open editor by click on stacktrace line
Question: I want python stacktrace lines to act like hyperlinks in a terminal. My
favorite editor should open the file and go to the correct line:
Traceback (most recent call last):
File "/home/foo_eins_dt/djangotools/utils/smtputils.py", line 73, i... |
WTForm not displayed, got python code instead
Question: I’m making a form for flask using WTForms. Here is the corresponding code :
class UploadForm(flask.ext.wtf.Form):
def __init__(self,year):
flask.ext.wtf.Form.__init__(self)
self.year=year
subjects = app.co... |
Cannot establish connection to sql-server using pyodbc on Windows 7
Question: I'm using ActivePython 2.7.2.5 on Windows 7.
While trying to connect to a sql-server database with the pyodbc module using
the below code, I receive the subsequent Traceback. Any ideas on what I'm
doing wrong?
CODE:
import py... |
How can i let the BASH script run as process? So that even the Python script is killed the BASH script runs forever?
Question: I need to track and launch few BASH scripts as process (if they for some
reason crashed or etc). So i was trying as below: but not working
def ps(self, command):
proces... |
ideas reseting stats in class
Question: Hi I made a simple program but when my monster dies the stats dont reset(hp
mainly) I am lost In how to make it reset every time the monsters hp reaches 0
and the xp is awarded. I know that I can wright the code over again and again
but I would like to be able to make it continue... |
error in dynamic bar chart generation on python
Question: Going by the this example,
<http://matplotlib.org/examples/pylab_examples/barchart_demo.html>
I wanted to generated the dynamic bar chart.so far I have following script.
import sys
import matplotlib.pyplot as plt
import numpy as np
... |
Python PIL cut off my 16-bit grayscale image at 8-bit
Question: I'm working on an python program to display images of stars. The images are
16-bit grayscale tiffs. If I try to display them in an extern program, e.g.
ImageMagick they are correct but if I load them in python and then use
'show()' or implement them in a c... |
AttributeError: '_pjsua.Transport_Config' object has no attribute '_cvt_to_pjsua'
Question: I'm currently trying to use the `pjsip` api `pjsua` in python and therefor
studying this Hello World example:
<http://trac.pjsip.org/repos/wiki/Python_SIP/Hello_World>
I copied the code over, integrated account configuration ac... |
Redis mass insertion do not work
Question: Problem as simple as I want to do mass insertion in redis using a file and
redis-cli in pipe mode. Redis documentation explains this here:
<http://redis.io/topics/mass-insert>
My file contains only this command:
HMSET client:1 name "Michael"
When I try it... |
How to show a text from wx module?
Question: Yesterday found out that my router can be controlled by telnet, and today I
was looking for some qt4,pygtk or wx to store all the router telnet commands
in a gui. Less than 15 minutes ago I found this website -
zetcode(dot)com/wxpython/advanced/ , which got the right informa... |
Comparing two numpy arrays of different length
Question: I need to find the indices of the first less than or equal occurrence of
elements of one array in another array. One way that works is this:
import numpy
a = numpy.array([10,7,2,0])
b = numpy.array([10,9,8,7,6,5,4,3,2,1])
indices = [num... |
neo4django mixin inheritance problems
Question: Considering [my previous
question](http://stackoverflow.com/questions/18849973/neo4django-multiple-
inheritance), I try to implement what I need.
The following is the content of a django app models.py.
from neo4django.db import models
from neo4django.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.