Facebook Twitter Instagram
    Raspberry Pi France
    • Accueil
    • Formation
    • Tutoriels
    • Projets
    • Boutique
      • Acheter un Raspberry Pi
        • Raspberry Pi 2
        • Raspberry Pi 3 A+
        • Raspberry Pi 3 B+
        • Raspberry Pi 4
        • Raspberry Pi Zero W
        • Raspberry Pi Zero WH
        • Kits Raspberry Pi
      • Accessoires
        • Boîtier
        • Cartes SD
        • Alimentation
        • Carte d’extension
      • Autres
        • Périphériques
        • Ecran tactile
        • Câbles
        • Composants
    • Gaming
    Facebook Twitter Instagram
    Raspberry Pi France
    Home»Raspberry Pi : Notre guide complet pour débuter»Raspbian : Commencer à programmer avec Python

    Raspbian : Commencer à programmer avec Python

    Comme dit dans l’introduction de ce guide, le Raspberry Pi a été conçu pour permettre aux étudiants d’apprendre la programmation. Le langage principal pour programmer sur Raspberry Pi est Python. Nous allons voir comment mettre en place un environnement de programmation en Python sur votre Raspberry Pi.

    Qu’est-ce que Python ?

    Python est un puissant langage de programmation dynamique qui est utilisé dans différents domaines (application, web, …) Il est souvent comparé à Perl, Ruby ou encore Java.

    Les principaux points forts de Python sont :

    • Langage adapté aux débutants
    • Les grandes possibilités du langage. Il va aussi bien être adapté aux petits projets qu’aux gros projets.
    • Peut-être cross-platform
    • Stable, langage qui est assez vieux et qui a fait ses preuves
    • Simple à comprendre

    Comment programmer en Python sur Raspbian ?

    Pour écrire votre premier programme, rendez-vous dans le menu de Raspbian et allez dans : Programming > Thonny Python IDE

    Une fenêtre s’ouvre et c’est ici que vous pourrez écrire votre code en Python.

     

    Votre premier programme : « Hello World » en Python

    Dans la partie à droite « Source », écrivez la ligne suivante :

    print ('Hello World")

     

    Puis enregistrez votre code en allant dans le menu « File > Save » (Je vous conseille de créer un dossier où vous stockerez vos fichiers python avant pour rester organisé.) Enregistrez votre fichier avec l’extension « .py », par exemple « helloworld.py »

    Vous allez ensuite pouvoir lancer le programme en cliquant sur « Run »

    Vous devriez voir apparaître :

    « Hello World »

    Si c’est le cas, tout fonctionne parfaitement et vous êtes prêt à coder vos premiers programmes en Python sur Raspberry Pi.

    Nous n’allons pas voir la programmation en Python dans la suite de ce guide. Si vous souhaitez en apprendre plus et commencer à programmer en Python, je vous conseille le tutoriel d’OpenClassrooms qui est très complet.

    Dans la suite de ce guide, nous allons voir comment transformer votre Pi en un média-center.

    4.4/5 - (17 votes)
    Cliquer ici pour recevoir le guide
    Le Raspberry Pi
    Raspberry Pi 4 Raspberry Pi 4 - 4 Go - Officiel Cliquez ici pour plus d'informations
    Raspberry Pi 4 kit Kit conseillé : Raspberry Pi 4 Cliquez ici pour plus d'informations
    Maîtriser son Raspberry Pi
    Livre Raspberry Pi Livre conseillé aux débutants Cliquez ici pour plus d'informations
    Le kit Media Center

     

    Kit Raspberry Pi Media Center
    Kit Media Center : Raspberry Pi 3 B+
    Cliquez ici pour plus d’informations

     

    Cliquer ici pour recevoir le guide
    Facebook Twitter Instagram Pinterest
    © 2023 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.