def write(self):
     data = HelloWorld.HelloWorld()
     data.message("Hello World")
     data.index(self.index)
     self.writer.write(data)
     print("Sending {message} : {index}".format(message=data.message(),
                                                index=data.index()))
     self.index = self.index + 1
Пример #2
0
def application(environ, start_response):

    results = []

    results.append(str(moduletest.ageofqueen))
    results.append(printhello())
    results.append(hello())

    helloWorld = HelloWorld()
    results.append(helloWorld.sayHello())

    user = Users()
    results.append(user.sayHello())

    article = Articles()
    results.append(article.sayHello())

    output = "<br/>".join(results)

    print output

    # build the response body possibly using the environ dictionary
    response_body = output

    # HTTP response code and message
    status = '200 OK'

    # These are HTTP headers expected by the client.
    # They must be wrapped as a list of tupled pairs:
    # [(Header name, Header value)].
    response_headers = [('Content-Type', 'text/html'),
                       ('Content-Length', str(len(response_body)))]

    # Send them to the server using the supplied function
    start_response(status, response_headers)

    # Return the response body.
    # Notice it is wrapped in a list although it could be any iterable.
    return [response_body]
Пример #3
0
def app(redis):
    spec = importlib.util.spec_from_file_location("app.py", Path("apps") / "hello_world" / "1.0.0" / "src")

    app = HelloWorld(redis=redis, logger=None, console_logger=None)
    yield app
Пример #4
0
import sys
import os
import HelloWorld

print('the command line arguments are:')
for i in sys.argv:
    print(i)

print('\n\nThe python path is: ', sys.path, '\n')

print(os.getcwd())

print("call hello world")
HelloWorld.HelloWorld()
print('hello world version:', HelloWorld.__version__)

print("_________dir_________")
dir(sys)

dir()
def test_hello():
    assert HelloWorld.HelloWorld("Leonhard Euler") == "Hello Leonhard Euler!"
Пример #6
0
import HelloWorld

print (HelloWorld.HelloWorld())
Пример #7
0
 def test_TestHelloWorld(self):
     out = StringIO()
     sys.stdout = out
     HelloWorld.HelloWorld()
     self.assertEqual(out.getvalue().strip(), "Hello, World!")
Пример #8
0
import MethodRunner
import HelloWorld

helloWorldNode = HelloWorld.HelloWorld()
methodRunner = MethodRunner.lib_MethodRunner()

methodRunner.runMethod(helloWorldNode);
Пример #9
0
# https://www.tutorialspoint.com/jython/index.htm
# c:\Users\qcaij\OneDrive - University of Florida\Files\College\Coursework\Summer 2020\CIS 4930 - Special Topics - Performant Programming in Python\Python-Crash-Course\src\Third Party Modules\Jython\jython_tutorial.py
########################################################################################################################
# Importing Java Libraries

from java.util import Date

d = Date()
print(d)

import HelloWorld

h = HelloWorld()
h.hello()
h.hello("Isaac")

########################################################################################################################
# Variables and Data Types

x = 10
print(type(x))
x = "hello"
print(type(x))

# Jython Numbers
x = 42  # int
print(type(x))
x = 1234567890L  # long
print(type(x))
x = 42.42  # float
print(type(x))
Пример #10
0
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name:        Raytheon Company
# Contractor Address:     6825 Pine Street, Suite 340
#                         Mail Stop B8
#                         Omaha, NE 68106
#                         402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
import HelloWorld
runner = HelloWorld.HelloWorld()
runner.setMessage(""" Trigger value: %TRIGGER% """)
return runner.execute()