Skip to content

how to execute within Entrance "if __name__ == "__main__":" #1495

@NiKeYiGuN

Description

@NiKeYiGuN

Here is a simple python file and I would like to try to execute it like main file in my .Net application. But I didn't find a way. Is there any way to do this? thx a lot
`import sys
import clr

def func1():
print('func1')

def func2(a, b):
print(a+b)
print('func2')
return a+b

if name == "main":
print(func2(1,2))
sys.exit(0)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions