hi,
I am trying to develop facebook app using django.
The problem I am facing is how to use facebook api and get user friend list.
view.py
def canvas(request):
# Get the User object
user, created = FacebookUser.objects.get_or_create(id = request.facebook.uid)
return direct_to_template(request, 'canvas.fbml', extra_context...
I would love to install python2.5 on sco unix, and am wondering anybody who has attempted to do this?
...
Can someone show me how to write unit tests for sqlalchemy model I created using nose.
I just need one simple example.
Thanks.
...
Is it possible to send a status code other than 200 via a python cgi script (such as 301 redirect)
...
Is there some place of freely available themes/skins for standard Django apps? I mean the typical stuff containing footer, header, etc.
...
I'm writing web application where I need to push data from server to the connected clients. This data can be send from any other script from web application. For example one user make some changes on the server and other users should be notified about that.
So my idea is to use unix socket (path to socket based on user #ID) to send dat...
Apparently libigraph and python-igraph are the only packages on earth that can't be installed via apt-get or easy_install under Ubuntu 8.04 LTS 64-bit.
Installing both from source from source on seems to go smoothly...until I try to use them.
When I run python I get:
>>> import igraph
Traceback (most recent call last):
File "<stdin>...
Hi,
I'm looking for a library to draw ASCII graphs (for use in a console) with Python. The graph is quite simple: it's only a flow chart for pipelines.
I saw NetworkX and igraph, but didn't see a way to output to ascii.
Do you have experience in this?
Thanks a lot!
Patrick
EDIT 1:
I actually found a library doing what I need, but i...
I have a mapping of catalog numbers to product names:
35 cozy comforter
35 warm blanket
67 pillow
and need a search that would find misspelled, mixed names like "warm cmfrter".
We have code using edit-distance (difflib), but it probably won't scale to the 18000 names.
I achieved something similar with Lucene, but as PyLucene only...
I've come across a place in my current project where I have created several classes for storing a complicated data structure in memory and a completed SQL schema for storing the same data in a database. I've decided to use SQLAlchemy as an ORM layer as it seems the most flexible solution that I can tailor to my needs.
My problem is tha...
I have been playing around with Python's FTP library and am starting to think that it is too slow as compared to using a script file in DOS? I run sessions where I download thousands of data files (I think I have over 8 million right now). My observation is that the download process seems to take five to ten times as long in Python th...
I am writing a server-client application to receive user message and publish it.
Thinking about authentication method.
Asymmetric encryption, probably RSA.
Hash (salt+password+'msg'+'userid'), SHA256
HMAC, SHA256. seems to be more secured than the method 2. Also involve hashing the password and msg data.
Symmetric Encryption of the '...
Sphinx is a new documentation tool for Python. It looks very nice. What I'm wondering is:
How suitable this is for documenting a C++ project?
Are there any tools for converting existing documentation (e.g. doxygen) to Sphinx format?
Are there online/downloadable examples of C++ projects that use Sphinx?
Any tips from anyone who has use...
It looks like the lists returned by keys() and values() methods of a dictionary are always a 1-to-1 mapping (assuming the dictionary is not altered between calling the 2 methods).
For example:
>>> d = {'one':1, 'two': 2, 'three': 3}
>>> k, v = d.keys(), d.values()
>>> for i in range(len(k)):
print d[k[i]] == v[i]
True
True
True
...
I'm trying to subclass str, but having some difficulties due to its immutability.
class DerivedClass(str):
def __new__(cls, string):
ob = super(DerivedClass, cls).__new__(cls, string)
return ob
def upper(self):
#overridden, new functionality. Return ob of type DerivedClass. Great.
caps = super(D...
I need to identify some locations in a file where certain markers might be. I started off thinking that I would use list.index but I soon discovered that returns the first (and only the first) item. so I decided to implement my own solution which was
count=0
docIndex=[]
for line in open('myfile.txt','r'):
if 'mystring' in line:
...
I've 3 tables:
A Company table with (company_id) primary key
A Page table with (company_id, url) primary key & a foreign key back to Company
An Attr table with (company_id, attr_key) primary key & a foreign key back to Company.
My question is how to construct the ManyToOne relation from Attr back to Page using the existing columns in...
How do I add a custom header to files pylons is serving from public?
...
I have a routine that takes a list of strings as a parameter, but I'd like to support passing in a single string and converting it to a list of one string. For example:
def func( files ):
for f in files:
doSomethingWithFile( f )
func( ['file1','file2','file3'] )
func( 'file1' ) # should be treated like ['file1']
How can ...
I'm looking for a cat for aac music files (the stuff iTunes uses).
Use Case: My father in law will not touch computers except for audiobooks he downloads to his iPod. I have taught him some iTunes (Windows) basics, but his library is a mess. It turns out, that iTunes is optimized for listening to podcasts and random songs from your libr...