-
Content Count
1005 -
Joined
-
Last visited
-
Days Won
65
Everything posted by pyscripter
-
Android is not supported yet.
-
installing/Executing Python4Delphi App on MacOs (Lazarus) (could not map symbol "Py_DebugFlag")
pyscripter replied to matrix1233's topic in Python4Delphi
In that case what happens of you comment out the importing of all flags? -
installing/Executing Python4Delphi App on MacOs (Lazarus) (could not map symbol "Py_DebugFlag")
pyscripter replied to matrix1233's topic in Python4Delphi
Strange. Py_DebugFlag should be exported on all platforms. Please uncomment the line with the Import - Import(Py_DebugFlag). Does it work then? -
installing/Executing Python4Delphi App on MacOs (Lazarus) (could not map symbol "Py_DebugFlag")
pyscripter replied to matrix1233's topic in Python4Delphi
Are you sure you are using the latest version from pyscripter/python4delphi: Free components that wrap up Python into Delphi and Lazarus (FPC) (github.com)? -
The fpc support for custom variants is incomplete. See the fpc section at SupportedPlatforms · pyscripter/python4delphi Wiki (github.com). Does it work if you store MainModule.screenshot() to a variable and then call ExtractPythonObjectFrom like in the previous example?
-
IconFontsImageList is an Image list. Font Awesome and Segoe MDL2 Assets font are both image fonts. They contain images that scale nicely. Anyway... Happy holidays to everyone!
-
Fonts scale quite nicely. Font Awesome for example and the like are used in high DPI apps. Microsoft suggests the use of Segoe MDL2 Assets font for UWP applications (supports layering, colorization and mirroring).
-
I am new to MacOS developement. I have added an new Connection Profile which test successfully, the PAServer is running, XCode has the command line tools, When I try to add a new SDK nothing happens. What am I missing? Any help?
-
Maybe because they are scalable? Scalable Vector Graphics (SVG)
-
It depends on who is responsible for the destruction of this object. If you call Py_XDecRef then when the last reference in the python code is deleted python the destructor of the object will be called.
-
git and Delphi tooling?
pyscripter replied to Lars Fosdal's topic in Project Planning and -Management
Windows XP leak confirmed after user compiles the leaked code into a working OS | ZDNet -
git and Delphi tooling?
pyscripter replied to Lars Fosdal's topic in Project Planning and -Management
Why should I be offended . All my code is open source anyway. -
git and Delphi tooling?
pyscripter replied to Lars Fosdal's topic in Project Planning and -Management
The emphasis was on more. I trust more... -
git and Delphi tooling?
pyscripter replied to Lars Fosdal's topic in Project Planning and -Management
The value of stealing commercial code is overstated. The whole Windows code base has been leaked if I remember well. Any employee can steal the source code. And I must say I trust Github abilities to protect the source code (and Google and Amazon) more than those of the IT departments of most companies. -
git and Delphi tooling?
pyscripter replied to Lars Fosdal's topic in Project Planning and -Management
TortoiseGit here as well. Happy user. -
There are many ways to expose Delphi objects to Python but by far the easiest is to use WrapDelphi. Please have a look at the WrapDelphi unit tests and Demo 31.
-
Running complicated python code from existing TThread hangs
pyscripter replied to DaveLaneCA's topic in Python4Delphi
Have you studied demo33 and used TPythonThread? -
You can only load one pythonxy.dll in the Delphi process, hence you can only have one PythonEngine in an application. Look at Demo33 on how to use threads and/or multiple sub-interpreters without blocking the main thread. But also note that you cannot bypass the python famous GIL (Global Interpreter Lock), so that only one python thread can be executing at the same time. Under Tutorials/Webinar II look at PyVizSVG.dproj on how to generate svg files in python scripts and how to display them in Delphi, The only way to really use multiple cores to generate the graphs is to use external processes. (there is the mutliprocessing unit in python, but it would be easier just to start multiple python processes from Delphi).
-
The mechanism that Delphi uses to dispatch such calls does not support it. You need some consistency. Either you use the low-level Python interface and PPyObjects or VarPyth and custom variants. Although you can easily convert PPyObjects to Variants and back (VarPythonCreate, ExtractPythonObjectFrom), sticking to one of the two simplifies life.
-
vars is a builtin function. You can use BuiltinModule.vars to access it using VarPyth If you are on Delphi 10.3 or later you can write something like for V in BuiltinModule.vars(anObject) do begin anAttr := BuiltInModule.getattr(anObject, V) Writeln(V, anAttr.__class__) end; assuming anObject is a Custom Variant pointing to the python object. (out of memory and not tested)
-
I guess everyone knows this already, but I did find this Stackoverflow answer surprising. Can you guess what is the message shown? function DoSomething(SomeBoolean: Boolean) : string; begin if SomeBoolean then Result := 'abc' end; procedure TForm1.Button1Click(Sender: TObject); var xx: string; begin xx := DoSomething(True); xx := DoSomething(False); ShowMessage(xx); end; Shouldn't the above deserve a compiler warning?
-
Have you read https://github.com/pyscripter/python4delphi/wiki/MaskFPUExceptions? There is no need to activate the Anaconda environment. Just read and follow https://github.com/pyscripter/python4delphi/wiki/FindingPython. If you want to work with a specific Conda environment (not the main installation) then you need to specify it as the DLLPATH.
-
Named pipe failure, multithreading and asynchronous I/O
pyscripter replied to FPiette's topic in Windows API
This is an old thread. However I have a question regarding Russell Libby's unit. Has anybody used/tested TPipeConsole? TPipeConsole uses standard pipes (OpenStdPipes calls CreatePipe), but then uses PeekNamedPipe on theses pipes in ProcessPipe. According to the documentation this is a blocking operation when used with anonymous pipes and the whole thing falls apart. Question: is this the case - does PeekNamedPipe blocks with anonymous pipes or this is only an issue when multiple threads try to access the same pipe? See also https://devblogs.microsoft.com/oldnewthing/20110707-00/?p=10223 by Raymond Chen -
DelphiVCL: Fantastic! But there are some issues
pyscripter replied to Reinier Sterkenburg's topic in Python4Delphi
Wrapping third party components is no different to wrapping VCL controls. Consider all the WrapDelphiXYZ units as demos on how to do that. - Please note that with EnhancedRTTI, the only thing that needs wrapping is events other than simple TNotifyEvent. So the wrapping code would be minimal. - There is no special wrapping needed for DataModules (TComponent descendent). Access to the Screen.DataModules property is already wrapped. - Data Access wrapping is provided by the WrapFireDAC unit - Demo 31 has extensive coverage of Forms (creation, subclassing etc.)