Skip to content

Commit 7b61712

Browse files
StartAutomatingStartAutomating
authored andcommitted
docs: Updating Python Examples
Using Template.HelloWorld.py
1 parent aced338 commit 7b61712

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Languages/Python/Python-Language.ps1

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,12 @@ function Language.Python {
99
Because Python does not support multiline comment blocks, PipeScript can be written inline inside of multiline string
1010
1111
PipeScript can be included in a Python string that starts and ends with ```{}```, for example ```"""{}"""```
12-
.Example
13-
.> {
14-
$pythonContent = @'
15-
"""{
16-
$msg = "Hello World", "Hey There", "Howdy" | Get-Random
17-
@"
18-
print("$msg")
19-
"@
20-
}"""
21-
'@
22-
[OutputFile('.\HelloWorld.ps1.py')]$PythonContent
23-
}
24-
25-
.> .\HelloWorld.ps1.py
2612
.EXAMPLE
2713
'print("Hello World")' > .\HelloWorld.py
2814
Invoke-PipeScript .\HelloWorld.py
15+
.EXAMPLE
16+
Template.HelloWorld.py -Message "Hi" | Set-Content ".\Hi.py"
17+
Invoke-PipeScript .\Hi.py
2918
#>
3019
[ValidatePattern('\.py$')]
3120
param()

0 commit comments

Comments
 (0)