source: pycodebattler/trunk/pycodebattler/scouter.py @ 85

Revision 85, 931 bytes checked in by atzm, 13 years ago (diff)

support to make warrior by parameters

  • Property svn:keywords set to Id
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4#  Copyright (C) 2010 by Atzm WATANABE <atzm@atzm.org>
5#
6#  This program is free software; you can redistribute it and/or modify it
7#  under the terms of the GNU General Public License (version 2) as
8#  published by the Free Software Foundation.  It is distributed in the
9#  hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10#  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11#  PURPOSE.  See the GNU General Public License for more details.
12#
13# $Id$
14#
15
16import sys
17import pycodebattler
18
19
20def _main_entry():
21    if len(sys.argv) == 1:
22        p = [pycodebattler.warrior.Warrior.make('stdin', sys.stdin)]
23    else:
24        p = [pycodebattler.warrior.Warrior.make(
25             pycodebattler.util.path2name(f), open(f))
26             for f in sys.argv[1:]]
27
28    print(pycodebattler.warrior.pformat(p))
29
30
31if __name__ == '__main__':
32    _main_entry()
Note: See TracBrowser for help on using the repository browser.