Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
882 connectés 

  FORUM HardWare.fr
  Programmation
  Python

  python et optparse

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

python et optparse

n°1802368
chaica
Posté le 20-10-2008 à 14:49:00  profilanswer
 

j'utilise le module optparse pour gérer mes options et arguments.
J'aimerais que si un argument n'est pas passé sur la ligne de commande, le programme s'arrête mais je dois louper la bonne méthode pour le faire. j'aimerais que quelque chose dans optparse me dise si la variable existe ou pas et comme ça je pourrais réagir en fonction.

mood
Publicité
Posté le 20-10-2008 à 14:49:00  profilanswer
 

n°1802443
masklinn
í dag viðrar vel til loftárása
Posté le 20-10-2008 à 16:35:59  profilanswer
 

Cet argument, c'est juste un flag ou bien c'est un flag avec une valeur associée?
(e.g. -x ou -x sometext?)


---------------
Stick a parrot in a Call of Duty lobby, and you're gonna get a racist parrot. — Cody

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Python

  python et optparse

 

Sujets relatifs
[Python]Les accents contre-attaquent (sur mysql)[Python]Parser un fichier XML contenant des accents
prog en pythonCherche programmeur python gtk2, glade2, open source
turtle python et les math/geometrie : dur dur...Python : Ouverture d'une socket TCP
[Python] [Resolu]temps en abscisse pour un graphWhat's New In Python 2.6 (and 3.0?)
Porting to Python 3000: a presentationSujet sudoku en python
Plus de sujets relatifs à : python et optparse


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR