Git Product home page Git Product logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
example log:

Delphi 7
Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)]
>>> xy_pos(1)
>>> xy_pos(1)
TypeError: xy_pos() takes exactly 2 arguments (1 given)
>>> xy_pos('test')
>>> xy_pos('test')
TypeError: xy_pos() takes exactly 2 arguments (1 given)
>>> xy_pos('test', 3, 4)
>>> xy_pos('test', 3, 4)
TypeError: xy_pos() takes exactly 2 arguments (3 given)

Original comment by [email protected] on 19 Dec 2013 at 3:36

from python4delphi.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
If i call command with "print(xy_pos(.....))" then TypeError exists each call. 
If i call command w/o print: "r = xy_pos(.....)", then issue here.


Original comment by [email protected] on 19 Dec 2013 at 3:58

from python4delphi.

pyscripter avatar pyscripter commented on May 24, 2024

Try changing the function to the following.

function xy_pos(Self, Args: PPyObject): PPyObject; cdecl;
var
  X, Y, N: Integer;
begin
  with GetPythonEngine do
  begin
    if PyArg_ParseTuple(Args, 'ii:xy_pos', @X, @Y) <> 0 then
    begin
      N:= X + Y;
      Result:= PyInt_FromLong(N);
    end else
       Result := nil;
  end;
end;

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.