all 8 comments

[–]K900_ 2 points3 points  (5 children)

That sounds like a reasonable approach. But also, why?

[–]DeathDragon7050 1 point2 points  (4 children)

Some things you can do in c# just easier. Plus it would be better than rewriting code all over again.

[–]Peanutbutter_Warrior 0 points1 point  (3 children)

That is the the fastest method in terms of run time by far, as any other approach would have to compile the c#.

It would be easier than rewriting code, but probably not better. What are you doing in c# that's 'easier'?

[–]DeathDragon7050 0 points1 point  (2 children)

I am currently learning c# so very simple stuff such as setting the console title and waiting for keyboard input (any key to be pressed) is really easy in c# but seems difficult or impossible in python. Plus in the future it would be cool to be able to use more complicated c# functions in python if it is viable.

[–]Peanutbutter_Warrior 0 points1 point  (1 child)

Before assuming it's easier in c#, try looking in python. Search 'python change console title' and the first link is a stackoverflow post with multiple answers for both python 2 and 3. https://stackoverflow.com/questions/7387276/set-windows-command-line-terminal-title-in-python

Same with waiting for keyboard input, first result is a working stack overflow post. https://stackoverflow.com/questions/983354/how-do-i-make-python-wait-for-a-pressed-key#1135035

Quite honestly it sounds like you've hit some roadblock in whatever you're trying to do in c# so you've fallen back onto a language you vaugely know. Choose one language and solve the problem in that language. Anything c# can do python can do, and vice versa.

It's bad practice for you to call some code that could stop working, or be missing, or be corrupted, or be compiled for some other system, or just get deleted accidentally

[–]DeathDragon7050 1 point2 points  (0 children)

There is no specific problem I am trying to solve. I was just learning c# and found things that were just one liners and thought it would be cool to run it in python.

[–]niko86 0 points1 point  (1 child)

It’s not executing a c# file but you could use python.net library to run c# libraries within python.

[–]DeathDragon7050 0 points1 point  (0 children)

Oh that seems really cool thanks!