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

Extract_code can detect single-line code. #1222

Closed
wants to merge 1 commit into from
Closed

Conversation

BeibinLi
Copy link
Collaborator

A parameter is added. Default to False.
When True, it will also detect single-line code.

For instance,
data = """

hello, how are you.

You can run python main.py

Or, you can write

1 + 1 == 2
print(3)
Formated stuff here
and there

Otherwise, do source download.sh for it.

I would also want to extract variable x.

Is that ok?
"""

extract_code(data, detect_single_line_code=True)

We will get

[('UNKNOWN', 'python main.py'),
 ('python', '1 + 1 == 2\nprint(3)'),
 ('UNKNOWN', 'Formated stuff here\nand there'),
 ('UNKNOWN', 'source download.sh'),
 ('UNKNOWN', 'x')]

Why are these changes needed?

Related issue number

Checks

A parameter is added. Default to False.
When True, it will also detect single-line code.
@BeibinLi
Copy link
Collaborator Author

Move to the autogen

@BeibinLi BeibinLi closed this Sep 19, 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

Successfully merging this pull request may close these issues.

None yet

1 participant