The Dink Network

Reply to Re: New Dev File: Skeleton Gelatin

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
November 8th 2024, 06:49 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Python and environments has always been a bit of a murky subject for me.

I thought I had this sorted on this PC as Python 3.11 was the only one I installed, so unless windows 10 comes with Python pre-installed (like macOS which was not helpful for me when trying to comes to grips with having both python2 and python3 running at different times), I'm not sure what else I need to do. Certainly just going into IDLE via the command prompt and typing in import PIL comes up with the same error I was getting using the photohard.py command before I switched to photohard.exe

Actually I tell a lie, I just went into IDLE via the command prompt and import PIL didn't flag an error in IDLE

but even adding that line into the photohard.py at the start still generates the error

Here is the revised code at the start of photohard.py

# photohard - a thing for making hard.dat tiles in photoshop
import PIL
from PIL import Image
from sys import argv, exit
import dfile.harddat
from pathlib import Path
#import xdialog
import struct
import array


And the error message
Traceback (most recent call last):
File "C:\Users\Simon\AppData\Local\DinkSmallwoodHD\dmods\test\photohard.py", line 2, in
import PIL
ModuleNotFoundError: No module named 'PIL'

but if I use this

python photohard.py hard.dat ts03newHard.png 3

then I get this

........................................................................................................................................................................................................................
Wrote harddat.dat

so I assume that works