pyro

Control a python thread from outside

妖精的绣舞 提交于 2019-12-25 16:57:35
问题 I have a program, which needs to continuously run in the background, but be able to receive instructions to change. I have this thread running, which sends data to an Arduino and receives data back: class receiveTemp (threading.Thread): def __init__(self, out): threading.Thread.__init__(self) self.out = out def run(self): self.alive = True try: while self.alive: rec = send("command") self.out.write(rec) except BaseException as Error: print(Error) pass Now I need to change the command I send

wix patch PYRO0103 : The system cannot find the file

血红的双手。 提交于 2019-12-25 03:09:01
问题 I have tried building a patch for my application. I need to replace two files, nothing more. Using a bootstrapper got the files in place, but when uninstalling the bootstrapper the files was gone and not replaced by the old ones(of course). I added Keypath=yes" to my application package(both old and new one) in hope of that would get my problem solved, but no. I have been following this tutorial: http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization/patchwork Here is my problem

Detach a subprocess started using python multiprocessing module

一曲冷凌霜 提交于 2019-12-21 09:14:53
问题 I would like to create a process using the mutliprocessing module in python but ensure it continues running after the process that created the subprocess exits. I can get the required functionality using the subprocess module and Popen, but I want to run my code as a function, not as a script. The reason I want to do this is to simplify creating pyro (python remote objects) objects. I want to start the pyro object request handler in a separate process using multiprocessing, but then I want

PYRO4 - Errno 10061 connection refused

前提是你 提交于 2019-12-11 11:25:06
问题 I am trying to connect a client machine to a server mashine in different network using PYRO4 and Python 2.7 My server code is: import Pyro4 class Thing(object): def method(self, arg): return arg*2 daemon=Pyro4.Daemon(port=9999,nathost="78.149.X.X", natport=5555) uri=daemon.register(Thing(),"gameServer") # register Thing() as a Pyro object print "Ready. Object uri =", uri daemon.requestLoop() and the client code is: import Pyro4 server = Pyro4.Proxy("PYRO:gameServer@78.149.X.X:5555") print

Pyro4 does not allow more than two clients to access one URI

时光毁灭记忆、已成空白 提交于 2019-12-10 10:29:51
问题 I am creating a turn based strategy game in Python using pygame. I found writing sockets incredibly difficult, so I turned to Pyro for sharing the state of the game board. However, Pyro seems unable to support more than 2 connections at a time. I am running a nameserver on localhost via python -m Pyro4.naming Test case 'server': import Pyro4 class Testcase: def __init__(self): self.values = [1, 2, 3, 10, 20, 30] def askvalue(self, i): return self.values[i] daemon = Pyro4.Daemon() ns = Pyro4

How to send a function to a remote Pyro object

ぐ巨炮叔叔 提交于 2019-12-09 18:58:23
问题 I am trying to set up some code using Pyro to process python code functions on a remote host and get results back. After starting the name server, i would execute this code on the remote host (actually still on localhost): import Pyro4 class Server(object): def evaluate(self, func, args): return func(*args) def main(): server = Server() Pyro4.Daemon.serveSimple( { server: "server" }, ns=True) if __name__ == '__main__': main() On the client side i have this code, which is an example of the

requestloop(loopCondition) doesn't release even after loopCondition is False

江枫思渺然 提交于 2019-12-07 18:59:31
问题 I have some issues with the requestLoop methode of the Pyro4.Daemon object. What I want is to call remotely a "stop()" method for releasing the requestLoop function and shutdown my daemon. This small exemple doesn't work SERVER #!/usr/bin/python # -*- coding: utf-8 -*- from daemon import Pyro4 class Audit(object): def start_audit(self): with Pyro4.Daemon() as daemon: self_uri = daemon.register(self) ns = Pyro4.locateNS() ns.register("Audit", self_uri) self.running = True print("starting")

requestloop(loopCondition) doesn't release even after loopCondition is False

隐身守侯 提交于 2019-12-06 12:44:01
I have some issues with the requestLoop methode of the Pyro4.Daemon object. What I want is to call remotely a "stop()" method for releasing the requestLoop function and shutdown my daemon. This small exemple doesn't work SERVER #!/usr/bin/python # -*- coding: utf-8 -*- from daemon import Pyro4 class Audit(object): def start_audit(self): with Pyro4.Daemon() as daemon: self_uri = daemon.register(self) ns = Pyro4.locateNS() ns.register("Audit", self_uri) self.running = True print("starting") daemon.requestLoop(loopCondition=self.still_running) print("stopped") self.running = None def hi(self,

How do I properly call a Python Pyro client using PHP and Apache web server?

余生颓废 提交于 2019-12-04 06:00:43
问题 I have a Python3 Pyro4 server client app that works great when run from command line. server.py import Pyro4 @Pyro4.expose class JokeGen(object): def __init__(self): self.jokevar = "Joke" def joke(self, name): return "Sorry "+name+", I don't know any jokes." def main(): Pyro4.Daemon.serveSimple( { JokeGen: "example.jokegen" }, ns = True) if __name__=="__main__": main() client.py #!/usr/bin/env python3 import Pyro4 import sys person_to_joke = sys.argv[1] joke_control = Pyro4.Proxy("PYRONAME

Comparison of the multiprocessing module and pyro?

雨燕双飞 提交于 2019-11-29 10:04:40
I use pyro for basic management of parallel jobs on a compute cluster. I just moved to a cluster where I will be responsible for using all the cores on each compute node. (On previous clusters, each core has been a separate node.) The python multiprocessing module seems like a good fit for this. I notice it can also be used for remote-process communication . If anyone has used both frameworks for remote-process communication, I'd be grateful to hear how they stack up against each other. The obvious benefit of the multiprocessing module is that it's built-in from 2.6. Apart from that, it's hard