Skip to content

Instantly share code, notes, and snippets.

@ltddev
Created April 7, 2014 03:35
Show Gist options
  • Save ltddev/10014484 to your computer and use it in GitHub Desktop.
Save ltddev/10014484 to your computer and use it in GitHub Desktop.
Learning about Python modules and import sequences.
<component name="ProjectDictionaryState">
<dictionary name="swosnick" />
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.5 (/usr/local/bin/python3.3)" project-jdk-type="Python SDK" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HelloWorld.iml" filepath="$PROJECT_DIR$/.idea/HelloWorld.iml" />
</modules>
</component>
</project>
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VagrantSettings">
<option name="instanceFolder" value="" />
<option name="provider" value="" />
<option name="vagrantExecutable" value="vagrant" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>
__author__ = 'swosnick'
def sayHello(name, age):
return 'Hello ' + name + ' you are ' + str(age)+ ' years old!'
__author__ = 'swosnick'
def sayGoodbye(name, age):
return 'Hello ' + name + ' you are ' + str(age)+ ' years old!'
__author__ = 'swosnick'
'''
Learning about Python modules and import sequences.
Expected output:
Hello Sheldon you are 56 years old!
Hello Rachelle you are 50 years old!
'''
from swosnick.data import hello1 as h1
from swosnick import hello2 as h2
print(h1.sayHello("Sheldon", 56))
print(h2.sayGoodbye("Rachelle", 50))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment