text stringlengths 226 34.5k |
|---|
How do I have python httplib accept untrusted certs?
Question: How do I have python httplib accept untrusted certs? I created a snake
oil/self signed cert on my webserver, and my python client fails to connect as
I am using a untrusted cert.
I'd rather problematically fix this in my client code rather than have it
tru... |
Link generator using django or any python module
Question: I want to generate for my users temporary download link. Is that ok if i use
django to generate link using url patterns? Could it be correct way to do
that. Because can happen that I don't understand some processes how it works.
And it will overflow my memory o... |
Image aspect ratio using Reportlab in Python
Question: I want to insert an image inside a frame. I found two ways to do this:
1. drawImage(self, image, x, y, width=None, height=None, mask=None, preserveAspectRatio=False, anchor='c')
2. Image(filename, width=None, height=None)
My question is: how can I add an imag... |
python-Twitter-api
Question:
import twitter
client = twitter.Api()
client = twitter.Api(username='uname', password='password')
update = client.PostUpdate('Tweetin from python!')
This is my code. When i execute this program i get this error
TypeError: __init__() got a... |
SQLAlchemy IntegrityError
Question: I'm having a problem using SQLAlchemy with PySide(PyQt). I'm trying to pop-up
a `QtGui.QDialog`, but when I do this SQLAlchemy throws an exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\preo\preodb\dbviewandmodel.py", line 32, in ... |
Python: how to know function return type and argument types?
Question: While I am aware of the duck-typing concept of Python, I sometimes struggle
with the type of arguments of functions, or the type of the return value of
the function.
Now, if I wrote the function myself, I DO know the types. But what if somebody
wan... |
How can I get a file's permission mask?
Question: How can I get a file's permission mask like 644 or 755 on *nix using python?
Is there any function or class for doing that? Could you guys help me out?
Thank you very much!
Answer: `os.stat` is a wrapper around the [stat(2)](http://linux.die.net/man/2/stat)
system cal... |
Why is Paramiko raising EOFError() when the SFTP object is stored in a dictionary?
Question: I'm having trouble with an application I'm writing that downloads and uploads
files to and from other boxes via SSH. The issue I'm experiencing is that I
can get (download) files just fine but when I try to put (upload) them on... |
Memory issues with as.dist function in R/rpy2
Question: I'm trying to perform a hierarchical clustering using a custom distance
measure. I perform all the calculations in Python and then pass the data
structures to R to do the clustering
import rpy2.robjects as robjects
r=robjects.r
from rpy2.rob... |
Read-write pipe() communication in R
Question: Most languages support two-way process communication. For example, in Python,
I can (sloppily) do:
>>> from subprocess import *
>>> p = Popen('nslookup', stdin=PIPE, stdout=PIPE)
>>> p_stdin, p_stdout = p.communicate("www.google.com")
>>> print p... |
Python regex: matching a parenthesis within parenthesis
Question: I've been trying to match the following string:
string = "TEMPLATES = ( ('index.html', 'home'), ('base.html', 'base'))"
But unfortunately my knowledge of regular expressions is very limited, as you
can see there are two parentheses t... |
How to split a list into pairs in all possible ways
Question: I have a list (say 6 elements for simplicity)
L = [0, 1, 2, 3, 4, 5]
and I want to chunk it into pairs in **ALL** possible ways. I show some
configurations:
[(0, 1), (2, 3), (4, 5)]
[(0, 1), (2, 4), (3, 5)]
[(0, 1)... |
Altering python-gearman worker tasks during job processing
Question: I'm attempting to change the tasks available on a python-gearman worker during
its work cycle. My reason for doing this is to allow me a little bit of
control over my worker processes and allowing them to reload from a database.
I need every worker to... |
Reloading submodules in IPython
Question: Currently I am working on a python project that contains sub modules and uses
numpy/scipy. Ipython is used as interactive console. Unfortunately I am not
very happy with workflow that I am using right now, I would appreciate some
advice.
In IPython, the framework is loaded by ... |
How to let Python code continue after telnet (telnetlib) timeout
Question: I am using Python for Automated telnet program using telnetlib. The problem
is: when the device that I am trying to telnet to doesn't responsd, means
timeout; the program gives me timeout message and doesn't continue to next
commands.
My Code:
... |
python: force non-relative import?
Question: I wanted to make a module called `utils/django.py` in my project. On the top I
have the line:
from django.db import models
However, it tries to import from itself, and that causes an error. I know I
can force a relative import with a prepended `.`:
... |
How do I stop Tornado web server?
Question: I've been playing around a bit with the [Tornado web
server](http://www.tornadoweb.org/) and have come to a point where I want to
stop the web server (for example during unit testing). The following simple
example [exists on the Tornado web
page](http://www.tornadoweb.org/doc... |
Iteratively write XML nodes in python
Question: There are many ways to read XML, both all-at-once (DOM) and one-bit-at-a-time
(SAX). I have used SAX or lxml to iteratively read large XML files (e.g.
wikipedia dump which is 6.5GB _compressed_).
However after doing some iterative processing (in python using ElementTree)... |
building a tree from a csv file using python
Question: My csv file has the following format
Col1 Col2
a b
b c
c d
d e
x b
y c
z c
m x
h b
i b
I will cre... |
Faster bitwise modulus for Lucas-Lehmer primality test
Question: The [Lucas-Lehmer primality
test](http://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test) tests
prime numbers to determine whether they are also [Mersenne
primes](http://en.wikipedia.org/wiki/Mersenne_prime). One of the bottlenecks
is the modulu... |
python - capturing stderr of subprocesses with their shell stdout alive
Question: Here are things I'm trying to do:
-python process captures stderr of multiple subprocesses to watch the subprocesses
-each subprocess runs on the separate window displaying stdout.
When I use **Popen(_command_ ,s... |
Python Run a daemon sub-process & read stdout
Question: I need to run a program and gather its output to stdout. This program (socat)
needs to run in the background for the duration of the python script. Socat
sits in dameon mode once it's run, but first it outputs some lines to stdout
that I need for the rest of my sc... |
No handlers could be found for logger "myapp.lib"
Question: I just upgraded to Django 1.3 which brings it's own logging module. I did set
up logging and it is working when the modules are accessed by Apache/mod_wsgi.
But when I am working with the django shell, Logging does not work - I always
get the infamous error "*... |
How to interfere some text in a html link string in python
Question: In the company I am working they use the above command to construct a link
from a list of data we are holding on a map
link=a % firstUpper(b)
which produces something like
<a href="path/tomyhtml/foo.html">foo</a>
... |
Squid-style external redirector for polipo doesn't work
Question: I am trying to write a trivial squid-style redirector for polipo http proxy,
as specified [in the
documentation](http://www.pps.jussieu.fr/~jch/software/polipo/manual/External-
redirectors.html#External-redirectors).
Here is the code:
#!/... |
Django, uWSGI & nginx: Process dies for "no reason"
Question: I am using uWSGI and nginx to run two parallell Django apps. One of them, the
one with somewhat more load (both are very small) keeps dying about once every
24 hours with the following message:
`[pid: 16358|app: 0|req: 1000/1000] 127.0.0.1 () {46 vars in 84... |
element tree search help(python, xml)
Question: I'm trying to find all child elements whose attribute `class` is 'TRX' and
whose attribute `distName` Starts with 'PLMN-PLMN/BSC-208812/BCF-1/BTS-1'
Is something like this possible?
root[0].findall("*[@class='TRX'][@distName='PLMN-PLMN/BSC-208812/BCF-1/BTS... |
Load website's content through python
Question: How can i load a specific content from a website through python?For example,i
want to load some posts of a blog and appear them to my own site.How can i do
this?
Answer: An answer:
import urllib2
from BeautifulSoup import BeautifulSoup
def fe... |
learn python the hard way exercise 40 help
Question: hey guys i am having trouble understanding this, i dont get when themap is
referenced to the cities dict really. or the last line, what is the(cities,
state) part?
thanks.
cities = { 'CA': 'San Francisco', 'MI': 'Detroit', 'FL': 'Jacksonville'}
... |
Adding Zooming in and out with a Tkinter Canvas Widget in Python
Question: How would I add zooming in and out to the following script, i'd like to bind
it to the mousewheel. If you're testing this script on linux don't forget to
change the MouseWheel event to Button-4 and Button-5.
from Tkinter import * ... |
python pip package install fails , dllwrap error after 'fixing': "unable to find vcvarsall.bat"
Question: I can't find this in the archives. Is there something not right with
mingw/msys? [I need to get vcvarsall.bat fixed, so I can install other
packages.]
Failure to install python package 'twisted' using pip.exe.
I ... |
Mathematica Notation and syntax mods
Question: I am experimenting with syntax mods in Mathematica, using the Notation
package.
I am not interested in mathematical notation for a specific field, but general
purpose syntax modifications and extensions, especially notations that reduce
the verbosity of Mathematica's Very... |
Find the default application name for a given file
Question: In Linux, is there a way to ask any xdg services, or gtk services, which
application is the default application for a given file?
I realize that **xdg-open** will in fact, launch the correct application.
However, I want to be able to display the application'... |
Verifying signature on android in-app purchase message in Python on Google App Engine
Question: The sample application on the android developers site validates the purchase
json using java code. Has anybody had any luck working out how to validate the
purchase in python. In particular in GAE?
The following are the rel... |
Is there any value to a Switch / Case implementation in Python?
Question: Recently, I saw some discussions online about how there is no good "switch /
case" equivalent in Python. I realize that there are several ways to do
something similar - some with lambda, some with dictionaries. There have been
other StackOverflow... |
Python multiprocessing pool.map for multiple arguments
Question: In the Python multiprocessing library, is there a variant of pool.map which
support multiple arguments?
text = "test"
def harvester(text, case):
X = case[0]
return text+ str(X)
if __name__ == '__main__':
... |
Add Python arguments in script's shebang line (script made with buildout and zc.recipe.egg:scripts)
Question: How to specify arguments for Python when building script with buildout?
Here's my buildout.cfg:
[buildout]
parts = python
develop = .
[python]
recipe = zc.recipe.egg:scripts... |
How to remove unsafe characters to save file
Question: I would like to save a file with the name that has the **most valid
characters** remaining intact, f.e. if I get supplied the filename:
`>This\ Ăwesomé_Song?©.mp3`
and I want to save it under `Windows 7`, it won't let me save it until I
remove `>`, `\` and `?`. T... |
URL encoding for Python OAuth2
Question: I am using %20 to encode a url using oauth2 for python.
It does not seem to work. I see that it encodes %20 as %252B . Is there a way
around?
Edited with example
import oauth2 as oauth
client = oauth.Client(consumer)
url = 'http://localhost:8080/api/v1/s... |
python omnicompletion in vim not working
Question: I am trying to use vim on my python journey, based on [this
guide](http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/)
I think I have the same problem as [a paid
nerd](http://stackoverflow.com/questions/2084875/vims-omnicompletion-with-
python-just-doesnt-work) b... |
Attribute error using __builtin__ functions inside class method
Question: I installed rdiff-backup on my arch linux box only to end up with the
attribute error:
AttributeError: 'module' object has no attribute 'reduce'
The error exists in one of rdiff_backup classes, but I can not spot the error.
T... |
error using pywinauto
Question: I am new to python and have just installed pywinauto using easy_install.
I am trying to execute a simple code as follow:
from pywinauto import application
app = application.Application.start ('notepad.exe')
Traceback (most recent call last):
File "<stdin>"... |
Adding and removing data to/from iCal
Question: I need to add/remove calendar data to/from iCal.
I google and found that I can uses [python
library](http://mashupguide.net/1.0/html/ch15s04.xhtml) to create the ics
file. With this, I can come up with applescript to run iCal to import the
generated ics file to add calen... |
how to print this number in a shortest time using thread in python
Question: this is my code :
import thread
k=0
b=0
def a(n):
i = 0
while i<n:
print i
i += 1
j = 5000
while k < 5000:
a(k)
k+=1
for n in range(2... |
returned dictionary value is 'None' python
Question: I have a function in a file which I am calling in a separate script (as shown
below). Printing directly from the function works correctly, however when I
try to return the value to the script it sends 'None'.
Any help would be appreciated. Thanks
script:
... |
Using Python object exported from DLL in an exe
Question: I have a two-part event generator:
**pyglobalexe (a stub to simulate events)** :
#pragma comment(lib, "pyglobalextension.lib")
#include <Python.h>
__declspec(dllimport) PyObject* PyInit_pyglobalextension;
__declspec(dllimpor... |
Django - consume XML - RESTful
Question: I have a python script running fine on my localhost. Its not an enterprise app
or anything, just something I'm playing around with. It uses the "bottle"
library. The app basically consumes an XML file (stored either locally or
online) which contains elements with their own uniqu... |
Google App Engine Bulkloader "Unexpected Thread Death"
Question: I am trying to upload a moderetly sized csv file to google app engine using
the bulkloader functionality, and it appears to die some of the way through
with the following result:
[INFO ] Logging to bulkloader-log-20110328.181531
[INF... |
How to differentiate timeout error and other `URLError`s in Python?
Question: How to differentiate timeout error and other `URLError`s in Python?
**EDIT**
When I catch a `URLError`, it can be `Temporary failure in name resolution` or
`timeout`, or some other error? How can I tell one from another?
Answer: I use cod... |
Truncating division in Python 3.2
Question: 1. Is integer floor division `//` faster than float division `/` in Python 3.2? If I know I'm going to be working with integers only, should I favour `//` instead of defaulting to `/`?
2. How do I get integer truncation behaviour in Python 3.2?
`1/2 = 0`
`-1/2 = 0`
Th... |
returning data in python
Question: I'm currently looking through the "Dive Into Python" to pick up the language
and I was a bit confused about chapter 5's example 5.10. UserDict Normal
Methods
Example 5.10. UserDict Normal Methods
def copy(self):
if self.__class__ is UserDict:
return... |
Python: Imaplib error
Question:
import serial
import imaplib
from time import sleep
IMAP_SERVER='imap.gmail.com'
IMAP_PORT=993
ser= serial.Serial ('/dev/ttyACM0',9600)
while True:
M = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT)
rc, resp = M.login('user@gmail.com', 'P... |
Python + MongoDB - Cursor iteration too slow
Question: I'm actually working in a search engine project.
We are working with python + mongoDb.
I'm having the following problem:
I have a pymongo cursor after excecuting a find() command to the mongo db.
The pymongo cursor have around 20k results.
I have noticed th... |
Mod_wsgi pylons (ckan) installation not working
Question: I am setting up CKAN, a pylons application according to these instructions:
<http://packages.python.org/ckan/deployment.html>
But when I point to the server (no DNS setup yet) using IP or hostname, I only
see apache's greeting page, sugesting the ckan app is no... |
os.environ does not contain HOST variable
Question: What could be the cause that os.environ does not contain the HOST environment
variable under Linux, except I set it explicitly for the interpreter
environment?
> echo $HOST; python -c 'import os; print "HOST" in os.environ'
bbox
False
> echo... |
Error parsing a DTD using lxml
Question: I'm trying to write a validation script that will validate XML against the
NITF DTD, <http://www.iptc.org/std/NITF/3.4/specification/dtd/nitf-3-4.dtd>.
Based on [this post](http://stackoverflow.com/questions/15798/how-do-i-
validate-xml-against-a-dtd-file-in-python) I came up wi... |
join two lists of dictionaries on a single key
Question: Given `n` lists with `m` dictionaries as their elements, I would like to
produce a new list, with a joined set of dictionaries. Each dictionary is
guaranteed to have a key called "index", but could have an arbitrary set of
keys beyond that. The non-index keys wil... |
Error parsing emails using Python's email module when the encoding is in shift_jis
Question: I am getting an error that says "UnicodeDecodeError: 'shift_jis' codec can't
decode bytes in position 2-3: illegal multibyte sequence" when I try to use my
email parser to decode a shift_jis encoded email and convert it to unic... |
django render_to_response is not defined error
Question: Hi I am getting this error, while I tried make a simple app.
NameError at /first/
global name 'render_to_response' is not defined
Request Method: GET
Request URL: http://localhost:8000/first/?preview
Django Version:... |
Best 3D library to model robotic motion
Question: A short while I asked for suggestions on choosing a Python-compatible 3D
graphics library for robotic motion modelling (using inverse kinematics in
Python). After doing a bit of research and redefining my objectives I hope I
can ask once again for a bit of assistance.
... |
Error loading MySQLdb module in MACOSX10.6 (Apache & mod_wsgi)
Question: > **Possible Duplicate:**
> [Python import MySQLdb error - Mac
> 10.6](http://stackoverflow.com/questions/4730787/python-import-mysqldb-
> error-mac-10-6)
I have a question that when I was using apache with wsgi to run a django
project the sys... |
Http connection freezes when request's content-length exceeds real content length
Question: I have a very basic python script that does HTTP connection.
import socket
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = "192.168.56.21"
s.connect((host,... |
Python Smooth Time Series Data
Question: I have some data in python that is unixtime, value:
[(1301672429, 274), (1301672430, 302), (1301672431, 288)...]
Time constantly steps by one second. How might I reduce this data so the
timestamp is every second, but the value is the average of the surroundi... |
Trying to implement import-> debug mode module
Question: So I am attempting to make a module that, when imported, will cause any
exception to drop into pdb. I'm thinking it will look something like this:
#file A.py
import pdbOnException
a = 1/0
print a
#file pdbOnException
i... |
How do you get all classes defined in a module but not imported?
Question: I've already seen the following question but it doesn't quite get me where I
want: [Python: Get list of all classes within current
module](http://stackoverflow.com/questions/1796180/python-get-list-of-all-
classes-within-current-module)
In part... |
Django AttributeError: type object 'User' has no attribute '_collect_sub_objects'
Question: I'm trying to reinstall a site I haven't used in several months and am getting
an error I can't seem to find a solution for.
Running the latest trunk of django, python 2.6.
Here is the stack trace:::
[Fri Apr 01... |
Is there a standard Python data structure that keeps thing in sorted order?
Question: I have a set of ranges that might look something like this:
[(0, 100), (150, 220), (500, 1000)]
I would then add a range, say `(250, 400)` and the list would look like this:
[(0, 100), (150, 220), (... |
Export each object on scene to another file
Question: I want to ask you, how can I export all objects to scene to seperate files in
blender using python scripts ? I want to export it to fbx, to have something
like this: Object File Car Car.fbx Boat Boat.fbx etc..
Each object will be have his of file. I'm tring to use ... |
multiply a matrix by an integer in python
Question: I know how to multiply two matrices(under a class). Below I show my code.
However I can not seem to figure out how to multiply a matrix and an integer
in Python.
**Update** : Example of a matrix.
L=[[1,2],[3,4],[5,6]]
3*L
# [[1,6],[9,12],[15,18... |
Installing the Swampy Python module on Windows
Question: I am trying to install the [Swampy
module](http://www.greenteapress.com/thinkpython/swampy/install.html) on
Python, but there is a lot that is unclear in the instructions given on the
site and the documentation. I have put the Swampy folder into the site-
package... |
Using urllib2 in Python. How do I get the name of the file I am downloading?
Question: I am a python beginner. I am using urllib2 to download files. When I download
a file, I specify a filename to with which to save the downloaded file on my
hard drive. However, if I download the file using my browser, a default
filena... |
FTPES - FTP over explicit TLS/SSL in Python
Question: I need a python client to do FTPES (explicit), does anyone has experience with
any python package that can do this.
I am not able to do this in python, but can connect to FTP server using tools
like FileZilla
Thanks
Answer: FTP-SSL Explicit is well supported by ... |
django-transmeta into admin, displaying "None" in the field.label_tag
Question: I'm trying to integrate django-transmeta into my django installation on ubuntu
10.10 (python-django version on system is 1.2.3-1ubuntu0.2.10.10.1) Following
the instructions in the project home/summary
[here](http://code.google.com/p/django... |
Determining redirected URL in Python
Question: I make a little parser using HTMLparser and I would like to know where a link
is redirected. I don't know how to explain this, so please look this example:
On my page I have a link on the source: `http://www.myweb.com?out=147`, which
redirects to `"http://www.mylink.com"`... |
Model API or load bulk data?
Question: I want to add scrapped data to my database. I like the fact that the API
enables validation but I assume that the overhead is too high. I'm writing
maybe 10k rows at a time, at most. Is that accurate?
Alright, so one other issue I was having, which was preventing me from testing
... |
soap ui generated code
Question: I have a webservice I am trying to build a client for.
I have the following wsdl:
http://www.cmicdataservices.com/datacenter/service.asmx?wsdl
It requires authentication. Looking at the WSDL description I see no method
that takes an authentication object, nor usern... |
Call a function in Python and pass only the arguments it expects
Question: How do I call a function and only pass it the arguments that it expects. For
example say I have the following functions:
func1 = lambda a: True
func2 = lambda a, b: True
func3 = lambda c: True
I want some Python code... |
PIL - libjpeg.so.8: cannot open shared object file: No such file or directory
Question: Compiled the libjpeg v8, PIL 1.1.7 and and import for _imaging works on the
system Python, but spouts this error inside the virtualenv:
libjpeg.so.8: cannot open shared object file: No such file or directory
her... |
What's with binary files on Windows?
Question: I made a script to download a file, but it only works on Unix/Linux/OSX when
I'm downloading binary executables, swf's, images, etc
\#Modfied section from PWB.py
import sys
if sys.version_info<(2,8):
import urllib as request
else:... |
Is there a way to wrap a tkinter GUI in a class that can be created and interacted with from another object? (*without* hanging in mainloop)
Question: Is there a way to wrap a tkinter GUI in a class that can be created and
interacted with from another object? For this to be really useful, the class
has to work so mainl... |
Is shared readonly data copied to different processes for Python multiprocessing?
Question: The piece of code that I have looks some what like this:
glbl_array = # a 3 Gb array
def my_func( args, def_param = glbl_array):
#do stuff on args and def_param
if __name__ == '__main__':... |
Casting in python
Question: I have problem with casting in python.
I have a method in file module_A.py:
import Common.Models.Pax as Pax
def verify_passangers_data(self,paxes):
for i in range(len(paxes)):
pax=paxes[i]
Here is my Pax.py
class Pax:
... |
matplotlib won't work on ubuntu 10.10
Question: I'm having a problem getting matplotlib to work in ubuntu 10.10.
First I install the matplotlib using apt-get, and later I found that the
version is 0.99 and some examples on the official site just won't work. Then I
download the 1.01 version and install it without unins... |
Using Python's Subprocess to Display Output in New Xterm Window
Question: I am trying to output different information in two terminals from the same
Python script (much like [this
fellow](http://stackoverflow.com/questions/2933601/how-i-can-open-different-
linux-terminal-to-output-differnt-kinds-of-debug-informa)). The... |
How do I handle Python unicode strings with null-bytes the 'right' way?
Question: **Question**
It seems that PyWin32 is comfortable with giving null-terminated unicode
strings as return values. I would like to deal with these strings the 'right'
way.
Let's say I'm getting a string like:
`u'C:\\Users\\Guest\\MyFile.as... |
Having trouble with ZMySQLDb with Plone 4.0.4 on Windows
Question: I'm installing ZMYSQLDA for Z MYSQL Databae connection through buildout.
Here are my initial definitions:
parts=
.....
zmysqlda
[zmysqlda]
recipe = cns.recipe.zmysqlda
target = ${productdistros:loc... |
Why is this shell script calling itself as python script?
Question: Obviously this shell script is calling itself as a Python script:
#!/bin/sh
## repo default configuration
##
REPO_URL='git://android.git.kernel.org/tools/repo.git'
REPO_REV='stable'
magic='--calling-python-from-/... |
Is it possible to obtain the IP address from a HTTP Request
Question: **I am trying to identify users that access my website. I know of assigning a
cookie to them & identifying them that way. But is it also possible to use
their IP address to identify them?**
I know of IP subclassing (is that the correct term) so if m... |
Easier way to check conditions?
Question: I'm new to python and I need to simplify this checker. How can I change:
...
if c == '>' and ( prevTime > currentTime ):
c2 = True
elif c == '>=' and ( prevTime >= currentTime ):
c2 = True
...
to something like:
i... |
Running generated nose tests
Question: Suppose I define a testFile.py python module with as follows.
def test_evens():
for i in range(0, 5):
yield check_even, i, i*3
def check_even(n, nn):
assert n % 2 == 0 or nn % 2 == 0
When I let nose identify the tests in co... |
Python wrapper amazon product api
Question: I was trying to install the following python wrapper for Amazons product api:
<http://pypi.python.org/pypi/python-amazon-product-api/0.2.5a1>
I'm getting an error "File "setup.py", line 3, in from setuptools import
setup, find_packages ImportError: No module named setuptools... |
Detecting Key Presses using win32api in Python
Question: I'm trying to break a loop in Python with a specific key press using win32api.
How would one go about this?
What is the actual version of **win32api.KeyPress('H')** , in the following
code?
**Revised:**
import win32api
while True :
... |
Provide C#'s namespace from IronPython
Question: I want to write Tomboy add-on using IronPython and I'm stuck and very
beginning -- I need to provide C#'s namespace.
I mean, here's howto in writing Tomboy add-on's
<http://live.gnome.org/Tomboy/HowToCreateAddins>
> Let's start with creating the plugin file called Inse... |
Unable to locate freeimage after install of mahotas in Python
Question: Hi I am new to Python and am following the [Python Image
Tutorial](http://pythonvision.org/basic-tutorial).
The following executes with no errors after installing the packages described
in the tutorial
import numpy
import scipy
... |
What is the fastest way to learn Javascript?
Question: What is the fastest way to learn Javascript for someone eloquent with class-
based OOP & typed functional programming (Scala, Java), and having some
knowledge of metaprogramming (Python, Ruby, Clojure)?
Answer: This is probably a subjective question. :-)
* Pla... |
How to specify py2app icon?
Question: How do I specify the icon file when using py2app?
Just now I create the setup file:
py2applet --make-setup MyApplication.py
and then build the application bundle:
python setup.py py2app -A
where is it that I specify the icon file.. gettin... |
How can I get input and raw_imput functions to work in Python?
Question: Whenever I use input and raw_imput in Python, it gives me an error report.
Such as in the simple number guessing game. This is what happens:
>>> import random
>>> number= random.randint(1,100)
>>> guess= input("guess a numbe... |
Reading BerkleyDB files from python: `\x01\x0b\x88\x0c\x01`?
Question: **This question in a nutshell: what do`\x04++HLMh7EjP3ILSfF\x00` and**
'\x01\x0b\x88\x0c\x01-\x10\x02\x06!\x05"\x05#\n$\x0c\'\x0e%\x0b\x01&\x02\'\x06(\n\x00\x00'
**mean?**
Hi all,
I'm trying to read palm pre 2 database files. ... |
Script for parsing a biological sequence from a public database in Python
Question: Greetings to the stackoverflow community,
I am currently following a bioinformatics module as part of a biomedical
degree (I am basically a python newbie) and the following task is required as
part of a Python programming assignment:
... |
Haystack indexes not all items
Question: I am using **django haystack** with **whoosh** for full-text search. There are
nine different models to index, but when I search for indexed entries, it
seems that none or not all of them get indexed for some models.
I try this at django shell, but I get 0 for some of the model... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.