Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisione Revisione precedente | |||
sistema:gestore_segnalibri_per_terminale [23/01/2025 - 10:13] Fabio Di Matteo |
sistema:gestore_segnalibri_per_terminale [25/01/2025 - 23:21] (versione attuale) Fabio Di Matteo |
||
---|---|---|---|
Linea 31: | Linea 31: | ||
**$HOME/terminali/mycategory/myremotepc.sh** | **$HOME/terminali/mycategory/myremotepc.sh** | ||
<file>ssh user@192.168.0.45</file> | <file>ssh user@192.168.0.45</file> | ||
+ | |||
+ | ===== Versione testuale ===== | ||
+ | |||
+ | <code bash> | ||
+ | #!/usr/bin/env python3 | ||
+ | import os | ||
+ | os.system("clear") | ||
+ | print("\nScegli la categoria del terminale:\n") | ||
+ | |||
+ | |||
+ | root = '/home/fabio/terminali' | ||
+ | nline=0 | ||
+ | lcat=[] | ||
+ | for filename in os.listdir(root): | ||
+ | file_path = os.path.join(root, filename) | ||
+ | if os.path.isdir(file_path): | ||
+ | lcat.append(filename) | ||
+ | print(f'{nline} : {filename}') | ||
+ | nline=nline+1 | ||
+ | try: | ||
+ | ncat=int(input("\nNumero categoria-> ")) | ||
+ | print("hai scelto %s" % lcat[ncat] ) | ||
+ | except: | ||
+ | print("Errore") | ||
+ | exit(-1) | ||
+ | |||
+ | subdir=root+os.sep+lcat[ncat] | ||
+ | nline=0 | ||
+ | lobj=[] | ||
+ | for filename in os.listdir(subdir): | ||
+ | file_path = os.path.join(subdir, filename) | ||
+ | if os.path.isfile(file_path): | ||
+ | lobj.append(filename) | ||
+ | print(f'{nline} : {filename}') | ||
+ | nline=nline+1 | ||
+ | try: | ||
+ | nobj=int(input("\nCollegati a -> ")) | ||
+ | print("hai scelto %s" % lobj[nobj] ) | ||
+ | file_cmd = open(subdir+os.sep+lobj[nobj], 'r') | ||
+ | cmd = file_cmd.read() | ||
+ | file_cmd.close() | ||
+ | os.system("clear") | ||
+ | os.system(cmd) | ||
+ | |||
+ | except: | ||
+ | print("Errore") | ||
+ | exit(-1) | ||
+ | |||
+ | </code> | ||
+ |
Il nostro wiki installa solamente cookie tecnici necessari al funzionamento della piattaforma "Dokuwiki". Niente analitics, statistiche, tracciamenti o altro.