All the database drivers (cx_Oracle, PHP OCI8, Node.js node-oracledb) execute single SQL or PL/SQL statements. They don't reimplement SQL*Plus.
You need to find a way to extract the statements from the file and execute them individually (and without trailing semi-colons or slashes). Because SQL*Plus scripts can handle 3 kinds of statements (SQL*Plus, SQL and PL/SQL) with three different line terminators (end-of-line, semi-colon and slash respectively) you may want to revisit your processes to make it easier to work in cx_Oralce.
What are the constraints around what you are trying to do - where does the file come from?
Thanks for your reply. I just like to run a SQL file which has a single statement. And I need to pass a parameter. How I can do it? Thanks.
How have you defined 1.sql?
How is the substitution variable in 1.sql defined?
You should print out the sql that is being generated and make sure it is syntactically correct.