I am trying to use the Mathematica output of a complicated expression as input for python. As suggested in this answer, the FortranForm of an expression already comes close. However, the FortranForm of the complex number 1i is
FortranForm[1I]
(0,1)
which would be a tuple in python and not a complex number. How do I convert these expressions to complex numbers? In Python, 1i would be 1j. I don't know if this is possible directly. Alternatively, complex numbers can be generated by calling the constructor complex(a, b), where a is the real part and b is the imaginary part.