run .py files with .py files

This is the place for queries that don't fit in any of the other categories.

run .py files with .py files

Postby mckryall » Tue Jan 14, 2014 2:23 am

How, in code, can I run a separate .py file without importing it's functions? Do I absolutely have to make it run a console command?
Last edited by Mekire on Tue Jan 14, 2014 6:15 am, edited 1 time in total.
Reason: Lock.
Python 2.7
Mac Mini (Desktop/server)
Macbook Air
Laptop w/ Ubuntu 14.04
Posts: 116
Joined: Sat Nov 23, 2013 6:13 pm

Re: run .py files with .py files

Postby metulburr » Tue Jan 14, 2014 3:23 am

Code: Select all

Code: Select all

Or like you said, you can have the OS call it via subprocess module.
However if the program is integrated, it would be better to import it.
we will be moving to on October 1 2016
more details here
User avatar
Posts: 2244
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 6 guests