File: example1.1.py

package info (click to toggle)
drmaa 0.7.9-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 360 kB
  • sloc: python: 1,295; makefile: 130; sh: 34
file content (24 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

from __future__ import print_function
import drmaa


def main():
    """Create a session, show that each session has an id,
    use session id to disconnect, then reconnect. Then exit"""
    s = drmaa.Session()
    s.initialize()
    print('A session was started successfully')
    response = s.contact
    print('session contact returns: ' + response)
    s.exit()
    print('Exited from session')

    s.initialize(response)
    print('Session was restarted successfully')
    s.exit()
    

if __name__=='__main__':
    main()