First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

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

asked Jul 1 '14

anonymous user

Anonymous

updated Aug 4 '14

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?

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 Jul 17 '14

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()
link
1

answered Jul 1 '14

Eli Pack gravatar image

updated Jul 20 '15

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.

link

Question Tools

Stats

Asked: Jul 1 '14

Seen: 421 times

Last updated: Jul 20 '15