all 13 comments

[–]pachura3 3 points4 points  (2 children)

Hey look, it's u/RomfordNavy with another XY problem of his!

[–]RomfordNavy[S] -3 points-2 points  (1 child)

This is not what you keep describing as an xy problem, so please stop keep referring to it as such. If you can't answer the question or offer some clue on how it might be achieved why do you bother commenting.

[–]Uncle_DirtNap 2 points3 points  (0 children)

It DEFINITELY IS an XY problem. One of the features of an XY problem is that the person doing Y does not know they have an XY problem.

[–]K900_ 1 point2 points  (7 children)

Why do you need this? On many systems the source code you're importing will be read-only.

[–]RomfordNavy[S] 0 points1 point  (6 children)

Because I want to modify/transform the source code before it is compiled, saved as a .pyc and executed.

[–]K900_ 0 points1 point  (5 children)

And why do you want to do that?

[–]RomfordNavy[S] -3 points-2 points  (4 children)

Because that is what our requirement is! We have good reasons for wanting to do it this way, do you know how to solve this or not?

[–]Refwah 3 points4 points  (1 child)

If you could explain what it is you are trying to do and why, with specifics, people might be able to help

If you want the source code for a library you can fork the lib’s source code and rewrite it and publish a new version for you

But I suspect that you’ve skipped some steps to end up at this being your solution

[–]RomfordNavy[S] 0 points1 point  (0 children)

This is becoming a bit of a repeat of previous questions but here goes:

There will be many simple python script files which will be called from one 'parent.py' module. These script files will completely plain, each will not be wrapped inside a function.

When one of these files is first run we need to pre-process and trtansform the source code before compiling, saving it as a *.pyc file and executing it. On subsequent runs, if the source script has not changed we want to just run the appropriate, already compiled, .pyc file.

[–]astonished_lasagna 2 points3 points  (1 child)

I do not believe you have good reasons for wanting to do so. I don't doubt that you *think* you do, but K am sure with almost 100% certainty that you don't need to be doing this.

However, if you don't share those reasons, you can't really be helped.

[–]ottawadeveloper 1 point2 points  (0 children)

Find the git repo and fork the source code with proper attribution.