Skip to content

Commit

Permalink
Enable python file to be run by ramp cli
Browse files Browse the repository at this point in the history
There is no possibility to use any options though
  • Loading branch information
Bachibouzouk committed Nov 19, 2023
1 parent 1ce5b7d commit 4a0eae3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ramp/ramp_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
See the License for the specific language governing permissions and limitations
under the License.
"""
import os

# %% Import required modules

Expand Down Expand Up @@ -58,5 +59,12 @@ def run_usecase(
pp.old_post_process(Profiles_list, fname, ofname)
else:
return Profiles_list
elif fname.endswith(".py"):
if os.path.exists(fname):
os.system(f"python {fname}")
else:
raise FileNotFoundError(f"{fname} is not an existing file")
else:
raise TypeError("Only the .xlsx file format is supported for ramp command line")
raise TypeError(
"Only the .py and .xlsx file format are supported for ramp command line"
)

0 comments on commit 4a0eae3

Please sign in to comment.