IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques tierces Python Discussion :

No such file or directory


Sujet :

Bibliothèques tierces Python

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2017
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2017
    Messages : 12
    Points : 12
    Points
    12
    Par défaut No such file or directory
    Salut ;

    Je suis entrain de développer une interface graphique pour envoyer un code G a Grbl , j'ai donc essayé ce code la mais quand je l'éxecute sur Raspberry y a une erreur qui m'affiche : No such file or directory 'grbl.code' .


    Voici le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
     
    import serial
    import time
     
    # Open grbl serial port
    s = serial.Serial('/dev/ttyS0',115200)
     
    # Open g-code file
    f = open('somefile.gcode','r');
     
    # Wake up grbl
    s.write("\r\n\r\n")
    time.sleep(2)   # Wait for grbl to initialize
    s.flushInput()  # Flush startup text in serial input
     
    # Stream g-code to grbl
    for line in f:
        l = line.strip() # Strip all EOL characters for streaming
        print ('Sending: ' + l,
        s.write(l + '\n')) # Send g-code block to grbl
        grbl_out = s.readline() # Wait for grbl response with carriage return
        print( ' : ' + grbl_out.strip())
     
    # Wait here until grbl is finished to close serial port and file.
    raw_input("  Press <Enter> to exit and disable grbl.")
     
    # Close file and serial port
    f.close()
    s.close()
    Merçi

  2. #2
    Expert éminent sénior
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 277
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 277
    Points : 36 762
    Points
    36 762
    Par défaut
    Salut,

    Citation Envoyé par mo7amedelhadi Voir le message
    y a une erreur qui m'affiche : No such file or directory 'grbl.code'
    çà veut juste dire que le fichier n'existe pas ou n'est pas dans le répertoire courant. Voir le chapitre sur les fichiers du Swinnen.

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2017
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2017
    Messages : 12
    Points : 12
    Points
    12
    Par défaut 'str' does not support the buffer interface
    Salut ;

    j'ai essayer d'ouvrir un fichier g code et l'envoyer par un port serie mais quand je l'execute il me sort une erreur : 'str' does not support the buffer interface

    voici le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
     
    import serial
    import time
     
    # Open grbl serial port
    s = serial.Serial('/dev/ttyS0',115200)
     
    # Open g-code file
    f = open(r'/home/pi/Downloads/spinner.gcode');
     
    # Wake up grbl
    s.write("\r\n\r\n")
    time.sleep(2)   # Wait for grbl to initialize
    s.flushInput()  # Flush startup text in serial input
     
    # Stream g-code to grbl
    for line in f:
        l = line.strip() # Strip all EOL characters for streaming
        print ('Sending: ' + l,
        s.write(l + '\n')) # Send g-code block to grbl
        grbl_out = s.readline() # Wait for grbl response with carriage return
        print( ' : ' + grbl_out.strip())
     
    # Wait here until grbl is finished to close serial port and file.
    raw_input("  Press <Enter> to exit and disable grbl.")
     
    # Close file and serial port
    f.close()
    s.close()
    Merçi

  4. #4
    Expert éminent sénior
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 277
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 277
    Points : 36 762
    Points
    36 762
    Par défaut
    Citation Envoyé par mo7amedelhadi Voir le message
    j'ai essayer d'ouvrir un fichier g code et l'envoyer par un port serie mais quand je l'execute il me sort une erreur : 'str' does not support the buffer interface
    Vous avez récupéré sur Internet ce script... écrit pour Python2.
    Pourquoi essayer de le faire fonctionner sous Python3?

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  5. #5
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2017
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2017
    Messages : 12
    Points : 12
    Points
    12
    Par défaut
    Oui parceque je suis entrain de développer une interface graphique avec python 3, et je dois convertir ce programme en python 3

Discussions similaires

  1. conio.h: No such file or directory
    Par débutant_en_C dans le forum C
    Réponses: 3
    Dernier message: 10/08/2006, 18h55
  2. list : no such file or directory :(
    Par Bakura dans le forum C++
    Réponses: 23
    Dernier message: 13/06/2006, 16h30
  3. Réponses: 7
    Dernier message: 26/04/2006, 09h56
  4. Réponses: 3
    Dernier message: 16/01/2006, 18h24
  5. Réponses: 1
    Dernier message: 04/10/2005, 20h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo