Running a batch file with parameters in Python OR F#

前端 未结 3 1976
旧巷少年郎
旧巷少年郎 2021-01-13 18:38

I searched the site, but I didn\'t see anything quite matching what I was looking for. I created a stand-alone application that uses a web service I created. To run the clie

3条回答
  •  抹茶落季
    2021-01-13 19:10

    Or you can use fsi.exe to call a F# script (.fsx). Given the following code in file "Script.fsx"

    #light
    
    printfn "You used following arguments: "
    for arg in fsi.CommandLineArgs do
      printfn "\t%s" arg
    
    printfn "Done!"
    

    You can call it from the command line using the syntax:

    fsi --exec .\Script.fsx hello world
    

    The FSharp interactive will then return

    You used following arguments:
            .\Script.fsx
            hello
            world
    Done!
    

    There is more information about fsi.exe command line options at msdn: http://msdn.microsoft.com/en-us/library/dd233172.aspx

提交回复
热议问题