## how to use polymake other than command line?

Questions and problems about using polymake go here.
qichen
Posts: 8
Joined: 09 Jul 2020, 02:01

### how to use polymake other than command line?

Can I write a bunch of codes and run them one time, but not just line by line in command line terminal. More over, can I define some functions by myself and save it to a file, then use it when I needed?

joswig
Main Author
Posts: 269
Joined: 24 Dec 2010, 11:10

### Re: how to use polymake other than command line?

Yes to both questions.

Even the command line provide full perl functionality.

Code: Select all

> sub myowncode($) { my ($arg)=@_; return cube(\$arg)->VOLUME; } > print myowncode(4); 16 
Then you can store a sequence of commands as a text file and apply load_commands to execute that code line by line.

For best experience, however, use the Jupyter notebook frontend, https://polymake.org/doku.php/user_guid ... []=jupyter
Here are some examples: https://github.com/micjoswig/polymake-notebooks

gawrilow
Main Author
Posts: 405
Joined: 25 Dec 2010, 17:40

### Re: how to use polymake other than command line?

You can also use the scripting facilities, as described here: https://polymake.org/doku.php/user_guid ... /scripting. You can put your frequently used functions in separate script files, if needed, because the script command can be used in other scripts too. Just think of starting every script file with an appropriate use application "..."; command.