Home > database >  Is there a way to start the python intrepeter so i can python print('hello world') without
Is there a way to start the python intrepeter so i can python print('hello world') without

Time:11-01

Because i would like to execute python scripts from my package.json like so

{
    "scripts": {
        "p": "python exec(compile(unhexlify(hex).decode(), '', 'exec'))"
    }
}

Is there any argument we can give to python to make this possible?

CodePudding user response:

You can use -c argument:

$ python3 -c 'print("hello world")'
hello world
  • Related