Identi.ca Identi.ca
  • Login
  • Public

    • Public
    • Groups
    • Featured
    • Popular

Conversation

Notices

  1. أنس أحمد أنس أحمد Python

    How I can get (the out of os.system order) as a string variable in !python?

    Sunday, 27-Jun-10 22:11:10 UTC from Choqok
    • Philippe Gauthier Philippe Gauthier

      @anassahmed: Take a look at the subprocess module instead: http://docs.python.org/library/subprocess.html

      Sunday, 27-Jun-10 22:16:30 UTC
    • Michael Hudson-Doyle Michael Hudson-Doyle

      @anassahmed os.popen("command").read() perhaps? If you want stderr too you have to fight unix a bit i guess

      Sunday, 27-Jun-10 22:48:07 UTC
    • alej0 alej0

      @anassahmed take a look at http://docs.python.org/library/subprocess.html, if you want "command" output as a string

      Sunday, 27-Jun-10 22:49:16 UTC
    • Daniel Devine Daniel Devine

      @anassahmed os.system.__str__

      Monday, 28-Jun-10 01:35:34 UTC
    • Sylvain Falardeau Sylvain Falardeau

      @anassahmed See subprocess module section 17.1.3.1 ur1.ca/0eem4

      Monday, 28-Jun-10 02:29:37 UTC
    • Sylvain Falardeau Sylvain Falardeau

      @anassahmed See subprocess module section 17.1.3.1 http://ur1.ca/0eem4

      Monday, 28-Jun-10 02:30:32 UTC
    • Épave Lapin Épave Lapin

      @anassahmed: subprocess.Popen('ls', stdout=subprocess.PIPE).communicate()[0] http://is.gd/d7934

      Monday, 28-Jun-10 04:24:19 UTC
    • G Philip G Philip Python

      @anassahmed , Could you clarify your !python question? I couldn't understand what you asked.

      Monday, 28-Jun-10 08:27:39 UTC
    • Florian Ludwig Florian Ludwig Python

      @anassahmed you can't use !python's subprocess module

      Monday, 28-Jun-10 08:31:45 UTC
    • Florian Ludwig Florian Ludwig Python

      @anassahmed should have been: you can't with os.sytem, use !python's subprocess :)

      Monday, 28-Jun-10 08:33:18 UTC
    • Osama Khalid Osama Khalid

      @anassahmed بالمناسبة، يفضل عادة ألا تعتمد على #subprocess أو غيرها بل استخدم المكتبات المتوفرة لأداء المهمة لتضمن عملها في مختلف الأنظمة

      Monday, 28-Jun-10 12:38:39 UTC
    • أنس أحمد أنس أحمد Osama Khalid

      @osamak نعم .. أريد ذلك لكن أحياناً أود معرفة ناتج الأمر وعندما أعتمد على os.system يوفر لى المحمولية لجميع الأنظمة لكن لا يعطيني خرج الأمر.

      Monday, 28-Jun-10 12:52:53 UTC
    • أنس أحمد أنس أحمد Python , Osama Khalid

      @osamak ولذا فقد نصحنى الأعضاء فى مجموعة !python أن أستخدم #subprocess كي أحصل على ناتج الأمر.

      Monday, 28-Jun-10 12:55:09 UTC

Site notice

  • API
  • Status

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Identi.ca is a microblogging service brought to you by Status.net. It runs the StatusNet microblogging software, version 1.1.0-alpha1, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Identi.ca content and data are available under the Creative Commons Attribution 3.0 license.

Switch to mobile site layout.

Built in Montreal