Links,
Scripting Language
SUMMARY: The origin of the term was similar to its meaning in "a movie script tells actors what to do": a scripting language controlled the operation of a normally-interactive program, giving it a sequence of work to do all in one batch. Scripting language
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
if (ComputerStamina < 15) {
while (ComputerStamina < 35) {
ComputerStamina++; }
}
Maybe I am missing the point, but why would anyone want to do this? It's just this, only much slower:
if (ComputerStamina < 15)
ComputerStamina = 35;
And what are you trying to do? Write Python in C++, then run your original C++ program through your scripting program so it reduces the number of if statements?
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
Write a simply script in a file, say, script.py. Then compile the script.py to script.txt
I know nothing about Python, but I think normally you don't "compile" a Python script; you just run it. And if you were to compile something, it seems like it would end up as an executable file, not a data file. Do you mean you want to execute a Python script and have that create a text file full of words (not executable code)? and make the C++ program read the script.txt file for the data.
Lots of ways to do this.Write a simple script in script.py and make the C++ program read the script.py for data.
So you want to write a Python interpreter in C++? Why not stick with the actual real Python interpreter? I'm not entirely sure I'm following 100%.And yup, it's just to keep the main program code a lot cleaner. Not only the if statements, all of it. I want just the main functions, etc, to stick in the C++, but all the main process to be in the .py file for example.
I think I'd have to see it. The project seems quite elaborate. Unless this is just all for fun, I think I would pick either C++ or Python and stick with it. If I wanted to clean up the C++ code or the Python code, I'd use a text editor or an IDE.
Best of luck on this. It sounds kind of interesting, though I still can't picture it.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
You could put all your non-inline functions in another source file instead of a header file.
That would make sure they aren't defined multiple times when your project grows.
Tigran
Junior Poster in Training
92 posts since Jun 2008
Reputation Points: 24
Solved Threads: 8