Haxe provides a simple resource embedding system that can be used for embedding files directly into the compiled application.
The docs on resources suggest that they are always embedded, even if concrete implementation details vary a bit (several targets, including Python, are actually missing here btw). But the end result is always that you only have a single file to worry about.
On Python, something like this instead causes the resource to simply be copied to a main.py.test file next to the .py:
-python main.py
-resource test.txt@test
Is there a good reason for this? Wouldn't it make more sense to follow the same approach as the JS and Lua targets, where resources are embedded via static fields?
Sidenote: on PHP, resources don't seem to be embedded either, but that seems less problematic since that's already not generated as a self-contained file anyway.
The docs on resources suggest that they are always embedded, even if concrete implementation details vary a bit (several targets, including Python, are actually missing here btw). But the end result is always that you only have a single file to worry about.
On Python, something like this instead causes the resource to simply be copied to a
main.py.testfile next to the.py:Is there a good reason for this? Wouldn't it make more sense to follow the same approach as the JS and Lua targets, where resources are embedded via static fields?
Sidenote: on PHP, resources don't seem to be embedded either, but that seems less problematic since that's already not generated as a self-contained file anyway.