Skip to content

Commit c846f92

Browse files
author
James Brundage
committed
docs: Updating Python Examples
Using Template.HelloWorld.py
1 parent 6671c4c commit c846f92

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Languages/Python/Python-Language.ps.ps1

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

0 commit comments

Comments
 (0)