The compressed image format files disguised files and convert files to python exe file (test done, really effective)

hello, partners, but also did not update the blog one week, bring something different to share today


1. Other file formats into other styles of camouflage files,

  We in certain scenarios, for example, needs to be some kind of compressed file disguised as a picture, you need to do is make it into the picture style camouflage

  We need to prepare for that, a picture, a file compression

 

The next step is to package it camouflage, specific command in the directory path, enter the command copy / b a.jpg b.zip my.jpg ( converted to other formats as long as its file name and extension modification on the line ) and then back to car, you will find a my.jpg generated file, click open file will find the appearance like a.jpg, if not use cmd command line is not the problem, the above command can be saved in a new txt documentation (such as the name of their casual defined xxx.txt), as well as with archive pictures in the same directory, modify the suffix xxx.bat, determined to save, double-click the bat file, and execute commands effect is the same, If you choose to open with WinRaR, will find the original file. that Qt applications

2. Package python files into one exe executable file

  The scene is in need, we are here to ask a python script file execution, people need to run on other machines, but in fact the environment on the other machine may not be the same with our machine environment, installed environment very much trouble, this we need to give each other a exe file, so you can easily complete the task, 

  Specific practices are as follows: 1. The first is the need to write a python script that is you need to prepare a .py file, 2. The next step is to install pyinstaller in command interpreter that is  pip install pyinstaller 

3. The next step is to write a python files in a directory, then that is in the same directory Place a ico file, as an icon of exe file, the last execution was in cmd terminal  pyinstaller -i xxx.ico - xxx.py --noconsole F ( front xxx refers to the name of the file icon ico, - noconsole role is to occur when you open the exe file to remove the black box ) will find more than a few files in the file directory to put the folder.

 

Xxx.exe executable file in the dist folder inside, directly run the exe file will take effect, so far python script to get into exe file. 4. package it sent to the other party can Shuangwai executed, and if the need to rely on external file, place it in the same directory as the past can be sent packing.

Guess you like

Origin www.cnblogs.com/f-g-f/p/11409542.html