Pyffi - Use Python from Racket

And i can import sympy. Thanks!

#lang racket
(require pyffi)
(initialize)
(post-initialize)

(import sympy)
(define x (sympy.Symbol "x" #:real #t))
(define pe sympy.parse_expr)
(for ([e (list "sin(x)" "cos(x)" "exp(x)" "x**3")])
    (let ([e~ (pe e)])
      (displayln
       (cons e~ (sympy.diff e~)))))
2 Likes