text
stringlengths
226
34.5k
Is it possible to coerce 0x11 to 0x00, keeping 0x01 -> 0x01 and 0x -> 10 using only bitwise operations? Question: Is it possible to implement a function that results in this mapping: { (0x01, 0x01), (0x10, 0x10), (0x11, 0x00) } Using only bitwise operations? ## Context In th...
Performance issues with Django Question: I'm trying to track down some performance issues I have had with Django. There seems to be a 600-800 ms delay from the time I click refresh to the time the browser gets a response. I set up a simple view and the profile middleware and this is the view and results: the view fun...
Code still runs using old version of Python Question: I have installed python 2.7 on my CentOS server. When I go into the python command line it tells me I'm using 2.7. When I issue a python -v command it reports 2.7. But when I run the script I'm working on and get it to output the version (using import sys print(sys....
Update list of dictionaries elementwise in Python Question: Say we have a list of dictionaries in Python: A = [{'x': 1, 'y': 2, 'z': 3},{'x': 0, 'y': 10, 'z': 11}] We pick out the 'x'-values using `map()` x = map((lambda i: i['x']), A) and do something with them. Now, what is t...
Stripping chars in python Question: I know this is not very pretty code and that I'm sure there is an easier way but I'm more concerned on why python is not stripping the characters I requested it to. import urllib, sgmllib zip_code = raw_input('Give me a zip code> ') url = 'http://www....
Configuring Script Handlers Google App Engine Question: I am trying to make a simple application using Google App Engine. Below is my code `helloworld.py` print "hello" class helloworld(): def myfunc(self): st = "inside class" return st ...
How to plot cdf in matplotlib in Python? Question: I have a disordered list named `d` that looks like: [0.0000, 123.9877,0.0000,9870.9876, ...] I just simply want to plot a cdf graph based on this list by using Matplotlib in Python. But don't know if there's any function I can use d ...
Why is splitting a string slower in C++ than Python? Question: I'm trying to convert some code from Python to C++ in an effort to gain a little bit of speed and sharpen my rusty C++ skills. Yesterday I was shocked when a naive implementation of reading lines from stdin was much faster in Python than C++ (see [this](htt...
Compare RPM Packages using Python Question: I'm trying to compare a csv file containing required Linux packages with the current installed packages. The comparison should output any packages not installed or newer than the current installed packages. The problem is that I'm unable to loop through the list of installed...
Python OptionMenus keep disappearing and reappearing - how can I make them "stay"? Question: I have a simple school assignment to do - a converter between F, C and K. I'm having problems with OptionMenus, because they keep disappearing and reappearing when I move over with the mouse. For example if I choose from Option...
How can I find circular relations in a graph with Python and Networkx? Question: Consider I have the following graph: A -> B B -> C C -> D C -> A What is the easiest way to find that A -> B -> C -> A is a circular relation? Is there such a function already built into NetworkX or another...
Python thread restart Question: I have a thread when it is run it has an infinite loop. When another thread is stopped, I wish to reset all the threads again, There threads have sockets that transfer data between each other. I am using node1._Thread__stop() function to stop the thread runing, but w...
writing text area in python, implementing sockets Question: I am doing a simulation of a print server in python, files are sent using sockets to a server which has to be placed in a printer queue. When the client initiates communication with the server must provide an ID (user) and PASSWORD, which will be checked again...
Python: How do I parse HTML of a webpage that requires being logged in? Question: I'm trying to parse the HTML of a webpage that requires being logged in. I can get the HTML of a webpage using this script: from urllib2 import urlopen from BeautifulSoup import BeautifulSoup import re webp...
losing locale when running fcgi script Question: I'm facing an issue with encoding in running a django app. I finally found out my django app has no locale set. The weird thing is that I did set up the envvars file correctly. With this in envvars : export APACHE_RUN_USER=www-data export APACHE_RUN_G...
Suds generates empty elements; how to remove them? Question: [Major Edit based on experience since 1st post two days ago.] I am building a Python SOAP/XML script using Suds, but am struggling to get the code to generate SOAP/XML that is acceptable to the server. I had thought that the issue was that Suds was not gener...
Python code not executing Question: I have the following code which is executed from the command line: import cgi,time,os,json,sys,zipfile,urllib2 from os import curdir, sep from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from time import strftime from poster.encode import m...
How can I use a pre-made color map for my heat map in matplotlib? Question: I want to use a color map from <http://goo.gl/5P4CT> for my matplotlib heat map. I tried doing this: myHeatMap.imshow(heatMap, extent=ext, cmap=get_cmap(cm.datad["Spectral"])) However, the Python interpreter complains ...
Python: eval() that coerces values to floating point? Question: Is there a way to execute an `eval`-like function that coerces its values to floating point? I am hoping to eval('1/3') and have it return the floating point value .333333 rather than the integer value 0. Answer: Grab the compiler fl...
Redirect stdout to logger in Python Question: Can I redirect all output from `stdout` to a logger I have set up with the standard `logging` module? (I have os.system calls whose output I'd also like to see or occational print statements) Answer: You might be able to make use of the suggestion in [this post](http://pl...
Image Interpolation in python Question: I am trying to use interpolation to remove chromatic aberration from an image. The code I have generates the following error: TypeError: unhashable type: 'numpy.ndarray'. Below is my code - any help would be greatly appreciated. Thank you- Areej This is an input explanation ...
Python parser for Python-like language Question: I'm looking to write a Python import filter or preprocessor for source files that are essentially Python with extra language elements. The goal is to read the source file, parse it to an abstract syntax tree, apply some transforms in order to implement the new parts of t...
Python C Extension in package - not working? Question: I'm working on packaging my python C extension and I'm running into trouble here: . |-- c_ext/ | |-- __init__.py |-- c_src/ setup.py With this setup.py from distutils.core import setup, Extension setup(...
Django - Error importing storages.backends Question: I have created a custom storage backend, the file is called `storages.py` and is placed in an app called `core`: from django.conf import settings from storages.backends.s3boto import S3BotoStorage class S3StaticBucket(S3BotoStorage): ...
setuptools/easy_install does not install *.cfg files and locale directories? Question: I have a little problem with setuptools/easy_install; maybe someone could give me a hint what might be the cause of the problem: To easily distribute one of my python webapps to servers I use setuptools' `sdist` command to build a t...
Python matplotlib -> 3D bar plot -> adjusting tick label position, transparent bars Question: I am trying to create a 3D bar histogram in Python using bar3d() in Matplotlib. I have got to the point where I can display my histogram on the screen after passing it some data, but I am stuck on the following: 1. Display...
grouper with a chunk size sequence in python? Question: I have a generator that I want to iterate through at two levels. The first level is unevenly spaced, then I want to chunk the next level into groups of 5, say. I need it to be memory efficient and work on generator inputs, so I'm doing something like the following...
Can't convert .py files into .exe files Question: I want to turn python files into .exe files but I can't. I have installed py2exe when I run the program setup.py on the windows command prompt with that command line python setup.py py2exe I get the following error message: no module ...
creating python keyed arrays Question: im calling them keyed arrays because if i knew what they were called i could find the answer myself =-) ok, for example: parser = OptionParser(conflict_handler="resolve") parser.add_option("-x", dest="var_x", help="") parser.add_option("-y", dest="var_y", ...
can not read correctly from STDIN Question: I have a weird problem to read from STDIN in a python script. Here is my use case. I have rsyslog configured with an output module so rsyslog can pipe log messages to my Python script. My Python script is really trivial : #! /usr/bin/env python # -*- codi...
python string in-place modification Question: folks, Suppose I want to change 'abc' to 'bac' in Python. What would be the best way to do it? I am thinking of the following tmp = list('abc') tmp[0],tmp[1] = tmp[1],tmp[0] result = ''.join(tmp) Answer: You are never editing a string "in pla...
Are there any python libraries to help test external python scripts Question: I'd like to test some python scripts. Are there any python libraries to help test external system behaviors(running scripts, testing the contents of external files, managing input/output files, and similar actions). Also I tried making the ...
how to execute nested python files Question: I have 3 python files.(first.py, second.py, third.py) I'm executing 2nd python file from the 1st python file. 2nd python file uses the 'import' statement to make use of 3rd python file. This is what I'm doing. This is my code. first.py import os file_path...
Why won't Python regex work on a formatted string of HTML? Question: from bs4 import BeautifulSoup import urllib import re soup = urllib.urlopen("http://atlanta.craigslist.org/cto/") soup = BeautifulSoup(soup) souped = soup.p print souped m = re.search("\\$.",souped) print m.gr...
Creating a Three Dimensional Matrix structure and writing in mat file in Python Question: I am very new to Python. I need to have a 3 dimensional matrix, in order to save 8 by 8 matrix in some length. Let's call 530. The problem is that I used np.array since matrix cannot have more than 2 dimensions as numpy argues. ...
sqlalchemy tutorial example not working Question: I'm trying to work my way through the example given in the [sqlalchemy tutorial](http://docs.sqlalchemy.org/en/latest/orm/tutorial.html) but I'm getting errors. As far as I can tell I'm following the example to the letter. Here's the code that I have from it so far. It ...
Importing Library into iTunes through Windows SDK (Python) Question: I am using the Windows COM SDK for python in order to manipulate iTunes. I would like to know if there is a way to import a new library in iTunes. The user is able to do that ("MenuBar>File>Library>Import list..."), but is it possible with the SDK? ...
distance formula in python bug Question: I'm calculating the length of a line segment in python, but I don't understand why one piece of code gives me zero and the other gives the right answer. This piece of code gives me zero: def distance(a, b): y = b[1]-a[1] x = b[0]-a[0] ans=...
Error when making random errors in Python Question: > > import random > import time > loop = [1,2,3,4,5,6,7,8,9,10] > queenstrength = 100 > queendamagenum = 1,20 > print "The queens health is currently: ",queenstrength > > while queenstrength > 0: > queendamage = random.randint((qu...
Python: How to allow duplicates in a set? Question: I ran into a problem regarding set in Python 2.7. Here's the appropriate example code block: letters = set(str(raw_input("Type letters: "))) As you can see, the point is to write some letters to assign to "letters" for later use. But if I type "a...
Parsing XPath within non standard XML using lxml Python Question: I’m trying to create a database of all patent information from Google Patents. Much of my work so far has been using this very good answer from MattH in [Python to parse non-standard XML file](http://stackoverflow.com/a/7336718). My Python is too large t...
Polymorphism with callables in Python Question: I have an interface class called iResource, and a number of subclasses, each of which implement the "request" method. The request functions use socket I/O to other machines, so it makes sense to run them asynchronously, so those other machines can work in parallel. The p...
Python - Is it worthwhile to invest time in apparently stagnant modules? Question: To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast. Ho...
Using random.randint help in python Question: The following code is my attempt at simulating a lottery. import random def lottery(numbers): lottoNumbers = [randint('0,100') for count in range(3)] if numbers == lottoNumbers: print('YOU WIN $10,000') else: ...
Cannot grok python multiprocessing Question: I need to run a function for the each of the elements of my database. When I try the following: from multiprocessing import Pool from pymongo import Connection def foo(): ... connection1 = Connection('127.0.0.1', 27017) db1 ...
Reducing duplicates in Python list of lists Question: I am writing a program that reads in a number of files and then indexes the terms in them. I am able to read in the files into a 2d array (list) in python, but then I need to remove the duplicates in the first column and store the index in a new column with the firs...
Capturing print output from shared library called from python with ctypes module Question: I am working with a shared library that is being called through the ctypes module. I would like to redirect the stdout associated with this module to a variable or a file that I can access in my program. However ctypes uses a sep...
Histogram in Pylab when mu is large Question: I ran into this problem; it feels like a bug, but it is probably me missing something, since I am completely new to pylab. When I use the following code: import pylab import random as rn mu = 10 sigma = 5 z = [] for i in xra...
"SVN Repositories" always comes up blank when you switch workspaces Is there a plugin to get Eclipse to remember them? Question: For example, say you have a project checked out from SVN Repository in one workspace, but it contains several projects (either related or not). You switch to a new workspace and do Window |P...
How to implement associative array (not dictionary) in Python? Question: I trying to print out a dictionary in Python: Dictionary = {"Forename":"Paul","Surname":"Dinh"} for Key,Value in Dictionary.iteritems(): print Key,"=",Value Although the item "Forename" is listed first, but dictionar...
Python datetime subtracting date oddity Question: I have a datetime object created from which I subtract 13 days as follow: (date.today()-timedelta(days=13)).strftime('%Y-%m-%d') The strangeness occurs when I execute the code at 6AM and 8:30AM. At 6AM, the resulting string is returned as (if today ...
How would I sum a multi-dimensional array in the most succinct python? Question: The closest was this one [summing columns](http://stackoverflow.com/questions/3223043/how-do-i-sum-the-columns- in-2d-list). So I'll do something similar in my question: Say I've a Python 2D list as below: my_list = [ [1,...
making exe file from python that uses command line arguments Question: I want to create an exe from a python script that uses command line arguments (argv) From what I've seen py2exe doesn't support command-line-arguments What can I do? EDIT: I was using a GUI2Exe tool, so I just missed the Console flag, but the ac...
Why simple wxPython application looks broken on the start? Question: I'm trying to create my first simple but real application based on wxPython. And I'm facing many strange things which are not discribed in the basic tutorial on the wxPython home site. Here Here is first one. I made an layout of some control on the f...
Python in Filemaker Pro Question: I was hoping to calculate fields using some rather complicated functions, which I don't think I can realistically write in filemaker. I would prefer to write a script to extract data into python, perform some procedures and then import it back into filemaker (so a user can see the res...
How to iterate/parse Tweepy get_user object Question: In playing around with Tweepy I notice that the 'status' variable returned from a call to get_user is `<tweepy.models.Status object at 0x02AAE050>` Sure, I can call get_user.USER.status, but how can I grab that information from the get_user call? i.e. I want to loo...
Mysql and Python on Mac Question: I installed Mysqldb for python but when I run it, I get this error: /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2...
Export blob properties from Datastore as binary files Question: I store pictures as Blob properties in Datastore, I am not using Blobstore, just Blob properties. Now I want to migrate my app to a different platform and I'd like to get the pictures out as JPEG files. Is there a way of doing this with the bulkloader too...
Wrapping C++ Library in Python, handling custom types Question: i'm currently writing a NLP application in python which requires a fast POS tagging implementation. the tagger has a c++ wrapper interface: #include "POSTagger.h" extern "C" POSTagger* initTagger(const char* fileName, bool Normalize...
beginner: python namespace collision? Question: Disclaimer: i am new to python but have drupal programming experience I am reading the Definitive Guide to Django (http://www.djangobook.com/en/1.0/chapter07/). After issuing python manage.py startapp books python creates the books package with views...
Python: ElementTree, get the namespace string of an Element Question: This XML file is named `example.xml`: <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven...
Using numpy loadtext Question: I have a text file containing 10 columns of numbers. What I would like to be able to do is to create a dictionary in which the first three numbers (of the 10 per line) of each row of the data can be used as a key to access two further numbers in columns 6 and 7 (in the same line). I have ...
Swig with cmake and additional libraries Question: I am working on a project where I want to use a C++ library in Python. After a little bit of research I figured out that Swig would be a good way to do it (a small example worked). So now I am trying to include Swig into cmake to make things more comfortable. In my c...
SqlAlchemy: array of Postgresql custom types Question: So in my postgres DB I have the following custom type: create type my_pg_type as ( sting_id varchar(32), time_diff interval, multiplier integer ); To further complicate things, this is being used as an array: ...
Adding attributes to instance methods in Python Question: I would like to add an attribute to an instance method in one of my classes. I tried the answer given in [this question](http://stackoverflow.com/questions/279561/what-is-the-python- equivalent-of-static-variables-inside-a-function), but this answer only works f...
Backend technology for front-end technologies like Twitter Bootstrap Question: This a noob alike question, but here we go. I´ve read about Twitter Bootstrap (among other presentation frameworks), which gives the designer/programmer the tools to build easily the front end of a webapp. What I don´t know is how to integra...
SQLAlchemy raises None, causes TypeError Question: I'm using the declarative extension in SQLAlchemy, and I noticed a strange error when I attempted to save an instance of a mapped class with incorrect data (specifically a column declared with nullable=False with a value of None). The class (simplified): ...
Parsing hostname and port from string or url Question: I can be given a string in any of these formats: * url: e.g <http://www.acme.com:456> * string: e.g www.acme.com:456, www.acme.com 456, or www.acme.com I would like to extract the host and if present a port. If the port value is not present I would like it ...
Can Python's argparse permute argument order like gnu getopt? Question: GNU getopt, and command line tools that use it, allow options and arguments to be interleaved, known as permuting options (see <http://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html#Using- Getopt>). Perl's Getopt::Long module also sup...
How can I iterate image processing through a directory of image files in a sub folder within Python? Question: Needing help specifically with how to connect an iterated list (declared as fileListL) which is dynamically built from a sequence of image files within a sub directory (left) and loops through until it reaches...
Python re.findall regex problems Question: I'm trying to find some very specific data in a string. The problem is I'm not finding all of the data with the current regex I'm using. Here is some sample data: [img:2gcfa9cc]http&#58;//img823&#46;imageshack&#46;us/img823/3295/pokaijumonlogo&#46;jpg[/img:2gcfa...
What is the optimal way to organize infinitely looped work queue? Question: I have about 1000-10000 jobs which I need to run on a constant basis each minute or so. Sometimes new job comes in or other needs to be cancelled but it's rare event. Jobs are tagged and must be disturbed among workers each of them processes on...
Error with multiple panels in one frame WXPYTHON Question: I have 3 panels in 1 frame the function onSwitchPanels take me from panel to panel,know i want to make a check and if this check is ok then i want to SwitchPanels there is the problem, i stack what i am doing wrong (sorry for my english) Can anyone helpme plea...
Import csv files containing data with commas into MySQL Question: I have more than 10GB .csv files. I m trying to import the data from these files into MySQL using python. Since csv files are comma separated files, and I have data which itself contains commas, therefore I can not use ',' here for splitting. There pleas...
How do I use the Python Scrapy module to list all the URLs from my website? Question: I want to use the Python [Scrapy module](http://scrapy.org/) to scrape all the URLs from my website and write the list to a file. I looked in the examples but didn't see any simple example to do this. Answer: Here's the python progr...
Change color in SQlite based application Question: let me explain this clearly: i'm decide to learn about how to store my data with SQLite, and i decide to download sample code and examine it. So, i have a .csv file with data, when my program launch, first thing user see is rows of elements. (Its like when you enter "...
@classmethod with Abstract Base Class Question: I have an Abstract Base Class and subclasses defined as follows (Python 2.7): import abc import MyDatabaseModule class _DbObject(object): __metaclass__ = abc.ABCMeta def _GetObjectType(self): raise NotImplemente...
urllib.urlretreive getting images, but images are broken Question: I'm currently teaching myself python (coming from no programming background, but a lot of sys admin, scripting experience) and have gone about creating a script/program that looks at a site and grabs all the images. I've struggled quite a bit but I've g...
Python's Tkinter simpledialog.askstring not working from command prompt Question: > **Possible Duplicate:** > [Script works in IDLE, but .py-file doesn't > work](http://stackoverflow.com/questions/8319022/script-works-in-idle-but- > py-file-doesnt-work) So i wrote a gui in python's tkinter using python 3.2.2's IDLE...
Communicate with Java program from Python Question: My Python progam is "check.py" import os.path,subprocess from subprocess import STDOUT,PIPE def compile_java(java_file): subprocess.check_call(['javac', java_file]) def execute_java(java_file): java_class,ext = os.p...
Do I need to create a separate class in my models.py when using the django.contrib.auth.models import user? Question: The import statement import the needed parts. but is the "user" class already made when you put that into your installed apps? or do you still need to clarify in models.py in order to make the table in ...
How do I write to .csv from text entry? Question: I'm working on my computing project for school, and I'm having trouble getting anything the user inputs to save to a .csv file. I'm using Python 3.2.2 and Tkinter as the GUI. No matter what I enter into the fields I get the wrong output into the csv, similar to ".545407...
Scan through txt, append certain data to an empty list in Python Question: I have a text file that I am reading in python . **I'm trying to extract certain elements from the text file that follow keywords to append them into empty lists** . The file looks like this: ![enter image description here](http://i.stack.imgur...
Where in the world is com.ibm.ws.scripting.adminCommand.AdminTask? Question: Frustrated with the damn awful API provided by WebSphere Admin Server, I'm writing my own Java DSL wrapper. My jython files now simply read: from my.package import MyDSL config = MyDSL(AdminConfig, AdminTask) config.goGo...
Python: Update XML-file using ElementTree while conserving layout as much as possible Question: I have a document which uses an XML namespace for which I want to increase `/group/house/dogs` by one: (the file is called `houses.xml`) <?xml version="1.0"?> <group xmlns="http://dogs.house.local"> ...
Include .pyd module files in py2exe compilation Question: I'm trying to compile a python script. On executing the exe I got:- C:\Python27\dist>visualn.exe Traceback (most recent call last): File "visualn.py", line 19, in <module> File "MMTK\__init__.pyc", line 39, in <module> File "...
How to use "range_key_condition" to query a DynamoDB table with boto? Question: To get range_key between (0,9999), can I do it this way? conn = boto.connect_dynamodb() table = conn.get_table("mytable") ... result = table.query( hash_key = "66", range_key_condition = {"0":...
adding each member of an array again, right after itself Question: if I have this Python array: mac_tags = [ "global_rtgn", "global_mogn" ] And I want this Python array: mac_tags = [ "global_rtgn", "global_rtgn", "global_mogn","global_mogn" ] How might I create it programmatica...
python paths and import order Question: Ok so I really want to get this right because I keep running into it when generating some big py2app/py2exe packages. So I have my package that contains a lot of modules/packages that might also be in the users site packages/default location (if a user has a python distribution) ...
wxPython: MenuBar Bound Events Execute on Init Question: Hello StackOverflow Hive Mind; I am in the process of learning how to use wxPython it make a GUI for an application I am writing. I've been slogging through that well enough until I noticed that I could not properly make a menu bar. Whatever I am doing wrong is ...
lxml error "IOError: Error reading file" when parsing facebook mobile in a python scraper script Question: I use a modified script from [Logging into facebook with python](http://stackoverflow.com/questions/2030652/logging-into-facebook-with- python) post : #!/usr/bin/python2 -u # -*- coding: utf8 -*...
"TypeError: 'str' object is not callable' raised when method is called in an if statement (Python) Question: I get a TypeError when I call a method in an if-block, but the method runs find when it is called outside an if block: randenzyme() randomly chooses a key from a dictionary called enzymes: def ra...
How to parse json in bash or pass curl output to python script Question: I'm looking to find some way to have pretty print of curl's output in json. I wrote short python script for this purpose, but it won't work with pipe Also I don't want to use subprocesses and run curl from them: So python: #!/usr/b...
File not being released Question: Ok so I have to run some queries in access 07 then compact and repair it. I am using python and win32com to do this. The code I'm currently using is this. import os; import win32com.client; DB1 = 'db1.mdb' DB2 = 'db1N.mdb' DB3 = 'db2.mdb' DBR = r'db1....
Access to deleted entity in Appengine NDB Question: I am using NDB in an Appengine project. I am using _post_delete_hook for doing some operations after some entity is deleted. In this method I have the key. But when I do key.get() I get an error. Here is some example code. [friends/models.py] f...
"".join(list) if list contains a nested list in python? Question: I know that `"".join(list)` converts the list to a string, but what if that list contains a nested list? When I try it returns a `TypeError` due to unexpected list type. I'm guessing it's possible with error handling, but so far my attempts have been fru...
CORS Access-Control-Allow-Origin despite correct headers Question: I am trying to set up simple Cross-Origin Resource Sharing using jQuery (1.7.1) powered ajax on the client and apache served python (django) server. According to all the instructions I have read my headers are set correctly, but I keep getting the follo...
Using Linux kernel add_key and keyctl syscalls with group keyring Question: I'm building an application that needs to use the Linux group keyring to share some sensitive data between processes with different owners. Whenever I try to access the group keyring (e.g."@g" or "-6") using either the keyctl command or the und...
Installing MySQLdb 1.2.3 with Python For Django on Mac OSX? Question: I am a beginner Java developer and newbie to Python and I want to install Django and from what i understood that i need to install MySQLdb 1.2.3 with Python and I have MySQL already installed so I am trying to do so and all the guides I find is for 1...
Hard typecasts in ctypes possible? int -> "pointer to struct" for example Question: I have am inside a callback that allows me to access the pointers passed to it as `int` (i.e. the Python `type()` function returns `int`). What so I have to do if I want convert this into a pointer of a `struct` whose layout I know and...