This question already has answers here:
How to obfuscate Python code effectively? [duplicate]
(22 answers)
Closed 3 years ago.
I have a script in .py format and random forest in pickle format and i should deliver it to a customer . He should not be able to read both.
If you really have to hide the code **, I recommend you to use an obfuscator
An example: https://wiki.python.org/moin/Pyarmor
PS: you have a similar question here: How to obfuscate Python code effectively?
Also, this is something I never did or explored, but through PYC-only distribution could be an alternative, but you must explore this by yourself.
Find out more at https://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-of-pyc-only.html
*** I know obfuscating code is not nice, but sometimes companies require it :/
Related
This question already has answers here:
What does "three dots" in Python mean when indexing what looks like a number?
(3 answers)
What does the Ellipsis object do?
(14 answers)
Closed 2 years ago.
So I have created a suffix tree using python and when I was printing my suffix tree, I came across one list that contains [...] at one of its indexes. I searched online and couldn't find anything regarding it. It would be really great if someone could explain to me that what does [...] mean in python. By the way, I'm using PyCharm IDE, not sure if it's an IDE specific issue. Cheers!
This question already has answers here:
Is there a label/goto in Python?
(22 answers)
Closed 9 years ago.
I want my program to go to a certain line in the program which is running when it I needed to and run from there. Is this possible and if so How can this be done?
Put whatever lines you want to be done in a function, then put the function call where you want. Goto is bad form in any language, and it doesn't exist in Python.
If you think your code is too short to warrant a full function, you can use a lambda function (but those can be tricky).
This question already has answers here:
Why avoid while loops?
(13 answers)
Closed 9 years ago.
One of my teachers warned me not to use while in python. It is really strange for me as I have not found any articles on why to do so. What do you think on what could the grounds be?
Use the control statement that best suits your needs in each situation.
An advice like "Don't use while, only use for" boils down to "If the only tool you know is a hammer, all problems look like a nail."
This question already has answers here:
How do I watch a file for changes?
(28 answers)
Closed 2 years ago.
I need to know in python whenever a new file was added/removed/modified in a particular directory
Is there a way for that?
I'm looking for an "inofity"-like function (from POSIX).
Thanks
You can use inotify for python, which is NOT the same as PyInotify (older).
As mentioned in the similar question, you might want to have a look at http://packages.python.org/watchdog/ which also works on Windows.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Is there a good Python library that can parse C++?
I want Python to scan through a file (a .cpp file) and generate tokens from it using the in-built Python tokeniser.How can this be achieved?
The built-in tokenizer and ast stuff is for parsing Python, not other languages like C++.
You may want to look at GCC-XML.