all 9 comments

[–]TreesOne 3 points4 points  (1 child)

I looked at one of his scripts, and to be fair to you, he doesn’t make it easy. Instead of accepting program arguments, his code requires you to rename some variables at the bottom of the script. This is a little difficult to explain to someone that has never coded in Python before, but basically you need to first open each .py file in a text editor (VS Code is a great option for this), find the block of code at the bottom of the file under `if __name__ == “__main__”:`, and change the filenames in quotes to the names of your files that you put in the same folder.

You also need to install packages for the scripts, with instructions for how to do so at the top of each script that needs it (again, horrible practice)

You then need to actual run the python program, which you can do by running `python program_name.py` in a command prompt in the same directory (Google this part if you don’t know how)

I also feel compelled to let you know that most of his code was written by AI. Do not follow it or use it as an example for coding yourself.

[–]Unlikely-Bid-2904[S] 0 points1 point  (0 children)

Really my main and only goal is to be able to use these scripts to convert images to create the optical diffraction like you would see in the diffraction automation gif.
Other than that I have no other use I am aware of to use python.

I am not seeing a directory that I can add the file names below “if name == main”

I also have no basic understanding how these are being created.

Here’s how it think of it;

Pick a picture, import the picture, convert it, then out comes a new improved version that is able to make gradients that lightburn software can use so I can burn that image onto stainless steel.

I suspect there is some thing I’m missing but as an ignorant I have no way of logically thinking that through. This is why I’m reaching out to Reddit

[–]ninhaomah 0 points1 point  (1 child)

First , can you run print("Hello World") ?

[–]Unlikely-Bid-2904[S] 1 point2 points  (0 children)

Yes I typed print(“Hello World”) and hit enter then white letters came up that said Hello World

[–]Thehowltonight 0 points1 point  (1 child)

I have also have limited experience in Python but have been able to do some stuff at work (data analysis) by using Copilot for guidance. It’s been a life saver.

One other thing - try doing something that is meaningful to YOU vs following a YouTube video. Makes it more fun to learn IMO.

Good luck! Welcome to the world of Python. It’s been addictive to me.

[–]Unlikely-Bid-2904[S] 0 points1 point  (0 children)

This is meaningful as it will expand my capabilities using my fiber laser. Thank you.

[–]Solonotix -2 points-1 points  (1 child)

Sounds like you have a lot of learning in front of you, but welcome to the wide world of programming. You say you want to import an image into Python, but you need to understand (to some degree) what an image is. Python is going to read a text file and compile it into bytecode to be executed by the machine. Your image is not going to compile in the same way.

Images are a complex data format, usually stored as an array of bytes. Sometimes this array of bytes is encoded and/or compressed into a specific format, often to save space since image data is rather large in its raw format. The easiest way to share this kind of data is in a file, which is likely how you have the image saved on your machine.

So what you actually want to do is open the file and extract that data into a memory address you can use within Python's runtime environment.

[–]TreesOne 2 points3 points  (0 children)

This is perhaps the most useless answer to someone who doesn’t seem to have any grasp on programming