I want to access the text file in pyz

Asked 2 years ago, Updated 2 years ago, 38 views

python 3.x

I used the zipapp module to create a pyz archive file.
If pyz contains a text file, how do I access it?
In the case of Java, I think I can read the text in the jar file, but is Python impossible?

Example

test.pyz
|-- |-- main.py
`-- a.txt
  • I want to access a.txt from within main.py
  • If you put a.txt in the same directory as test.pyz, you can read it, but you want to put it in pyz

python python3

2022-09-30 10:44

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.