Author Topic: Running python itself  (Read 11940 times)

0 Members and 1 Guest are viewing this topic.

David Dyer-Bennet

  • Member
  • **
  • Posts: 21
    • View Profile
Running python itself
« on: 2014-11-01 17:14:48 »
Thumbs Plus seems to contain a full Python installation, with extra TP goodness packaged in;  on my Windows 7 system I have C:\Program Files (x86)\ThumbsPlus9\Python, and in that file python.exe and pythonw.exe and the LICENSE.txt, NEWS.txt, and README.txt files that I believe a normal Python install has.  Plus the subdirectories with various things in them.

But, when I run (locally, or via PATH) python.exe from there, I get "The program can't start because python27.dll is missing from your computer."  And, looking through those directories, there is in fact no python27.dll. (What I tried precisely is, from  a Windows command window, "python.exe --version".  It clearly found python.exe, but couldn't go much beyond that.)  

I do see C:\Program Files (x86)\ThumbsPlus9\Python\libs\python27.lib and also libpython27.a, which suggests that maybe the Python in Thumbs Plus is statically linked rather than built as a DLL, which seems weird off the top of my head but I've never done a Python embedding so I don't know what the issues are.  So, in that case, the appearance of having a Python distribution present isn't real, maybe?  (And those exe files that look so tempting but can't work under that theory shouldn't be there, then; save space in the installer and on my system, avoid a source of confusion, etc.)

I can of course install another Python installation and do my initial testing on that (I was hoping to use the TP one to avoid having possibly different versions for when I ran something within TP and when I ran standalone).  And soon I'll probably (I hope) be tied into TP internals and thus unable to run my scripts anywhere else.  This may not make much difference.

But at the moment it looks weird, like an anomaly, and I hate leaving anomalies I don't understand behind me as I dive into things; too often they prove I really don't understand them by biting me in the ass later.  

I don't imagine anybody but some of the actual developers can actually *answer* this, and it's probably not important to that many people anyway.  But just in case, and to document what I'm doing, I'm posting it.

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Running python itself
« Reply #1 on: 2014-11-03 14:37:54 »
I do have python27.dll in c:\Programme\ThumbsPlus9\Bin\

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Running python itself
« Reply #2 on: 2014-11-03 14:43:02 »
I can run the TP Python as a stand alone when changing to c:\Programme\ThumbsPlus9\Bin\ and then typing ..\Python\Python

I did not try to set the dll search path accordingly, but I am sure that this will work as well.

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Running python itself
« Reply #3 on: 2014-11-03 14:46:53 »
I have a 800 K size libpython27.a and a 200 K libpython27.lib file in c:\Programme\ThumbsPlus9\Python\libs\

This suggests that TP in fact uses statical linking for its Python "scripts".

-Michael

David Dyer-Bennet

  • Member
  • **
  • Posts: 21
    • View Profile
Running python itself
« Reply #4 on: 2014-11-03 15:03:25 »
Yep, quite right.  One step higher up the tree than I ran my search from :-(.  I greatly appreciate your help, perhaps especially when it consists of pointing out where I've screwed up.

So, that strongly suggests the Python distribution is complete and workable after all, which is more elegant.  I share your intuition that with the right setup of various environment variables the Python distribution will work just fine.

(While I'm typing, I'll say I've finished my quick review of Python; there'll be lots to learn in practice, but I've at least seen the bones of the rules.  I haven't programmed in Python beyond minor play before, but I've programmed Perl and Bash pretty seriously and all sorts of compiled languages over 45 years, so I'm not really worried about "one more" language.)

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Running python itself
« Reply #5 on: 2014-11-04 14:42:02 »
>> I haven't programmed in Python beyond minor play before, but I've programmed Perl and Bash pretty seriously and all sorts of compiled languages over 45 years, so I'm not really worried about "one more" language.

Same here (No Perl, really quite a lot of languages :) :)  )

-Michael