Get π in python scripted expression for a driver?

  • $\begingroup$ pi or radians(180) $\endgroup$
    – user7952
    Dec 14, 2014 at 0:22
  • 1
    $\begingroup$ @SixthOfFour thanks... I tried math.pi, after nearly a year of javascript & php, I just couldn't believe it was as simple as pi! :D P.S. Post that as an answer $\endgroup$ Dec 14, 2014 at 0:24
  • $\begingroup$ I think math is already imported by default, and mapped so you needn't specify it. I'm still learning Python though, so I'm not sure how it's done. However, I use XYZ math surface quite a lot, and it has both pi and radians() without having to specify the math module. $\endgroup$
    – user7952
    Dec 14, 2014 at 0:38

1 Answer 1


pi or radians(180) should do the trick.

  • $\begingroup$ Thanks for the edit. I didn't know about the backticks. I'll try to remember them. :) $\endgroup$
    – user7952
    Dec 14, 2014 at 0:28
  • $\begingroup$ What import should be done to reference it in a script? In console pi is recognized, just as bpy is, in a script however, I notice that import bpy has to be done. $\endgroup$ Dec 29, 2020 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .