text stringlengths 226 34.5k |
|---|
Encoding string in UTF8 from list
Question: I'm having trouble formating the strings to utf-8 In this script im getting
data from excel file then printing it out in a loop, the problem is that the
string with special characters shows up wrong.
In result I keep getting 'PatrÄ«cija' instead of 'Patrīcija' Can't seem to
... |
Python unicode trouble
Question: I am having trouble with unicode in a script I am writing. I have scoured the
internet, including this site and I have tried many things, and I still have
no idea what is wrong.
My code is very long, but I will show an excerpt from it:
raw_results = get_raw(args)
wri... |
Python expression evaluator and Interpreter pattern
Question: I am trying to implement a simple expression evaluator in python,but I am
stuck in parser method.Below is my code snippet.
class Number:
def __init__(self,value):
self.value=value
def execute(self):
... |
Calling Python code from Gnome Shell extension
Question: I was looking for some time, but still can't find any documented way to call
python functions from GnomeShell extension code. Is there any possibility to
do that?
Answer: You can do it like this :)
const Util = imports.misc.util;
let python_s... |
Granger Test (Python) Error message - TypeError: unsupported operand type(s) for -: 'str' and 'int'
Question: I am trying to run a granger causality test on two currency pairs but I seem
to get this error message in Shell whenever I try and test it. Can anyone
please advise?
I am very new to programming and need this ... |
How do I query for data in Rhythmbox
Question: I'm using ubuntu 12.04 and I'm trying to write a python plugin to query the
Rhythmbox database. The Rhythmbox version is v2.96 but this issue also occurs
with v2.97 as well. When I do a python query, Ubuntu crashes with a
segmentation fault.
I need to confirm the followin... |
Tab-delimited file using csv.reader not delimiting where I expect it to
Question: I am trying to loop through a tab-delimited file of election results using
Python. The following code does not work, but when I use a local file with the
same results (the commented out line), it does work as expected.
The only thing I c... |
appending values to a list in python
Question: i am doing this:
def GetDistinctValues(theFile, theColumn):
lines=theFile.split('\n')
allValues=[]
for line in lines:
allValues.append(line[theColumn-1])
return list(set(allValues))
i am getting `string index out of rang... |
Get output of Netcat in Pythonscript
Question: I need to get the output from netcat in python script. My current code is
response = subprocess.Popen(["netcat","smtp.myserver.net", "25"], stdout=subprocess.PIPE).stdout.read()
x = response.find("220 ***")
I want it to check for 200 _*_ status... |
Does Mongodb have a special value that's ignored in queries?
Question: My web application runs on MongoDB, using python and pyMongo. I get this
scenario a lot - code that reads something like:
from pymongo import Connnection
users = Connection().db.users
def findUsers(firstName=None, lastNam... |
How to run a shell in a separate process and get auto completions? (Python)
Question: I have a linux application that gets an input stream from some device. That
input should be directed to a shell process so that it emulates to the user a
standard shell. So far, I've done it by creating a process that runs '/bin/sh'
a... |
How do I write global variables correctly in python?
Question: I am using sqlalchemy for connection pooling, and I want to make an engine
object available to the other modules. I created a module for utilities that
other modules need, and it looks like this:
from sqlalchemy import [...]
_engine ... |
Scala mass URL download
Question: I've recently taken an interest in learning Scala (mostly working through
Project Euler at the moment), and I've decided on a simple program I want to
write: A simple concurrent downloader. I'm having some difficulty wrapping my
head around a good way to do it.
I know Python well, and... |
Email datetime parsing with python
Question: I am trying to parse date time of an email using python script.
In mail date value is like below when i am opening mail detils...
from: abcd@xyz.com
to: def@xyz.com
date: Tue, Aug 28, 2012 at 1:19 PM
subject: Subject of that mail
... |
Importing PyVISA via Py2exe
Question: My script file test.py is:
try:
from visa import *
except Exception as ex:
print ex
raw_input()
My setup.py file is:
from distutils.core import setup
import py2exe
setup(console=['test.py'])
I then r... |
Python Unit Test - compare content of iterables in Python < 2.7
Question: How can I check if an array of custom class is sorted in the order that I
want? I know that there is assertSequenceEqual in Python 2.7 and up, but I'm
using Python 2.6, and while I might be able to do this using a forloop... is
there better somet... |
In python using Flask, how can I write out an object for download?
Question: I'm using Flask and running foreman. I data that I've constructed in memory
and I want the user to be able to download this data in a text file. I don't
want write out the data to a file on the local disk and make that available
for download.
... |
Setting folder permissions in Windows using Python
Question: I'm using Python to create a new personal folder when a users AD account is
created. The folder is being created but the permissions are not correct. Can
Python add the user to the newly created folder and change their permissions?
I'm not sure where to begin... |
my python modules (matplotlib, numpy) don't work
Question: I'm using mac mountain lion(10.8.1) and python(2.7.3). And I want to use
python matplotlib, numpy modules for figuring a graph. But there's not
matplotlib, numpy ver for mountain lion. I've tested with matplotlib(1.1.1),
numpy(1.7.0b1). They had been installed.... |
OpenCV Save Image Dramatically Increases File Size of .tif
Question: I'm using [OpenCV](http://opencv.willowgarage.com/wiki/) in Python to find
images within other images using the
[MatchTemplate](http://opencv.willowgarage.com/documentation/cpp/object_detection.html)
method. I've noticed that when I load a .tif file t... |
Open and reading multiple pcap files
Question: I'm trying to find out how I can use the dpkt module to open **multiple**
.pcap files and read them at the **same** time. After much googling and many
long hours, the examples which I manage to find only shows how you can open
and read 1 .pcap file.
I've tried using more ... |
Reverse IP Lookup with Python
Question: How can I lookup all hosts hosted on an IP Address? I have checked Bing's API,
but I don't think they provide free API key anymore to make a query with an IP
Address. Google probably would block after searching first 2-3 pages. I was
also looking at the [shodanhq
api](http://docs... |
Python Paramiko: verifying SSH host key fingerprints manually
Question: I am using python Paramiko to connect using ssh to a remote ubuntu box hosted
on a vps provider. Using a windows 7 based client machine, I am able to
connect as follows:
import paramiko
import binascii
ssh = paramiko.SSHClien... |
How to retrieve the value using a regular expression in Python?
Question: I wrote code like this:
print re.findall(r'(<td width="[0-9]+[%]?" align="(.+)">|<td align="(.+)"> width="[0-9]+[%]?")([ \n\t\r]*)([0-9,]+\.[0-9]+)([ \n\t\r]*)([&]?[a-zA-Z]+[;]?)([ \n\t\r]*)<span class="(.+)">',r.text,re.MULTILINE)... |
Python: List all the file names in a directory and its subdirectories and then print the results in a txt file
Question: My problem is as follows. I want to list all the file names in my directory
and its subdirectories and have that output printed in a txt file. Now this is
the code I have so far:
impor... |
authGSSServerInit looks for wrong entry from keytab
Question: I am attempting to initialize a context for GSSAPI server-side authentication,
using python-kerberos (1.0.90-3.el6). **My problem is that
myserver.localdomain gets converted to myserver - a part of my given principal
gets chopped off somewhere. Why does this... |
Using ZeroMQ in a PHP script inside Apache
Question: I want to use the ZeroMQ publisher/subscriber to dispatch data from my web
application to multiple servers.
I use Apache and PHP for the web app, my php script works as follow:
//Initialization
$context = new ZMQContext();
$publisher = $contex... |
u'Too' u'much' u'unicode' u'returned'
Question: I have an api which I'm putting things into and out of in a natural language
processing context, using json.
_Everything_ is coming out as unicode. For example, if retrieve a list of
words from my api, every single word is u''. This is what the json output
looks like aft... |
How to install Django 1.4 with Python 3.2.3 in Debian?
Question: I installed Python 3.2.3 in Debian /usr/local/bin/python3 and I installed
Django 1.4 in the same directory. But when I try to import django from python
3 shell interpreter I get syntax error! What am I doing wrong?
Answer: Django does not support Python... |
In Python, how do I inspect and then re-raise an exception while maintaining the original call stack?
Question: I've got a situation where I'm catching a specific exception type, inspecting
the exception's message to check if it's actually an exception I want to
catch, and then re-raising the exception if not:
... |
Main Window resize in Python with Qt
Question: I have a gui in `ui_main.py` file (designed in Qt Designer). I load it in my
main `*.py` file in this way:
from PyQt4 import QtGui, QtCore
from ui_main import Ui_MainWindow
class MyForm(QtGui.QMainWindow):
def __init__(self, parent=None):
... |
Matrix creation in python
Question: In a block of code I found the following thing
M = [3,4,5]
from math import *
class matrix:
# implements basic operations of a matrix class
def __init__(self, value):
self.value = value
self.dimx = len... |
Python - problems with shared variable
Question: I'd like to use a shared queue from multiple threads and modules. I have the
following Python code:
# moda.py
import queue
import modb
q = queue.Queue()
def myPut(x):
q.put(x)
def main():
print('moda:... |
Are there any benefits to using Python for GUI development?
Question: I was looking into Tkinter, but I was wondering if there are any other
packages that help with GUI. Even though Java is more robust than python,
python is faster to write and would be very helpful if I am just trying to
create a quick application. I ... |
GTK Label wrapping in a dialog
Question: I'm trying to create a **non-resizable dialog** with a label in it. This label
has a lot of text, so I want it to **wrap without making the dialog
ridiculously wide**.
For some reason, I can't find out what it takes to get GTK to allow this to
happen. I can't even find a way of... |
Adding Colorbar and Contour Map to PyPlot surface imshow in Python
Question: I am using code written by a former employee. In this code, the person
performs a plot on Python using Qt. I'm trying to add a colorbar and contour
maps, but to no avail. Here's part of the code that's relevant.
#IMPORTS
fro... |
Installing Swampy for python 3 in Windows
Question: I am a beginner python learner using The book 'Think Python' where I have to
install module name Swampy. The link provided fro instruction and download has
a [tar.gz](http://pypi.python.org/pypi/swampy/2.1.1) file. I found the python
3 version of the swampy with googl... |
Using sparse matrices/online learning in Naive Bayes (Python, scikit)
Question: I'm trying to do Naive Bayes on a dataset that has over 6,000,000 entries and
each entry 150k features. I've tried to implement the code from the following
link: [Implementing Bag-of-Words Naive-Bayes classifier in
NLTK](http://stackoverflo... |
How to decrypt unsalted openssl compatible blowfish CBC/PKCS5Padding password in python?
Question: I've been looking for a python library to help decrypt an openssl blowfish
encrypted password.
I have managed to achieve this in Java but the python libraries to support
this appeared more of a learning curve, and requir... |
matplotlib: (re-)plot ping standard-input data. Doable?
Question: I recently started tinkering with python and the matplotlib module(1.1.0)
shipped with Enthought Python Distribution(the free version one). I thought of
an interesting project I could do and came up with something like this:
* get ping of an internet ... |
Python: importing a sub‑package or sub‑module
Question: Having already use flat packages, I was not expecting the issue I encountered
with nested packages. Here is…
# Directory layout
dir
|
+-- test.py
|
+-- package
|
+-- __init__.py
|
+-- subp... |
"AttributeError: 'module' object has no attribute 'argv'" when using Python.h
Question: When messing around with Python.h I got this error:
AttributeError: 'module' object has no attribute 'argv'
C++ code:
#include "stdafx.h"
#include "C:/Python27/include/Python.h"
#inclu... |
How to use python and windows com in pyramid (threads)?
Question: I'm connecting to MS Word by win32com.client.Distpatch function and on the
second request i've got error: 'CoInitialize has not been called.' I've found
this topic:
<http://www.velocityreviews.com/forums/t328097-coinitialize-error-when-using-
adodbapi.h... |
Getting started with speech recognition and python
Question: I would like to know where one could get started with speech recognition. Not
with a library or anything that is fairly "Black Box'ed" But instead, I want
to know where I can Actually make a simple speech recognition script. I have
done some searching and fou... |
What is the meaning of the letters in the output from struct.pack?
Question: when i change number into hex in struct module of python,
>>> import struct
>>> struct.pack("i",89)
'Y\x00\x00\x00'
>>> struct.pack("i",890)
'z\x03\x00\x00'
>>> struct.pack("i",1890)
'b\x07\x00\x00'
... |
Run Python script from C# with command line params
Question: I need to execute Python script from C# using IronPython and pass into it some
command line parameters. Is there any way to do it?
My sample code:
var e = Python.CreateEngine();
var source = e.CreateScriptSourceFromFile(@".... |
joining two numpy matrices
Question: If you have two numpy matrices, how can you join them together into one? They
should be joined horizontally, so that
[[0] [1] [[0][1]
[1] + [0] = [1][0]
[4] [1] [4][1]
[0]] [1]] ... |
Python - Sending Packets issuing error - Minecraft Packets
Question: **I'm using the following script:**
import socket
import struct
username = "username_value"
verification_key = "verification_key"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # boilerplate
s.conne... |
Parse birth and death dates from Wikipedia?
Question: I'm trying to write a python program that can search wikipedia for the birth
and death dates for people.
For example, Albert Einstein was born: 14 March 1879; died: 18 April 1955.
I started with [Fetch a Wikipedia article with
Python](http://stackoverflow.com/ques... |
What's the pythonic way to wrap several functions in the same with statements
Question: I am using the Python library,
[Fabric](http://docs.fabfile.org/en/1.4.3/index.html), to do some remote
server maintenance. Fabric automatically outputs all of the responses to
remote and local commands unless you wrap the command i... |
django import local settings from the server
Question: In my home directory, I have a folder called `local`. In it, there are files
called `__init__.py` and `local_settings.py`. My django app is in a completely
different directory. When the app is **NOT** running in DEBUG mode, I want it
to load the `local_settings.py`... |
Correct usage of multithreading and Queue module in data collection application written in Python
Question: I am working on collecting data from several devices, and since the tests are
long duration, I want to use Python's `threading` and `Queue` modules. I've
written a short script to figure out how to use these, and... |
How to assure applying order of function decorators in Python?
Question: Some decorators should only be used in the outermost layer.
A decorator that augments the original function and add a configure parameter
is one example.
from functools import wraps
def special_case(f):
@wraps(f)
... |
Program returns an "IndexError: string index out of range."
Question:
from random import shuffle
alphabet="abcdefghijklmnopqrstuvwxyz"
def substitution(alphabet,plaintext):
# Create array to use to randomise alphabet position
randarray=range(0,len(alphabet))
... |
Python import: from django import template: module object 'template' has no attribute 'loader'
Question: I'm developing a Django project and deploying it to OpenShift PaaS. At first
everything worked, but after some changes irrelevant to template system (I
added django-hosts) something broke there and a `"module object... |
Measuring time using pycuda.driver.Event gives wrong results
Question: I ran
[SimpleSpeedTest.py](http://wiki.tiker.net/PyCuda/Examples/SimpleSpeedTest)
from the PyCuda examples, producing the following output:
Using nbr_values == 8192
Calculating 100000 iterations
SourceModule time and first thr... |
Retrieving field formats of numpy record array as list
Question: I am trying regularize the formats of a pytable and recarray for the purposes
of appending the recarray to the pytable. To do this I need to get field
information from the recarray (i.e. names and field formats) I can easily get
a list of the recarray nam... |
Customize the Django settings.py file depending on the OS
Question: I'm working on a Django project using two different machine, a Windows and a
Mac Os X. I have everything synchronized over Dropbox. The problem is that
some settings in settings.py are single strings (e.g. the MEDIA_ROOT or the
STATIC_ROOT) and not tup... |
locating pywin32 library components python
Question: Hello I am using pywin32 to track several actions on server, currently i am
looking to track the files open per user on server, well I found
`File_Info_Structure_3`, here <http://msdn.microsoft.com/en-
us/library/windows/desktop/bb525375%28v=vs.85%29.aspx>, but i can... |
Why am I not getting a live response to Comet server stream events?
Question: I have a CGI script that streams events:
#!/usr/bin/python
...
print 'Content-Type: text/event-stream\n'
while (True):
delay()
print 'event: item'
print 'data: ' + get_random_event()
... |
Retrieving the list of all the Python APIs given by an application
Question: i would like to retrieve the list of all the APIs that an application is
giving to the users.
The Application is written in C/C++ for the biggest part.
I was hoping that python has a standard function for that, i was also trying
to approach ... |
create JSON with multiple dictionaries, Python
Question: I have this code:
>>> import simplejson as json
>>> keys = dict([(x, x**3) for x in xrange(1, 3)])
>>> nums = json.dumps(keys, indent=4)
>>> print nums
{
"1": 1,
"2": 8
}
But I want to create a loop to make... |
How to zip up files of same prefix in python?
Question: If I have a directory "C:\Files" that contains a bunch of files:
A_File1 A_File2 B_File1 B_File2
What is the best way to iterate through the files to zip up any file with the
same prefix into a single zip file? For instance, output would be "A.zip" and
"B.zip" a... |
Freeze when using tkinter + pyhook. Two event loops and multithreading
Question: I am writing a tool in python 2.7 registering the amount of times the user
pressed a keyboard or mouse button. The amount of clicks will be displayed in
a small black box in the top left of the screen. The program registers clicks
even whe... |
Splitting input into two with for-loop
Question: This is where I got stuck, trying to learn Python using web-course.
> > Write a program that takes a single input line of the form
> «number1»+«number2», where both of these represent positive integers, and
> outputs the sum of the two numbers. For example on input 5+12... |
Cannot import Skype4Py in Python
Question: I'm using Skype4Py with Python 3.2.3 on windows. There was an error while
trying to import Skype4Py package and I did the following to figure out what
it was:
import sys
try:
import Skype4Py
except:
print (sys.exc_info()[0])
pri... |
Compile python code then place it somewhere else
Question: I have python file, for example, named blah.py, that I would like to have
compiled then placed into another folder using cmake. Right now, I am capable
of doing this with the following code in my cmake file:
ADD_CUSTOM_TARGET(output ALL /usr/bin/... |
pypy memory usage grows forever?
Question: I have a complicated python server app, that runs constantly all the time.
Below is a very simplified version of it.
When I run the below app using python; "python Main.py". It uses 8mb of ram
straight away, and stays at 8mb of ram, as it should.
When I run it using pypy "py... |
subprocess.check_output not accepting long arguments
Question: Sorry for this basic question but it is driving me crazy.
From the same machine, if I do:
$ wkhtmltopdf --title "Transaction 773 (printed version)" --margin-left 5 --margin-right 2 --encoding utf8 www.google.com - > salida.pdf
I get a ... |
import cv2 works but import cv2.cv as cv not working
Question: I think the sys path is correct, cv.pyd and cv.pyd reside in
c:\OpenCV2.3\build\Python\2.7\Lib\site-packages.
>>> import sys
>>> sys.path
['', 'C:\\Python27\\Lib\\idlelib', 'C:\\Python27\\lib\\site-packages\\pil-1.1.7-py2.7-win32.egg'... |
Debugging Django/Gunicorn behind Nginx
Question: Fresh install of Nginx, Gunicorn, Supervisor, New Relic, Django, Postgres,
etc. Hitting the URL gives a big fat "Internal Server Error."
Turning debug on in the Nginx configuration gives a whole lot of detail, but
nothing that points to what is causing the 500 error (ju... |
from django.utils.functional import wraps and from functools import wraps
Question: What is the difference in functionality between from django.utils.functional
import wraps and from functools import wraps?
i m using django 1.3 and python 2.4.i want to remove sensitive information
from post data but django.views.decor... |
python module for nslookup
Question: Is there a python-module that's doing the same stuff as nslookup does? I am
planning to use nslookup on digging some information regarding the domain of a
URL to be scrapped. I know I can use os.sys to call nslookup but I am just
wondering if there is a python-module for this alread... |
how to run python project after remove .py file?
Question: i want to remove my source code .py files to avoid rivals to see my code.
so i use
python -c "import compileall; compileall.compile_dir('D:/acc')"
to compile all py files to pyc,next step is to remove py files,and run the
project only use ... |
The Requests streaming example does not work in my environment
Question: I've been trying to consume the Twitter Streaming API using Python Requests.
There's a [simple example](http://docs.python-
requests.org/en/latest/user/advanced/#streaming-requests) in the
documentation:
import requests
import ... |
Application design for exchanging values between C/C++ and Python
Question: I'm writing a C/C++ application, this application is used directly by the user
to give inputs, basically numerical values like a precise values, a range and
something like that, think about an UI with some pieces like:
* a numpad
* a slide... |
Problems using python dragonfly on linux bases machine
Question: I am playing with the Dragonfly lib in python. I am working on Mac OSX, and
this will be my target platform. However when try to run my program I receive
the following error:
Traceback (most recent call last):
File "clock_challenge.py... |
Django Tutorial: Generic Views. Attribute Error
Question: I'm at the last part of
[this](https://docs.djangoproject.com/en/1.4/intro/tutorial04/) tutorial.
from django.conf.urls import patterns, include, url
from django.views.generic import DetailView, ListView
from polls.models import Poll
... |
Google App Engine: Random error "ImportError: cannot import name nodes"
Question: I recently went to my App Engine site which has been running just fine and no
errors and got the big ugly error page. In the admin tool App Engine was
logging this error:
2012-09-06 10:53:43.938
Traceback (most recent c... |
Difference between command-line tar and shutil.make_archive?
Question: When I generate a tar.gz file using `tar cfz cl.tar.gz Sources` as compared to
the python `shutil.make_archive ( "py", "gztar", "Sources" )`, I get different
results:
$ tar -tf cl.tar.gz | head -3
algorithm/
aligned_storage.hp... |
Python Binary File CTime 4 Bytes
Question: I am trying to parse a binary file for which I have the file format for. I
have 3-4byte variables that are list as "CTime" I read them in using
struct.unpack. I want to convert this number to an actual day time year value.
The value that I have seems to be the number of second... |
chilkat decryptStringENC TypeError: in method 'CkRsa_decryptStringENC'
Question: I downloaded a trial version for 64-bit Python 2.7:
chilkat-9.3.2-python-2.7-x86_64-linux.tar.gz. I found a strange problem: when
I wrote one method (decrypRSA() as follow) which will decode given RSA
encrypted string, it works only if I c... |
YAML file url and script in GAE python
Question: I'm using Python 2.7 in Google App Engine and can't seem to get my app.yaml
file set up right.
My goal is so that if I go to `http://localhost/carlos/` I get an executed
carlos.py
Here is my directory structure:
app\
\app.yaml
\main.py
... |
Get Python 2.7's 'json' to not throw an exception when it encounters random byte strings
Question: Trying to serialize a dict object into a json string using Python 2.7's `json`
(ie: `import json`).
Example:
json.dumps({
'property1': 'A normal string',
'pickled_property': \u000... |
Python Error: name 'admin' is not defined
Question: I am creating a Python application in Django for the first time. I know that I
must uncomment the admin tools in the urls.py, I have done that. I have also
added `autodiscover`. Everytime I try to add a new feature to the
administration panel, I get this error:
"Name... |
Issues when writing an xml file using xml.dom.minidom python
Question: I have an xml file and a python script is used for adding a new node to that
xml file.I used xml.dom.minidom module for processing the xml file.My xml file
after processing with the python module is given below
<?xml version="1.0" ?><... |
Python threading: can I sleep on two threading.Event()s simultaneously?
Question: If I have two `threading.Event()` objects, and wish to sleep until either one
of them is set, is there an efficient way to do that in python? Clearly I
could do something with polling/timeouts, but I would like to really have the
thread s... |
Having issues running Django with Postgres
Question: I have installed Postgres and Django on my machine(Mac OS), but when I run the
Django server I get this error
50>>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line ... |
Various errors while parsing JSON in Python
Question: Attempting to parse json from a url requiring login. Including all my code
here as I'm not sure where the error is.
try: import simplejson as json
except ImportError: import json
import urllib2
username = 'user'
password = '1234'
... |
Use simplejson with Python 2.7 on GAE
Question: Having trouble using `simplejson` with google app engine running Python 2.7.
Just switched from Python 2.5 on the Master/Slave datastore to Python 2.7 on
the High Replication Datastore. This used to work:
from django.utils import simplejson
Now in or... |
Hide Python rocket dock icon when using ScriptingBridge
Question: I'm retrieving the current track playing in iTunes, Mac OS X, with
ScriptingBridge.
from ScriptingBridge import SBApplication
iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
print iTunes.currentTrack().n... |
Implementing Home Grown Plugins for a Python Service
Question: I am writing a simple scheduling service. I don't want to hard-code all of the
tasks it can schedule and instead would like to support plugins that can be
dropped in a folder and loaded dynamically at runtime.
My plan is to have a JSON file (or any configu... |
Vim code completion for webapp2,flask,etc
Question: I'm using [john andersons](http://sontek.net/blog/detail/turning-vim-into-a-
modern-python-ide#tab-completion-and-documentation) wonderful vim set-up. It
has code completion for python enabled. I'm curious if such a solution exists
for say webapp2,flask
It's possible... |
building Python from source with zlib support
Question: When building Python 3.2.3 from source on Ubuntu 12.04, the zlib module is not
available.
I downloaded the official source distribution from python.org, and attempted
to build and install it with the following commands.
tar xfa Python3.2.3.tar.bz2
... |
Regex in python not taking the specified data in td element
Question: I'm using regex in python to grab the following data from HTML in this line:
<td xyz="123"><a href="blah.html">This is a line</a></td>
The problem is that in the above td line, the `xyz="123"` and `<a href>` are
optional, so it d... |
OpenID login no longer working
Question: We have 2 AppEngine Python apps which do federated login via the open id api
(create_login_url).
We had the login working for some time, but currently receive HTTP 204 on the
/_ah/login_redir.
Had there been any recent changes to the flow or API?
Answer: After some analysis,... |
MySQL Query error when run within Python but not when run directly
Question: I am passing `'2012-09-10 00:00:00-05:00'` to a MySQL query. This value is
retrieved using the [pytz module](http://pytz.sourceforge.net/) for Python.
import pytz
class MyClass():
def __init____(self):
se... |
Edgelines vanish in mplot3d surf when facecolors are specified
Question: I have produced the following surface plot in matlab:

and I need to create this in .NET instead. I'm hoping to use IronPython to do
this. But first I am just trying to create the plot in Pytho... |
Django Cache cache.set Not storing data
Question: When I run `python manage.py shell` and then:
from django.core.cache import cache
cache.set("stack","overflow",3000)
print cache.get("stack")
(output: ) None
I tried restarting memcache, and here is what's in my settings:
... |
For Python 3.2: Why does adding bytes to a bytes object take longer as more bytes are added?
Question: I recently started learning Python (my first programming language since using
GW BASIC as a kid). I’ve noticed that when adding bytes to a bytes object,
each byte takes more time to add than the last; and by contrast,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.