コード例 #1
0
ファイル: file2.py プロジェクト: samarthchadda/pypi
import file1

print(file1.fn())

print(file1.other_fn())
コード例 #2
0
#Choice what you need and chance the name
from random import choice as gimme_one, shuffle as mix_up_fruits

"""
Costumes Modules
"""
#Diferent file
def fn():
    return "do some stuff"

def other_fn():
    return "do some other stuff"

#THis is another file that i import the first file
import file1
file1.fn() # 'do some stuff'
file2.fn() # 'do some other stuff'

#if I only one to import one function
from bananas import dip_in_chocolate as dip
print(dip())

"""
Installing External Modules and  Termcolor
"""
import termcolor

print(dir(termcolor))
help(termcolor)
text = colored("HI THERE!", color="magenta", on_color="on_green", attrs=["blink"])
print(text)
コード例 #3
0
from file1 import MyFunc
import file1
from file1 import MyFunc as fn

MyFunc('Hi')
file1.MyFunc('Hello')
fn('Hello alias')