text
stringlengths
226
34.5k
how to compress a python dict to save into mysql Question: i have a large python dict, maybe 10MB, failed to save it in mysqldb, as repr(dict) i tried zlib.compress, the result string is ill to save mysql. now how about compress the dict and convert to binary, and save as blob? any coding sample? #update i tried struc...
Removing lines from a file using python Question: > **Possible Duplicate:** > [Python 3 regular expression to find multiline > comment](http://stackoverflow.com/questions/7081882/python-3-regular- > expression-to-find-multiline-comment) I need some inputs on how this can be done,really appreciate your inputs,I look...
How to grant access to google appengine page in Python? Question: I have a simple app that serves a page, I want this page to be accessible only to a couple of predetermined users already signed into Google. In fact, I want access only through importHTML function in Google Spreadsheets. How to implement this with mini...
How to know which application run a python script Question: Is there a way to know which application I'm running a python script from? I can run python from multiple sources, like Textmate, Sublime Text 2 or Terminal (I'm on Mac OSX). How can I know, exactly which tool launched the current python app. I've tried look...
How to re-display a QDialog after hiding it? Question: I am working with python and pyqt. I have a dialog that I want to temporarily hide. After calling dlg.hide() I try calling dlg.show() but nothing happens. It is never re-displayed. I am new to pyqt so any help is greatly a...
Interleave different length lists, elimating duplicates and preserve order in Python Question: I have two lists, lets say: keys1 = ['A', 'B', 'C', 'D', 'E', 'H', 'I'] keys2 = ['A', 'B', 'E', 'F', 'G', 'H', 'J', 'K'] How do I create a merged list without duplicates that ...
Complex Sorting - Multi Key Question: I am using Python 2.6.2. I have a dictionary, `graph` which has tuple (source, destination) as key with a certain weight as its value. Would like to sort `graph` based on source in descending order of weight. There could be more than one same source in the tuple of graph with diff...
cxfreeze missing distutils module inside virtualenv Question: When running a cxfreeze binary from a python3.2 project I am getting the following runtime error: /project/dist/project/distutils/__init__.py:13: UserWarning: The virtualenv distutils package at %s appears to be in the same location as the sys...
Bound Python method accessed with getattr throwing:" takes no arguments (1 given) " Question: Something rather odd is happening in an interaction between bound methods, inheritance, and getattr that I am failing to understand. I have a directory setup like: /a __init__.py start_module.py /...
How to run different Django projects under different Domains on one web server? Question: I am trying to running two different projects in my web server. I want them to be pointed by different domain. So I configured my httpd.conf like this: NameVirtualHost *:80 <VirtualHost *:80> Server...
Create Class Implicitly In Python Question: I have a function that its job is generate a python class implicitly according to the given name that pass throw the function. After that I want to create field and method implicitly for the generated class too. I don't know how can start it. Can someone help... Answer: Do ...
How to use Python to find all isbn in a text file? Question: I have a text file `text_isbn` with loads of ISBN in it. I want to write a script to parse it and write it to a new text file with each ISBN number in a new line. Thus far I could write the regular expression for finding the ISBN, but could not process any f...
Segment an image using python and PIL to calculate centroid and rotations of multiple rectangular objects Question: I am using python and PIL to find the centroid and rotation of various rectangles (and squares) in a 640x480 image, similar to this one ![enter image description here](http://i.stack.imgur.com/6JYjd.png) ...
Python Duplicate Removal Question: I have a question about removing duplicates in Python. I've read a bunch of posts but have not yet been able to solve it. I have the following csv file: **EDIT** **Input:** ID, Source, 1.A, 1.B, 1.C, 1.D 1, ESPN, 5,7,,,M 1, NY Times,,10,12,W 1, ESPN, 10,,Q...
python drag and drop explorer files to tkinter entry widget Question: I'm fairly new to Python. I'm trying to input a file name (complete with full path) to a TKinter entry widget. Since the path to the file name can be very long I would like to be able to drag and drop the file directly from Windows Explorer. In Perl ...
Python Random Random Question: ho i making the random number be below the random number before. if Airplane==1: while icounter<4: ifuelliter=random.randrange(1,152621) #litter/kilometer LpK=152620/13500 km=LpK*ifuelliter ipca=random.randrange(0,50) ...
Python Week Numbers where all weeks have 7 days, regardless of year rollover Question: I have an application where I need to measure the week-number of the year, and I want all weeks to have 7 days, regardless of whether the days are in separate years. For example, I want all the days from Dec 30, 2012 to Jan 5, 2013 ...
Python bytes are missing after recv from UDP socket Question: import socket import sys import datetime import os try: username = "root" password = "Apacheah64" db_name = "DB_GPS" table_name = "Tbl_GPS" host = "" port = 6903 buf = 4096 ...
urllib2 python exception in Ubuntu when loading a https json file Question: I'm trying to load a json file but it's throwing an exception: <urlopen error [Errno 104] Connection reset by peer> This is my code (I executed it on the shell for testing/debugging purposes): >>> import urll...
os.environ['http_proxy'] not working Question: > **Possible Duplicate:** > [Is it possible to change the Environment of a parent process in > python?](http://stackoverflow.com/questions/263005/is-it-possible-to-change- > the-environment-of-a-parent-process-in-python) I am using python 2.4.3. I tried to set my http_...
urllib2.URLError: <urlopen error unknown url type: c> Question: I am using the below code to scrape over XFN content from web page <http://ajaxian.com> but I am gatting the below error: Traceback (most recent call last): File "C:\Users\Somnath\workspace\us.chakra.social.web.microformat\src\micr...
Best practice for starting/stopping daemons as part of a unittest (using pytest) Question: Functional testing of code often requires external resources like e.g. a database. There are basically two approaches: * assuming that a resource (e.g. database) is always running and is always available * start/stop the re...
cannot add or apply the user defined package of TCL in Python Question: I have a TCL script that requires a user defined package within, when I run the TCL through python by the below script: import subprocess p = subprocess.Popen( "tclsh tcltest.tcl", shell=True, stdin=subpro...
Python Unit Testing a loop function Question: This is a followup question from [1](http://stackoverflow.com/questions/14282783/call-a-python-unittest-from- another-script-and-export-all-the-error-messages#comment19835851_14282783) I need to test the function with two given cases in a loop. However, based on the printe...
I am trying to make a file delete program Question: I get winErrors at runtime like 'The system cannot find the file specified', but I know that those files exist... The idea is to try and use recurssion to embed itself into every file, and then delete them, which greatly decreases the time spent deleting the files. My...
Using gevent with pyramid Question: I'm building a website using pyramid, and I want to fetch some data from other websites. Because there may be 50+ calls of `urlopen`, I wanted to use gevent to speed things up. Here's what I've got so far using gevent: import urllib2 from gevent import monkey;...
How to parse XML in Python and LXML? Question: Here's my project: I'm graphing weather data from WeatherBug using RRDTool. I need a simple, efficient way to download the weather data from WeatherBug. I was using a terribly inefficient bash-script-scraper but moved on to BeautifulSoup. The performance is just too slow (...
Python, first time using Decimal and quantize Question: I was just wondering if anybody had any input on how to improve this code. My goal is for it to be as pythonic as possible since I'm trying to really learn python well. This program works fine, but if you see anything that you think could be done to improve (not m...
Django REST framework: help on object level permission Question: Following this tutorial: <http://django-rest-framework.org/tutorial/1-serialization.html> through <http://django-rest-framework.org/tutorial/4-authentication-and- permissions.html> I have this code: # models.py class Message(BaseDate...
Cannot import a python module that is definitely installed (mechanize) Question: On-going woes with the python (2.7.3) installation on my Ubuntu 12.04 machine and importing modules. Here I am having an issue where I have definitely installed mechanize both on my machine and in various virtual environments. I have tri...
Create a set of objects when their type is set by ini file (Python) Question: I'm working on a smart home project. I've got a bunch of pieces, such as a handful of XBee readios, leds, GPS-synched clocks, water counters etc. I tried to use OOP approach, so I created many classes and subclasses. Now all you have to do in...
python scipy leastsq fit with complex numbers Question: I have a data set of complex numbers, and I'd like to be able to find parameters that best fit the data. Can you fit data in complex numbers using leastsq as implemented by scipy in python? For example, my code is something like this: import cmath...
How to refresh the multi-line output dynamically Question: I want to refresh some info dynamically(just like progress bar), I can do it with following code #! /usr/bin/env python import sys import time print "start the output" def loop(): i = 0 while 1: ...
Implementing this algorithm on Lists - Python Question: Edit: Seems I made a mistake on my previous description and example so here it is fixed. # Latest Version interactions = [ ['O1', 'O3'], ['O2', 'O5'], ['O8', 'O10'] ['P3', 'P5'], ...
Python. Generating a random + or - sign using the random command Question: What is the easiest way to generate a random `+`,`-`,`*`, or `/` sign using the import random function while assigning this to a letter. E.G. g = answeryougive('+','-') Thanks in advance :) Answer: You want [`random.choic...
Syntax error when trying to assign objects to class in Python using Mac OS X Terminal Question: I am learning python programming and I am just going through easy exercises. One of them has me create a class as follows: class MyFirstClass: Pass That is it. I save this and then when I try to ...
Python ctypes: How to modify an existing char* array Question: I'm working on a Python application that makes use of libupnp which is a C library. I'm using CTypes to use the library which is easy enough. The problem I'm having is when I'm registering a callback function for read requests. The function has a prototype ...
Can I run a python file within another python file? Question: > **Possible Duplicate:** > [Run a python script from another python script, passing in > args](http://stackoverflow.com/questions/3781851/run-a-python-script-from- > another-python-script-passing-in-args) Suppose I have script2.py that returns a int val...
Testing Python C libraries - get build path Question: When using setuptools/distutils to build C libraries in Python $ python setup.py build the `*.so/*.pyd` files are placed in `build/lib.win32-2.7` (or equivalent). I'd like to test these files in my test suite, but I'd rather not hard code the `...
Finding the variables (read or write) Question: I'd like to develop a small debugging tool for python programs.In Dynamic Slicing How can I find the variables that are accessed in a statement? And find the type of access (read or write) for those variables (in Python).### Write: A statement can change the program state...
Using python's pack with arrays Question: I'm trying to use the pack function in the struct module to encode data into formats required by a network protocol. I've run into a problem in that I don't see any way to encode arrays of anything other than 8-bit characters. For example, to encode "TEST", I can use format sp...
Parsing dictionary-like URL parameters in Python Question: I'm working on implementing server-side filtering to serve KendoUI's Grid component, using Python. The problem I'm facing is that the AJAX call that it generates by default seems to be incompatible with both Flask's built-in URL parser and Python's `urlparse` ...
Filter a django model by comparing two foreign keys Question: I need to create a filter in Django by comparing two foreign keys to each other. The double-underscore syntax only works on the left hand side of the equation. So whatever is on the right side throws an error: match = UserProfile.objects.filte...
django south: problems with path to django Question: The problem causes this error when I try to use south: $ python manage.py schemamigration You must provide an app to create a migration for. $ python manage.py schemamigration myapp --initial OSError: [Errno 13] Permission denied: '../myapp...
Video Appears Corrupted on Upload via Python ftplib Question: I'm attempting to use the **ftplib** library in Python to try and FTP some videos to my website. I've got a script with the basics "working", but there's a problem with it. When I try to play my video back using VLC player, it appears that it's corrupt, as i...
awscli getting started error Question: I'd already asked this on the AWS official forum on Jan-2 but not any reply. So, I m posting it here again so that I can get the error fixed. * * * I installed awscli as stated in this page <http://docs.amazonwebservices.com/cli/latest/userguide/cli-chap-getting- started.html> ...
DLL load failed with PyQGIS Question: I've already asked this question in the "gis.stackexchange" forum, but it seems to be more appropriate for this one. I am having problems with Python Shell importing the module "qgis.core". When I type "import qgis.core" the Shell ("idle.pyw") gives me this error: T...
Is there a way to access an overridden method within a multiple inheritance object in Python? Question: I have the following Python code. How do I get c to return 2 without changing the class definitions? Or differently stated. How to access overridden methods in an object with multiple inheritance? clas...
python android getcontacts Question: I read the python api of android. I found a method called contactsGet(). I use such method as bellow. import android droid = adroid.Android() cons = droid.contactsGet() print cons but I get no contact info. could you please help me with this? t...
ImportError: No module named _backend_gdk Question: I am starting to get some insight into interactive plotting with python and matplotlib using pyGTK+. Therefore I took a look at the example given at the matplotlib website: <http://matplotlib.org/examples/user_interfaces/gtk_spreadsheet.html> This is a short exerpt ...
Line-buffering of stdout fails on MINGW/MSYS Python 2.7.3 Question: The problem is illustrated by this simple script: import time, os, sys sys.stdout = os.fdopen( sys.stdout.fileno(), 'w', 1 ) # line-buffer stdout print 'before sleep' time.sleep( 10 ) print 'after sleep' If line-buf...
Define a route for url ending with integer in python Question: Here is a portion of my python code: @app.route("/<int:param>/") def go_to(param): return param The above function routes a url such as `www.example.com/12` to this function. How can I declare a parameter rule to redirect u...
is it possible to add syntax synonym to 'def' in python? Question: I would like to use let instead of def. I am looking for sane way of changing syntax of own code in this way. basically in c it would be #define let def How to make the same in python? Answer: `def` is a keyword in python, so it...
CSV to KML via Python Question: I have a little problem I always get the error: > TypeError: cannot concatenate 'str' and 'list' objects import csv import os fp = "filepath/testfile.csv" file = open(fp) lines =file.readlines() for line in lines: line = line.strip() fie...
Setting up i18n with python GAE: importError No module named babel Question: [GAE's webapp2_extra.i18n can't import babel on MacOSX](http://stackoverflow.com/questions/10898491/gaes- webapp2-extra-i18n-cant-import-babel-on-macosx) I followed the post above and added babel and pytz libraries under the file path /lib. B...
Why does Capistrano need modifications to use something like pythonbrew? Question: As I understand, all that Capistrano does is ssh into the server and execute the commands we want it to (mostly). I've used rvm in some past couple of projects, and had to install the rvm- capistrano gem. Otherwise, it failed to find th...
Python Pandas - Deleting multiple series from a data frame in one command Question: In short ... I have a Python Pandas data frame that is read in from an Excel file using 'read_table'. I would like to keep a handful of the series from the data, and purge the rest. I know that I can just delete what I don't want one- b...
How to send a file using scp using python 3.2? Question: I'm trying to send a group of files to a remote server through no-ack's python byndings for libssh2, but I am totally lost regarding the library usage due to the lack of documentation. I've tried using the C docs for libssh2 unsuccesfully. Since I'm using pytho...
Django DateTimeField() and timezone.now() Question: OK, weird time zone issues when I'm running function tests. Django 1.4, Python 2.7. Are milliseconds truncated in DateTimeField() on MySQL? That's the only theory I've got. model file from django.db import models from django.utils import timezone ...
import error in celeryd task Question: I am having problems running my celery task because it cannot find one of my modules: (ff)bash-3.2$ flipfinder_app/manage.py celeryd [...] Traceback (most recent call last): File "/Users/jasonlfunk/.virtualenvs/ff/lib/python2.7/site-packages/billiard/pro...
Is there a recommended format for multi-line imports? Question: I have read there are three ways for coding multi-line imports in python With slashes: from Tkinter import Tk, Frame, Button, Entry, Canvas, Text, \ LEFT, DISABLED, NORMAL, RIDGE, END Duplicating senteces: from ...
Python: Pair alphabets after loop is completed Question: I tried to pair Alphabets by this import string a=string.uppercase for i in range(0,30): print a[i%26]*(i / 26+1) This will print A-Z and then after Z it will print AA BB like string but i need to put this string like...
extract label value for checkbox input object with beautiful soup instead of mechanize in python Question: New to mechanize and BeautifulSoup and am loving it. I used the prototypical way of opening a URL with mechanize, and I now have the returned object: def OpenURL(URL, USERAGENT): br...
Python: Intersection of full string from list with partial string Question: Let's say I have a string and a list of strings: a = 'ABCDEFG' b = ['ABC', 'QRS', 'AHQ'] How can I pull out the string in list b that matches up perfectly with a section of the string a? So the would return would b...
Truncating files and logging in Python Question: I'm writing a script that needs to go delete massive movie/media files from our company's database. I'm developing in a Mac and Python environment both of which are new to me. I'm trying to make this as resilient as possible since it can possibly nuke the database of all...
Most lightweight way to plot streaming data in python Question: To give you a sense of what I'm looking for, it looks like [this](http://youtu.be/xMWIATas_e0?t=1m37s): Up until now I have used matplotlib for all my plotting, and timing hasn't been critical (it's been done in postprocessing). I'm wondering if there is...
What are the three arguments to Gdk.threads_add_idle()? Question: Using python and the `gi.repository` module, I am trying to call `Gdk.threads_add_idle`, but I get the error message that three arguments are required. The [documentation](http://developer.gnome.org/gdk/2.22/gdk- Threads.html#gdk-threads-add-idle), howev...
Getting yesterdays date with time zone Question: Hi I was able to find the answer to this question but now with the timezone included (http://stackoverflow.com/questions/1712116/formatting-yesterdays- date-in-python) This is working fine for me: >>> import time >>> time.strftime('/%Z/%Y/%m/%d') ...
HOGDescriptor with videos to recognize objects Question: Unfortunately I am both a python and a openCV beginner, so wish to excuse me if the question is stupid. I am trying to use a `cv2.HOGDescriptor` to recognize objects in a video. I am concerned with a frame-by-frame recognition (i.e. no tracking or so). * * * H...
How to make a For loop without using the In keyword in Python Question: I was just wondering how I could go about using a For loop without using the "in" keyword in Python? Since the "in" keyword tests to see if a value is in a list, returning True if the value is in the list and False if the value is not in the list,...
Dajaxice not found on production server Question: I have a Django 1.4 project, running on Python 2.7 in which I'm using [Dajaxice](http://www.dajaxproject.com/) 0.5.4.1. I have set it up on my development machine (Windows 7) and everything works perfectly. However when I deploy my app to production server (Ubuntu 12.04...
Python urlparse -- extract domain name without subdomain Question: Need a way to extract a domain name without the subdomain from a url using Python urlparse. For example, I would like to extract `"google.com"` from a full url like `"http://www.google.com"`. The closest I can seem to come with `urlparse` is the `netl...
Determine if a Python class is an Abstract Base Class or Concrete Question: My Python application contains many abstract classes and implementations. For example: import abc import datetime class MessageDisplay(object): __metaclass__ = abc.ABCMeta @abc.abstractproperty ...
Scrapy: why does my response object not have a body_as_unicode method? Question: I wrote a spider, that worked brilliantly the first time. The second time I tried to run it, it didn't venture beyond the `start_urls`. I tried to `fetch` the url in `scrapy shell` and create a `HtmlXPathSelector` object from the returned ...
ctypes: Cast string to function? Question: I was reading the article [Tips for Evading Anti-Virus During Pen Testing](http://pen-testing.sans.org/blog/pen-testing/2011/10/13/tips-for- evading-anti-virus-during-pen-testing) and was surprised by given Python program: from ctypes import * shellcode = '\...
Internationalization with python gae, babel and i18n. Can't output the correct string Question: jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir),extensions=['jinja2.ext.i18n'], autoescape = True) jinja_env.install_gettext_translations(i18n) config['webapp2_extras.i18n'] = ...
Dynamically create a list of shared arrays using python multiprocessing Question: I'd like to share several numpy arrays between different child processes with python's multiprocessing module. I'd like the arrays to be separately lockable, and I'd like the number of arrays to be dynamically determined at runtime. Is th...
Get the "bits" of a float in Python? Question: I am looking for the Python equivalent of Java's `Float.floatToBits`. I found this [Python: obtain & manipulate (as integers) bit patterns of floats](http://stackoverflow.com/questions/1922771/python-obtain-manipulate- as-integers-bit-patterns-of-floats) but does anyone k...
For class using the `with` keyword in python, can I have it __repr__ (print) itself? Question: I'm trying to create an object that plays nicely with the `with` keyword in Python. I understand that you have to create `__enter__` and `__exit__` methods, but I'm not quite sure how manipulate the object. As a concrete exam...
moving django site to another server Question: I want to move my django site to another machine. (I want to start with empty DB) I thought i'll be done with the following steps. * copy all files setup all tools(django,python,..etc) run syncdb When I run `manage.py syncdb`, it complains some table(such as djang...
Openerplib error "Method not available execute_kw" Question: When I try to load data from OpenERP bd using [OpenErp Client Lib](http://pypi.python.org/pypi/openerp-client-lib/1.0.3): I get this error, from an iPython screen. openerp-server is running, as well as openerp-web, and I get no error on the log. Config file...
Creating a video using OpenCV 2.4.0 in python Question: I am trying to create a video using `OpenCV 2.4.0` in `python 2.7.2`. But the `avi` file size is 0. My code: from cv2 import * im1 = cv.LoadImage("1.jpg") fps = 20 frame_size = cv.GetSize(im1) #writer = cv.CreateVideo...
Unexpected behavior when using python thread locks and circulair imports Question: I wrote a simple test program using thread locks. This program does not behave as expected, and the python interpreter does not complain. test1.py: from __future__ import with_statement from threading import Thread, R...
solving `DetachedInstanceError` with event.listens on SQLAlchemy Question: I have a very similar problem as this [question](http://stackoverflow.com/questions/9704927/pyramid-sql-alchemy- detachedinstanceerror), however, even if I try to do something like ... from my_app.models import Session use...
How can I create my custom xmlrpc fault error in python Question: When using `xmlrpclib` in python an error on the server side is reported by the client side as an `xmlrpclib.Fault`. A `division by zero` error in a method on the server side (using `SimpleXMLRPCServer`) usually gives an output like the following: ...
Shell - Trying to output last portion of a logfile (Time-stamp is the separator) Question: I would like to read in a logfile into shell, and output the last logged event that had occurred. These logs are selenium-python automated test results that I am using in larger script. This script requires the last chunk of the ...
Two forward slashes in Python Question: I came across this sample of code from a [radix sort](http://en.wikipedia.org/wiki/Radix_sort#Example_in_Python): def getDigit(num, base, digit_num): # pulls the selected digit return (num // base ** digit_num) % base What does the '`//`' do i...
Segfault on calling standard windows .dll from python ctypes with wine Question: I'm trying to call some function from Kernel32.dll in my Python script running on Linux. As Johannes Weiß pointed [How to call Wine dll from python on Linux?](http://stackoverflow.com/questions/4052690/how-to-call-wine-dll-from- python-on-...
How to remove a resource (Google Docs document) from the root collection (folder) Question: I am using the python gdata library to copy and move a google Docs file in a specific folder. I am using the MoveResource method from DocsClient, the file appears in the desired folder, but also stays in the root folder. I cann...
python MySQLdb wont insert into db Question: Hi I have an issue with inserting info to my db. It doesn't give off an error.The code is here. import MySQLdb as m def Room(room): db = m.connect("localhost","root","password","rooms") cur = db.cursor() cur.execute('INSERT INTO r...
Hot to get query string from Python script (using PyISAPI on IIS) Question: I've done everything from this blog <http://geographika.co.uk/setting-up- python-on-iis7>. I'm using only Python 2.6 (not Django) and want to get query string parameters in my python script. For example, during the execution of `http://localho...
Python: Iterating over two lists and replacing elements in one list1 with the element from list2 Question: I have two lists of strings. In list1, which contains around 1000 string elements, you have a string called "Date" that occurs randomly, immediately followed by a string that contains the a particular Date : "17/0...
coverage on a frozen executable Question: Is there any way to run coverage against an executable built with pyinstaller? I tried just running it like a it was a python script and it didnt like the executable file as input (I didnt really expect it to work) and I suspect that the answer is no there is no easy way to run...
Using matplotlib in GAE Question: My tags and title quite clearly state my problem. I want to use matplotlib to create real-time plots in Google App Engine. I've read the [documentation](https://developers.google.com/appengine/docs/python/tools/libraries27) and searched on SO and Google. I found a post, pointing to [th...
gaussian fit with scipy.optimize.curve_fit in python with wrong results Question: I am having some trouble to fit a gaussian to data. I think the problem is that most of the elements are close to zero, and there not many points to actually be fitted. But in any case, I think they make a good dataset to fit, and I don't...
Converting numpy array to rpy2 matrix (forecast package, xreg parameter) Question: I don't seem to be able to get the line `fit = forecast.Arima(series, order=order, xreg=r_exog_train)` to work. It does work without the xreg parameter so I'm pretty sure it's the numpy array to rpy2 matrix conversion that makes a proble...
Why is my python/numpy example faster than pure C implementation? Question: I have pretty much the same code in python and C. Python example: import numpy nbr_values = 8192 n_iter = 100000 a = numpy.ones(nbr_values).astype(numpy.float32) for i in range(n_iter): a = numpy.sin(...
Load in images from file python pygame Question: I'm working on a pygame project, and in my main directory I have a folder called "Sprites" for example. Is there a way using python to load all the images in that file into a list? I know how to put things in list using a for loop, I'm just not sure if there is a way to ...
Creating thumbnails from video files with Python on my website Question: I need to create thumbnails for a video file which users uploaded to web site running django. How would I go about this...which function can do this ? I can display thumbnail images but I cant capture a view from a video. Thanks for helps. Answ...
How to securely maintain a persistent SSH connection in PHP? Question: I am currently working on a VPS panel that uses a master-slave model. One master server runs a panel written in PHP, and manages multiple slave servers via SSH. The slave servers are accessed via a limited account, that can sudo to specific server a...