Skip to content

Commit

Permalink
more details on importing flux in a python script
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanday36 committed Jul 25, 2024
1 parent f573f9f commit 4002e22
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flux/section6.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ You can then create a handle for the currently running Flux instance with:
```
f = flux.Flux()
```
Note that, in order to `import flux` you need to have the Flux python bindings in your `PYTHONPATH`. If you are in a Flux allocation, this will have been done automatically, but if you're not already in an allocation, you may need to add an appropriate path to your `PYTHONPATH` (e.g. `PYTHONPATH=/usr/lib64/flux/python3.6:$PYTHONPATH`). Alternatively, you can call the Python that Flux was built against with `#!/bin/flux python`.
### Using the Flux API to submit a simple job
Once you've imported Flux and the Jobspec and created a Flux handle, you can construct a job request using the Jobspec class and submit it using the `flux.job.submit` function. For example, to submit a `sleep 60` command:
```
Expand Down

0 comments on commit 4002e22

Please sign in to comment.