Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates .pyc files - but has no documentation to explain what they are or how to use them #72

Closed
2 tasks done
readnotify opened this issue Oct 31, 2021 · 3 comments
Closed
2 tasks done

Comments

@readnotify
Copy link

readnotify commented Oct 31, 2021

Checklist

  • I use the latest release of atbswp
  • The issue is not existing yet

Verbose log

n/a

Miscellaneous information

Operating System

Ubuntu LTS

Desktop Environment/Window Manager

default

Python version

default

Description

Records and plays back perfectly, and has an undocumented option "Compile to exe" - which writes-out a binary file with .pyc on the end of the name, however, this doesn't execute and there's no explanation for how we use it.

[cnd@uvm ~]$ chmod ugo+x clicky.pyc
[cnd@uvm ]$ ./clicky.pyc
./clicky.pyc: line 1: $'B\r\r': command not found
./clicky.pyc: line 2: $'\331p
a\203\a\343\005@s\026\003dd\001lZdd\001l\001Z\001d\002e_\002e\001\240\003d\003\241\001\001e\240\004d\004d\005\241\002\001e\240\004d\006d\a\241\002\001e\240\004d\bd': command not found
./clicky.pyc: line 3: unexpected EOF while looking for matching ``'
./clicky.pyc: line 7: syntax error: unexpected end of file

It also does not auto-play if I try this:-

[cnd@uvm ~]$ ./atbswpv0.3.0-linux clicky.pyc

Please...

a) Document what "Compile to exe" actually is/does
b) Make it work so that I can save something and then run a command to play it back :-)

( I assume (b) exists, but it's not documented on the project homepage... )

@readnotify
Copy link
Author

Also tried this:-

 [cnd@uvm ~]$ python3 clicky.pyc 
 RuntimeError: Bad magic number in .pyc file

@readnotify
Copy link
Author

I noticed this find nothing:-

grep -r sys.arg .

so it looks like this tool does not have any way to read commandline arguments?

I guess this is now a feature-request:-

Please allow us to run this code as follows:-

  ./atbswpv0.3.0-linux  saved_capture_file

and for the code to open, automatically play that capture, and then end and exit.

Think about this: right now, there's no way to automate the mouse, without using the mouse...

This simple extra addition allows us to script mouse things from the command line.

@RMPR
Copy link
Owner

RMPR commented Nov 1, 2021

a) Document what "Compile to exe" actually is/does
b) Make it work so that I can save something and then run a command to play it back :-)

( I assume (b) exists, but it's not documented on the project homepage... )

The .pyc is a python bytecode file, you can read more about that here. I am not against a PR to explain a bit what it is to people that might be confused. I just don't find it that much relevant to add to the project page as it's not something specific to atbswp, but to the whole Python ecosystem. I will probably never do that myself.

Also tried this:-

 [cnd@uvm ~]$ python3 clicky.pyc 
 RuntimeError: Bad magic number in .pyc file

This is actually interesting to me, can you try to decompile the file and post the content here?

uncompyle6 -o . your_filename.pyc

You might need to install uncompyle6 first

I noticed this find nothing:-

grep -r sys.arg .

so it looks like this tool does not have any way to read commandline arguments?

I guess this is now a feature-request:-

Please allow us to run this code as follows:-

  ./atbswpv0.3.0-linux  saved_capture_file

and for the code to open, automatically play that capture, and then end and exit.

Think about this: right now, there's no way to automate the mouse, without using the mouse...

This simple extra addition allows us to script mouse things from the command line.

Yes, it's a GUI-only program (for now). Playing a capture from atbswp seems like an useful addition for people that don't have Python installed on their OS. Feel free to open a new issue with that specific inquiry and I will certainly have a look when I have more time.

@RMPR RMPR closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants