Git Product home page Git Product logo

Comments (8)

pyscripter avatar pyscripter commented on September 20, 2024

Python stores command line parameters in sys.argv (list object). You can manipulate sys.argv before running the file.

And PLEASE stop using the Issue Tracker for questions.

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

Issue Tracker is on Github and was created to ask questions, what is the problem?

from python4delphi.

pyscripter avatar pyscripter commented on September 20, 2024

was created to ask questions

No. The issue tracker is for reporting bugs. PLEASE don't use it to ask questions.

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

No. The issue tracker is for reporting bugs. PLEASE don't use it to ask questions.

Sorry, I don't have many questions, just a couple of questions.

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

It’s a little unclear how it goes like this ?:

function ExecPythonFile(const Filename:string;params:string):string;
var
FGILState: PyGILstate_STATE;
begin
Result := '';
FGILState := PythonEngine.PyGILState_Ensure;
try
PythonEngine.PySys_SetArgv(0, '-help');
PythonEngine.ExecFile(Filename);
finally
PythonEngine.PyGILState_Release(FGILState);
end;
end;

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

I'm getting errors for some reason

PythonEngine.PySys_SetArgv(0, PPWideChar('-in -o -m'));

Invalid typecast

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

Will this be right ?

function ExecPythonFile(const Filename:string;params:string):string;
var
args:PPWideChar;
FGILState: PyGILstate_STATE;
begin
Result := '';
args:=@params;
FGILState := PythonEngine.PyGILState_Ensure;
try
PythonEngine.PySys_SetArgv(0, args);
PythonEngine.ExecFile(Filename);
finally
PythonEngine.PyGILState_Release(FGILState);
end;
end;

ExecPythonFile(ExtractFilePath(ParamStr(0))+'pyscript\main.py, '-i -o -threads 10')

from python4delphi.

Uefi1 avatar Uefi1 commented on September 20, 2024

No, it doesn’t work, and if only the first parameter one works, the rest are ignored =(
I don’t quite understand how to do it

from python4delphi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.