root / trunk / python / create-compute-node.py @ 4
Historique | Voir | Annoter | Télécharger (896 octet)
1 |
#! /usr/bin/python
|
---|---|
2 |
#
|
3 |
#
|
4 |
# Define a main function to allow for function declaration in any order.
|
5 |
def main(): |
6 |
# System modules
|
7 |
import sys |
8 |
# Local modules (must live in the same directory).
|
9 |
import ciab_user_functions as cuf |
10 |
from ciab_common_vars import (commonVariables) |
11 |
#
|
12 |
# Variables
|
13 |
nodeNumberString = ''
|
14 |
|
15 |
# Yep, the comma is correct: it's a list of variables!
|
16 |
nodeNumberString, = usage(sys.argv) |
17 |
print commonVariables.keys()
|
18 |
print commonVariables.values()
|
19 |
print nodeNumberString
|
20 |
# End main
|
21 |
|
22 |
def usage(arguments): |
23 |
import sys |
24 |
if (len(arguments) < 2): |
25 |
print
|
26 |
print
|
27 |
print 'Missing parameter. Aborting' |
28 |
print
|
29 |
print 'Usage: ' + arguments[0] + ' node_number' |
30 |
print
|
31 |
print
|
32 |
sys.exit(1)
|
33 |
nodeNumberString = arguments[1]
|
34 |
# Yep, the comma is correct: it's a list of variables!
|
35 |
return nodeNumberString,
|
36 |
|
37 |
if __name__ == "__main__": |
38 |
main() |