Example #1
0
def run():
    '''
    主函数,登录验证+交易操作
    :return:
    '''
    print('-------------欢迎使用,请插入您的银行卡-------------')
    data = login_auth.login()  # 登录验证并返回数据
    if data:
        main.main(data)  # 调用主模块main下的主函数进行交易操作
Example #2
0
type -p python2.4 >/dev/null 2>&1 && exec python2.4 -- "$P" ${1+"$@"}
exec python -- "$P" ${1+"$@"}; exit 1

This is a Python 2.x script, it works with Python 2.4, 2.5, 2.6 and 2.7. It
doesn't work with Python 3.x. Feel free to replace the #! line with
`#! /usr/bin/python', `#! /usr/bin/env python' or whatever suits you best.
"""

import os
import os.path
import sys

if not ((2, 4) <= sys.version_info[:2] < (3, 0)):
    sys.stderr.write(
        'fatal: Python version 2.4, 2.5, 2.6 or 2.7 needed for: %s\n' %
        __file__)
    sys.exit(1)

script_dir = os.path.dirname(__file__)
try:
    __file__ = os.path.join(script_dir, os.readlink(__file__))
    script_dir = os.path.dirname(__file__)
except (OSError, AttributeError, NotImplementedError):
    pass
if os.path.isfile(os.path.join(script_dir, 'lib', 'pdfsizeopt', 'main.py')):
    sys.path[0] = os.path.join(script_dir, 'lib')

import lib
from lib import main
sys.exit(main.main(sys.argv, script_dir=script_dir))
Example #3
0
from inspect import getsourcefile

if sys.version_info.major == 2 or sys.version_info < (3, 7):
    print('Error: cabernet requires python 3.7+.')
    sys.exit(1)

from lib import main

if __name__ == '__main__':

    init_path = os.getcwd()
    script_dir = os.path.abspath(os.path.dirname(getsourcefile(lambda: 0)))
    os.chdir(os.path.dirname(os.path.abspath(__file__)))
    #script_dir = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))
    #print('os.path.realpath', os.path.realpath(__file__))
    #print('os.path.abspath(os.path.dirname',os.path.abspath(os.path.dirname(__file__)))
    #print('os.path.dirname',os.path.dirname(sys.argv[0]))
    #print('os.getcwd()', os.getcwd())
    #print('getsourcefile', os.path.abspath(os.path.dirname(getsourcefile(lambda:0))))
    main.main(script_dir)

    sys.stderr.flush()
    sys.stdout.flush()
    os.chdir(init_path)
    if ('-r' in sys.argv) or ('--restart' in sys.argv):
        pass
    else:
        sys.argv.append('-r')
        sys.argv.append('1')
    os.execl(sys.executable, sys.executable, *sys.argv)
#!/usr/bin/env python3

try:
    from lib.main import Main, main
    from lib.core.exceptions import CrowbarExceptions
except Exception as err:
    import sys

    print(err, file=sys.stderr)
    sys.exit(1)

if __name__ == "__main__":
    main()
Example #5
0
from lib import main, generator
import os
os.system('node lib/index.js PLXQAecVlk3h8GyTHVeNAuWB_b2TEoLlPV')
main.main('53706285', 'PLXQAecVlk3h8GyTHVeNAuWB_b2TEoLlPV')
generator.main('收藏歌曲')
Example #6
0
from lib import main, generator
import os
os.system('node lib/index.js PLXQAecVlk3h_imMrwArKh_-4OexMDsHkb')
main.main('223969385', 'PLXQAecVlk3h_imMrwArKh_-4OexMDsHkb')
generator.main('收藏舞蹈')
from traceback import print_exc

# Only print a traceback on error if the user
# asked for one explicitly. For development
# you do want to invoke elfweaver with --traceback
if "--traceback" in sys.argv:
    traceback = sys.argv.index("--traceback")
    del sys.argv[traceback]
else:
    traceback = 0

for a in sys.argv:
    print a,

try:
    from lib.main import main
    main(sys.argv)
except KeyboardInterrupt:
    pass
except SystemExit, exit_code:
    sys.exit(exit_code)
except:
    import sys
    print "An error occurred:", sys.exc_info()[1]
    # unless --traceback is specified that's all you get
    if traceback:
        print "Now printing a traceback."
        print
        print_exc(file=sys.stdout)
        print
Example #8
0
#!/usr/bin/env python
################################################################################################
#
# Copyright (c) 2017 Jason Resch
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################################

from lib.main import main
from lib.coin_types import ltc

if __name__ == "__main__":
    main(ltc)
Example #9
0
#!/usr/bin/env python
################################################################################################
#
# Copyright (c) 2017 Jason Resch
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################################

from lib.main import main
from lib.coin_types import btc

if __name__ == "__main__":
    main(btc)
Example #10
0
# -*- coding: utf-8 -*-
from lib.main import main

if __name__ == '__main__':
    main()
#! /usr/bin/env python

import sys, argparse
import os

# Parse argumnets for host and port
argParser = argparse.ArgumentParser(prog="FlappyBird",
                                    description="Flappy bird game client.")
argParser.add_argument("--host",
                       default="127.0.0.1",
                       type=str,
                       help="Set a specific host, 127.0.0.1 default.")
argParser.add_argument("--port",
                       default=9234,
                       type=int,
                       help="Set a specific port, 9234 default.")

from lib import main
if __name__ == "__main__":
    args = argParser.parse_args(sys.argv[1:])
    if args.port <= 0:
        print("Port must be positive!")
    else:
        main.main(args.host, args.port)
Example #12
0
#!/usr/bin/env python
################################################################################################
#
# Copyright (c) 2017 Jason Resch
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################################

from lib.main import main
from lib.coin_types import bch

if __name__ == "__main__":
    main(bch)
Example #13
0
 def StartUp(self, event):
     main.main(self.dialog1.GetPath())
     self.Close(True)
Example #14
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Programmed by Kaan AKŞİT
try:
  import sys
  from lib import main
except ImportError, err:
	print "couldn't load module. %s" % (err)
	sys.exit()

try:
  main.main()
except KeyboardInterrupt:
  sys.exit()
Example #15
0
 def process(query_params):
     return main(query_params)
Example #16
0
#! /usr/bin/env python

import sys
import os
try:
    libdir = os.path.abspath(os.path.dirname(__file__))
    sys.path.insert(0, libdir)
except:
    # probably running inside py2exe which doesn't set __file__
    pass

from lib import main
main.main()
def organoid(path_data, path_images, debug=False):
    main(path_data, path_images, debug)