text stringlengths 226 34.5k |
|---|
Why can't I access the private variables of the superclass in Python?
Question: I know that I _should_ use the access methods. I see in the `datetime` module
that the class `datetime` inherits from date.
class datetime(date):
<some other code here....>
self = date.__new__(cls, year, month... |
bash: syntax error near unexpected token `(' - Python
Question:
# from lxml import etree;
import module2dbk;
print module2dbk.xsl_transform(etree.parse('test-ccap/col10614/index.cnxml'), []);
Error: bash: syntax error near unexpected token `('
Answer: add `#!/usr/bin/env python` at the to... |
Convert float to comma-separated string
Question: How would I convert a float into its 'accounting form' --
100028282.23 --> 100,028,282.23
100028282 --> 100,028,282.00
Is there a python method that does this?
Answer: You can use the
[`locale.format()`](http://docs.python.org/library/locale.h... |
Biopython local BLAST database error
Question: I am trying to run blastx locally with the "nr" database using Biopython's
NcbiblastxCommandline tool but I always get the following error regarding the
protein database search path:
>>> from Bio.Blast.Applications import NcbiblastxCommandline
>>> nr = "... |
pythonpath for google app engine in pydev eclipse
Question: I have `google app engine` installed to /home/mydev folder such that
dev_appserver.py is in `/home/mydev/google_appengine` directory.
In eclipse helios,I have pydev and for my project's PYTHONPATH,I added the
path `/home/mydev/google_appengine/lib` under exte... |
Python checking if a fork() process is finished
Question: Just wondering if some one could help me out. The problem I'm having is that I
os.fork() to get several bits of information and send them to a file, but
checking to see if the fork process is not working.
import sys
import time
import os
... |
Moving from multiprocessing to threading
Question: In my project, I use the `multiprocessing` class in order to run tasks
parallely. I want to use `threading` instead, as it has better performance (my
tasks are TCP/IP bound, not CPU or I/O bound).
`multiprocessing` has wonderful functions, as `Pool.imap_unordered` and... |
Python Run Two Functions With Different Timers In One Daemon
Question: I'm using the [template python daemon discussed
here](http://stackoverflow.com/questions/473620/how-do-you-create-a-daemon-in-
python) in two different scripts to launch two separate daemons. I would like
to combine them into one daemon script that ... |
Why does the pygame window not close properly?
Question: When I go to close the program window, the program freezes, then I am forced
to force quit the program. Why doesn't the program close when the X / Close
button is clicked on. I am also using python 2.7 if that matters.
import pygame
import os, ... |
how to schedule a timed event in python
Question: I'd like to schedule a repeated timed event in python like this: "at time X
launch function Y (in a separate thread) and repeat every hour"
"X" is fixed timestamp
The code should be cross-platform, so i'd like to avoid using an external
program like "cron" to do this.... |
How can I express this Python for loop in Haskell?
Question: Sometimes when I want to use `wget`, I just end up printing a bunch of lines
with Python like so:
>>> for i in range(25):
... print "http://www.theoi.com/Text/HomerOdyssey", i, ".html"
...
http://www.theoi.com/Text/HomerOdyssey 0... |
Set/Get user information from a xmpp server: python
Question: I am new in python and I am trying to create a testing python script to test
different actions on my XMPP server. I already was able to test the login of
my user and now I want to get the information that the server is sending
(stanza) and set new informatio... |
How to make Python 2.7 and Python 3.1 coexist on windows 7?
Question: I have a Python 3.1 installed on my desktop but now I need to have Python 2.7
to run CQL. I installed both versions Python on my box, type 'Python', the 3.1
version was invoked. but when I tried to use 2.7 version by specified the path
of the executa... |
Python's append() only allows unique items in a list?
Question: The python documentation implies that duplicate items can exist within a list,
and this is supported by the assignmnet: list = ["word1", "word1"]. However,
Python's append() doesn't seem to add an item if it's already in the list. Am
I missing something he... |
Python: Decimal part of a large float
Question: I'm trying to get the decimal part of `(pow(10, i) - 1)/23` for `0 < i < 50`.
I have tried
(pow(10, i) - 1)/23 % 1
in Python 3 but I get `0.0` for all values of `i` greater than 17.
How can I extract the decimal part of a large integer in Python?
A... |
Surf missing in opencv 2.4 for python
Question: I'm trying to instantiate a SURF object in python using OpenCV as described
[here](http://docs.opencv.org/modules/nonfree/doc/feature_detection.html#surf)
but this happens:
>>> import cv2
>>> cv2.__version__
'2.4.0'
>>> cv2.SURF()
Traceback ... |
NameError: a global name 'RPyPException' is not defined
Question: 2ND question: Thanks so much Ben! It works! I got at Error 13 message saying I
couldn't make a temporary file in C:\Program Files so I movd the ARSER folder
and put it under my user name. That took care of the Error 13 but now I get
NameError: a global n... |
GNU time(1) reports wrong I/O count
Question: on fedora 16, running time(1) on a small program that just does 10 writes of
1024 bytes to a file, reports "24 outputs". I was expecting the I/O count to
be 10. Note that if i run strace on the program I can see the 10 write()
calls. So what is the I/O count as reported by ... |
Python db2 install using easy install
Question: I want to install python db2 package for Python but Im unable to install it.
I have installed the easy_install and Im able to successfully import the
easy_install.
My easy_install location :c:/python27/lib/site-packages/
My db2 egg location c:/python27/ibm_db-1.0.5-py2... |
How does one override the __setitem__ method for (possibly multidimensional) arrays created via ctypes _fields_?
Question: I am using ctypes in Python 3.2.2 to encapsulate some C data structures. The
ultimate goal is to be able to have an object that wraps a C structure notice
when the structure's data contents have be... |
Getting a Blobstore key
Question: I am reading about the Blobstore in Google App Engine. The code below is from
the sample documentation. After the user selects a file to upload and clicks
Submit, how do I get the key into a javascript variable? I can show it on a
page, but I only want to keep it for later use. Obvious... |
else: syntax is incorrect
Question: I am a little new to python and I am trying to write this script to cancel
print jobs over 1 mb.. (the line where it is checking for size is set to 1 mb
just to make sure it is working). for some reason my last else statement keeps
saying it has invalid syntax. I checked to see if al... |
Constructing a regular expression for url in start_urls list in scrapy framework python
Question: I am very new to scrapy and also i didn't used regular expressions before
The following is my `spider.py` code
class ExampleSpider(BaseSpider):
name = "test_code
allowed_domains = ["www.exampl... |
pymongo installed but import fails
Question: CentOS 5.8 ships with Python 2.4.3. I installed pymongo using command: sudo
pip install pymongo (after installing pip with easy_install after installing
python-pip...typical CentOS, nothing works out of the box).
The install appears to work, I get the messages:
... |
Python: Idiomatic properties for structured data?
Question: I've got a bad smell in my code. Perhaps I just need to let it air out for a
bit, but right now it's bugging me.
I need to create three different input files to run three Radiative Transfer
Modeling (RTM) applications, so that I can compare their outputs. Thi... |
Compiling WxPython with Py2EXE and IDLE-X
Question: At the moment i am learning python and i have been experimenting compiling
python code.
The problem i am having is, once the script is compiled, it does not respond.
I learnt that an IDLE-X extension can help fix this problem, but the same
error occurs after compila... |
python script that captures an image and compares it to another image
Question: Basically, I want to automate something. I would capture a 100x50 picture of a
certain button, and have a script that takes a picture of the same area with
the same size, and then compares the two pictures to see if they are
different. If t... |
Moving Django 1.3 to new server
Question: I'm trying to move website made in Django 1.3.
Server is set up as the privies one (I think so).
After Django installation, I moved all files to new server, I swap settings
files so now in settings are files from the privies server. I changed files
locations in setting, so ri... |
Plot a cube of 3D intensity data
Question: I have k cubes of `(n,n,n)` intensity values and I would like to plot them.
I consider them as diffusion tensors in diffusion MRI and I would like to
visualize them (maybe as ellipsoids) and then try to "align" in some way. At
present I simply plot for each cube its n "slice"... |
Parsing emails problems
Question: I'm having problems with decoding emails that that I'm fetching.
The script should log on to an email account, get the unread messages and then
later on store them in a database. I only want the actual text from the email
but none of the html stuff.
I have found many examples but non... |
Looping over weekday in python time object
Question: I have a dataset of drivers' travel diaries. For each trip there is an
associated start time, end time and day of week in a csv file. There are no
dates associated with the trips.
I have now got the data into python where each start time and end time has the
weekday... |
TypeError: 'InMemoryUploadedFile' object is not subscriptable
Question: I have a Google Appengine Project using Python2.7 and Django1.2 on Eclipse,
that allows the user to use a form to upload a picture, resize it, and store
it as a BLOB field.
I added a breakpoint where I indicated below, and saw "file['content']"
sh... |
wordpress with python on proxy server
Question: This is a code for posting on a blog. It is my first try. I dont know what is
the error in it. I am using proxy server and the error I'm getting is
connection to server failed.
Can anyone help me out pleaseeeeeeeeee :/
import wordpresslib
# dummy ... |
When I enter the django shell, why does it 'freeze' the database
Question: Why does the database remain static when a user enters the django shell via
`python manage.py runserver`? For example:
>>> from userprofile.models import UserProfile
>>> up=UserProfile.objects.get(id=4)
>>> up.get_jobs_app... |
PS3 controller driver -> uinput-> python? somehow?
Question: I'm trying to read from a PS3 controller in python on Ubuntu and I'm not
having much luck. I started with the ps3joy driver from Willow Garage
(http://www.ros.org/wiki/ps3joy) which supposedly publishes all the important
bits of the PS3 controller to somethin... |
Log everything printed into a file
Question: I would like to create a function that keeps a record of every `print`
command, storing each command's string into a new line in a file.
def log(line):
with open('file.txt', "a") as f:
f.write('\n' + line)
This is what I have, but is ... |
Julia's Python performance example in pypy
Question: [Julia](http://julialang.org/) is a new statistical programming language that
claims significantly better performance than competing languages. I'm trying
to verify this. Julia has a performance test written in Python:
<https://github.com/JuliaLang/julia/blob/master/... |
why is xrange able to go back to beginning in Python?
Question: I've encountered this code from [Most pythonic way of counting matching
elements in something
iterable](http://stackoverflow.com/questions/157039/most-pythonic-way-of-
counting-matching-elements-in-something-iterable)
r = xrange(1, 10)
p... |
How to execute a file that requires being in the same directory?
Question: I have a python script that needs to execute a `.jar` file that is located in
another directory. What would be the best way to do this? So far I was
thinking -
subprocess.call(["cd","/path/to/file"])
subprocess.call(["./file.j... |
Why print operation within signal handler may change deadlock situation?
Question: I got simple program as below:
import threading
import time
import signal
WITH_DEADLOCK = 0
lock = threading.Lock()
def interruptHandler(signo, frame):
print str(frame), 'received... |
Paramiko ssh_config parameters
Question: I'm using python with paramiko (wrapped in pysftp) and there appears to be an
issue where it will hang for a long time if it cannot authenticate during ssh.
I can't figure out a way to set a timeout for the connection and I'm cycling
through many machines, so a single machine th... |
Generating Xml using python
Question: Kindly have a look at below code i am using this to generate a xml using
python .
from lxml import etree
# Some dummy text
conn_id = 5
conn_name = "Airtelll"
conn_desc = "Largets TRelecome"
ip = "192.168.1.23"
# Building the XML... |
Python eliminate duplicates of list with unhashable elements in one line
Question: > **Possible Duplicate:**
> [Python: removing duplicates from a list of
> lists](http://stackoverflow.com/questions/2213923/python-removing-
> duplicates-from-a-list-of-lists)
Say i have list
a=[1,2,1,2,1,3]
If a... |
Error in Fullcalendar with json and web2py
Question: I´m calling:
events: {
url: '/CondominioVip/evento/evento_json.json',
error: function() {
alert('there was an error while fetching events!');
}
}
I've also tried to add `type: 'POST` but it didn't work eith... |
Python star unpacking for version 2.7
Question: As mentioned [here](http://stackoverflow.com/a/431959/386279), you can use the
star for unpacking an unknown number of variables (like in functions), but
only in python 3:
>>> a, *b = (1, 2, 3)
>>> b
[2, 3]
>>> a, *b = (1,)
>>> b
[]
... |
Multithreading in Python with the threading and queue modules
Question: I have a file with hundreds of thousands of lines, each line of which needs to
be undergo the same process (calculating a co-variance). I was going to
multithread because it takes pretty long as is. All the examples/tutorials I
have seen have been ... |
string append in python
Question: i am trying to prepend each line of a file with " (2 spaces/tabs after ") and
append with string- "\r\n"+". the lines of the file before this operation
looks like as folllows.
<!--You have a CHOICE of the next 5 items at this level-->
<!--Optional:-->... |
Python - How do i remove the window border? I have imported UI from Qt into Python and applied setWindowFlags
Question: How to make this window Border-less (remove minimize/maximize/close)?

1 import sys
2 from PyQt4 import QtCor... |
bittorrent tracker server for private file transfer - python
Question: We have a client/server application that needs to transfer the same large
files to, sometimes, many different clients.
At first all is being done the most obvious way, serving the file from the
webserver api where the clients send their requests to... |
Python threading outperforms simple while loop OR threading Optimization
Question: A few hours ago, I asked a question about Python multithreading. To understand
how it works, I have performed some experiments, and here are my tests:
* * *
Python script which uses threads:
import threading
import Q... |
Generating Symmetric Matrices in Numpy
Question: I am trying to generate symmetric matrices in numpy. Specifically, these
matrices are to have random places entries, and in each entry the contents can
be random. Along the main diagonal we are not concerned with what enties are
in there, so I have randomized those as we... |
Controlling PowerPoint with Python's win32com. How to access "Save As" option programmatically
Question: I'm trying to open powerpoint via python and then save the slide presentation
as pdf handouts (three to a page). After a bit of googling, I stumbled upon
[this](http://stackoverflow.com/questions/2170830/vba-save-pr... |
most efficient way to substring path and file out of a string
Question: I am new to python, just wondering what's the best way for python to do the
following:
file='/var/log/test.txt'
==action==
after ==action==, I want to get the path and the file separated like:
path='/var/log'... |
Defining PYTHONPATH automatically in virtualenvs
Question: Is possible to configure PYTHONPATH for a virtualenv automatically with
mkvirtualenv? I don't define PYTHONPATH in my ~/.bashrc, but in each
virtualenv. Every time I create a new virtualenv, I have to put these lines in
`$VIRTUAL_ENV/bin/activate` manually:
in... |
Python module not found (directory problems)
Question: I have a Python 2.5 project with following directory structure:
database/__init__.py
database/createDBConnection.py
gui/mainwindow.py
When I try to run
python gui/mainwindow.py
I get the error
C:\PopG... |
Django Python: Install multiple versions of the same package within a virtualenv
Question: I'm integrating two Django apps together, but am finding that one requires
django-mptt version 3.x and the other requires 5.x. I can't upgrade the 3.x
app because I don't 'own' that particular app and it might be needed for some
... |
Filtering objects matching a given logical formula
Question: I have an array of Python objects, and I would like to get all objects that
evaluate to true for a given logical formula.
Let's say the objects are tasks in a task tracking system. Each task has a
status, an assignee and a due date. Now I'd like to get all o... |
SOAP web service behind proxy, access using python-suds
Question: I have this strange case scenario with python suds.
I have a soap service (java) running on a local ip, say
`http://10.0.0.1:8080/services/`
I use suds http base auth within the local network and it's working fine.
from suds.client impor... |
PyQt4 - QGIS form error
Question: I've to build a form in QGIS to customize data input for each polygon in the
shapefile. I use QtDesigner to create a form (.ui), with some textboxes and
comboboxes pointing to the fields of my shapefile.
Then I use the python file from Nathan QGIS Blog to add some logic.
Python code... |
Windows explorer context menus with sub-menus using pywin32
Question: I'm trying add some shell extensions using python with icons and a sub menu
but I'm struggling to get much further than the demo in pywin32. I can't seem
to come up with anything by searching google, either.
I believe I need to register a com server... |
How to do multiple arguments to map function where one remains the same in python?
Question: Lets say we have a function add as follows
def add(x, y):
return x + y
we want to apply map function for an array
map(add, [1, 2, 3], 2)
The semantics are I want to add 2 to the... |
EOFError in python
Question: I got an EOFError at line 87 of the following code:
import random
def printDice(diceList):
upperLine=" _____ _____ _____ _____ _____"
line1="|"
line2="|"
line3="|"
lowerLine=" ----- ----- ----- ----- ---... |
Python: How to get Outer class variables from inner static class?
Question: I want to specify variable once by making instance Outer(variable), than this
variable use in all static classes, how should I do that? Is there any other
solution than use not static methods and pass Outer into each inner class?
... |
How to return Python exception info to jQuery.ajax POST call?
Question: I make a JQUERY AJAX code in my HTML code:
$.ajax({
type: "POST",
url: "runrep.py",
data:
{
'my_data' : 'test'
... |
Euro sign issue when reading an RTF file with Python
Question: I need to generate a document in RTF using Python and pyRTF, everything is ok:
I have no problem with accented letters, it accepts even the euro sign without
errors, but instead of `€`, I get this sign: `¤`. I encode the strings in this
way:
... |
Internationalization in Django doesn't get activated
Question: I have followed the documentation how to do the i18n but the words still show
up in English.
**Settings.py:**
USE_I18N = True
LANGUAGES = (
('en', 'English'),
('de', 'German'),
)
LANGUAGE_CODE = 'de'
**Views:**
... |
How do you get checkbox selections from a CustomTreeCtrl
Question: I'm working with a CustomTreeCtrl with checkboxes and I can't figure out how
to determine which checkboxes are selected. I looked at
<http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.TreeCtrl.html#GetSelection>
and put this together:
... |
Python name space issues with ipython parallel
Question: I'm starting to experiment with the IPython parallel tools and have an issue.
I start up my python engines with:
ipcluster start -n 3
Then the following code runs fine:
from IPython.parallel import Client
def dop(x):
... |
Python Changing the format of a text file to a new format
Question: I am giving a text file with the format below:
3 Bham Hoover - Vestiva
123 234 1 456 876 1 876 745 1
0
4 Bham Vestiva - Greensprings
235 876 1 647 987 1 098 765 1 234 546 1
0
This goes on for seve... |
python file in-out adding last three characters
Question: Ok, so basic python question. I have a simple script to replace text on
html(txt) files. I wrote some code and put in some newline html that had xhtml
coding i wanted to replace so I tried to write a python script to replace the
xhtml coding versions with regula... |
Python: Remove Duplicates from Text File
Question: I am new to python. I want to remove duplicate word
and except English word i want to delete all other word and blank line.
purely English word only i want to extract.
i have some text file which contain such like following
aaa
bbb
aaa223
... |
Capture output from subprocess.call that I have no control over
Question: I'm testing a piece of Python code that uses subprocess.call(), so I have no
control over that function call. I need to capture the output from that system
call to do assertions. I tried to set os.stdout to a StringIO object, but that
doesn't cap... |
os.system doesn't work in Python
Question: I'm working on windows vista, but I'm running python from DOS command. I have
this simple python program. (It's actually one py file named test.py)
import os
os.system('cd ..')
When I execute "python test.py" from a Dos command, it doesn't work. For
ex... |
Python Tkinter - add external function as command in menu
Question: I'm having a problem with Tkinter menu. Here is the code for my gui.py file:
from tkinter import *
from SS2 import file
class AppUI(Frame):
def __init__(self, master=None):
Frame.__init__(self, maste... |
GeocoderDotUS... Syntax of Python check for 'None'
Question:
import csv
from geopy import geocoders
import time
g = geocoders.GeocoderDotUS()
spamReader = csv.reader(open('locations.csv', 'rb'), delimiter='\t', quotechar='|')
f = open("output.txt",'w')
for row in spamRea... |
How to securely store LWPCookieJar objects in python?
Question: I'm using a `cookielib.LWPCookieJar` object in Python 2.6 to save cookies and
re-load them on future invocations of my script. The `save()` method produces
files with the default permissions - that is, other users on my system can
read (and presumably then... |
How to use dj-database-url while connecting with postgresql in heroku using python
Question: I'm here because I'm really really new with heroku-python-django-postgresql
group. I have googled for a usage for dj-database-url and I don't understand
why i have to use it when developing a python application that needs to
co... |
Understanding global variable in Python
Question: I came across a strange issue in Python when using global variables.
I have two modules(files):`mod1.py` and `mod2.py`
`mod1` tries to modify the global variable `var` defined in `mod2`. But the
`var` in mod2 and `var` in `mod` seems to be two different things. Thus, ... |
Python - Multithreaded Word / Line Count
Question: I'm trying to get a handle on multithreading in python. I have working code
that calculates the number of words, the number of lines with text, and
creates a dict with the count of each word. It runs fast on small files like
the one noted in the code comments. However ... |
Hadoop streaming crashes in the middle of map/reduce operation
Question: I'm using hadoop 1.0.1 on a single node and I'm trying to stream a tab
delimited file using python 2.7. I can get Michael Noll's word count scripts
to run using hadoop/python, but can't get this extremely simple mapper and
reducer to work that jus... |
Python / CGI - Upload file attempt returns an empty page
Question: I really searched about 50 related pages but never seen a problem similar to
my problem. When I press the submit button, it calls the script but the script
returns an empty page and I see no file was uploaded. There is no typing error
in my codes, I che... |
Is it a good practice to use decorator to convert all Unicode strings to binary strings?
Question: Recently I wrote a little script to connect to servers via telnet (for some
reason all the specific programs refused to connect). The program was this:
import telnetlib
tn = telnetlib.Telnet('www.google... |
Python code, extracting extensions
Question: > **Possible Duplicate:**
> [In python, how can I check if a filename ends in '.html' or
> '_files'?](http://stackoverflow.com/questions/10873777/in-python-how-can-i-
> check-if-a-filename-ends-in-html-or-files)
import os
path = '/Users/Marjan/Docum... |
Rerunning the Django Project
Question: Intitally when i setup i didn't have any error when i typed python manage.py
runserver. However when i installed mysql and changed admins and databases in
my settings.py, i can't seem to run the server again.
Setting.py
DATABASES = {
'default': {
... |
Google App Engine: "We can not locate data file'
Question: I am a beginner with google app engines. My goal is to port an existing
webpage to GAE. The difficulty I am having centers around the location of the
.js files. To get it to run on my local machine, I placed .js files in a
static directory with references in th... |
alignment of stacked subplots
Question: EDIT:
I found myself an answer (see below) how to align the images within their
subplots:
for ax in axes:
ax.set_anchor('W')
EDIT END
I have some data I plot with imshow. It's long in x direction, so I break it
into multiple lines by plotting slices... |
How to enable OpenSSL support in an alternate install of Python 2.5.1?
Question: Some background info:
I'm trying to run a server program in `python 2.5.1` (the version the server
was written for and tested on). The program needs the OpenSSL library for some
of its functions. I installed python 2.5.1 from source as t... |
How to convert a webpage (from an intranet wiki) to an Office document?
Question: I have a set of Wiki pages (MediaWiki style) on my company's intranet that I
would like to convert to Microsoft Office Word documents (or something that I
can import in it). I am looking for something that has:
## Requirements
* Keep ... |
libjpeg.so.62: cannot open shared object file: No such file or directory
Question: I am trying to do some image processing with python and the PIL. I was having
a problem that I wouldn't correctly import the _imaging folder so I did a
reinstall and now I am getting this problem:
libjpeg.so.62: cannot ope... |
What's the pythonic way to run a lottery?
Question: I need to pick several random items from a weighted set. Items with a higher
weight are more likely to get picked. I decided to model this after a lottery.
I feel that my solution makes good C++, but I don't think it makes for good
python.
What's the pythonic way of ... |
Why does my 'instance' turn into an 'ndarray' when I use Scipy optimize?
Question: I have written a function using a quantum simulation class
[QuTIP](http://qutip.googlecode.com) that returns a float. Next, I called
scipy.optimize.fmin_cg on the function. I keep getting the error:
AttributeError: 'numpy.... |
What is a better way to deal with unknown list structures in python?
Question: My python program receives MIDI data from a C library. Sometimes the data will
look like this:
[[[[240,0,1,116]]],[[[3,100,8,1]]],[[[107,247,0,0]]]]
and sometimes it will include timestamps like this:
[[[[... |
Python Countdown w/o Sleep
Question: I am working on a Twisted socket, but what I've heard is that if you use
time.sleep while using a socket, the system hangs and the socket goes on halt.
Is there any way of doing a countdown without time.sleep?
Thanks.
Answer: Twisted has a couple of options. You could use a simpl... |
Python: Submodules Not Found
Question: My Python couldn't figure out the submodules when I was trying to import
`reportlab.graphics.shapes` like this:
>>> from reportlab.graphics.shapes import Drawing
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
from ... |
local variable referenced before assignment for decorator
Question: I'm using decorator with the functional syntax as it's described
[here](http://www.python.org/dev/peps/pep-0318/#current-syntax).
I loop over a list of dict. In this loop I wrap a generic function with a
decorator taking a parameter. Then i call the w... |
Google App Engine (python): filter users based on custom fields
Question: i am using the `webapp2_extras.appengine.auth.models.User` service which
basically extends the `google.appengine.api.users model`. Now , I have custom
users registered with my application and they have a lot of custom fields. The
problem is i wan... |
Python Memory error solutions if permanent access is required
Question: first, I am aware of the amount of Python memory error questions on SO, but so
far, none has matched my use case.
I am currently trying to parse a bunch of textfiles (~6k files with ~30 GB)
and store each unique word. Yes, I am building a wordlist... |
Python SciPy call from terminal failing
Question: I am trying to call the following Python script from the Ubuntu terminal using
the standard
`python rosen.py`
but it fails. I can hit `F5` in idle and it works fine but it fails when
called from the terminal. The code for `rosen.py` is as follows:
from ... |
Fresh installation of sphinx-quickstart fails
Question: Trying to get it going with Sphinx for the first time, with a clean Sphinx
1.1.3 installation, and shinx-quickstart fails. Should there be any
dependencies installed? I tried to `pip --force-reinstall sphinx` but the
result is the same.
myhost:doc... |
How to port a Python application to Linux that works fine in Windows
Question: I am having trouble porting a working, Windows Python application to Linux. I
am having some problems, because I did not write the code and am just learning
Python. I am having trouble fixing the issues that it keeps throwing up. So
here is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.