I am attempting to create python bindings for some C++ code using swig. I seem have run into a problem trying to create python properties from some accessor functions I have for methods like the following:
class Player {
public:
void entity(Entity* entity);
Entity* entity() const;
};
I tried creating a property using the python pr...
I'm developing on the Google App Engine and I would like to integrate Facebook Connect into my site as a means for registering and authenticating. In the past, I relied on Google's Accounts API for user registration. I'm trying to use Google's webapp framework instead of Django but it seems that all the resources regarding Facebook conne...
I basically am working with an oldschool php cms based site in Russian, one of the many new functionalities requested is permalinks.
As of now, currently the website just uses the standard non-mvc 'article.php?id=50'. I was browsing the Russian wiki and this was really the only Russian site I've seen that made use of native Russian perm...
I am using built-in module to insert few instances , so they can be accessed globally for debugging purpose, but problem with __builtins__ module is that it is a module in main script and is a dict in modules, but as my script depending on cases can be main script or module, I have to do this
if isinstance(__builtins__, dict):
__bui...
I require to do a project as a part of my final year of engineering graduation studies.Can you suggest some projects pertaining to distributed systems and artificial intelligence together and which require python,c or c++ for programming?
Note:-Please suggest a project that is attainable for a group of 2 students.
...
I am using a form to upload files to the google app engine and store them in the datastore. l would also like to store the original file name and extension for presentation purposes.
Is there a way of retrieving this data from the post sever side or can it only be gathered client side and sent as separate fields (e.g. http://www.tinyurl...
I'm basically trying to setup my own private pastebin where I can save html files on my private server to test and fool around - have some sort of textarea for the initial input, save the file, and after saving I'd like to be able to view all the files I saved.
I'm trying to write this in python, just wondering what the most practical w...
SSViewer::set_theme('bullsorbit');
this my string. I want search in string "SSViewer::set_theme('bullsorbit'); " and replace 'bullsorbit' with another string. 'bullsorbit' string is dynamically changing.
...
In Python, I'm trying to extend the builtin 'int' type. In doing so I want to pass in some keywoard arguments to the constructor, so I do this:
class C(int):
def __init__(self, val, **kwargs):
super(C, self).__init__(val)
# Do something with kwargs here...
However while calling C(3) works fine, C(3, a=4) gives: ...
Hi,
This is related to a similar question about BIND, but in this case I'm trying to see if there's any easy way to parse various zone files into a dictionary, list, or some other manageable data structure, with the final goal being committing the data to a database.
I'm using BIND 8.4.7 and Python 2.4. I may be able to convince manag...
I'm trying to automate downloading of some text files from a z/os PDS, using Python and ftplib.
Since the host files are EBCDIC, I can't simply use FTP.retrbinary().
FTP.retrlines(), when used with open(file,w).writelines as its callback, doesn't, of course, provide EOLs.
So, for starters, I've come up with this piece of code which "...
So I'm attempting to write a Django reusable app that provides a method for displaying your Twitter feed on your page. I know well that it already exists 20 times. It's an academic exercise. :)
Directory structure is pretty simple:
myproject
|__ __init__.py
|__ manage.py
|__ settings.py
|__ myapp
|__ __init__.py
|__ adm...
I am implementing a relatively simple thread pool with Python's Queue.Queue class. I have one producer class that contains the Queue instance along with some convenience methods, along with a consumer class that subclasses threading.Thread. I instantiate that object for every thread I want in my pool ("worker threads," I think they're ...
I am trying create a new frame in wxPython that is a child of the main frame so that when the main frame is closed, the child frame will also be closed.
Here is a simplified example of the problem that I am having:
#! /usr/bin/env python
import wx
class App(wx.App):
def OnInit(self):
frame = MainFrame()
frame.Show(...
I'm not quite sure what i mean here, so please bear with me..
In sqlalchemy, it appears i'm supposed to pass an expression? to filter() in certain cases. When i try to implement something like this myself, i end up with:
>>> def someFunc(value):
... print(value)
>>> someFunc(5 == 5)
True
How do i get the values passed to == from ...
I am completing my first database project which aims to build a simple discussion site.
The answers which I got at Superuser suggests me that Python is difficult to use in building a database webapp without any other tools.
Which other tools would you use?
...
Markov chains are a (almost standard) way to generate random gibberish which looks intelligent to untrained eye. How would you go about identifying markov generated text from human written text.
It would be awesome if the resources you point to are Python friendly.
...
I've implemented what I believe to be a merge sort algorithm in python. I've never programmed in Python before, so I used several resources with commands that seemed foreign to me, to gain a better understanding.
However, I've also never implemented merge sort in the first place, so I'm not sure if I've even implemented it correctly....
This question is based on this answer.
I'm looking for a function similar to PHP's session_start() for Python. I want to access a dictionary like $_SESSION in PHP which becomes available after running the command.
...
I've come to the conclusion that python has a function for just about everything I could ask for. It's just a matter of actually finding these functions. Is there a function that will trim not only spaces for whitespace, but also tabs?
Thanks :)
...