Conversation
Notices
-
How I can get (the out of os.system order) as a string variable in !python?
-
@anassahmed: Take a look at the subprocess module instead: http://docs.python.org/library/subprocess.html
-
@anassahmed os.popen("command").read() perhaps? If you want stderr too you have to fight unix a bit i guess
-
@anassahmed take a look at http://docs.python.org/library/subprocess.html, if you want "command" output as a string
-
@anassahmed os.system.__str__
-
@anassahmed See subprocess module section 17.1.3.1 ur1.ca/0eem4
-
@anassahmed See subprocess module section 17.1.3.1 http://ur1.ca/0eem4
-
@anassahmed: subprocess.Popen('ls', stdout=subprocess.PIPE).communicate()[0] http://is.gd/d7934
-
@anassahmed , Could you clarify your !python question? I couldn't understand what you asked.
-
@anassahmed you can't use !python's subprocess module
-
@anassahmed should have been: you can't with os.sytem, use !python's subprocess :)
-
@anassahmed بالمناسبة، يفضل عادة ألا تعتمد على #subprocess أو غيرها بل استخدم المكتبات المتوفرة لأداء المهمة لتضمن عملها في مختلف الأنظمة
-
@osamak نعم .. أريد ذلك لكن أحياناً أود معرفة ناتج الأمر وعندما أعتمد على os.system يوفر لى المحمولية لجميع الأنظمة لكن لا يعطيني خرج الأمر.
-
@osamak ولذا فقد نصحنى الأعضاء فى مجموعة !python أن أستخدم #subprocess كي أحصل على ناتج الأمر.
-