Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    automatizzare visualizzazione url tempificata da file

    ciao,
    esiste qualcosa che, leggendo gli url da un file sequenziale, li visualizza su un browser ogni x tempo ?



    grazie

  2. #2
    In python lo puoi fare in una manciata di linee tramite il modulo webbrowser:

    codice:
    import webbrowser
    
    urls = """
    www.html.it
    www.libero.it
    www.google.com
    """
    
    for url in urls.split():
        webbrowser.open(url)
    Per "tempificare" (!) il tutto usa una banale sleep.
    Rilasciata Python FTP Server library 0.5.1
    http://code.google.com/p/pyftpdlib/

    We'll be those who'll make the italian folks know how difficult can be defecating in Southern California without having the crap flying all around the house.

  3. #3
    che devo fare per avere questo modulo ?

  4. #4
    Devi installare python, incollare quel codice in un file con estensione .py, salvare, e poi, da prompt dei comandi, lanciarlo digitando "nome_file.py" (INVIO).
    Rilasciata Python FTP Server library 0.5.1
    http://code.google.com/p/pyftpdlib/

    We'll be those who'll make the italian folks know how difficult can be defecating in Southern California without having the crap flying all around the house.

  5. #5
    appena digitato:
    ./prova.py

    ho una crocetta al posto del puntatore

    e poi


    ./prova.py: line 4: urls: command not found
    ./prova.py: line 10: syntax error near unexpected token `('
    ./prova.py: line 10: `for url in urls.split():'

  6. #6
    Lancia "python prova.py".
    Oppure aggiungi in cima al file la riga:

    codice:
    #!/usr/bin/python
    ...rendi il file eseguibile con "chmod +x prova.py" e lancialo tramite "./prova.py".
    Rilasciata Python FTP Server library 0.5.1
    http://code.google.com/p/pyftpdlib/

    We'll be those who'll make the italian folks know how difficult can be defecating in Southern California without having the crap flying all around the house.

  7. #7
    ok

    pero' mi ha aperto 3 firefox differenti ...

  8. #8
    Quello credo dipenda da firefox. Agisci sulle impostazioni dei tab di modo che un nuovo collegamento si apra in un nuovo tab anzichè in una nuova finestra.
    Rilasciata Python FTP Server library 0.5.1
    http://code.google.com/p/pyftpdlib/

    We'll be those who'll make the italian folks know how difficult can be defecating in Southern California without having the crap flying all around the house.

  9. #9
    a me servirebbe che sulla solita finestra, dopo 20 secondi ad esempio, cambiasse sito .....

  10. #10
    ho fatto delle modifiche..... per temporizzare e per far aprire un solo tab

    #!/usr/bin/python
    import webbrowser
    import time
    urls = """
    www.html.it
    www.libero.it
    www.google.it
    """
    for url in urls.split():
    webbrowser.open(url, new=0)
    time.sleep(10)


    ma mi apre tab diversi....

    eppure leggo nella descrizione del modulo webbrowser:
    .... open( url[, new=0[, autoraise=1]])
    Display url using the default browser. If new is 0, the url is opened in the same browser window. If new is 1, a new browser window is opened if possible. If new is 2,....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.