Spade support for Python 3.8.1
- SPADE version: 3.1.4
- Python version: 3.8.1
- Operating System: Windows 10, 64bit
Description
I'm a beginner with Spade and I was trying to follow the Quick start guide. In particular I was trying to make my first dummyagent.py work (where password is a .py file with variable my containing my correct password):
from spade import agent
import password
class DummyAgent(agent.Agent):
async def setup(self):
print("Hello World! I'm agent {}".format(str(self.jid)))
dummy = DummyAgent("[email protected]", password.my)
dummy.start()
dummy.stop()
So I installed the latest version of Python 3.8.1, created a virtual environment and installed Spade 3.4.1 through pipenv.
Then when I launched python dummyagent.py nothing happened. It seems that the process freezes and the agent won't start (no "Hello World" expected message will be printed.)
Launching that dummyagent.py should print the above mentioned message.
What I Did
I created a folder test in which i put the dummyagent.py and the password.py.
The last command will never write Hello World ...
I tried the same with Python 3.7.6, and it works.
Hi I've never tested SPADE with python >=3.8. I'll try to test it and fix code ASAP.
However, having a start and a stop in a row may be too fast. Try introducing a sleep between them, or the common:
dummy.start()
while True:
try:
time.sleep(1)
except KeyboardInterrupt:
break
dummy.stop()
However, having a start and a stop in a row may be too fast. Try introducing a sleep between them, or the common:
dummy.start() while True: try: time.sleep(1) except KeyboardInterrupt: break dummy.stop()
Before opening this issue I also tried the second example present in "Quick Start Guide".
It seems to adopt the above mentioned pattern, but the example code still doesn't work with python 3.8.1, while (I've tried and) it works with python 3.7.6.
It won't go ahead from here.
hello guys, How can I broadcast messages using spade in a multi-agent system? can you please give me some sample code in python (SPADE)?