Page 1 sur 1

Ouverture pour ecriture dans Terminal via python

Posté : ven. 21 juin 2019 17:26
par Yoko
Bonjour,

Je suis à la recheche d''une information pour finaliser mon interface.
Je voudrais savoir, comment je peux ouvrir le terminal, afin d'écrire des lignes.
Mais cela en passant par Python.
Sauf que je ne trouve pas la chemin du terminal ?

Merci pour votre aide

Re: Ouverture pour ecriture dans Terminal via python

Posté : dim. 23 juin 2019 21:55
par jelopo
Bonjour,

Pour ouvrir un terminal, essayer "/usr/bin/lxterminal".

A+

Re: Ouverture pour ecriture dans Terminal via python

Posté : lun. 24 juin 2019 13:46
par Yoko
Merci pour l'info du chemin.
Mais cela ne vas pas.
Il y a un message d'erreur :

PermissionError : [Errno 13]
Permission denied: '/usr/bin/lxterminal'

voici le point qui bloque :

LXTerm = '/usr/bin/lxterminal'

def HDMI():
Fichier = open(LXTerm, 'w')
Fichier.write('cd LCD-Show/\n')
Fichier.write('./LCD-hdmi')

Sous W7, cela marche sans soucis. Avec un autre executable bien sur.
Mais rien sous RaspBerry ...

Re: Ouverture pour ecriture dans Terminal via python

Posté : mer. 26 juin 2019 22:53
par jelopo
Bonjour,

Le lien donné permet juste d'ouvrir un terminal, par exemple comme ceci.

Code : Tout sélectionner

import os
os.popen("/usr/bin/lxterminal")
A+