Skip to main content

Python LiveReload is an awesome tool for web developers

Project description

This is a brand new LiveReload in version 2.0.0.

Installation

Python LiveReload is designed for web developers who know Python.

Install Python LiveReload with pip:

$ pip install livereload

If you don’t have pip installed, try easy_install:

$ easy_install livereload

Developer Guide

The new livereload server is designed for developers. It can power a wsgi application now:

from livereload import Server, shell

server = Server(wsgi_app)

# run a shell command
server.watch('static/*.stylus', 'make static')

# run a function
def alert():
    print('foo')
server.watch('foo.txt', alert)

# output stdout into a file
server.watch('style.less', shell('lessc style.less', output='style.css'))

server.serve()

The Server class accepts parameters:

  • app: a wsgi application

  • watcher: a watcher instance, you don’t have to create one

server.watch

server.watch can watch a filepath, a directory and a glob pattern:

server.watch('path/to/file.txt')
server.watch('directory/path/')
server.watch('glob/*.pattern')

You can also use other library (for example: formic) for more powerful file adding:

for filepath in formic.FileSet(include="**.css"):
    server.watch(filepath, 'make css')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livereload-2.1.0.tar.gz (15.8 kB view details)

Uploaded Source

File details

Details for the file livereload-2.1.0.tar.gz.

File metadata

  • Download URL: livereload-2.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for livereload-2.1.0.tar.gz
Algorithm Hash digest
SHA256 5600c99285b74a6b815aea56a8d70bfdfa854588d0b716e885bf8e443f2464c9
MD5 f6530ebedb21d74b45f7c30a96b7d759
BLAKE2b-256 702a000a763872cadf05ef4b370f9e98bebed27c70b2e6b582445d950b8a2894

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page