I do not quite understand what you try to achieve.
Let's say that you manage to do what you want to do, what are you going to do with it? For your sketch to do something useful with it (e.g. if (a==1) ), the compiler needs to know about it.
If you want to store values in a file and assign them to a variable in your compiled sketch, then the answer is that it is possible.
wrybread:
For example, suppose I have a file with the contents:
int a = 1;
int b = 2;
Can I load those variables directly into my script
No, at least not like that.
Remember that C/C++ is a compiled language. Each code line in your sketch is translated into low-level machine code before the sketch is uploaded to the "Arduino" (in this case an Arduino-compatible ESP32 board). The Arduino has no C compiler of its own, it relies on the PC to do that before the upload. So you can't put lines of C code into a file, to be read by the Arduino and compiled, it can't do that.
But what you could do is put into your file:
1
2
and then your sketch can open that file and read the first line into variable a and the second line into variable b.