-
-
Save KarlHerler/1559609 to your computer and use it in GitHub Desktop.
Importing without specified PYTHONPATH or virtualenv (/src/lib/ and src/test/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fibonacci numbers module | |
print "I am imported!" | |
def printMe(): | |
print "From a.py" | |
# IGNORE, just some test methods | |
def fib(n): # write Fibonacci series up to n | |
a, b = 0, 1 | |
while b < n: | |
print b, | |
a, b = b, a+b | |
def fib2(n): # return Fibonacci series up to n | |
result = [] | |
a, b = 0, 1 | |
while b < n: | |
result.append(b) | |
a, b = b, a+b | |
return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.append('../') #so kill me | |
#print sys.path | |
from lib.a import printMe | |
printMe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment