On my server, I'm using the standard example for Python (with an extra Hello World Method) and on the Client side I'm using the XML-RPC.NET Library in C#.
But everytime I run my client I get the exception that the method is not found. Any Ideas how fix that.
thanks!
Python:
from SimpleXMLRPCServer import SimpleXMLRPCServer
from Simpl...
I have a couple of Python functions that I use to make game development with Pygame easier. I have them in a file called helper.py in my Python-path, so I can import them from any game I make. I thought, as an exercise to learn about Python extensions, to convert this module to C. My first problem is that I need to use functions from Pyg...
I'm attempting to get my feet wet with python on Project Euler, but I'm having an issue with the first problem (find the sum of the multiples of 3 or 5 up to 1,000). I can successfully print out multiples of three and five, but when I attempt to include the sum function I get the following error:
TypeError: 'int' object is not iterab...
Is there a way to do panning or 3d sound in Pygame? The only way I've found to control sound playback is to set the volume for both the left and right channels.
...
I'm trying to write a SWIG wrapper for a C library that uses pointers to functions in its structs. I can't figure out how to handle structs that contain function pointers. A simplified example follows.
test.i:
/* test.i */
%module test
%{
typedef struct {
int (*my_func)(int);
} test_struct;
int add1(int n) { return n+1; }
tes...
When using the sqlite3 module in python, all elements of cursor.description except the column names are set to None, so this tuple cannot be used to find the column types for a query result (unlike other DB-API compliant modules). Is the only way to get the types of the columns to use pragma table_info(table_name).fetchall() to get a des...
I just invented a stupid little helper function:
def has_one(seq, predicate=bool):
"""Return whether there is exactly one item in `seq` that matches
`predicate`, with a minimum of evaluation (short-circuit).
"""
iterator = (item for item in seq if predicate(item))
try:
iterator.next()
except StopIteration...
I'm interested in Ruby, Python, PHP and Java. Does programming training and consultancy the way I described exist for any of those programming languages? Is it good? Why? Is it on the internet? Where?
...
I'm learning python and Qt to create graphical desktop apps. I designed the UI with Qt Designer and converted the .ui to .py using pyuic, according to the tutorial I'm following, I should be able to run my app. but when I do it, a terminal window opens and it says:
cd '/Users/andresacevedo/' && '/opt/local/bin/python2.6' '/Users/andres...
In the past, I created a Django wiki, and it was fairly straightforward to make a Page table for the current wiki entries, and then to store old revisions into a Revision table.
More recently, I decided to set up a website on Google App Engine, and I used some wiki code that another programmer wrote. Because he created his Page model in...
I need to have an at-home project now that I'm working on Python/Django at work. I'd like to learn something new, so I was thinking of checking out Java.
What's the most well respected web framework for deploying Java web apps?
The only reason I'm not checking out ruby on rails is because of how similar the ORM and other parts are to Dj...
Can you give an example and other examples that show when and when not to use Lambda?
My book gives me examples, but they're confusing.
...
I'm building a flash game website using Google App Engine. I'm going to put achievements on it, and am scratching my head on how exactly to store this data. I have a (non-google) user model. I need to know how to store each kind of achievement (name, description, picture), as well as link them with users who earn them. Also, I need to ke...
I'm working my way through DiveIntoPython.com and I'm having trouble getting the import to work. I've installed ActiveState's Pythonwin on a windows xp prof environment.
In the website, there is an exercise which involves 'import odbchelper' and odbchelper.name
http://www.diveintopython.org/getting_to_know_python/testing_modules.ht...
Okay, this is starting to drive me a little bit nuts. I've tried several xml/xpath libraries for Python, and can't figure out a simple way to get a stinkin' "title" element.
The latest attempt looks like this (using Amara):
def view(req, url):
req.content_type = 'text/plain'
doc = amara.parse(urlopen(url))
for node in doc.x...
I have a class like the following:
class Positive(object):
def __init__(self, item):
self._validate_item(item)
self.item = item
def _validate_item(self, item):
if item <= 0:
raise ValueError("item should be positive.")
I'd like to write a unit test for _validate_item(), like the following:
...
I'm trying to create a wave robot, and I have the basic stuff working. I'm trying to create a new blip with help text when someone types @help but for some reason it doesnt create it. I'm getting no errors in the log console, and I'm seeing the info log 'in @log'
def OnBlipSubmitted(properties, context):
# Get the blip that was just s...
I'm trying to profile an instance method, so I've done something like:
import cProfile
class Test():
def __init__(self):
pass
def method(self):
cProfile.runctx("self.method_actual()", globals(), locals())
def method_actual(self):
print "Run"
if __name__ == "__main__":
Test().method()
But no...
Hello,
I am looking for a python library that would allow me to compute stochastic calculus stuff, like the (conditional) expectation of a random process I would define the diffusion. I had a look a at simpy (simpy.sourceforge.net), but it does not seem to cover my needs.
This is for quick prototyping and experimentation.
In java, I u...
Hello I have this string:
mystring = '14| "Preprocessor Frame Count Not Incrementing; Card: Motherboard, Port: 2"|minor'
So I have 3 elements (id, message and level) divided by pipe ("|"). I want to get each element so I have written these little functions:
def get_msg(i):
x = i.split("|")
return x[1].strip().repl...