Bonjour,
Débutant en python, je dois réaliser une applie avec en utilisatn mod_python et j'ai des problèmes pour "mélanger le code"...
Voici le code en question :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #!/usr/bib/env python from mod_python import apache import shutil, os, sys, glob def listeJob(motif, chemin_rech, sep_chemin = os.pathsep): for chemin in chemin_rech.split(sep_chemin): for corresp in glob.glob(os.path.join(chemin, motif)): yield corresp def index(req): req.content_type = "text/html; charset=utf-8" print listeJob('*.py',os.environ['PATH']).next() return """<html> toto </html> """
L'idée serai de lister le contenu d'un répertoire et de l'afficher dans la page html quand la fonction www.site.fr/script.py/ est appelée.Cela est il possible ?
car je tourne en rond et mon ami google n'est pas très bavard sur ce genre de problème...
Merci par avance pour votre aide.
Bonne fin de journée







Répondre avec citation




Partager