Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ToPython.wl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ the Numpy python-ready expression (to be copied as a string);
------------------------------------------------------;
Not tested for every possible combination; use at your risk, by Gustavo Wiederhecker*)
If[numpyprefix=="",sep="",sep="."];(*if no prefix is included, the "." separator is not used*)
lp="( ";
rp=" )";
lp="(";
rp=")";
PythonForm[Rational[a_,b_]]:=PythonForm[a]<>"/"<>PythonForm[b];
PythonForm[Complex[a_,b_]]:="complex"<>lp<>PythonForm[a]<>","<>PythonForm[b]<>rp;
PythonForm[Times[a_,b_]]:=PythonForm[a]<>" * "<>PythonForm[b];
Expand Down