Tagged Questions
1
vote
1answer
34 views
%typemapping of a C++ Library for Python Interface
I want to create a python wrapper for my C++ library. It would be cool, if there is a automatic conversion of std::vector to python lists and the other way round.
Unfortunatly if I add this code to ...
3
votes
1answer
49 views
Idiomatic multiple inheritance with python Abstract Base Classes
In simplest terms what I want is a tuple with one or two additional methods. __new__ or __init__ are not going to be modified.
I would like to create an abstract base class that is subclass of ...
0
votes
1answer
56 views
How can I prevent user entered password from showing on screen? [duplicate]
I am trying to create a utility program, but after the password is correctly typed in it goes to the main screen, and shows the password right above it! Is there any way I can automatically make the ...
2
votes
1answer
56 views
Python - Creating a command line like interface for loading modules/functions
In my Python project I'm trying to make the interface somewhat like a command prompt where I can type the name of a function and it will be executed.
Example:
Prompt >>> run.check
Running ...
-3
votes
0answers
34 views
I can't access to a admin page of my site [closed]
Sorry about my english, isn't my first language. I'am trying to learn Django and follow the book: DjangoBook.pdf ( I don't know who is the Writer).
It's all ok until the Chapter 6: The Django ...
0
votes
1answer
62 views
How to create cross-module, on-thy-fly variable name in python?
What I am trying to do, is creating a module, with a class; and a function, which is an interface of that class; and a variable name on-the-fly in this function, which is pointing to an instance of ...
3
votes
2answers
49 views
Selective exposure of methods and variables of one class to another in Python | (interfaces?)
I am trying to create a simulation of a simple robot which moves about in a 2-D world using pygame. There are obstacles in the world. The robot only has contact sensors. So it can only sense something ...
1
vote
1answer
75 views
How to extend a class in python?
In python how can you extend a class? For example if I have
color.py
class Color:
def __init__(self, color):
self.color = color
def getcolor(self):
return self.color
...
1
vote
0answers
102 views
Python application design
I'm designing a Python application yet I'm unable to figure out how to setup the preferred coding interface I want for it. (The first implementation will not have a GUI.)
I want the user to be able ...
0
votes
4answers
163 views
Is it possible to create Python-based Application in Xcode or equivalent?
So I have a lot of python scripts that I have written for my work but no one in my lab knows how to use Python so I wanted to be able to generate a simple Mac App where you can 'Browse' for a file on ...
0
votes
1answer
70 views
Could someone explain how a python daemon can also function to communicate with a running instance of itself?
I'd like to implement a Python module that functions as a daemon and as an interface to that daemon. For example, when I run:
python daemon.py do_something
The daemon module should try to ...
0
votes
0answers
29 views
Configurable step selection in Strategy pattern [closed]
I have a component that provides some functionality to multiple clients. This functionality is broken down into a sequence of steps. The use of strategy pattern seems like a good idea.
It is very ...
0
votes
1answer
90 views
swig: how to pass void* into generic function
I have scenario where I need pass around opaque void* pointers through my C++ <-> Python interface implemented based on SWIG (ver 1.3). I am able to return and accept void* in regular functions ...
0
votes
0answers
14 views
Detached core and interfaces skeleton
I'm thinking about making a skeleton application in python (or some other language) which clearly separates the functions of the core application and multiple interfaces (CLI, GUI, ws, etc.) that work ...
2
votes
2answers
134 views
Force a function parameter type in Python?
I have a function in a Python class that adds Interfaces to a list.
def RegisterAsListener(self, inListener):
self.__TransitListeners.append(inListener)
This is nice, because a class just needs ...
1
vote
1answer
46 views
Is it a good idea to define properties in Python interfaces?
Is it a good practice to define properties in an interface like this?
class MyInterface(object):
def required_method(self):
raise NotImplementedError
@property
def ...
1
vote
2answers
138 views
How to create maze type interface using tkinter python?
Hi I was wondering if there is a way to create a maze type interface (a very simple one), as I am making a game which involves a pacman type feel but at a smaller and simpler scale. I want to do so ...
0
votes
1answer
101 views
Python Network Programming on Linux - Simultaneous use of two network interface on the client?
Currently I have two network interfaces on my client. I created two separate sockets which binds to each interface ip. Now I also have two servers with each one talking to one socket on the client. I ...
2
votes
1answer
76 views
What's a good way to implement something simliar to an interface in Python?
What's a good way to implement something similar to a Delphi/C# interface or abstract class in Python? A class that will force all its subclasses to implement a particular set of methods?
0
votes
1answer
40 views
How to get a list of interfaces from a java class in jython?
I am using Jython within the Gephi package.
I would like to have a list of the interfaces that a certain class (from java) is implementing. Is that possible in Jython?
thanks!
0
votes
0answers
75 views
C# wrapper for a Python piece of code
Is it much struggle to write a C# wrapper for some existing Python function ? I would like to use numpy methods in a C# code, binding python code to C# code.
I am sorry there are not so many ...
0
votes
1answer
113 views
IRCUtils: Cannot make memory view because object does not have the buffer interface
I'm playing about with the idea of making a simple IRC bot. It seems like there is a variety of Python software written for this purpose, with varying feature sets and varying degrees of complexity. I ...
0
votes
1answer
180 views
Python Polymorphism through inheritance and interface
I am using Python 2.7 (google app engine)
Learning Python, I have figured out how the language uses inheritance to achieve polymorphism.
INHERITANCE-BASED POLYMORPHISM IN PYTHON:
class pet:
...
2
votes
1answer
855 views
Calling MATLAB .m-files and functions in Python script
I have a platform for python scripting, and I would like to call matlab functions inside. I have found several threads tackling the issue, among them those two
How do I interact with MATLAB from ...
0
votes
1answer
133 views
Event handler for OptionsMenuItem in fullscreenwrapper2 and sl4a
How to make Event handler for OptionsMenuItem in fullscreenwrapper2 and sl4a?
FullScreenWrapper2App.get_android_instance().addOptionsMenuItem("Exit","exit",None,"ic_menu_revert") # adding exit ...
1
vote
2answers
84 views
Interface-Based and API based programming in Django
I have searched the web for this issue. And there is a post already with the same title, but not really describing the actual question. So I haven't found the right solution.
I'm developing very ...
0
votes
3answers
105 views
What is the interface for python iterators? [duplicate]
Possible Duplicate:
Build a Basic Python Iterator
What are the required methods for defining an iterator? For instance, on the following Infinity iterator, are its methods sufficient? Are ...
1
vote
0answers
35 views
How to create a Java String object in a Python script after using JCC to create an interface to a Java Library?
I have a Java library which I have created a CPython interface using JCC from Apache. When I do the following, the "String" object appears, so I suppose there is a suitable interface to the String ...
1
vote
1answer
211 views
running pronterface in python: import error: no module named
I am a complete beginner to programming, python, pronterface and 3d printing so unsurprisingly I am having a few difficulties.
I have now managed to download pronterface and get it running on my ...
3
votes
1answer
131 views
Celery dynamic tasks / hiding Celery implementation behind an interface
I am trying to figure out how to implement my asynchronous jobs with Celery, without tying them to the Celery implementation.
If I have an interface that accepts objects to schedule, such as ...
1
vote
1answer
81 views
Separating objects from the format in which they can be represented
I often need to read a CSV file and use it to populate an internal table-like structure with the appropriate objects like this:
column_types = {'Car Make' : str, 'Year' : int,
'Quantity' : int, ...
0
votes
1answer
49 views
Error-Implement interface in python 3.2 with the module overloading
I am try to implement a interface in python with the module "overloading"
http://www.python.org/dev/peps/pep-3124/#interfaces-and-adaptation
The problem is that no found the module overloading when ...
0
votes
2answers
56 views
Constrain method access to an interface?
I have a Python system consisting of around 9-10 classes all implementing most of a fat duck-typed interface and used interchangeably by a large collection of modules. I'm trying to refactor the ...
2
votes
1answer
146 views
Twisted python: UDP Multicast Interface and Group
I have 2 questions regarding the security of twisted's UDP Multicast.
class UDPProtocol(twisted.internet.protocol.DatagramProtocol):
def startProtocol(self):
...
1
vote
1answer
610 views
Pass python IplImage object as simple struct to shared C library using ctypes
I'm trying to create a python wrapper for application written in C/C++ which make extensive use of OpenCV C API. I would like to use ctypes for this, because I have used it successfully in previous ...
3
votes
2answers
275 views
f2py — prevent array reordering
I have an array which is read from a fortran subroutine as a 1D array via f2py. Then in python, that array gets reshaped:
a=np.zeros(nx*ny*nz)
read_fortran_array(a)
a=a.reshape(nz,ny,nx) #in ...
5
votes
1answer
357 views
Network interface simulation in Python?
I'm making a simulator for a digital radio using Python. The radio relays over RF one each of an RS-232 port and an Ethernet port, with a pair of radios making seamless pipes. Thus, the simulator ...
0
votes
1answer
303 views
Python - Tkinter GUI [closed]
I am having issues with Tkinter. This is my first time using it and i'm wondering if you could help me. I have written the GUI of what i want but i can't make it into a class, could someone help me?
...
-2
votes
1answer
186 views
Stuck on python open file method [closed]
I'm trying to build an assembler in Python 2.7, but I'm stuck at the first step. Can anyone give me an example of how to write code that would open up a dialog box to select a file like with the Java ...
3
votes
1answer
992 views
Integrating Python with R
I am trying to install the appropriate packages to allow easy access to R from Python.
From what I understand, I have to use a command called easy_install to install a program called py2
But to do ...
1
vote
1answer
265 views
Wrapping a function that takes an array of pointers
I have a struct a { } defined. My C function takes an array of struct a by reference and then fills data in it. So it accepts an argument struct a **. I want to call this function from Python using ...
0
votes
1answer
175 views
R/XLL: Interface to call XLL method in R
I am trying to call the methods defined in the XLL addin(for Excel) from R.
Something similar to this Python code:
import os
from win32com.client import Dispatch
Path = 'myxll.xll'
xlApp = ...
1
vote
1answer
266 views
Django Rest Interface - unable to access authenticated user in my resource
I'm using django-rest-interface to build an API. However, when I make a request through curl, say:
curl -u 'username:password' -X PUT --data "field=value" http://127.0.0.1:8080/resource/
and ...
0
votes
1answer
353 views
Communication between a C# and Python application hosted on the same machine
We're working on a project that requires us to interface with a specific set of hardware; one set can be controlled very easily using C#, the other of which is natively programmed using Python. Part ...
2
votes
1answer
62 views
How can a zope.interface.Interface require implementation of a list of objects that implement another interface?
In the following example, I want objects implementing IParentInterface to be required to supply a mycollection attribute that is a list of objects implementing IChildInterface.
from zope.schema ...
-2
votes
2answers
505 views
Simple python code to website [closed]
I am a beginner in python. For practice reasons I want to learn how to upload a python code to a website.
I have a domain and web hosting service, however I'm really confused about how to integrate my ...
0
votes
3answers
123 views
what is pythonic way to communicate between modules?
let's assume following C code:
// events.h
enum Events {eOne, eTwo, eThree};
enum Events getEvent(void);
...
//ctrl.c
#include "events.h"
void ctrl(void)
{
switch(getEvent())
{
case ...
6
votes
2answers
451 views
python: urllib2 using different network interface
I have the following code:
f = urllib2.urlopen(url)
data = f.read()
f.close()
It's running on a machine with two network interfaces. I'd like to specify which interface I want the code to use. ...
3
votes
3answers
1k views
Java abstract/interface design in Python
I have a number of classes which all share the same methods, only with different implementations. In Java, it would make sense to have each of these classes implement an interface or extend an ...
1
vote
0answers
213 views
is there any tool for automatic interface generation using swig?
I have a project running in c++. I want to create a python wrapper for the classes and some global functions.
I am wondering if there is any tool for generating the interface file for swig ...