Skip to main content

This is a brand new LiveReload in version 2.0.0.

Downloads Version

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

Command Line Interface

Python LiveReload provides a command line utility, livereload, for starting a server in a directory.

By default, it will listen to port 35729, the common port for LiveReload browser extensions.

$ livereload --help
usage: livereload [-h] [-p PORT] [directory]

Start a `livereload` server

positional arguments:
  directory             Directory to watch for changes

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port to run `livereload` server on

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')

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.2.1.tar.gz (17.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for livereload-2.2.1.tar.gz
Algorithm Hash digest
SHA256 d88d909d827b136b496ecc44b3bbb0c574e8539778c2ac1e557e711ea5ed73d1
MD5 8390fa4e0ebbbcfd8c3ae7f4d976cd5e
BLAKE2b-256 3ae7266d100138b927b4529b61461d5543054a41ba9cc6225b1928990a87f5a1

See more details on using hashes here.

Release history Release notifications | RSS feed

2.7.1

2 files

2.7.0

2 files

2.6.3

2 files

2.6.2

1 file

2.6.1

2 files

2.6.0

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.2

1 file

2.3.1

1 file

2.3.0

1 file

2.2.2

1 file

This release

2.2.1 This release

1 file

2.2.0

1 file

2.1.0

1 file

2.0.0

1 file

1.0.1

1 file

1.0.0

1 file

0.15

1 file

0.14

1 file

0.13

1 file

0.12

1 file

0.11

1 file

0.10

1 file

0.9

1 file

0.8

1 file

0.7

1 file

0.6

1 file

0.5

1 file

0.4

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page