Rocky Python HelloWorld
From NIMBioS
Revision as of 16:59, 10 April 2023 by Jstratt7 (talk | contribs) (Created page with "= Python Code = '''helloworld.py''' <pre> print("Hello World!") </pre> = Batch Script = '''helloworld.run''' <pre> #!/bin/bash #SBATCH --job-name=PYTHON_HELLOWORLD #SBATCH --output=python_hell0_%j.out module load Python python3 helloworld.py </pre> = Running Job = <pre> [test_user@rocky7 helloworld]$ pwd /home/test_user/projects/python/helloworld </pre> <pre> [test_user@rocky7 helloworld]$ ls helloworld.py helloworld.run </pre> <pre> [test_user@rocky7 helloworld]...")
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!