Chapter 9. Running External Programs

Sometimes, your code needs to interact with programs in the outside world, be it the operating system in which it runs, or other languages such as C or FORTRAN. This chapter shows how straightforward it is to run external programs from Julia and covers the following topics:

  • Running shell commands—interpolation and pipelining
  • Calling C and FORTRAN
  • Calling Python
  • Performance tips—a summary

Running shell commands

To interact with the operating system from within the Julia REPL, there are a few helper functions available as follows:

  • pwd(): This function prints the current directory, for example, "d:\\test"
  • cd("d:\\test\\week1"): This function helps to navigate to subdirectories
  • In the interactive shell, you can also use ...

Get Julia: High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.