Pages : 1
#1 Le 02/06/2012, à 08:21
- bertrand47
[RÉSOLU] lancer fichiers PY au démarrage
Bonjour,
j'ai deux petits programmes qui ne se lancent jamais au démarrage, tous les deux fichiers ".py", python donc, je crois. Je les ai pourtant mis dans les applications à lancer au démarrage, en donnant à chaque fois le chemin du fichier dans la commande, mais ils ne se lancent pas.
Quelle est la solution ?
Dernière modification par bertrand47 (Le 02/06/2012, à 18:51)
Hors ligne
#2 Le 02/06/2012, à 08:43
- serged
Re : [RÉSOLU] lancer fichiers PY au démarrage
chmod +x toto.py
?
LinuxMint Vera Cinnamon et d'autres machines en MATE, XFCE... 20.x , 21.x ou 19.x
Tour : Asus F2A55 / AMD A8-5600K APU 3,6GHz / RAM 16Go / Nvidia GeForce GT610 / LM21.1 Cinnamon
Portable : LDLC Mercure MH : Celeron N3450 /RAM 4Go / Intel HD graphics 500 i915 / biboot Win 10 (sur SSD) - LM21.1 MATE (sur HDD)
Hors ligne
#3 Le 02/06/2012, à 08:50
- bertrand47
Re : [RÉSOLU] lancer fichiers PY au démarrage
Merci. Je teste de suite...
Hors ligne
#4 Le 02/06/2012, à 08:58
- bertrand47
Re : [RÉSOLU] lancer fichiers PY au démarrage
Ca ne marche pas. J'ai mis ça pour l'un des deux:
chmod +x /home/bertrand/gnome-shell-google-calendar/gnome-shell-google-calendar.py
Est-ce que c'est bon ?
Hors ligne
#5 Le 02/06/2012, à 14:06
- Tawal
Re : [RÉSOLU] lancer fichiers PY au démarrage
Hello,
Pour lancer un script écrit en python, il faut utiliser une commande du genre :
/usr/bin/python [/chemin/vers/le/fichier .py]
Du coup, plus besoin de chmod +x
Le savoir n'a d’intérêt que si on le transmet.
Useless Use of Cat Award
Filenames and Pathnames in Shell: How to do it Correctly
À chaque problème sa solution, à chaque solution son moyen, si pas de moyen, toujours le problème !
Hors ligne
#6 Le 02/06/2012, à 14:29
- ljere
Re : [RÉSOLU] lancer fichiers PY au démarrage
je te conseille plutôt
sh -c "python ~/gnome-shell-google-calendar/gnome-shell-google-calendar.py"
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#7 Le 02/06/2012, à 14:47
- serged
Re : [RÉSOLU] lancer fichiers PY au démarrage
Ca ne marche pas. J'ai mis ça pour l'un des deux:
chmod +x /home/bertrand/gnome-shell-google-calendar/gnome-shell-google-calendar.py
Est-ce que c'est bon ?
Au cas où ça ne marche pas, rajouter dans la première ligne du script :
#!/usr/bin/python
(comme on met #!/bin/bash pour un script bash)
LinuxMint Vera Cinnamon et d'autres machines en MATE, XFCE... 20.x , 21.x ou 19.x
Tour : Asus F2A55 / AMD A8-5600K APU 3,6GHz / RAM 16Go / Nvidia GeForce GT610 / LM21.1 Cinnamon
Portable : LDLC Mercure MH : Celeron N3450 /RAM 4Go / Intel HD graphics 500 i915 / biboot Win 10 (sur SSD) - LM21.1 MATE (sur HDD)
Hors ligne
#8 Le 02/06/2012, à 18:50
- bertrand47
Re : [RÉSOLU] lancer fichiers PY au démarrage
je te conseille plutôt
sh -c "python ~/gnome-shell-google-calendar/gnome-shell-google-calendar.py"
Ca marche très bien merci...
Hors ligne