コード例 #1
0
#!/usr/bin/env python
import hello
#world = hello.world()
world = hello.world('Hello')
print(world.get())
world = hello.world(1, 2)

print(hello.abstract().value())
コード例 #2
0
ファイル: use_hello.py プロジェクト: dmgrogers/Exercises
import os

print(os.getcwd())

# Ensure that your current working directory is the folder in which the module scripts are stored.
# os.chdir('/users/david/documents/github/exercises/Py_testModule')

import hello

hello.world()
hello.spiel()

from hello import noHello

noHello()

# Note that it doesn't work to attempt to import a module that is in a sub-folder of the current working directory
import secretModule

secretModule.secretFunction(
)  # doesn't work (and you'll have to kill the terminal)

# For modules in sub-folders, the working directory needs to be changed
os.getcwd()
os.chdir(
    '/users/david/documents/github/References-and-Illustrations/Py_testModule/secretModule'
)
import secretModule

secretModule.secretFunction(
)  # This works fine (after a fresh terminal opened)
コード例 #3
0
ファイル: test_hello.py プロジェクト: xinming90/python-misc
def test_hello():
    assert hello.world() == 'hello world'
コード例 #4
0
ファイル: hello_test.py プロジェクト: gutomaia/sentinel
 def test_hello(self):
     self.assertEquals('Hello', world())
コード例 #5
0
# import hello module
import hello

# Call function
hello.world();

# Print variable
print(hello.shark);

# Call class
jesse = hello.Octopus("Jesse", "orange");
jesse.tell_me_about_the_octopus();
コード例 #6
0
import hello  #import our custom hello module

hello.world()  #run the world() function within the hello module
コード例 #7
0
#!/usr/bin/python3
import sys;

sys.path.append('/home/srm/aa/PYTHON/PROJECTS');


from hello import world


world();
コード例 #8
0
#!/usr/bin/python3

import sys

sys.path.append('/home/srm/aa/PYTHON/PROJECTS')

from hello import world

world()
コード例 #9
0
# Import hello module
import hello

# Call function
print(hello.world())

# Print variable
print("---------->", hello.ant)

# Call class
the_machine = hello.Car("Ford Mustang", "1967 Fastback", "night blue")
the_machine.tell_me_about_the_car()
print(the_machine.color)

コード例 #10
0
def test_hello_world():
    assert hello.world() == "Hello, World!"
コード例 #11
0
 def test_world(self):
     self.assertEquals(hello.world("Hello, World!"), "Hello, World!")