[Haskell-beginners] system and FilePath with space

Frerich Raabe raabe at froglogic.com
Thu Jan 26 10:03:42 UTC 2017


On 2017-01-26 10:50, PICCA Frederic-Emmanuel wrote:
> Hello
> 
> I try to execute a command using system.
> 
> my code is like this
> 
> 
> system (unwords ["python",  p])

An easier way to execute programs is to use the functions defined in 
System.Process, e.g.:

import System.Process

main :: IO ()
main = callProcess "/usr/bin/python" ["/my super/script.py"]

Note that 'callProcess' takes a list of strings, each element being one 
argument. The elements may contain spaces.

-- 
Frerich Raabe - raabe at froglogic.com
www.froglogic.com - Multi-Platform GUI Testing


More information about the Beginners mailing list