text stringlengths 226 34.5k |
|---|
"overloading" doesn't work with stderr
Question:
/*---------------stdcallbk_module.h---------------------*/
#ifndef STDCALLBK_MODULE_H
#include <Python.h>
#define STDCALLBK_MODULE_H
// Type definition for the callback function.
typedef void __stdcall(CALLBK_FUNC_T)(const char* p);
... |
Python multiprocessing pipe will not recv() properly
Question: This is for Python 3.2.2. I'm only just learning how Python and
multiprocessing work and this simple example has been tripping me:
from multiprocessing import Pipe, Process
def f(r):
print(r.recv())
if __name__ == '_... |
How to use ebay sdk in Python?
Question: I have found this code sample to make a query in ebay from
[here](http://code.google.com/p/ebay-sdk-python/) and also downloaded ebay-sdk
for Python. How can I install the sdk and integrate this code with it?
from ebaysdk import finding, nodeText
f = find... |
How to parse multiple sub-commands using python argparse?
Question: I am implementing a command line program which has interface like this:
cmd [GLOBAL_OPTIONS] {command [COMMAND_OPTS]} [{command [COMMAND_OPTS]} ...]
I have gone through the [argparse
documentation](http://docs.python.org/dev/librar... |
matplotlib, define size of a grid on a plot
Question: I am plotting using matplotlib in python. I want create plot with grid, here
is an [example](http://www.scipy.org/Plotting_Tutorial) from plotting
tutorial. In my plot range if the y axe is from 0 to 14 and if use
`pylab.grid(True)` then it makes grid with size of s... |
Python: What's the right way to make modules visible to a TestRunner?
Question: after watching a couple of presentations about django testing, I want to code
my own TestRunner in order to skip django tests, and create better packages
structures for my tests.
The problem is that we've changed the project structure and ... |
Recursive Searching and MySql Comparison
Question: Good evening. I am looking at developing some code that will collect EXIF data
from JPEG images and store it in a MySQL database using Python v2.x The
stumbling block lies in the fact that the JPEGs are scattered in a number of
subdirectories and further subdirectories... |
Python: how to get correct list when split?
Question: In test.txt, I have 2 lines of sentences.
The heart was made to be broken.
There is no surprise more magical than the surprise of being loved.
The code:
import re
file = open('/test.txt','r')#specify file to open
data ... |
plpgsql - bytes are not getting unpacked right
Question: I wrote a function in plpgsql `unpack_numeric_bytes`, the most important part
of the functions is:
FOR i IN 1..v_length LOOP
v_val := v_val + (get_byte(v_bytes, v_byte_index) << v_bit_shift);
v_bit_shift := v_bit_shift + 8;
... |
simple python "printing own arguments"
Question: I've just discovered that in my course, the lecturer doesn't want us to use
the 'import' function, as it's apparently 'too advanced for the student's
needs at this point.'
Messing around with what I am "allowed" to use, I've come up with this:
#!/usr/bin/... |
Write curl in python code
Question: > **Possible Duplicate:**
> [CURL alternative in
> Python](http://stackoverflow.com/questions/2667509/curl-alternative-in-
> python)
I'm trying to write a python snippet that returns a JSON response. With curl
it works and look like this:
curl -H 'content-type: app... |
HTML/JS as interface to local SQLite database
Question: I'm writing a pretty simple database application, which I want to be locally
stored (as opposed to looking up a remote database). I like HTML/Javascript
for designing interfaces, and they're cross-platform (everybody has a
browser!), so I'd really like to write a ... |
Calculating cartesian coordinates using python
Question: Having not worked with cartesian graphs since high school, I have actually
found a need for them relevant to real life. It may be a strange need, but I
have to allocate data to points on a cartesian graph, that will be accessible
by calling cartesian coordinates.... |
In Go, how do I capture stdout of a function into a string?
Question: In Python, for example, I can do the following:
realout = sys.stdout
sys.stdout = StringIO.StringIO()
some_function() # prints to stdout get captured in the StringIO object
result = sys.stdout.getvalue()
sys.stdout = re... |
How do I find the angle between 2 points in pygame?
Question: I am writing a game in Python with Pygame.
The co-ords (of my display window) are
`( 0 , 0 )` at the top left and
`(640,480)` at the bottom right.
The angle is
`0°` when pointing up,
`90°` when pointing to the right.
I have a player sprite with a... |
Is it possible to monitor every file creation on a Windows drive?
Question: I'm writing a program in Python that stores information for every file on the
system. When it's installed, it will walk over every file, but afterwards I
want to update it whenever a new file is created, or when a file is moved. For
example, In... |
How to send a zip file as an attachment in python?
Question: I have looked through many tutorials, as well as other question here on stack
overflow, and the documentation and explanation are at minimum, just
unexplained code. I would like to send a file that I already have zipped, and
send it as an attachment. I have t... |
After successful installation of cjklib and CEDICT, when I use it, it throw errors, why?
Question: This is my first post here.
I have been reading posts here since I started learning python and it has been
nothing but a great help to my learning process. So, just want to say A BIG
THANK YOU to you all before my questi... |
Writing a notification program using Tweepy
Question: In trying to learn the Python-tweepy api, I put together a little bit of code
that tells me if there has been any new tweets within the most recent ~10
second interval (of course, in practice it is more than 10 seconds because
code aside from `sleep(10)` also takes ... |
How to play song from Playlist
Question: I am making a music player in python 2.6 with Tkinter. Here's my code :
from Tkinter import *
import mp3play
import tkFileDialog
import Tkinter
def open_file(): #Opens a dialog box to open .mp3 file
global music... |
Python adding text at the line
Question: I have a file which contains following row:
//hva_SaastonJakaumanMuutos/printData/reallocationAssignment/changeUser/firstName>
I want to add "John" at the end of line.
I have written following code but for some reason it is not working,
def a... |
google-app-engine : Import works only after a refresh
Question: After somes problems with a simple import of httplib2 (see my post
[here](http://stackoverflow.com/questions/10471111/google-app-engine-
importerror-httplib2-in-google-api-python-client-hello-
world#comment13527322_10471111 "google-app-engine : ImportError... |
ZIP folder with subfolder in python
Question: I need to zip a folder that containts an .xml file and a .fgdb file by using
python. Could anyone help me? I tried a few scripts I found on internet but
there is always some technical issue (such as creating an empty zip file, or
create zip file I cannot open 'no permission... |
How do I tell py2app to use/include 32bit Python (for wxPython)?
Question: I'm using OS X Lion (10.7.3) and I'm trying to write a cross-platform, stand-
alone GUI-based program using `wxPython` and `py2app`.
I tried to use Python 2.7.1 which comes shipped with Lion.
I got the `wxPython2.8` binaries (wxPython2.8-osx-u... |
How to get the directory of an argparse file in Python?
Question: I use [`argparse`](http://docs.python.org/library/argparse.html) to get a file
from the user:
import argparse, os
parser = argparse.ArgumentParser()
parser.add_argument('file', type=file)
args = parser.parse_args()
Then I... |
How to handle multi-page images in PythonMagick?
Question: I want to convert some multi-pages .tif or .pdf files to individual .png
images. From command line (using ImageMagick) I just do:
convert multi_page.pdf file_out.png
And I get all the pages as individual images (file_out-0.png, file_out-1.p... |
cache in python function
Question: This appeared as some test question. If you consider this function which uses
a cache argument as the 1st argument
def f(cache, key, val):
cache[key] = val
# insert some insanely complicated operation on the cache
print cache
and now creat... |
'Document' object has no attribute 'get_uri'
Question: I'm working on porting some Gedit 2 plugins to Gedit 3 and I've run into the
error `'Document' object has no attribute 'get_uri'` and am stumped as to
what's wrong. For what it's worth, the Gedit 2 version of the plugin works.
def view_result(self, w... |
Python and gevent - AttributeError: 'module' object has no attribute 'queue'
Question: I am rather new with gevent but I an trying to create a queue but I get the
below error. I am using python2.7.
import gevent
queue = gevent.queue.Queue()
Traceback (most recent call last):
File "/hom... |
Serial communication Python to Arduino - can't recognise carriage return
Question: I'm trying to communicate via serial between a BeagleBone running Ubuntu 10.04
and an Arduino. So far, I can send a string okay, but I'm having problems
recognising the newline character.
From the BB side, in Python3 and using PySerial,... |
"Bad marshal data" Django development server error
Question: Got this error while insterting data into my MySQL database
ValueError at /admin/arbkdb/arbkcompany/
bad marshal data (unknown type code)
Request Method: GET
Request URL: http://[2001:6f8:1c00:18b::2]:9000/admin/arbkdb/arbkcompan... |
Python - Installing matplotlib in Mac OSX Snow Leopard
Question: I've been having trouble installing matplotlib. I'm getting a similar error to
many other topics, but none of those solutions have been working for me. I
have tried installing matplotlib via pip and via git and I receive the same
error every time I would ... |
Get IP Mask from IP Address and Mask Length in Python
Question: Given an IP Address in dotted quad notation, for example:
192.192.45.1
And a mask length for example 8, 16, 24 typically, but could be anything i.e.
17.
Can somebody please provide the code in python to calculate the subnet mask?
Preferably I could ge... |
Difference between PyMODINIT_FUNC and PyModule_Create
Question: If I'm understanding correctly,
(a) PyMODINIT_FUNC in Python 2.X has been replaced by PyModule_Create in
Python3.X (b) Both return PyObject*, however, in Python 3.X, the module's
initialization function _MUST_ return the PyObject* to the module - i.e.
... |
Deploying django - "ImportError" for Apache VirtualHost and mod_wsgi
Question: I'm deploying django on port 81 of my webserver. This is to get it off the
development server, but I'm not ready to have it be served as the root on port
80.
The problem is that any time I try to access any page on port 81, I see the
django... |
VS2010, C#, Python: Python script file execution on runtime
Question: I wish to create a sample program in C# where it downloaded real time data (ie
datalogger) via USB port. C# accept the data (hex or numerical) and then
automatically download a python file (ie validatemethodA.ps) which is then
executed. The python ac... |
Python: Failed to import extension - Errno 2
Question: I am having weird behaviors in my Python environment on Mac OS X Lion. Apps
like Sublime Text (based on Python) don't work (I initially thought it was an
app bug), and now, after I installed hg-git, I get the following error every
time I lauch HG in term:
`*** fai... |
Python: Access/Save memory block just given by pointer without copying
Question: Here is an example of what I try to do:
import ctypes
MEM_SIZE = 1024*1024*128
# allocate memory (this is Windows specific)
ptr = ctypes.cdll.msvcrt.malloc(MEM_SIZE)
# make memory accessible to Pyth... |
python trick needed to convert dictionary of functions into dictionary of results
Question: I am currently blank on how to do this in an effective way.I thought about
using objects but I don't see how they could help in this case. Any ideas?
from random import choice
from copy import deepcopy
... |
Tkinter canvas updating speed reduces during the course of a program
Question: The following python program creates a Tkinter `Canvas` object and draws
random matrix on it. It also measures the time it takes to make 10 subsequent
updates. As you may see from the output below, this time grows continiously
and substantia... |
Is there a __enter__ and __exit__ equivalent for all functions in a class?
Question: One functionality of python that I found very handy when working with
databases (or files) are the `__enter__` and `__exit__` functions you can give
to a class. Now by using the `with` statement you can make sure that in this
block `__... |
App Engine 401/403 Status Codes Not Working on WebApp2
Question: I am trying to raise a 401/403 status for when a user attempts to access
something they don't have privileges to. I used the [Webapp2
Exceptions](http://webapp-improved.appspot.com/guide/exceptions.html) example
which generates the proper error codes for ... |
Best approach to doing analysis of sets of tags?
Question: I have thousands of survey responses that have been tagged according to the
content of the response. Each response can have one tag or many (up to 20),
and the tags are independent of one another rather than being structured into
category-subcategory or somethi... |
Why isn't the data written to the database? (DBM, Python 3.2)
Question: I have been working to learn the `pickle` and `dbm` python modules. I wrote
some code that connected to a dbm database and wrote data and pickled info.
import dbm
import pickle
class PickleDB:
def set_dbname(self):
... |
How to save nltk Text.similar() with variable
Question: I'm a noob in nltk and python.Recently I got a problem,I want to save what
text.similar() show in terminal in a variable,but I failed many times.How
could I save it?
text = nltk.Text(word.lower() for word in nltk.corpus.brown.words())
save = []
... |
Python: cannot find the handle with win32gui.FindWindowEx()
Question: I'm trying to ge the handle for "Yes" button in a dialog, so I can send the
message to click it.
I get the dialog and then I try to find the button, but I always get 0 back.
import win32gui
hwnd = win32gui.FindWindow("#32770"... |
Convert date format python
Question: I have django form and I am receiving from POST a date formated like
"%d/%m/%Y" and I would like to convert it to "%Y-%m-%d", How could I do it?
Answer: Use [strptime and
strftime](http://docs.python.org/library/datetime.html#strftime-strptime-
behavior):
In [1]: im... |
Can I set the umask for tempfile.NamedTemporaryFile in python?
Question: In Python (tried this in 2.7 and below) it looks like a file created using
`tempfile.NamedTemporaryFile` doesn't seem to obey the umask directive:
import os, tempfile
os.umask(022)
f1 = open ("goodfile", "w")
f2 = tempfi... |
Python programming memory leak? Maybe? File search & destroy script
Question: I've got a python script that searches for files in a directory and does so
infinitely while the computer is running. Here is the code:
import fnmatch
import os
import shutil
import datetime
import time
impo... |
incomplete gamma function in python?
Question: the `scipy.special.gammainc` can not take negative values for the first
argument. Are there any other implementations that could in python? I can do a
manual integration for sure but I'd like to know if there are good
alternatives that already exist.
Correct... |
String splitting in Python using regex
Question: I'm trying to split a string in Python so that I get everything before a
certain regex.
example string: `"Some.File.Num10.example.txt"`
I need everything before this part: `"Num10"`, regex: `r'Num\d\d'` (the number
will vary and possibly what comes after).
Any ideas o... |
check if a URL to an image is up and exists in Python
Question: I am making a website. I want to check from the server whether the link that
the user submitted is actually an image that exists.
Answer: This is one way that is quick:
It doesn't really verify that is really an image file, it just guesses based
on file... |
python and ctypes cdll, not getting expected return from function
Question: I'm in the process of working on interfacing a haptic robot and eye tracker.
So, both come with their own programming requirements, namely that the eye
tracker software is based in python and is the main language in which I'm
programming. Our h... |
Read file and copy to standard output.
Question: I'm trying to write a python program that will read input and copy it to
standard output (with no alterations). I've been told that it needs to operate
as a Python version of the Unix cat function. If a file cannot be opened, an
error message needs to be printed, and the... |
Override __new__ doubts
Question: I will try to simplify the case here, when overriding `__new__` as bellow i
don't know the correct way of calling super `__new__` to do the job, am i
doing it ok or is there other way of doing this? `super().__new__(cls)` is not
producing correct results as i expected
i'm a python beg... |
Delete Files from Google Cloud Storage
Question: So I've got a django application up and running on appengine and have it
creating files when a user uploads them. The issue I'm having is trying to
figure out how to delete them. My code for creating them looks like.
from google.appengine.api import files
... |
How do I run a Python script in the command line with an embedded text file?
Question: there. I apologize for the simple question, but I am a complete novice and
need some help. I am trying to run Peter Norvig's Spelling Corrector
(http://norvig.com/spell.py), but I'm receiving the following reply:
C:\>s... |
Multiple Domain Hosting With One Django Project
Question: I'm new to Django and python in general, so please bear with me. I want to
create a very simple SaaS app to get started with Django and python. My design
dictates that all domains will run on the same codebase. The only thing that
will differ between each websit... |
mod_wsgi error - class.__dict__ not accessible in restricted mode
Question: This started biting our ass on our production server really hard. We saw this
occasionally (for 1 request per week). Back then we found out it is because of
mod_wsgi doing some funky stuff in some configs. As we could not track the
reason for t... |
pytest automation apparently running tests during test collection phase
Question: Running webui automated tests with pytest and selenium; having an issue where
it appears that my tests are actually running during the _collection_ phase.
During this phase, I would expect pytest to be collecting tests - not running
them.... |
how to stream jpeg frame from java client to python server
Question: i am developing an android application wherein i have to send a frame in jpeg
format allocated to a BufferedArrayOutputStream (baos variable in code). I
convert this baos into a byte array to write into the socket. On the server
side i would like to r... |
How to do a basic query on yahoo search engine using Python without using any yahoo api?
Question: I want to do a basic query on yahoo search engine from a python script using
Beautiful Soup and urllib. I've done the same for Google which was rather easy
but Yahoo is proving to be a bit difficult. A minimal example scr... |
How to send a function to a remote Pyro object
Question: I am trying to set up some code using Pyro to process python code functions on
a remote host and get results back. After starting the name server, i would
execute this code on the remote host (actually still on localhost):
import Pyro4
cla... |
python - Overhead on looping over an iterable class
Question: I was fiddling around with Python's generators and iterable class, just for
fun. Basically I wanted test out something that I've never been too sure
about: that classes in Pythons have some significant overhead and it's better
to rely on methods that impleme... |
How to start a loop with a specific iterator
Question: I want to loop through a list in several loops always starting with the item
of the last loop:
import itertools as it
list1=[1,2,3,4,5,6,7,8]
a=iter(list1)
while a.next()!= 8:
a,b=it.tee(a) #copy the iterator
while b.next(... |
wxPython StyleSetSpec and SetLexer not working?
Question: Ok, let's get straight to the point. I got 2 questions
1\. Why self.StyleSetSpec(stc.STC_STYLE_DEFAULT, "fore:#000000" + FontSet) not
working?
2\. Why the custom lexer is not applied?
This is the source code
import wx, re, keyword
from ... |
MemoryError on dictionary variable
Question: What is wrong with my code that executinon in 3rd round of `nfind` (while
loop), return MemoryError in line with `CACHE[sha] = number`? On system there
is enough memory, and on the every end of the while loop I clear allocated
memory, but it returns error in the 3rd run thro... |
Generating Links to Youtube Audio
Question: I have been for a while now, as part of a larger project, trying to find a way
to stream Youtube AUDIO into an application without downloading the
corresponding file.
What I have as of now is a program that downloads the video using a web
service such as [saveyoutube.com](ht... |
Structuring a fabric project with namespaces
Question: I use fabric more and more frequently now, and I love it. So far, my fabric
scripts tend to be relatively short and ad-hoc. It gets the job done and it's
fine. That's what I like about it compared to more elaborate tools out there.
I am now trying to bunch togethe... |
Python - IOError: [Errno 13] Permission denied:
Question: Im getting IOError: [Errno 13] Permission denied, i dont know what im doing
wrong.
Im trying to read a file given an absolute path (meaning only file.asm),
and a relative path (meaning /.../file.asm) and i want the program to write
the file
to whatever path i... |
How to add drop down list for timezone using python-TZ at user registration page using UserCreationForm class
Question: I want to add a Drop down list showing common timezone using PYtZ package at
the time of user registration page. To register an user i am using
UserCreationForm class. Code as follow:
c... |
Python threading: how to use return values of external scripts?
Question: (I found a decent solution
[here](http://stackoverflow.com/questions/5093164/multi-threading-different-
scripts "here") for this, but unfortunately I'm using IronPython which does
not implement the mutliprocessing module ...)
Driving script Thre... |
Python - Office Communicator API - Is it possible to send messages despite restrictions
Question: I've messed around with a number of Office programs using win32com in Python.
Excel has been useful and Outlook was simple to satisfy my basic use needs.
I have Microsoft Lync and I'm having trouble using it.
I know the... |
concurrent.futures ThreadPoolExecutor fails to wait?
Question: I am trying to get a script performance improved, using ThreadPoolExecutor
from concurrent.futures. I am launching some external python scripts via Popen
and encapsulating them as a future objects, but these objects enter the
callback function as finished, ... |
Killing python ffmpeg subprocess breaks cli output
Question: I'm trying to execute a system command with subprocess and reading the output.
But if the command takes more than 10 seconds I want to kill the subprocess.
I've tried doing this in several ways.
My last try was inspired by this post:
<http://stackoverflow.... |
performance issue : big numpy array and system call
Question: There is a performance issue when using a system call after pre-allocating big
amount of memory (e.g. numpy array). The issue grows with the amount of
memory.
test.py :
import os
import sys
import time
import numpy
start ... |
extracting specific content from html page
Question: Suppose I have an html page source like:
<p><font face="Arial" color="#400040"><small><strong>
<a href="some_link">description</a>: </strong>some text.</small></font></p>
I want to just extract the "description part? How do I do this. I ... |
Python path issue while importing my own modules. What is the best way to go about it?
Question: I've created python modules but they are in different directories.
/xml/xmlcreator.py
/tasklist/tasks.py
Here, tasks.py is trying to import xmlcreator but both are in different paths.
One way to do ... |
Will this work? hex edited a file and changed inet_aton to inet_pton
Question: I am trying to port a python script to an old Solaris 10 machine. I downloaded
and installed all the required packages from sunfreeware. It crashed in the
import line (import CGIHTTPServer) with this error message:
> ImportError: ld.so.1: p... |
Makefile on python
Question: I'm trying to write a Makefile for a python script, that will create a
`VMTranslator`
executable file, which is supposed to get an input,
meaning this is how it is supposed to be done on shell commands:
1)make <==== should make the VMTranslator executable.
2)VMTran... |
How to store lat-lon geolocation point in a document for GAE search?
Question: There where indications in the [GoogleIO talk on Search
API](http://youtu.be/7B7FyU9wW8Y?t=26m10s) that we can do searches based on
geolocation.
I can't find an [appropriate
field](https://developers.google.com/appengine/docs/python/search/... |
Does win32security.LogonUser() Update Last Logon Timestamp?
Question: I'm writing a Python script that will automatically logon users from a list.
This script will be run once a month to prevent accounts from being disabled
due to low activity. Below is the working code:
import win32security
import g... |
include tag not up-to-date on App Engine 1.6.5
Question: I'm running Google App Engine 1.6.5 and according to the release notes, Django
1.3 is supposed to be supported. However my {% include %} tags can't accept
context parameters; I get the following error. I've checked my django version
which is 1.3.1 when app engine... |
Dramatic memory leak in wxpython application
Question: I'm some way into building a fairly complex wxPython app using ode for
physical modelling, openGL for rendering, and wx for UI. Everything was going
swimmingly until the application started to crash. After a few days of making
no progress I finally noticed that my ... |
Indentation Error -Python frames
Question: Can someone look what is the problem with this code..Everything looks good for
me but I get indentation error.
The code below creates a new frame and contains a button.. WHen the button is
clicked a event is triggered and displays more information about the parent
and child..... |
noob: organizing input fields in wxpython dialogs
Question: I am new to wxpython so this may be a pretty easy question, I dunno.
I want to have a dialog box pop up that takes user input. Check. I want
multiple user input fields. Check. I also want to have them come up in the
same line, e.g.:
Enter the Month: _x_ Ente... |
Most suitable python library for Github API v3
Question: I am looking for a python library for the Github APIv3 suitable for me.
Background: I am a python noob with a background primarily rooted in Matlab
and C++, and have recently learned to use python-matplotlib.
I found one library [(python-github3)](https://github... |
Deleting everything that is enclosed with quotes or is a number in Python?
Question: Lets say I have this string:
myString="'Hello'+yes+'Whats hello'6"
I am looking for a way to delete everything enclosed in quotes
So, it would become:
"+yes+"
Because, 'Hello' and 'Whats hello... |
hashlib.sha256 returned some weird characters in python
Question: In javascript the code below returned
**eec097af19ad461ac825ccce57a012543da33c986e4607475e1fe5c6dc098d0a**
<script src="http://crypto-js.googlecode.com/svn/tags/3.0.1/build/rollups/hmac-sha512.js"></script>
<script>
var hash = ... |
How to hide console with Popen on Windows?
Question: I had found this topic and i found this as a solution:
[Module subprocess has no attribute
'STARTF_USESHOWWINDOW'](http://stackoverflow.com/questions/4703983/module-
subprocess-has-no-attribute-startf-useshowwindow)
but when I run code reality differs. :/
1. Run... |
Python version of a Perl regular expression
Question: I have this Perl regular expression and I want to convert it to Python.
The regex I want is a search and replace that finds text and converts it to
upper case. It also must be the first occurring result. Perl regex:
open FILE, "C:/thefile.txt";
w... |
How to write a python package
Question: I am trying to refactor my code (a bunch of core modules and some apps living
in a common directory). I want to get this structure
Root
__init__.py
Core
__init__.py
a.py
b.py
c.py
AppOne
__... |
Concurrent programming in Python and Qt
Question: I wrote a small program to evaluate the state of cellular automata and paint
it on the screen. I have dual-core PC, so in order to increase efficiency I
decided to make calculations in two threads. I made my own implementations of
QThread, like so:
clacc ... |
dotcloud supervisord.conf file environment specification
Question: <http://docs.dotcloud.com/guides/daemons/> states:
Configuring The Environment
You can easily modify the environment of execution of your daemon with the “directory” and “environment” directives to change the directory where the comma... |
How can I calculate the average of a list of tuples in python?
Question: I have a list of tuples in the format:
[(security, price paid, number of shares purchased)....]
[('MSFT', '$39.458', '1,000'), ('AAPL', '$638.416', '200'), ('FOSL', '$52.033', '1,000'), ('OCZ', '$5.26', '34,480'), ('OCZ', '$5.1571'... |
converting a time string to seconds in python
Question: I need to convert time value strings given in the following format to
seconds.I am using `python2.6`
eg:
1.'00:00:00,000' -> 0 seconds
2.'00:00:10,000' -> 10 seconds
3.'00:01:04,000' -> 64 seconds
4. '01:01:09,000' -> 3... |
Basic python script giving Internal Server Error
Question: I'm using hostgator and they swear that python is supported, but I've yet to
see one working python script. I've tried several scripts, my latest one is
the one they give on their website:
#!/usr/bin/python
print "Content-type: text/html\n\n"... |
Efficient multiprocessing of massive, brute force maximization in Python 3
Question: This is an extension of my recent question [Avoiding race conditions in Python
3's multiprocessing
Queues](http://stackoverflow.com/questions/10607747/avoiding-race-conditions-
in-python-3s-multiprocessing-queues). Hopefully this versi... |
Referencing file from method in python
Question: I need some help with this. I am using this method to help me open a file with
a dialog box:
from Tkinter import *
import tkFileDialog
fileOpen = Tk()
fileOpen.withdraw() #hiding tkinter window
file_path = tkFileDialog.askopenfile... |
How to disable text shaking when I click a button?
Question: I am working with buttons in Tkinter, python.
The thing is when I click in one button the text of the button shakes. It
might be a default behavior for this widget and I don't know how to disable it
and make it static.
Does anyone know how to fix this?
An... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.