'How to run given Python script with class, init and main from cmd?
I'm supplid with script.py file with Python contents of which this is psuedo code:
import pandas as pd
import numpy as np
params = {...}
class SomeClass:
def __init__(self, ab):
self.ab = ab
self.de = None
def main(self):
self.foo()
@staticmethod
def DoSomethingUsefull(abc, params=params):
abc['x'] = abc['Red Fox'].copy()
return some_list(abc);
def foo(self):
self.de = SomeClass.DoSomethingUsefull(self.ab)
self.de['de'] = "de"
I cannot change the contents of the file, just use it as is. Eventually I need to execute the script from external (C#) code, currently trying to run from cmd (Python is installed). My question is how to execute from command line? If it's not possible to execute from command line and a wrapper script is needed, what will it look like?
Using WinPython 3.9.10
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
