Answers.Body: <p>Complements of Phil Shapiro;</p>
  <p>Use ~{} instead of ${}.</p>
  <p>So this example from the current docs is wrong:</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;${in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
  <p>It should be :</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;~{in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-07T20:42:43.473Z
Answers.LastActivityDate: 2021-01-07T20:42:43.473Z
Answers.UserDisplayName: Liam McIntyre
Body: <p>I'm updating my WDL from draft 2 (whichs works fine) to version 1. I'm stuck with a Py snippet</p>
  <pre><code>task getReadGroup {
  
      input {
          String inputFile
      }
  
      command {echo input = ${inputFile}}
  
      # command &lt;&lt;&lt;
      # python &lt;&lt;CODE
      # print (&quot;${inputFile}&quot;.strip().split('/'))
      # CODE
      # &gt;&gt;&gt;
  
      output {
      Array[String] o = read_lines(stdout())
      }
  }
  </code></pre>
  <p>This command gives the expected result:</p>
  <pre><code>input = /mnt/lustre/working/genomeinfo/data/20191015_LongRead/20191015_LongRead_1/data/LXBAB201271/LXBAB201271/LXBAB201271/20190417_0612_1-A7-D7_PAD44174_42dcde1a/fast5/test/
  </code></pre>
  <p>But the commented out python code:</p>
  <pre><code>print (&quot;${inputFile}&quot;.strip().split('/'))
  </code></pre>
  <p>Gives an empty list - &quot;${inputFile}&quot; is empty in the code command for some reason!</p>
  <p>Any ideas? I've tried using a File instead of String to make it just like the example in the docs (below) other than that I see no diff:</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;${in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T05:31:34.270Z
Comments.Text: print (inputFile.strip().split('/')). ??
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T05:32:51.977Z
Comments.Text: Is that a wild guess or do you know?
Comments.UserDisplayName: Liam McIntyre
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T05:53:31.893Z
Comments.Text: Don’t know what is WDL and how it works but it’s like the variable it’s inputFile , and $ goes with echo, but could be wrong. Can’t try by my own given I don’t know WDL
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T12:13:01.757Z
Comments.Text: Given u don't know what WDL is it would be best if you didn't make suggestions...
Comments.UserDisplayName: Liam McIntyre
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T19:46:43.630Z
Comments.Text: Fine https://github.com/openwdl/wdl/blob/main/versions/1.0/SPEC.md#command-section got the use of placeholders    in whatever WDL is
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T19:48:19.357Z
Comments.Text: What does print ("${inputFile}") alone gives you
Comments.UserDisplayName: pippo1980
Tags: <python><wdl>
Title: What changed wwith Python in WDL change from draft 2 to version 1?
ThreadText: # What changed wwith Python in WDL change from draft 2 to version 1?
  
  (Asked by: username_0 on 2021-01-07)
  
  I'm updating my WDL from draft 2 (whichs works fine) to version 1. I'm stuck with a Py snippet
  
  ```
  task getReadGroup {
  
      input {
          String inputFile
      }
  
      command {echo input = ${inputFile}}
  
      # command <<<
      # python <<CODE
      # print ("${inputFile}".strip().split('/'))
      # CODE
      # >>>
  
      output {
      Array[String] o = read_lines(stdout())
      }
  }
  
  ```
  
  This command gives the expected result:
  
  ```
  input = /mnt/lustre/working/genomeinfo/data/20191015_LongRead/20191015_LongRead_1/data/LXBAB201271/LXBAB201271/LXBAB201271/20190417_0612_1-A7-D7_PAD44174_42dcde1a/fast5/test/
  
  ```
  
  But the commented out python code:
  
  ```
  print ("${inputFile}".strip().split('/'))
  
  ```
  
  Gives an empty list - "${inputFile}" is empty in the code command for some reason!
  
  Any ideas? I've tried using a File instead of String to make it just like the example in the docs (below) other than that I see no diff:
  
  ```
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("${in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  ```
  
  **Tags:** python, wdl
  
  > **Comments:**
  > **username_1**: print (inputFile.strip().split('/')). ??  
  > **username_0**: Is that a wild guess or do you know?  
  > **username_1**: Don’t know what is WDL and how it works but it’s like the variable it’s inputFile , and $ goes with echo, but could be wrong. Can’t try by my own given I don’t know WDL  
  > **username_0**: Given u don't know what WDL is it would be best if you didn't make suggestions...  
  > **username_1**: Fine https://github.com/openwdl/wdl/blob/main/versions/1.0/SPEC.md#command-section got the use of placeholders    in whatever WDL is  
  > **username_1**: What does print ("${inputFile}") alone gives you  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-01-07. Score: 2 | Accepted answer
  
  Complements of Phil Shapiro;
  
  Use ~{} instead of ${}.
  
  So this example from the current docs is wrong:
  
  ```
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("${in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  ```
  
  It should be :
  
  ```
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("~{in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  ```
  
  
  ---
  
  