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

[Bug] Copy pasting generated Python code #1881

Open
Devansh-awat opened this issue Oct 15, 2024 · 1 comment
Open

[Bug] Copy pasting generated Python code #1881

Devansh-awat opened this issue Oct 15, 2024 · 1 comment
Labels
software: pybricks-blocks Issues with blocks and code generation software: pybricks-code Issues with https://code.pybricks.com application

Comments

@Devansh-awat
Copy link

Describe the bug
Python files turning into block files

To reproduce

  1. Copy a Python code from the read-only editor in blocks programming
  2. Create a new Python project and paste the code
  3. Go to another file
  4. Come back to the new file
  5. The file will now be a block file

Expected behaviour
The Python file should have stayed a Python file

Video recording

Screen.Recording.2024-10-15.at.9.46.03.PM.mov
@Devansh-awat Devansh-awat added the triage Issues that have not been triaged yet label Oct 15, 2024
@laurensvalk
Copy link
Member

Thanks for reporting.

Block programs are Python files with the block representation stored as a comment on the first line.

When you copied the code, it also copied that first line. This isn't visible in your video, but you will see it if you scroll to the first line after pasting it in a new file. You can delete that first line to work around it.

@laurensvalk laurensvalk changed the title [Bug] [Bug] Copy pasting generated Python code Oct 15, 2024
@laurensvalk laurensvalk added software: pybricks-code Issues with https://code.pybricks.com application software: pybricks-blocks Issues with blocks and code generation and removed triage Issues that have not been triaged yet labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software: pybricks-blocks Issues with blocks and code generation software: pybricks-code Issues with https://code.pybricks.com application
Projects
None yet
Development

No branches or pull requests

2 participants