Yes, you can accomplish this by either creating a class or a function. You can import either into another script. Here is an example with a class:
# example.py
from multiprocessing import Process
class Example(object):
def __init__(self, queue):
"""
@type queue: multiprocessing.Queue
"""
self.q = queue
def run(self, a, m=None):
p = Process(target=self.f, args=(a, m))
p.start()
print self.q.get()
p.join()
def f(self, a, m='No'):
print m
self.q.put(a)
Then import from your example:
>>> from multiprocessing import Queue
>>> from example import Example
>>> q = Queue()
>>> e = Example(q)
>>> e.run('123', m='Yes')
Yes
123