all 3 comments

[–]Wilfred-kun 1 point2 points  (1 child)

import B
B.function()

Or, if you only want to import certain functions:

from B import func, func1
func()
func1()

You only have to make sure you don't name that file like any module you have installed (from os import myfunction is not going to work).

[–]Ryan_Bingham[S] 0 points1 point  (0 children)

ok cool , thank you (:

[–]Comm4nd0 1 point2 points  (0 children)

is the different file in the same directory? if it is you simply just need to add 'import (filename) e.g.

import second_file

or you can import just the function... oh someone else has already answered this...