o
    d}                     @   s2   d Z ddlZdd Zedkre Zee dS dS )u1   
Recherche d'un Arduino branché
à un port USB.
    Nc                  C   s   t d tjjjdd} t| dkrct| dkr#t tt| d  nt d d}| D ](}t dt| d	 |j d
 t|j  t|jdkrO|j}|  S |d }q+t	t
d}| |d  }|jS t d t d d S )Nz"Recherche d'un port serie (USB)...F)Zinclude_linksr      u%    ports USB actifs ont été trouvés:u"   un port USB actif a été trouvé:u   n° z : u    – type constructeur :  zwch.cnu<   Écrivez le numéro de la liste pour le port USB désiré : u'   Aucun port USB actif n'a été trouvé
u5    Veuillez vérifier le branchement USB avec l'arduino)printserialtoolsZ
list_portsZcomportslenstrdeviceZmanufacturerintinput)ZportsZligneportZ
portTrouveZchoixZ
portChoisi r   @C:\Users\laboratoire.PEDAGO\Desktop\P09 - python\port_Arduino.pyport_Arduino   s$   (
r   __main__)__doc__Zserial.tools.list_portsr   r   __name__ZportUSBr   r   r   r   r   <module>   s   