[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Python help
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 19
Thread images: 1
File: 1325822313605.jpg (48 KB, 500x373) Image search: [Google]
1325822313605.jpg
48 KB, 500x373
Guys, I've spent the last hour trying to figure this easy shit out, and since I'm half-retarded, I can't get it.

I have a variable (x) in python that I need to pass as an argument in a shell program

How on earth do I do this?

call(['echo', "$x"]) doesn't work

please help.
>>
>>52010051
>>>/r/homeworkhelp
>>
>>52010051
i don't even know python and I did it in 30 seconds by googling it you fucking twat
>>
>>52010077
>not linking >>>/wsr/
why
>>
>>52010083
...and?
>>
>>52010051
Have you tried installing gentoo?
>>
>>52010089
I'm sorry could you please form one or more sentences consisting of more than one conjunctive adverb and punctuation?
>>
>>52010051
>I have a variable (x) in python that I need to pass as an argument in a shell program
Dude just pass the variable (x) unto a file, and pass your argument with computer quotes, like `these` instead of normal quotes like 'these'.
>>
>>52010133
you're almost as retarded as OP
>>
>>52010151
>you're almost as retarded as OP
Enlighten me.
>>
>>52010172
Because I said so bitch. Bow down and sexually please thy master bitch.
>>
>>52010172
you don't need to do all that and besides, backticks are deprecated
>>
>>52010172
>>52010213
and they're definitely not called "computer quotes"
>>
https://i.4cdn.org/wsg/1450732873409.webm
>>
>>52010213
>backticks are deprecated
What's better?
>>
>>52010051

isn't it like, argv[0] or whatever? I haven't used it much, but from what I understand thats the use for it
>>
>>52010051
> What is sys.argv
Now piss off
>>
>>52010051
import subprocess
subprocess.call('[./program.sh', x])

Is that what you are looking for?
>>
>>52010618
Meant to use:
import subprocess
subprocess.call(['./program.sh', x])
Thread replies: 19
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.