0

I would like a python file (something like this: https://stackoverflow.com/a/36946412)

BUT:
Only create a .PYD file, and not a .C file or a BUILD directory

Reason:
Want to close source my program.
I have already done that (use my self made hex obfuscator (so people cant see the source code with a hex editor), and use cython) (Not perfect but makes it hard enough so that its not worth it)
But currently I'm making a program that makes other program (keep in mind: the "program builder" will get distributed, so I can't just not distribute the other files)
I have already done most of it
But right now all I need is a setup.py file which generates .PYD file, and not the other stuff

Also:
I don't want to prohibit cython from creating the c files, I just don't want them to be accessible to the user (so as an example, keeping them in your memory but not putting the files on the disk or only putting those files in a dir which is not accessible to the user (and every time you use the program it will remove the user rights to that folder))

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
RandomGuy
  • 11
  • 1
  • 2
    You cannot avoid creating a .c file or a build folder. Those are necessarily intermediate steps. You don't have to distribute those though – DavidW Sep 25 '21 at 16:49
  • 1
    @DavidW as i said in the post, i am creating a program that creates programs So i dont have a choice if i want to distribute them or not (as i am distributing the program builder which peaple will run on their pc) – RandomGuy Sep 25 '21 at 16:53
  • I see. Then unfortunately Cython cannot do what you want (because it is a Python->C converter, so it has to output C files) and you should find a different tool. – DavidW Sep 25 '21 at 16:56
  • 1
    @DavidW Thanks for youre help but what i probably should have said in the post, I dont want to prohibit cython from creating the c files, i just dont want them to be assesible to the user (so as an accample, keeping them in youre memory but not putting the files on the disk or only putting those files in a dir wich is not accessable to the user (and everytime u use the program it will remove the user rights to that folder)). Just edited the question – RandomGuy Sep 25 '21 at 16:59
  • 2
    I don't think there's a very good way of doing what you want but you might be able to write to a temporary directory that you delete when you're done. It won't stop anyone determined though. (And I don't personally know how you do that) – DavidW Sep 25 '21 at 17:09
  • I don't think what you want to do is possible with the given requirements. Cython works by generating C files for the compiler, there seems to be no direct mode transfer mode (e.g. via ``stdin``). So if your program is run as a certain user, that user must by definition have access to the files. – MisterMiyagi Sep 25 '21 at 18:40

0 Answers0