• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mymodule.sayhi函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mymodule.sayhi函数的典型用法代码示例。如果您正苦于以下问题:Python sayhi函数的具体用法?Python sayhi怎么用?Python sayhi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sayhi函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1:

# Filename: mymodule_demo.py

import mymodule

mymodule.sayhi()
print 'Version', mymodule.version
开发者ID:lance-chen,项目名称:python,代码行数:6,代码来源:mymodule_demo.py


示例2: sayhi

#!/usr/bin/python
#使用自己的模块mymodule



#Filename: mymodule_demo2.py
from mymodule import sayhi, version;
#Alternative:
#from mymodule import *;

sayhi();
print("Version", version);
开发者ID:CleanSky,项目名称:Python,代码行数:12,代码来源:mymodule_demo2.py


示例3: sayhi

#!/usr/bin/python
# Filename: mymodule_demo2.py

import mymodule

from mymodule import sayhi, version

# Alternative:
# from mymodule import *

sayhi()
print("Version", version)
开发者ID:fanswm,项目名称:pythonathome,代码行数:12,代码来源:mymodule_demo2.py


示例4:

import mymodule
import RiskRuleTemplate

mymodule.sayhi();
print '哇哈哈'
开发者ID:PaulMrzhang,项目名称:utmost,代码行数:5,代码来源:Hello.py


示例5: sayhi

#!/usr/bin/python

import sys

#path='/xxx/xxx' # the mymodule.py should be in the directory
#sys.path.append(path)

from mymodule import sayhi, version

print "the command line arguments are:"
for i in sys.argv:
	print i

if __name__ == '__main__':
	print 'The import.py program is being run by itself'
else:
	print 'The import.py program has been imported from another module'

sayhi() #call it directly

print "mymodule.version:", version
开发者ID:exuuwen,项目名称:study,代码行数:21,代码来源:import2.py


示例6: main

def main():
    i = 5
    print(i)
    i = i + 1
    print("value of i is", i)
    ############### Testing the method of application of string output
    s = """This is a multi-line string.
   This is the second line."""
    print(s)
    s = "This is a string. \
   This continues the string."
    print(s)

    i = 10 ** 10
    print("i = 10**10 = ", i)

    i = 134
    j = 50
    k = i // j
    print(" i =", i, " j =", j, " k = i//j =", k)
    k = i % j
    print(" i =", i, " j =", j, " k = i%j =", k)
    ############### Testing the method of application of for-loop
    for i in (10, 12, 33, 14, 57):
        if ~i % 2:
            print(i, "is an even number.")
        else:
            print(i, "is an odd number.")
    for i in range(0, 3):
        print(i)
    else:
        print("The for loop is over with outputting range(0,3)")
    for i in range(0, 300, 98):
        print(i)
    else:
        print("The for loop is over with outputting range(0, 300, 98)")
    ##   ############### Testing the method of application of while-if
    ##   number = 23
    ##   guess = 10
    ##   while(guess!=number):
    ##      guess = int(input('Enter an integer to guess: '))
    ##      if guess == number:
    ##          print('Congratulations, you guessed it.') # New block starts here
    ##          print("(but you do not win any prizes!)") # New block ends here
    ##      elif guess < number:
    ##          print('No, it is a little lower than that') # Another block
    ##          # You can do whatever you want in a block ...
    ##      else:
    ##          print('No, it is a little higher than that')
    ##          # you must have guess > number to reach here
    ##   else:
    ##      print('The while loop is over.')
    ##      # Do anything else you want to do here
    ##   print('Done')
    ##   ############### Testing the method of application of break-clause
    ##   while True:
    ##      s = input('Enter something until with quit: ')
    ##      if s == 'quit':
    ##         break
    ##      elif len(s) < 3:
    ##         print('input string is too short to quit')
    ##         continue
    ##      print('Length of the string is', len(s))
    ##   print('Done')
    ############### Testing the method of application of call-funtion
    sayHello()
    printMax(100, 321)
    print("maximum(123,142) is", maximum(123, 142))
    printMaxDoc(123, 142)
    print(printMaxDoc.__doc__)
    help(printMaxDoc)
    help(printMax)
    ############### Testing the method of application of modules
    print("The command line arguments are:")
    for i in sys.argv:
        print(i)
    print("\n\nThe PYTHONPATH is", sys.path, "\n")
    mymodule.sayhi()
    print("mymodule.version is", mymodule.version)
    # Fcn001.main()    # the same behavior with the time import first time
    # print('Fcn001.version is',Fcn001.version)
    print("math.sqrt(10.2) =", math.sqrt(10.2))
    print()
    print("multiply(10,21) is", mymodule.multiply(10, 21))
    print("divide(10,21) is", mymodule.divide(10, 21))
    print()
    ############### Testing the method of application of intrinsic constant
    if __name__ == "__main__":
        print("This program is being run by itself")
    else:
        print("I am being imported from another module")
    # print(__path__)
    # print(__line__)
    print("current file path is", __file__)
    ############### Testing the method of application of dir() fcn.
    zzz = 99
    newInt = 100
    print("Show the attribute-list of current module as following:")
    print(dir())
    yy = 78
#.........这里部分代码省略.........
开发者ID:Wvsnow,项目名称:Hawk,代码行数:101,代码来源:third.py


示例7: sayhi

from mymodule import sayhi,__version__
#from mymodule import * #这里使用 * 不会导入__version__(可以理解为双下划线开头的变量是private的)

sayhi()# 如果指定了导入的function 那可以直接调用function 而不需要module 名
print('Version',__version__)
开发者ID:foxli180,项目名称:PythonLearning,代码行数:5,代码来源:mymodule_demo.py


示例8:

#!/usr/bin/python
# Filename: mymodule_demo.py

import mymodule as md
import using_name 

md.sayhi()

print('Version is ',md.version)

#dir(md)
开发者ID:EstherLacan,项目名称:jiangfw,代码行数:11,代码来源:mymodule_demo.py



注:本文中的mymodule.sayhi函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mymysql.connectDB函数代码示例发布时间:2022-05-27
下一篇:
Python mylib.print_console函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap