0

Py to Exe

Hello, I recreated the snake game in python and I would like to convert it to .exe without having a problem with Onedrive because when I convert it, Onedrive blocks my access telling me that there is a suspicion of a virus. Can you help me ?

28th May 2024, 6:34 PM
gregoire kniefeld lointier
6 Answers
+ 3
About the tags: This is not about type conversion, despite the name. I know you’re trying to “convert” a Python script to a binary executable per se, but “type conversion” specifically has to do with changing the data type of a variable in a program, not converting files. I do appreciate though that you tried to tag the question appropriately, even if you misunderstood what the term meant. As for the question, you didn’t mention what you’re using to pack the Python file into an exe (which you should), but I suspect it’s PyInstaller. Am I right?
28th May 2024, 6:55 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 3
you can pack it with pyinstaller. Keep in mind when you packing anything inside a executable, antivirus and similar protection services cannot always unpack and analyze it, so they cannot know if is a malicious code or not. Packing is very common on malware, so whatever suspicious automatically means threat. Usually they detected specific patterns, that pyinstaller for example use in every packed executable. I don't think is good idea tell you how to bypass antivirus checks, but i can suggest you to try to use a not so popular python packer. May onedrive not have yet its pattern in their blacklist, so it will not detect it as packer and will not flag it as malicious
29th May 2024, 12:28 AM
john ds
john ds - avatar
+ 1
gregoire kniefeld lointier Same. As john ds mentioned, packed executables aka transparent archive executables generally raise a few hermistic eyebrows. Throw any PyInstaller packed exe into VirusTotal, and about 5 services will flag it. Thankfully, the most popular of them (Malwarebytes) has been usually very quick to whitelist the hashes of my apps when I reported a false positive. However, every new PyInstaller exe will be considered suspect unless they make a patch, and honestly that’s not unreasonable. As for distributing, If you are okay with open-sourcing the project, I might suggest that instead of OneDrive, you push the project to a GitHub repository and publish the bundled EXE as a release. As a simpler option, you might just try to get your friends to install Python, or use a different storage service, or a zip archive, but with the latter two your friends might get suspicious too.
29th May 2024, 6:29 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
29th May 2024, 4:55 AM
gregoire kniefeld lointier
0
john ds I'm just looking to make sure that my python code can be published in .exe to please my friends
29th May 2024, 4:57 AM
gregoire kniefeld lointier
0
If you are able to create the exe file on your local filesystem, and the problem only occurs when you try to share it on Onedrive, you may consider compressing the exe with 7zip or rar, I think those formats are not considered harmful because they are not so transparent to the operating system.
29th May 2024, 6:39 AM
Tibor Santa
Tibor Santa - avatar