Answer the question
In order to leave comments, you need to log in
How to count the byte code of a file?
I need to read the byte code of the file in order to move it
file1 = open(direct + "/eee.py", mode="rb")
file = file1.read()
file2 = open("C:/Users/"+file+"/"+"AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup", mode="wb")
file2.write(file)
Answer the question
In order to leave comments, you need to log in
What for?
To read the bytecode of a file, it must be copied.
python file example
[email protected]:~/project/test_nuitka# cat test_program.py
def test():
print('passed')
if __name__ == "__main__":
test()
[email protected]:~/project/test_nuitka# python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import py_compile
>>> import os
>>> os.listdir()
['include', 'share', 'test_program.py', 'lib64', 'bin', 'pyvenv.cfg', 'lib', 'ping.py']
>>> py_compile.compile('test_program.py')
'__pycache__/test_program.cpython-37.pyc'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question