[Python] How to save/reload regions using a file
****** solution with Python marshal
See comment #7
-------
Hello I'm running into something I can't figure out. This might be a python question than sikuli but since sikuli functions is involve I should ask here. I trying to write several region to a file called region.txt
3 Region Variables:
r1=Region(
r2=Region(
r3=Region(
#Save Function call by swing button
def save(event):
filename=
regionfile=
regionfile.
regionfile.
regionfile.
regionfile.close()
I open the file and it produce these:
r1=Region[252,120 150x25]@Screen(0) E:Y, T:3.0
r2=Region[252,140 150x25]@Screen(0) E:Y, T:3.0
r3=Region[252,160 150x25]@Screen(0) E:Y, T:3.0
instead of these:
r1=Region(
r2=Region(
r3=Region(
I tried using pickle dump but it cannot coarse to int and obviously converting it to strings won't work either. Any suggestion? My only other option might have to create a separate function to open the file and delete or change those unwanted extra characters. I do need to read from this file too just fyi
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by SkaiCloud
Can you help with this problem?
Provide an answer of your own, or ask SkaiCloud for more information if necessary.