コード例 #1
0
import fibonacci_sequence as fib
import hello_world as hlwd
import slope as sl

#Variables
input_, loop = 0, 1

#Main loop
while (loop == 1):
    print(
        '\n--------------------------------------------------\nAssignment 1:\nHello World:[1]   Celsius/Fahrenheit Converter:[2]\nFurlong/Meter/Kilometer Converter:[3]   Slope:[4]\nFibonacci Sequence:[5]   Change Calculator:[6]\nQuit:[7]\n--------------------------------------------------'
    )
    input_ = int(input('>>'))
    if (input_ == 1):
        print('Running Hello World:\n')
        hlwd.hello_world()
    elif (input_ == 2):
        print('Running Celsius/Fahrenheit Converter:\n')
        cov.cel_fah_con()
    elif (input_ == 3):
        print('Running Furlong/Meter/Kilometer Converter:\n')
        cov.fur_met_con()
    elif (input_ == 4):
        print('Running Slope:\n')
        sl.slope()
    elif (input_ == 5):
        print('Running Fibonacci Sequence:\n')
        fib.fib_seq()
    elif (input_ == 6):
        print('Running Change Calculator:\n')
        chg.change()
コード例 #2
0
ファイル: main.py プロジェクト: syokoysn/studying_programming
import hello_world

if __name__ == "__main__":
    print(hello_world.hello_world())
コード例 #3
0
#!/usr/bin/env python3

from name_function import get_formatted_name
from hello_world import hello_world
from good_bye import good_bye

print("Enter 'q' at any time to quit.")
while True:
    first = input("\nPlease give me a first name: ")
    if first == 'q':
        break
    last = input("Please give me a last name: ")
    if last == 'q':
        break

    formatted_name = get_formatted_name(first, last)
    print("\nNeatly formatted name: " + formatted_name + '.')

    hello_world_fun = hello_world()
    print(hello_world_fun)

    good_bye = good_bye()
    print(good_bye)
コード例 #4
0
 def test_hello_world(self):
     expected_result = "hello world"
     actual_result = hello_world()
     self.assertEqual(expected_result, actual_result)
コード例 #5
0
import os
import shutil
from subprocess import check_call, call

try:
    os.remove('hello_world.c')
except WindowsError:
    pass

try:
    os.remove('hello_world.pyd')
except WindowsError:
    pass

shutil.rmtree('build', ignore_errors=True)

check_call(r'python setup.py build_ext -if'.split())

import hello_world
import numpy as np
import Cython

print "*" * 80
print hello_world.hello_world(np.arange(10.))
print "Cython Version:", Cython.__version__
print "NumPy version:", np.__version__
print "*" * 80
コード例 #6
0
 def test_hello_world(self):
     self.assertEqual(hello_world("Toto"), "Hello Toto!")
コード例 #7
0
def test_hello_world():
    city = "Chicago"
    assert "Temperature" in hello_world.hello_world(city)
コード例 #8
0
def test_hello_world():
    if 'Message sent!' != hello_world( 'Test message!' ):
        raise StandardError( 'Failed test_hello_world()')
コード例 #9
0
ファイル: hello_world_test.py プロジェクト: capt-alien/ex.io
 def test_hello_world(self):
     x = hello_world.hello_world()
     assert x == "Hello World!"
コード例 #10
0
def hello_test():
    hello_world.hello_world()
コード例 #11
0
ファイル: test_hello_world.py プロジェクト: magetron/ENGF0002
def test_hello_world(capsys): 
    hello_world() 
    out, _ = capsys.readouterr()
    assert out == "Hello World!\n"
コード例 #12
0
 def testHelloWorld(self):
     self.assertEqual(hello_world(), "Hello, World!")
コード例 #13
0
def test_print():
    assert hello_world() == "Hello World"
コード例 #14
0
 def test_hello_world(self):
     self.assertEqual(hello_world.hello_world(), 'Hello, World!')
コード例 #15
0
 def test_hello_world(self):
     """Will this return 'Hello World!'?"""
     hello_world_test = hello_world()
     self.assertEqual(hello_world_test, 'Hello World!')
コード例 #16
0
def test_hello_world():
    assert (hello_world(), 'Hello World!')
コード例 #17
0
def test_hello_world():
    assert hello_world("v1") == "Hello World v1"
コード例 #18
0
 def test_string(self):
     self.assertEqual(hello_world(), 'Hello World!')
コード例 #19
0
    def test_hello_world(self):
        value = hello_world()

        self.assertEqual(value, 'Hello World!')
コード例 #20
0
def call():
    return hello_world(request)
コード例 #21
0
# Dependency Injection is where a piece of code allows the calling code to control its dependencies.

import hello_world


if __name__ == "__main__":
    hello_world.hello_world(output_function=print)
コード例 #22
0
 def test_hello(self):
     self.assertEqual(hello_world(), 'hello_world2')
コード例 #23
0
import hello_world
hello_world.hello_world()

from hello_world import hello_world
hello_world()

from hello_world import hello_world as hw
hw()

import hello_world as hw
hw.hello_world()

from hello_world import *
hello_world()
コード例 #24
0
ファイル: main.py プロジェクト: mkfsn/cython-lab
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__date__ = '11 14, 2014 '
__author__ = 'mkfsn'

import split_urls
import hello_world

URLS = 'http://google.pl http://youtube.com'
print split_urls.do_split(URLS)
hello_world.hello_world()
コード例 #25
0
def test_hello_world(capsys):
    hello_world()
    out, _ = capsys.readouterr()
    assert out == "Hello World!\n:"
コード例 #26
0
def test_hello_world():
    '''Testing route at `/routes/helloworld.py`'''
    assert hello_world(None) == {'hello': 'world'}
コード例 #27
0
import hello_world as hw

hw.hello_world()
コード例 #28
0
 def test_hello_world(self):
     self.assertEqual(hello_world(), "Hello World")