Ask Your Question
0

Seperate a single .py file into multiple .py files [closed]

asked 2014-06-30 21:30:53 -0600

anonymous user

Anonymous

updated 2014-08-03 19:24:41 -0600

JervisW gravatar image
  1. I want to separate the file (*.py). If I saparate the file which are A.py and B.py and C.py. B and C are the sub-files of A.py If I run the A.py, A file must call the B and C files. How should I do?

    1. I want make the modeling about Low pass filter for the frequency from PSS/E. How should I solve this problem?
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by petite cho
close date 2017-01-23 20:06:29.447107

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-07-17 06:25:18 -0600

rimux gravatar image

Regarding 1st question - just write in the top of A.py:

import B
import C

than if you have e.g. in B.py some function1, you can reach it in A.py :

B.function1()
edit flag offensive delete link more
1

answered 2014-06-30 22:09:26 -0600

Eli Pack gravatar image

updated 2015-07-20 01:12:12 -0600

To call B.py from A.py, just use the following line at the end of A.py:

execfile("B.py")

I'm not sure what your goal is, but if you need to pass a frequency trace through a low pass filter, I'd suggest using scipy or something similar. This is more of a generic Python question than a PSSPy question. This might be useful: FIRFilter.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-06-30 21:30:53 -0600

Seen: 416 times

Last updated: Jul 20 '15