Ir para conteúdo
Fórum Script Brasil

RaphaMarques23

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre RaphaMarques23

RaphaMarques23's Achievements

0

Reputação

  1. Boa tarde amigos. Fiz um programa em Python que deveria retornar o endereço de uma página através de um link. Porém, não estou conseguindo fazê-lo funcionar no WING IDE. Sou iniciante na linguagem python, vocês poderiam verificar por que isso está ocorrendo? import os, sys, string logfilename = "/absolute/path/to/log/file/directory/" # change the directory path exc_list = ["xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx"] #exc_list = [] # the list of machines to exclude from logging ######### And now the tricky bit ############# # Get input infolist = sys.argv[1:] + [ os.popen('date').read(), os.environ.get("REMOTE_ADDR", "--noaddr-- (00:17) Wall: "), os.environ.get("HTTP_USER_AGENT", "--noagent--"), os.environ.get("HTTP_REFERER", "--noreferer--"), '\n'] # print infolist out = string.join(infolist, ' : ') address = os.environ.get("REMOTE_ADDR", "noaddr") logfilename += (address + ".dat") if address not in exc_list: open(logfilename,'a').write(out) print "Content-type: text/html\n\n" # Logger script based on Matt's Perl "Book 'Em Dano" script # Original perl script available from http://worldwidemart.com/scripts Obrigado.
×
×
  • Criar Novo...