10000 Update README.md · anki-code/xonsh-cheatsheet@19d68e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19d68e2

Browse files
authored
Update README.md
1 parent 4579c03 commit 19d68e2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,22 @@ echo "We're in the docker container now!" | lolcat
15311531
```
15321532
Don't forget that `Alt+Enter` can run the command from any place where the cursor is.
15331533
1534+
### Use `prompt` instead of `input` for multiline input
1535+
1536+
In python there is `input` function but it has no support of multiline pasting. Use `prompt`:
1537+
1538+
```xsh
1539+
from prompt_toolkit import prompt
1540+
1541+
echo @(prompt('Content:\n')) > /tmp/myfile
1542+
# Content:
1543+
# <Paste multiline text "1\n\2\n" from clipboard>
1544+
1545+
cat /tmp/myfile
1546+
# 1
1547+
# 2
1548+
```
1549+
15341550
### Using the name of the alias in alias logic
15351551
```xsh
15361552
@aliases.register(",")

0 commit comments

Comments
 (0)
0