python:les_modules
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
python:les_modules [2014/05/02 17:36] – [Fabric] root | python:les_modules [2024/12/20 12:41] (Version actuelle) – [Fabric] admin | ||
---|---|---|---|
Ligne 237: | Ligne 237: | ||
env.roledefs = { | env.roledefs = { | ||
- | | + | |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
} | } | ||
Ligne 405: | Ligne 405: | ||
<code python readline.py> | <code python readline.py> | ||
- | # | ||
- | |||
import readline, signal | import readline, signal | ||
- | prompt = ' | + | prompt = 'GigiX > ' |
def signal_handler(signal, | def signal_handler(signal, | ||
- | | + | |
- | | + | input(prompt) |
- | return | + | return |
signal.signal(signal.SIGINT, | signal.signal(signal.SIGINT, | ||
Ligne 423: | Ligne 421: | ||
def _parser(self, | def _parser(self, | ||
- | if search is None: | + | if (search is None) or (callable(search) == True): |
return [] | return [] | ||
elif len(line) == 0: | elif len(line) == 0: | ||
Ligne 437: | Ligne 435: | ||
results = self._parser(line, | results = self._parser(line, | ||
return results[state] | return results[state] | ||
+ | |||
+ | def linux_sles_12(): | ||
+ | print(' | ||
tree = { | tree = { | ||
- | | + | |
- | | + | ' |
- | | + | ' |
- | | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | } |
- | ' | + | |
- | }, | + | ' |
- | ' | + | ' |
- | | + | ' |
- | ' | + | ' |
- | | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | }, |
- | ' | + | ' |
- | ' | + | ' |
- | }, | + | ' |
- | | + | ' |
- | | + | ' |
- | ' | + | ' |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | }, | + | |
- | ' | + | |
- | { | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | } | + | |
- | } | + | |
}, | }, | ||
- | 'windows': | + | 'SLES': |
- | { | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | } |
- | } | + | }, |
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
} | } | ||
Ligne 495: | Ligne 490: | ||
l = '' | l = '' | ||
while l != (' | while l != (' | ||
- | | + | |
- | l = raw_input(prompt) | + | l = input(prompt) |
- | except EOFError: | + | |
- | + | | |
- | break | + | print(' |
- | except: | + | break |
- | continue | + | except: |
+ | continue | ||
</ | </ | ||
Ligne 531: | Ligne 527: | ||
import ctypes, ctypes.util | import ctypes, ctypes.util | ||
- | ctypes.cdll.LoadLibrary(ctypes.util.find_library(' | + | libc=ctypes.cdll.LoadLibrary(ctypes.util.find_library(' |
libc.printf(" | libc.printf(" | ||
</ | </ |
python/les_modules.1399052187.txt.gz · Dernière modification : 2014/05/02 17:36 de root