Skip to content

Using with include_str! #4

@DerpyCrabs

Description

@DerpyCrabs

I'm trying to include file using include_str! macro:
#[shell(cmd = "python -c")] fn run_python(name: &str) -> Result<String, Box<std::error::Error>> { include_str("main.py") }
but getting an error on compilation:
--> src/main.rs:3:1 | 3 | #[shell(cmd = "python -c")] help: message: Invalid input. Expected fn containing only string literal without any other statements
Is it possible to use include_str! macro for this or can I include file through other means?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions