New at Python, some trouble with examples

Kevin Forbes VK3KUF vk3ukf at westnet.com.au
Sat Apr 25 11:56:05 EDT 2009


"MRAB" <google at mrabarnett.plus.com> wrote in message 
news:mailman.4563.1240669629.11746.python-list at python.org...
> Kevin Forbes VK3KUF wrote:
>> Hello folks, my name is Kevin, HAM call vk3ukf, site www.vk3ukf.com
>>
>> I am brand new to Python and having the big learn at the moment.
>> Running Windows XP pro SP3 with Delphi 7 free version
>> I installed Python 2.6 and the 1.1.6 PIL to go with it
>> Now, because I am running the free version of Delphi 7.
>>
>> I had to remove the vcldb and maybe some other reference in 
>> PythonForDelphi installation files.
>> They were removed to allow me to fix the Delphi Python installation *.dpk 
>> files in the C:\Program
>>
>> Files\PythonForDelphi\Components directory, for Delphi to accept and 
>> compile them.
>>
>> Oh, and I had to rename the Python26.dll to Python25.dll for Delphi to 
>> operate. ???
>>
> [snip]
> The fact that you had to rename to Python25.dll suggests that Delphi is
> expecting Python 2.5. You might want to download Python 2.5 (actually
> Python 2.5.4) instead to see whether that works better.

Hello, thanks for your reply,

I have gotten Delphi to successfuly run some scripts,
but not one including import image.

e.g.

# Python Code Test File

FILENAME = PythonDelphiVar1.Value
BLIMEY = PythonDelphiVar2.Value

infile = ''
outfile = ''

class MakeJpgFromPgm:
  def __init__(MakeJpgFromPgm, FileName=''):
    MakeJpgFromPgm.FileName = FILENAME

  def RunReport(MakeJpgFromPgm):
    print 'FileName ' + MakeJpgFromPgm.FileName
    print  ' Yada Yada.'
    print  MakeJpgFromPgm.FileName
    print  'PD1 ' + PythonDelphiVar1.Value

class MakeJpgFromPgm2:
  def __init__(MakeJpgFromPgm2, ImageTest=''):
        MakeJpgFromPgm2.ImageTest = BLIMEY

        if PythonDelphiVar2.Value == 1:
            print  'PD2 ' + 'True'
        if PythonDelphiVar2.Value == 0:
            print  'PD2 ' + 'False'

# end py code

The above showed me that I could pass values from variables back and forth.


I'll try your suggestion MRAB, let you know what happens.






More information about the Python-list mailing list