Rocky Python HelloWorld

From NIMBioS

Python Code

helloworld.py

print("Hello World!")

Batch Script

helloworld.run

#!/bin/bash
#SBATCH --job-name=PYTHON_HELLOWORLD
#SBATCH --output=python_hell0_%j.out

module load Python

python3 helloworld.py

Running Job

[test_user@rocky7 helloworld]$ pwd
/home/test_user/projects/python/helloworld
[test_user@rocky7 helloworld]$ ls
helloworld.py  helloworld.run
[test_user@rocky7 helloworld]$ sbatch helloworld.run 
Submitted batch job 3871
[test_user@rocky7 helloworld]$ ls
helloworld.py  helloworld.run  python_hell0_3871.out
[test_user@rocky7 helloworld]$ cat python_hell0_3871.out 
Hello World!