Skip to content

Commit 05a90df

Browse files
committed
Merging with master branch
2 parents c1f1051 + dd4cfb5 commit 05a90df

6 files changed

Lines changed: 20 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ __recovery/
5858
/Modules/DelphiFMX/dcu
5959
/Modules/DelphiVCL/dcu
6060
Release/
61+
*.a
3.13 KB
Binary file not shown.

Source/VarPyth.pas

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
interface
4141

4242
uses
43-
Variants, PythonEngine;
43+
Variants, PythonEngine, Classes;
4444

4545
type
4646
TSequenceType = (stTuple, stList);
@@ -135,10 +135,12 @@ TVarPyEnumerateHelper = record
135135

136136
function VarPyIterate(const AValue: Variant): TVarPyEnumerateHelper;
137137

138+
function VarPyToStrings(const AValue : Variant; const AStrings: TStrings): Integer;
139+
138140
implementation
139141

140142
uses
141-
VarUtils, SysUtils, TypInfo, Classes;
143+
VarUtils, SysUtils, TypInfo;
142144

143145
type
144146
TNamedParamDesc = record
@@ -289,6 +291,7 @@ TPythonData = class(TObject)
289291
SCantConvertValueToPythonObject = 'Can''t convert Value into a Python object';
290292
SCantCreateNewSequenceObject = 'Can''t create a new sequence object';
291293
SExpectedPythonVariant = 'Expected a Python variant';
294+
SExpectedPythonList = 'Expected a Python List: ';
292295

293296
{ Python variant creation utils }
294297

@@ -2816,6 +2819,17 @@ function TVarPyEnumerateHelper.GetEnumerator: TVarPyEnumerator;
28162819
Result := TVarPyEnumerator.Create(FIterable);
28172820
end;
28182821

2822+
function VarPyToStrings(const AValue : Variant; const AStrings: TStrings): Integer;
2823+
begin
2824+
Assert(Assigned(AStrings));
2825+
if VarIsPythonList(AValue) then
2826+
GetPythonEngine.PyListToStrings(
2827+
ExtractPythonObjectFrom(AValue), AStrings)
2828+
else
2829+
raise Exception.Create(SExpectedPythonList + _type(AValue));
2830+
Result := AStrings.Count;
2831+
end;
2832+
28192833
initialization
28202834
PythonVariantType := TPythonVariantType.Create;
28212835

683 KB
Binary file not shown.

Tutorials/Webinar I/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
- [Video replay](https://youtu.be/aCz5h96ObUM)
99

10-
- [Slides](https://www.slideshare.net/embarcaderotechnet/python-for-delphi-developers-part-1-introduction)
10+
- [Slides](Python4Delphi(Part1).pdf)
1111

12-
- Source code included in this folder
12+
- Source code included in this folder

Tutorials/Webinar II/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
- [Video replay](https://blogs.embarcadero.com/combining-the-strengths-of-delphi-and-python/)
99

10-
- [Slides]()
10+
- [Slides](Python%20for%20Delphi%20Developers%20II.pdf)
1111

1212
- Source code is included in this folder. [Demo33](https://github.com/pyscripter/python4delphi/tree/master/Demos/Demo33) is in the Demos directory and the python extension [module demos](https://github.com/pyscripter/python4delphi/tree/master/Modules/DemoModule) are in the Modules directory.
1313

0 commit comments

Comments
 (0)