Shaare your links...
78 links
Interesting Links Home Login RSS Feed ATOM Feed Tag cloud Picture wall Daily
Links per page: 20 50 100
page 1 / 1
1 results for tags Python x
  • Utiliser du Bash dans du Python via Subprocess
    ------------------------------------------------------------------------------------------------
    import subprocess

    def bash_command(cmd):
       subprocess.Popen(cmd, shell=True, executable='/bin/bash')

    bash_command('a="Apples and oranges" && echo "${a/oranges/grapes}"')
    ------------------------------------------------------------------------------------------------

    Sortie:
    ------------------------------------------------------------------------------------------------
    Apples and grapes
    ------------------------------------------------------------------------------------------------

    OU si probleme:

    ------------------------------------------------------------------------------------------------
    import subprocess

    def bash_command(cmd):
       subprocess.Popen(['/bin/bash', '-c', cmd])
    ------------------------------------------------------------------------------------------------

    Source 1:
    http://www.saltycrane.com/blog/2011/04/how-use-bash-shell-python-subprocess-instead-binsh/
    Source 2:
    http://jimmyg.org/blog/2009/working-with-python-subprocess.html
    Mon 08 Dec 2014 10:05:30 AM UTC - permalink -
    - ?n_pyBA
    Bash Linux Programmation Python
Links per page: 20 50 100
page 1 / 1
Shaarli 0.0.41 beta - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.