mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Updated to include Aleksandar's editorial changes; mostly python to Python
in the comments.
This commit is contained in:
1 parent
c1ccbc0923
commit
8a6798fb4f
2 files changed
+7
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Demo simple interoperation between PowerShell and Python
|
||||
|
||||
# Basic execution of a python script fragment
|
||||
# Basic execution of a Python script fragment
|
||||
python -c "print('Hi!')"
|
||||
|
||||
# Capture output in a variable
|
||||
@@ -13,7 +13,7 @@ $data
|
||||
# Use in expressions
|
||||
5 + (python -c "print(2 + 3)") + 7
|
||||
|
||||
# Create a python script using a PowerShell here-string, no extension
|
||||
# Create a Python script using a PowerShell here-string, no extension
|
||||
@"
|
||||
#!/usr/bin/python3
|
||||
print('Hi!')
|
||||
@@ -25,7 +25,7 @@ chmod +x hi
|
||||
# Run it - shows that PowerShell really is a shell
|
||||
./hi
|
||||
|
||||
# A mode complex script that outputs JSON
|
||||
# A more complex script that outputs JSON
|
||||
cat class1.py
|
||||
|
||||
# Run the script
|
||||
@@ -49,7 +49,7 @@ cat class1.ps1
|
||||
# And run it, treating the output as structured data.
|
||||
(./class1)[1].buz[1]
|
||||
|
||||
# Finally a PowerShell script with in-line python
|
||||
# Finally a PowerShell script with in-line Python
|
||||
cat inline_python.ps1
|
||||
|
||||
# and run it
|
||||
|
||||
Reference in new issue
Block a user