Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

run.py 423 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  1. """
  2. Run a Python script. The script name should come from a script name in 'scripts'.
  3. """
  4. import sys
  5. import runpy
  6. from pathlib import Path
  7. import logging
  8. _log = logging.getLogger('run.py')
  9. src_dir = Path(__file__).parent
  10. sys.path.insert(0, src_dir)
  11. from bookdata import setup
  12. setup()
  13. script = sys.argv[1]
  14. _log.info('preparing to run %s', script)
  15. del sys.argv[1]
  16. runpy.run_module(f'scripts.{script}', alter_sys=True)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...