text
stringlengths
226
34.5k
How to read csv file with string but convert to different type and send to an array in python? Question: I have a csv file, contain datetime, number1, number2, number3 number4. I use code to read, but how to change the types. my code: import csv import datetime myarray=([]) filename='Contra...
Missing Table When Running Django Unittest with Sqlite3 Question: I'm trying to run a unittest with Django 1.3. Normally, I use MySQL as my database backend, but since this is painfully slow to spinup for a single unittest, I'm using Sqlite3. So to switch to Sqlite3 just for my unittests, in my settings.py I have: ...
Python comparing strings to their equivalent integers effeciently Question: What's the most efficient way to compare two python values both of which are probably strings, but might be integers. So far I'm using str(x)==str(y) but that feels inefficient and (more importantly) ugly: >>> a = 1.0 >>> b =...
Using an MFC .dll file with Python 3.2 Question: I am currently planning to access my MFC Dialog based application's .dll file using Python. I am new to Python and have the latest version of Python installed i.e. 3.2. I have installed PythonWin as well, but not really sure if it would be useful or not. I have understoo...
How can I pass file names to external commands executed from Python? Question: I am trying to execute a command inside a Python script: import subprocess output_process = subprocess.Popen("javac -cp C:\Users\MyUsername\Desktop\htmlcleaner-2.2.jar Scrapping_lastfm.java", ...
How to count the number of words in a paragraph and exclude some words (from file)? Question: I've just started to learn Python so my question might be a bit silly. I'm trying to create a program that would: \- import a text file (got it) \- count the total number of words (got it), \- count the number of words i...
Python one-liner to extract field Question: Input: $ ./ffmpeg -i test020.3gp ffmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers built on May 5 2011 14:30:25 with gc...
introspective code completion with VIM? ... or other lightweight editor with this feature? Question: I've been all over the web trying to find a way to get VIM to have code completion similar to PyDev. It doesn't seem like it is possible! -I have tried to use the omnicompletion suggested at this link: <http://blog.dis...
Redirect subprocess to a variable as a string Question: > **Possible Duplicate:** > [Parsing a stdout in > Python](http://stackoverflow.com/questions/2101426/parsing-a-stdout-in- > python) With the following command, it prints '640x360' >>> command = subprocess.call(['mediainfo', '--Inform=Video;%Wid...
Why do I have to type ctrl-d twice? Question: For my own amusement, I've cooked up a python script that allows me to use python for bash one-liners; Supply a python generator expression; and the script iterates over it. Here's the script: DEFAULT_MODULES = ['os', 're', 'sys'] _g = {} for m i...
is there a way to do range() with ast.literal_eval? Question: or another way to ask I suppose is there a literal which will literal_eval to the equivalent of the range function (without sending the entire array as a range). the following import ast ast.literal_eval("range(0,3)") ast.literal_eval...
Extending my application - Pyramid/Pylons/Python Question: Simple question about extending my application Lets say I have a "Main Application", and in this application I have the following in the _init_.py file: config.add_route('image_upload', '/admin/image_upload/', view='mainapp.views.upload...
Making python imports more structured? Question: The code works but looks messy so this might be a code review question where I didn't study enough of pythons conventions to know how to structure and organize the beginning of my file more pythonic. I basically just pasted in imports so they could be duplicates, not nee...
file error in python Question: I have the following script: import os import stat curDir = os.getcwd()+'/test' for (paths, dirs, files) in os.walk(curDir): for f in files: if os.stat(f)[stat.ST_SIZE]>0: print f and the folder tes...
Parsing crontab-style lines Question: I need to parse a crontab-like schedule definition in Python (e.g. 00 3 * * *) and get where this should have last run. Is there a good (preferably small) library that parses these strings and translates them to dates? Answer: Perhaps the python package [croniter](http://pypi.py...
Save python plistlib data Question: how do I save the output I get for this program(as a variable), instead of it being printed? import plistlib, time import plistlib as pl p=pl.readPlist("Restore.plist") print p["ProductType"]#I want this to be outputted as a variable, such as 'x' instead of...
How can I detect whether my python class instance is cast as an integer or float? Question: I have a python class to calculate the number of bits when they have been specified using "Kb", "Mb" or "Gb" notation. I assigned a `@property` to the `bits()` method so it will always return a `float` (thus working well with `i...
Python: How do you use re to ignore links in parentheses? Question: The relevant part of the code is: import re reargs = '<a\s*href=[\'|"](.*?)[\'"].*?>' link = re.search(reargs,content,flags=re.IGNORECASE) I'm building a crawler and the web pages I'm working with have links in parentheses ...
How can I parse an external XML file with django/python Question: I've done some research on trying to parse an XML file from another web server and came across something called [minidom](http://docs.python.org/library/xml.dom.minidom.html). I've tried implementing this in my view.py file: from xml.dom ...
merging arrays in python Question: I am new to python..I have two sorted arrays (by key) that I would like to merge. Both arrays have some common keys and some exist uniquely in one of the arrays. I want to do an outer join. Array1 = {'key_1': 10, 'key_2': 14,..'key_m': 321} Array2 = {'key_1': 15, 'k...
Dynamically loading instance method during object instantiation Question: I want to be able to dynamically load instance methods during object instantiation. According to my design, the default behaviour is coded in the base class. However, if certain conditions are met during object instatination, I dynamically change...
alternative to oauth2 (Python module) on GAE? Question: From my app running on GAE, I want to be able to post tweets periodically. I've a code with which I am able to post tweets from localhost. import urllib import urllib2 import simplejson as json import oauth2 as oauth consumer_...
Change the column data delimiter on mysqldump output Question: I'm looking to change to formatting of the output produced by the mysqldump command in the following way: (data_val1,data_val2,data_val3,...) to (data_val1|data_val2|data_val3|...) The change here being a different ...
Is using Python modules main function for validation testing a bad idea? Question: I'll quickly explain exactly what I mean by this. I'm working on a project using python, where I have multiple modules doing segments of work. Let's say for example I have a module called `Parser.py` and this module has a function `pars...
CPU usage increasing over time Question: I have a python program that is running for many days. Memory usage does not increase by very much, however the program becomes slower and slower. Is there a tool or utility that will list all function calls and how long they take to complete? Something like [guppy/heapy](http:/...
Open and read sequential XML files with unknown files names in Python Question: I wish to read incoming XML files that have no specific name (e.g. date/time naming) to extract values and perform particular tasks. I can step through the files but am having trouble opening them and reading them. What I have that works i...
Space padded binary string in Python Question: I need to convert this PHP function into Python but I don't even know, what is space padded binary string. pack('A*', $string); Python has struct.pack what should be probably used but I end here. Can somebody help and explain me the behaviour? Thanks!...
Parsing a website with a javascript call using Python Question: Since I counldn't find an API function in common wikimedia to get alicense of an image, the only thing left to do it to fetch the webpage and parse it myself. For each image, there is a nice popup in wikimedia that lists the "Attribution" field which I ne...
Python error when retrieving a url from a database and opening it with webbrowser() Question: I am trying to make an app similar to StumbleUpon using Python as a back end for a personal project . From the database I retrieve a website name and then I open that website with webbrowser.open("http://www.website.com"). Sou...
XML parsing python Question: <dict> <key>1208</key> <dict> <key>Track ID</key><integer>1208</integer> <key>Name</key><string>Kings And Queens</string> <key>Artist</key><string>30 Seconds To Mars</string> <key>Album Artist</key><string>...
How to deal with Linux/Python dependencies? Question: Due to lack of support for some libraries I want to use, I moved some Python development from Windows to Linux development. I've spent most of the day messing about getting nowhere with dependencies. **The question** Whenever I pick up Linux, I usually run into so...
Scaling Problem with Pygame Question: When I attempt to scale an object, only the top and left of the image get bigger. The rest stays the same. I want an even scale. import pygame._view import pygame, sys from pygame.locals import * import random pygame.init() barrel = ...
NameError: name 're' is not defined Question: I am very new to python. Very new. I copied the following from a tutorial #!/usr/bin/python import re from urllib import urlopen from BeautifulSoup import BeautifulSoup webpage = urlopen('http://feeds.huffingtonpost.com/huffingtonpost/Lat...
Converting timezone-aware date string to UTC and back in Python Question: I'm parsing the National Weather Service alerts feed into a web application. I'd like to purge the alerts when they hit their expiration time. I'd also like to display the expiration time in the local time format for the geographic area they pert...
Python: Question about multiprocessing / multithreading and shared resources Question: Here's the simplest multi threading example I found so far: import multiprocessing import subprocess def calculate(value): return value * 10 if __name__ == '__main__': pool = multi...
python libraries in a computer cluster Question: I'm having a problem for python to find the installed libraries when I run it in a computer cluster. When I try, e.g., to load numpy in the script: #file: /home/foo/test.py import numpy print numpy.__version__ on the server, I get this: ...
Python script to find word frequencies of a given document Question: I am looking for a simple script that can find frequencies of words for a given document (probably by using portable stemmer). Is there any library or simple script that does this process? Answer: use [nltk](http://www.nltk.org/) imp...
Sending messages or datas with bluetooth via python Question: How can i send messages over bluetooth via python without key authentification like type numbers ? i used pybluez but i got this error: File "./send", line 12, in <module> connect() File "./send", line 8, in connect sock.c...
Python pty module usage example Question: What I need to do is the following: in a Python script spawn, say the "ls --colors=always /" Linux command, and read its output. The important part of this is that I need the output to keep all the ANSI escape sequences (colors and such) to later translate these sequences into ...
Executing python code Question: I am starting fresh with python and trying to execute a code from the python command window. I wrote a file on Desktop\practice\new.py and lunched the python command window. when I type C:\users\user\Desktop\practice\new.py it gives me SyntaxError: in...
Embarassingly Parallel DB Update Using Python (PostGIS/PostgreSQL) Question: I need to update every record in a spatial database in which I have a data set of points that overlay data set of polygons. For each point feature I want to assign a key to relate it to the polygon feature that it lies within. So if my point '...
Making multidimensional lists in python Question: This question maybe asked earlier (atleast topic wise) , but still I couldn't find a solution for my specific problem. Basically, I need a multidimensional array in python. Such that: I will be able to access contents in list by : contenets[no_of_record]...
Can't activate django admin screen Question: Error page shows the following: Traceback (most recent call last): File "/Library/Python/2.6/site-packages/django/core/servers/basehttp.py", line 283, in run self.result = application(self.environ, self.start_response) File "/Library/Python/2.6/site-packages/django/core/ha...
Python DST & Time Zone Detection After Addition Question: So I currently have a line of code which looks like this: t1 = datetime(self.year, self.month, self.day, self.hour, self.minute, self.second) ... t2 = timedelta(days=dayNum, hours=time2.hour, minutes=time2.minute, s...
'str' object has no attribute '__dict__' Question: I want to serialize a dictionary to JSON in Python. I have this 'str' object has no attribute '**dict** ' error. Here is my code... from django.utils import simplejson class Person(object): a = "" person1 = Person() person1....
MongoDB not that faster than MySQL? Question: I discovered mongodb some months ago,and after reading this [post](http://www.vedana.it/it/component/content/article/9-linux/62-testing- mongodb-vs-mysql-with-python-scripting-under-linux), I thought mongodb was really faster than mysql, so I decided to build my own bench, ...
Bitnami Djangostack + Eclipse IDE? Question: I'm trying to setup the Eclipse (with pyDev) to work with Bitnami Djangostack in Mac OS X. I have installed the Djangostack and it works all right. Problem is that I can't get the Eclipse to understand Djangostack. I've added the Djangostack python interpreter to the PyDev-...
Handling ascii char in python string Question: i have file having name `"SSE-Künden, SSE-Händler.pdf"` which having those two `unicode char ( ü,ä)` when i am printing this file name on python interpreter the unicode values are getting converted into respective ascii value i guess `'SSE-K\x81nden, SSE-H\x84ndler.pdf'` b...
How can I get Django application name for a file inside that application? Question: Having full path for the file that is a part of django application I would like to get a Django application name. For example for this path: /lib/python2.6/site-packages/django/contrib/auth/tests/auth_backends.py A...
Run Time Error (exit status 1) when submitting puzzle in Python Question: I have python 2.7 installed on my windows computer. I'm trying to email a puzzle answer to Spotify, which is running Python 2.6.6. When I submit my *.py source code, I'm getting the following error: Run Time Error Exited, exit status: 1 I only...
Pyglet: equivalent of pygame.Rect Question: I am contemplating migrating from pygame to pyglet (main reason: move from Python to Pypy). However, I found no rectangle collision tools in the pyglet doc, while I use pygame.Rect quite often. Do you know how pyglet deals with rectangle collision (maybe with OpenGl funcs, b...
Python 2.5 time.time() as decimal Question: Is it possible to receive the output of time.time() in Python 2.5 as a Decimal? If not (and it has to be a float), then is it possible to guarantee that inaccuracy will always be more than (rather than less than) the original value. In other words: >>> repr(0....
syntax error with KeyError in python 3.2 Question: I'm a beginner using python 3.2 and i have a book whos code is all in python 2.6. i wrote part of a program and keep getting: Syntax Error: invalid syntax Then python's IDLE highlights the comma after KeyError in my code: from tank import Tank t...
Converting a parent child relationship into Json in python Question: I have a list of list like the below. The first column is the parent, second is the child, and the third are node attributes. I need to convert the below to a JSON format like the following. 0 0 "flair" 1000 0 1 "analytics" 1000 ...
random string in python Question: I am trying to make a script that will generate a random string of text when i run it. I have got far but im having a problem with formatting. Here is the code im using import random alphabet = 'abcdefghijklmnopqrstuvwxyz' min = 5 max = 15 ...
error in matplotlib library in python while using csv2rec Question: I am working in Ipython, trying to load a csv file. from matplotlib import * data=matplotlib.mlab.csv2rec('helix.csv',delimiter='\t') Here is the error message IOError Traceback ...
Python style: should I avoid commenting my import statements? Question: I'll try to make this as closed-ended of a question as possible: I often find that I have a group of imports that go together, like a bunch of mathy imports; but later on I might delete or move the section of code which uses those imported items t...
Why is __init__.py not being called? Question: I'm using Python 2.7 and have the following files: ./__init__.py ./aoeu.py `__init__.py` has the following contents: aoeu aoeuaoeu aoeuaoeuaoeu so I would expect running aoeu.py to error when Python tries to load `__init__.py`,...
Last element in xml not getting picked up Question: I have a python 3 script below that is supposed to download an xml file and split it into smaller files with only 500 items each. I am having two problems: 1. the last item in the original xml is not present in the split files 2. if the original xml was 1000 item...
Retrieve a cookie set in Python serverside Question: G'day, I'm following a guide found here: <http://www.doughellmann.com/PyMOTW/Cookie/> which has the code: c = Cookie.SimpleCookie() c.load(HTTP_COOKIE) to retrieve a cookie previously set (by the server), but my server does not have the HTT...
Django recursive imports Question: I have two apps: pt and tasks. pt.models has a Member model. tasks.models has a Filters model. Member model has a foreign key to Filters model (one for a member). Filters has M2M field to Member as it holds some kind of filtering settings. So, I must recursively import both models ...
Python 3 concurrent.futures socket server works with ThreadPoolExecutor but not ProcessPoolExecutor Question: I am trying to create a simple socket server using the new concurrent.futures classes. I can get it to work fine with ThreadPoolExecutor but it just hangs when I use ProcessPoolExecutor and I can't understand w...
Exception handling in Python Tornado Question: I am trying to handle exception occurred in `AsyncClient.fetch` in this way: from tornado.httpclient import AsyncHTTPClient from tornado.httpclient import HTTPRequest from tornado.stack_context import ExceptionStackContext from tornado import iol...
Python binding to ImageMagick Question: I am looking for a good Python binding to [ImageMagick](http://www.imagemagick.org/), but there seem a lot of bindings already. I am not sure that which of these is the right tool for my job. Can you guys recommend me one? Here is the list of my requirements and preferences (in ...
celery get tasks count Question: I am using python celery+rabbitmq. I can't find a way to get task count in some queue. Some thing like this: celery.queue('myqueue').count() Is it posible to get tasks count from certaint queue? One solution is to run external command from my python scrpit: ...
problem with deserialization xml to objects - unwanted split by special chars Question: I try to deserialize xml to objects, and i met a problem with encoding of various items in xml tree. **XML example:** <?xml version="1.0" encoding="utf-8"?> <results> <FlightTravel> <QuantityOfPasse...
ImportError: No module named paramiko Question: I have installed "python-paramiko" and "python-pycrypto" in Red hat linux. But still when i run the sample program i get "ImportError: No module named paramiko". I checked the installed packages using below command and got confirmed. ncmdvstk:~/pdem $ rpm ...
Module import Error Python Question: I just installed **lxml** for parsing xml file in python. I am using **TextMate** as an IDE. Problem is that when I try to import lxml `(from lxml import entree)` then I get **ImportError** :'No module named lxml' But when I use **Terminal** then everything is fine ...
iotop script does not work via custom script execution Question: I have CSF installed (configure safe firewall), it has a function to allow you to have custom scripts executed on load average events. My script: ##!/usr/bin/env bash iotop -bto --iter=1 2>&1 | mail -s "$HOSTNAME iotop output" incident...
Decrypt in Python an encrypted message in Java Question: I'm trying to decrypt in Python (with M2Crypto) an encrypted message generated in Java with this [library](http://www.androidsnippets.com/encryptdecrypt- strings) My code (which I actually found here) works decrypting messages encrypted by itself, but not from J...
reading content from a cmd window via python Question: I'm trying to connect to an existing cmd window and read its content. It is an arbitrary cmd window and not a child process. Any ideas how this can be done with python? Thanks in advance, Omer. Answer: ** **Note: the[original version of the question](http://st...
Does Python have C#/Java-style interfaces? Question: I worked for a few months as a C# programmer, and got used to the idea of ~~generics/templates~~ interfaces, which I could pass to a library without caring how the object was created. I'm about to start on a relatively large project, probably in python (I've written...
Python datetime randomly breaking Question: This isn't the first time this has happened to me so now I'm looking for an answer because I'm completely stumped. I have code running in a production environment for over 3 months now and it worked absolutely fine, then out of no where I started to get errors in python. ...
Updating a tk ProgressBar from a multiprocess.proccess in python3 Question: I have successfully created a threading example of a thread which can update a Progressbar as it goes. However doing the same thing with multiprocessing has so far eluded me. I'm beginning to wonder if it is possible to use tkinter in this way....
Python expand OSX path with spaces in it Question: I'm trying to modify the plist file at: `/Volumes/MacintoshHD/Users/christian/Library/Application Support/iPhone Simulator/4.3.2/Library/Preferences/com.apple.Accessibility.plist` Here's my noob python script: import plistlib import os.path ...
python subprocess dd and stdout Question: I am using subprocess to create a random file from /dev/random using unix dd. Now, if i want the data output of dd to be written to a file instead of stdout. so here's the code am using, import subprocess out_fd = open('test_file','w') def os_system_dd():...
Converting Numpy Array to OpenCV Array Question: I'm trying to convert a 2D Numpy array, representing a black-and-white image, into a 3-channel OpenCV array (i.e. an RGB image). Based on [code samples](https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/python2/find_obj.py) and [the docs](http://opencv.willo...
os.walk multiple directories at once Question: > **Possible Duplicate:** > [How to join two generators in > Python?](http://stackoverflow.com/questions/3211041/how-to-join-two- > generators-in-python) Is there a way in python to use os.walk to traverse multiple directories at once? my_paths = [] ...
Python non-ascii characters Question: I have a python file that creates and populates a table in ms sql. The only sticking point is that the code breaks if there are any non-ascii characters or single apostrophes (and there are quite a few of each). Although I can run the replace function to rid the strings of apostrop...
Configuring and installing python2.6.7 and mod_wsgi3.3 on RHEL for production Question: This is a long question detailing all that I did from the start. Hope it helps. I am working on a django application and need to deploy it on to the production server. The production server is a virtual server managed by IT, and I d...
Mental block with os.walk - want to process a file not the filename string Question: Trying to implement a little script to move the older log files out of apache (actually using a simple bash script to do this in 'real life' - this is just an exercise to practice using Python). I'm getting the filename as a string as ...
Generating second graph in different window - VPython Question: If I have a graph like this in VPython: graphX = gcurve(color = color.cyan), how can I make another graph (graphY = gcurve(color = color.red)) in a different window (different set of axes)? Answer: use gdisplay() to create graph window: fr...
Python - SqlAlchemy: Filter query by great circle distance? Question: I am using Python and Sqlalchemy to store latitude and longitude values in a Sqlite database. I have created a [hybrid method](http://www.sqlalchemy.org/docs/orm/extensions/hybrid.html) for my Location object, @hybrid_method def gr...
Python equivalent to Bash $() Question: I search the Python equivalent for the following Bash code: VAR=$(echo $VAR) Pseudo Python code could be: var = print var Can you help? :-) Regards Edit: I search a way to do this: for dhIP in open('dh-ips.txt', 'r'): ...
What is the correct import statement to use for a Select object in webdriver 2.4 under python? Question: I am writing tests with selenium webdriver 2.4 on python 2.7. The documentation (http://seleniumhq.org/docs/03_webdriver.html) demonstrates the ability to manipulate select form elements as follows: ...
Search and Replace Strings in a Text File Using Wildcards Question: Trying to do a search/replace in python using wildcards on the contents of a text file: If the contents of the text file looks like: "all_bcar_v0038.ma"; "all_bcar_v0002.ma"; "all_bcar_v0011.ma"; "all_bcar_v0011.ma"; L...
improving my python script Question: I have an interesting python script (not sure if it has been done before) It uses import os os.system("say %s" % say) #and I have added; os.system("say -v whisper %s" % say) but now there are new voices in lion and i want to know how to get those v...
How to set up multiple django versions on single apache service? Question: I'm using Windows XP and want to know how can I create multiple django versions on a single apache service through virtual host(of course). I'm trying to do that with one instance of python too. Should i create 1 instance of python for each dja...
ElementTree's iter() equivalent in Python2.6 Question: I have this code with ElementTree that works well with Python 2.7. I needed to get all the nodes with the name "A" under "X/Y" node. from xml.etree.ElementTree import ElementTree verboseNode = topNode.find("X/Y") nodes = list(verboseNode...
403 Forbidden Error for Python-Suds contacting Sharepoint Question: I'm using Python's SUDs lib to access Sharepoint web services. I followed the standard doc from Suds's website. For the past 2 days, no matter which service I access, the remote service always returns 403 Forbidden. I'm using Suds 0.4 so it has built-...
How should I resolve my appspot backup failure? Question: I'm trying to make a backup but it won't: 2011-10-01 09:22:43.706 /remote_api 302 5ms 0cpu_ms 0kb 213.89.134.0 - - [01/Oct/2011:05:22:43 -0700] "GET /remote_api HTTP/1.1" 302 0 - - "montaoproject.appspot.com" ms=6 cpu_ms=0 api_cpu_ms=0 cp...
get formated output from mysql via python Question: Hi I want the following output from my query: OK|Abortedclients=119063 Aborted_connects=67591 Binlog_cache_disk_use=0 But I dont know how to generate it. this is my script: #!/usr/bin/env python import MySQLdb conn = My...
Can Basemap draw a detailed coastline at the city level? Question: I'm trying to draw a detailed coastline of the NYC area using Basemap in Python. Using the full resolution dataset, Manhattan looks like rectangle, and the Hudson doesn't show up at all about midtown. Here's the code I'm using. Any suggestions? ...
Can't install module with python-pip properly Question: I would like to install a module but `pip` is not installing it in the right directory which I assume should be `/usr/local/lib/python2.7/site-packages/`. After all, I just installed Python 2.7.2 today. Originally I had 2.6.5 and had installed modules successfully...
How can I use boto to stream a file out of Amazon S3 to Rackspace Cloudfiles? Question: I'm copying a file from S3 to Cloudfiles, and I would like to avoid writing the file to disk. The Python-Cloudfiles library has an object.stream() call that looks to be what I need, but I can't find an equivalent call in boto. I'm h...
wxPython and windows 7 taskbar Question: For brevity's sake: I'm trying to implement [this](http://stackoverflow.com/questions/1736394/using-windows-7-taskbar- features-in-pyqt/1744503#1744503) with wxPython, but I'm struggling to fit that code into a script based on wxPython. My simple PyQt test code works fine. Here...
Binary string in Python issues Question: For some reason I'm having a heck of a time figuring out how to do this in Python. I am trying to represent a binary string in a string variable, and all I want it to have is 0010111010 However, no matter how I try to format it as a string, Python always cho...
Python observable implementation that supports multi-channel subscribers Question: In a twisted application I have a series of resource controller/manager classes that interact via the Observable pattern. Generally most observers will subscribe to a specific channel (ex. "foo.bar.entity2") but there are a few cases whe...
Is this an appropriate use of python's built-in hash function? Question: I need to compare large chunks of data for equality, and I need to compare many per second, _fast_. Every object is guaranteed to be the same size, and it is possible/likely they may only be slightly different (in unknown positions). I have seen,...
Python MySQLdb freeze on connect attempt Question: I'm trying to use MySQLdb in Python to connect to the database I have established on a Pagoda Box application. First, I open the Pagoda tunnel to the database with: $ pagoda tunnel -a <app-name> and it returns that the tunnel has been successfully ...