Calling PARI/GP from Python
问题 I would like to call PARI/GP from Python only to calculate the function nextprime(n) for different n s that I define. Unfortunately I can't get pari-python to install so I thought I would just call it using a command line via os.system in Python. I can't see in the man page how to do get PARI/GP to run in non-interactive mode, however. Is there a way to achieve this? 回答1: You can pipe input into gp's stdin like so, using the -q flag to quash verbosity: senderle:~ $ echo "print(isprime(5))" |