def main(): func1() func2() func3() my_obj = MyClass('a', 'b', 'c') my_obj.threefunc() my_obj.remove_threefunc()
def main(): func1() func2() func3() my_obj = MyClass('Bilbao', 'Igorre', 'Leioa') my_obj.hello() my_obj.not_hello()
def main(): mytest.func1() mytest.func2() mytest.func3() tempclass = mytest.MyClass(1, 'some string', 4) tempclass.hello() tempclass.not_hello()
def main(): print 'Testing mytest functions and main class...' func1() func2() func3() myobj = MyClass(1, 2, 3) myobj.hello() myobj.not_hello()
def main(): mytest.func1() mytest.func2() mytest.func3() x = mytest.MyClass('Steacie','010','342') x.hello() x.not_hello()
def main(): '''Testing Function import''' func1() func2() func3() print 'If you see World, Simple and Whatever on the 3 lines above this is successful' print '#' * 40 print 'Should see telnet and ssh commands below' obj = MyClass('10.4.4.4', 'lastuser', '4044') obj.hello() obj.not_hello()
def main(): word = negative('Hello','World',2) print word.changeme() word2 = Myclass('Hello','World', 2) print word2.repeat() word3 = MyChildClass('Hello','World',2) print word3.negate() mytest.func1() mytest.func2() mytest.func3()
def main(): '''Main func''' print() print("Testing func1...", end="") func1() print("Testing func2...", end="") func2() print("Testing func3...", end="") func3() print("\nTesting MyClass...") my_obj = MyClass('a', 'b', 'c') my_obj.hello() my_obj.not_hello() print()
def main(): '''Main func''' print print "Testing func1...", func1() print "Testing func2...", func2() print "Testing func3...", func3() print "\nTesting MyClass..." my_obj = MyClass('a', 'b', 'c') my_obj.hello() my_obj.not_hello() print
def main(): '''Main func''' print print "Testing func1...", func1() print "Testing func2...", func2() print "Testing func3...", func3() print "\nTesting MyClass..." my_obj = MyClass(1, 3, 5) my_obj.hello() my_obj.not_hello() print
def main(): print "-" * 40 print "Testing func1...", func1() print "Testing func2...", func2() print "Testing func3...", func3() print print "-" * 40 print "\nTesting TestClass..." my_obj = TestClass('jon', 'jerry', 'dean') my_obj.hello() my_obj.not_hello() print
def main(): print " function 1 display: \n" func1() print "\n" print " function 2 display: \n" func2() print "\n" print " function 3 display: \n" func3() print "\n" print " MyClass display: \n" my_obj = MyClass( "January", 2, "Mach") my_obj.x print "\n" my_obj.y print "\n" my_obj.z print "\n" my_obj.hello() print "\n" my_obj.not_hello() print "\n"
Write a Python script in a different directory (not the one containing mytest). a. Verify that you can import mytest and call the three functions func1(), func2(), and func3(). b. Create an object that uses MyClass. Verify that you call the hello() and not_hello() methods. """ import mytest from mytest import * from mytest import func3 print '*' * 80 print "Print out 3 functions" print '*' * 80 mytest.simple.func1() # Work with 'import mytest' func2() # Work with 'from mytest import *' func3() # Work with 'from mytest import func3' aMyClassObj = MyClass("It", "will", "be a beautiful day tommorrow!") print print '*' * 80 print "Print out Hello and NonHello for a MyClass object" print '*' * 80 aMyClassObj.Hello() aMyClassObj.NonHello()
#!/usr/bin/env python import mytest print mytest.func1() mytest.func2() mytest.func3()
print '-' * 30 cwd = os.getcwd() print cwd print print 'Python sys path:' pprint (path) print '-' * 50 print print 'func1' print '-' *15 mytest.func1() print print 'func2' print '-' *15 mytest.func2() print print 'func3' print '-' *15 mytest.func3() a_class = mytest.MyClass(10, 25, 30) print print 'hello' print '-' *15 a_class.hello() print print 'not hello' print '-' *15 a_class.not_hello()