# Interaction bash python

**URL:** <https://www.debian-fr.org/t/interaction-bash-python/33223>\
**Category:** Programmation\
**Created:** [Février 21, 2016, 2:55 UTC](https://www.debian-fr.org/t/interaction-bash-python/33223 "2016-02-21T02:55:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![limax](https://www.debian-fr.org/user_avatar/www.debian-fr.org/limax/32/3886_2.png) [@limax](https://www.debian-fr.org/u/limax)\
**Post date:** [Février 21, 2016, 2:55 UTC](https://www.debian-fr.org/t/interaction-bash-python/33223/1 "2016-02-21T02:55:19Z")

</div>

Bonjour

Je fais un programme en python

Je souhaite lancer mon programme depuis une console $ [monprogramme.py](http://monprogramme.py) le/dossier/lefichier

Est il possible de récupérer la variable le/dossier/fichier?

Je ne dois pas mettre les bon mot clé et je n’arrive pas à trouver

Merci

---

<div class="post-metadata">

**Author:** ![MisterFreez](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@MisterFreez](https://www.debian-fr.org/u/MisterFreez)\
**Post date:** [Février 21, 2016, 2:55 UTC](https://www.debian-fr.org/t/interaction-bash-python/33223/2 "2016-02-21T02:55:19Z")

</div>

[diveintopython.adrahon.org/scrip … ments.html](http://diveintopython.adrahon.org/scripts_and_streams/command_line_arguments.html)  
Ainsi :

[code]#!/usr/bin/python

import sys

print sys.argv[1][/code]  
0 pour le nom du script 🙂

---

<div class="post-metadata">

**Author:** ![limax](https://www.debian-fr.org/user_avatar/www.debian-fr.org/limax/32/3886_2.png) [@limax](https://www.debian-fr.org/u/limax)\
**Post date:** [Février 21, 2016, 2:55 UTC](https://www.debian-fr.org/t/interaction-bash-python/33223/3 "2016-02-21T02:55:19Z")

</div>

> [@MisterFreez](#):
>
> …

merci beaucoup ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")

edit: correction /

---

<div class="post-metadata">

**Author:** ![M3t4linux](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@M3t4linux](https://www.debian-fr.org/u/M3t4linux)\
**Post date:** [Février 21, 2016, 2:55 UTC](https://www.debian-fr.org/t/interaction-bash-python/33223/4 "2016-02-21T02:55:20Z")

</div>

[quote=«&nbsp;limax&nbsp;»][quote=«&nbsp;MisterFreez&nbsp;»]…[/quote]  
merci beaucoup ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")[/quote][/quote]
