I don't know if you can do this in the specific configuration you are discussing; in fact you don't say which PLC you are using so I doubt any respondant can tell you.
But under the assumption you can technically connect the pieces, you will probably discover the performance is not adequate to really carry out reliable mechanical control.
Normally PLCs run through their program hundreds of times per second, each time sampling inputs and computing new outputs. This is fast enough so mechanics effectively see "smooth" control. (5 Hz would likely cause mechanical chatter and jerky movements of hardware).
If you "involve" Python to compute that, somehow you have pay bus communication times to/from the PLC to the Python, the Python wakeup time, Python execution time, and Python message packing/unpacking time. I doubt you can achieve all of this at several hundred times per second reliably (what happens when the OS interrupts Python to write 10M of data onto the disk for some other background process)?
If you insist in involving Python somehow, it should act only in an advisory role. That is, the PLC does all the work (e.g., you need that "ladder logic/..." to be written) but the Python code sends occasional messages to the PLC to change its overall behavior, e.g, control mode, feed rates, etc.