You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
This question is really "how do I pass strings to a python program" (and it's not done the way you do it), and it's honestly a programming question. To make this really short: you want to use command line arguments, or passing in textual data through standard input. Both is well-documented for Python!Marcus Müller– Marcus Müller2023-04-14 15:35:30 +00:00Commented Apr 14, 2023 at 15:35
-
1People: Please don't vote to migrate on topic questions. This is 100% on topic here and should not be migrated.terdon– terdon ♦2023-04-14 15:53:00 +00:00Commented Apr 14, 2023 at 15:53
-
1@MarcusMüller python is a standard tool used to administer *nix systems and this is not a question about string literals, it's about "how do I get my *nix system to work with this" and that is on topic.terdon– terdon ♦2023-04-14 15:59:22 +00:00Commented Apr 14, 2023 at 15:59
-
1@MarcusMüller the main issue here is about the shell, python is incidental. The reason it doesn't work is because the variable is expanded by the shell before python ever sees it, so python ends up seeing an unquoted string literal. So it really is about how the shell and python interact. If this had been presented as a python script, that could arguably be off topic, but a one-liner is essentially a *nix command, so...terdon– terdon ♦2023-04-14 16:05:18 +00:00Commented Apr 14, 2023 at 16:05
-
1Oh, and to clarify, I have no more "authority" about what is on topic than anyone else. Mods don't decide that, the community does. Mods do tend to be very familiar with the scope, that much is true, but that doesn't mean I'm right just because I'm a mod!terdon– terdon ♦2023-04-14 16:06:27 +00:00Commented Apr 14, 2023 at 16:06
|
Show 7 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. shell-script), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you