This explains the method of communication between Python 2 and Python 3 by Redis
Install Redis Server on Windows. Both Python 2 and Python 3 will act as Redis clients. This setup allows Python 2 and Python 3 to communicate with each other through the Redis Server. Note that the Redis Server does not necessarily have to be installed on Windows, as long as both Python 2 and Python 3 can connect to it.
Python 2: VC side
Python 3: Install Python 3.x, so you can use pip install
to get the latest version of modules you want to use.
------ Files ------
- redis folder: This version is 2.10.6, very old, but works in VC, copy to C:\Users<User Name>\Documents\Visual Components\4.x\My Commands, for 4.9, copy to C:\Users<User Name>\Documents\Visual Components\4.x\My Commands\Python 2,
- Redis-x64-3.2.100.msi: Redis server on Windows
- RedisDemo.mp4: Demo video (Demo1: Python3 write joint values to Python2)
- RedisDemo.vcmx VC file
- RedisDemo.py: Python3 run this file
- RedisDemo_v2.mp4: Demo video (Demo2: Python2 call function from Python3)
- RedisDemo_v2.vcmx VC file
- RedisDemo_v2.py: Python3 run this file
------ Steps ------
- Install Redis-x64-3.2.100.msi (Also old version, but works)
- Open RedisDemo.vcmx in VC, start simulation (Demo1: Python3 write joint values to Python2)
- Execute RedisDemo.py in Python3
- Execute RedisDemo_v2.py in Python3 (Demo2: Python2 call function from Python3)
- Open RedisDemo_v2.vcmx in VC, start simulation
Redis_Python2_Python3.zip (16.2 MB)