Skip to content

Commit f2154fe

Browse files
authored
fix: fix README.md error (#99)
1 parent 5ed74c3 commit f2154fe

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ def main():
8282
# Your code
8383
pass
8484

85-
with objwatch.ObjWatch(['your_module.py']):
85+
if __name__ == '__main__':
86+
obj_watch = objwatch.watch(['your_module.py'])
8687
main()
88+
obj_watch.stop()
8789
```
8890

8991
### Example Usage

docs/source/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ Using the API
9191
# Your code
9292
pass
9393
94-
with objwatch.ObjWatch(['your_module.py']):
94+
if __name__ == '__main__':
95+
obj_watch = objwatch.watch(['your_module.py'])
9596
main()
97+
obj_watch.stop()
9698
9799
Example Usage
98100
--------------
@@ -393,4 +395,4 @@ Indices and tables
393395

394396
* :ref:`genindex`
395397
* :ref:`modindex`
396-
* :ref:`search`
398+
* :ref:`search`

0 commit comments

Comments
 (0)