Question about Python

Started by mowens, September 11, 2025, 01:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mowens

The language, not the snake.

I'm in a slow period right now. I have a couple programs I wrote in vbscript. One creates a .xml that manages all of the programs that go into a single panel and the other one calculates the weight of a single panel.

During the slow period, just for shits and giggles, I am using AI to translate this code into python. The trouble is, I don't know how to execute the file. If you double click on a .vbs file it executes the file. If i do that on  a python file it just opens the file for editing.

Any advice, or is this a stupid idea to begin with?

When I wrote the original scripts, I used .vbs because I knew I didn't need a compiler. I was just trying to get around a really cludgy, pain in the ass piece of software. I didn't know anything about.vbs so most everything came from cut and paste from google.
"I would gladly risk feeling bad at times if it also meant that I could taste my dessert." - Data

riverhunter

#1
Download python.  run from inside it!  think of it as a 3rd party software like vericut.  you load you code inside then run in the shell mode.

mowens

I may be out of luck there. I don't have admin privileges.
"I would gladly risk feeling bad at times if it also meant that I could taste my dessert." - Data

YoDoug

We have a five foot long Red Tail Boa at home. It's mean. I have to put on big welding gloves when I take it out to feed it because it likes to bite hands.

I have not spent any meaningful time in Python. I write everything I do in C#. That give you and executable when you build the program.
Funny Funny x 1 View List
"In all my years here and on the old forum I have heard, and likely said, some pretty unhinged stuff. But congrats, you're the new leader in clubhouse."  - ghuns, 6/06/2025

mowens

Would I need to install a compliler?
"I would gladly risk feeling bad at times if it also meant that I could taste my dessert." - Data

riverhunter

Quote from: mowens on September 11, 2025, 01:33 PMI may be out of luck there. I don't have admin privileges.

VBA is still really powerful.  are you trying to combine the two programs you have into one?

mowens

No; I'm really just killing time and trying to learn coding in different languages. I really have no requirement for what I am doing. It just seemed more value added than playing games on my phone.
Like Like x 1 Funny Funny x 2 View List
"I would gladly risk feeling bad at times if it also meant that I could taste my dessert." - Data

riverhunter

I did the same thing a few months ago and started building a lot of stuff in VBA. then i went HTML as its a cleaner way for end user interface, but has limitations.  its crazy what you can do!

TylerBeer

I had to do something in VBA and it's horribly limited but cool it can run in excel. I would avoid it like the plague unless forced for some limitation.

Python will require you to compile it into an executable,

Most examples will show you using 'pip', that's a management tool for python packsges. First install pip in the command line, then you can install like pyinstaller

OR what's probably easier, use VSCode to write your program and run it in that using python as the build. AI should be able to tell you how to do that.

Also if using ChatGPT I've had it screw up a number of python things subtlety that it caused an employee hours of grief and bad learning. Use with caution, but AI really is amazing for writing code (when you know how to spot mistakes/bad ideas)

YoDoug

Quote from: TylerBeer on September 11, 2025, 02:45 PMAlso if using ChatGPT I've had it screw up a number of python things subtlety that it caused an employee hours of grief and bad learning. Use with caution, but AI really is amazing for writing code (when you know how to spot mistakes/bad ideas)

GPT is totally awesome at coding......until it isn't. I have had a few times where it has amazed me at how well it produced code and started building an app that was more than I envisioned. Then all of the sudden it would make one mistake and from that point on every time it produced a new fix or new feature it would break existing functionality. To the point where I had to go back to the previous good working code and start a new chat so it would forget all the stupid stuff it kept trying.
"In all my years here and on the old forum I have heard, and likely said, some pretty unhinged stuff. But congrats, you're the new leader in clubhouse."  - ghuns, 6/06/2025

Here's Johnny!

Quote from: YoDoug on September 12, 2025, 06:48 AMThen all of the sudden it would make one mistake and from that point on every time it produced a new fix or new feature it would break existing functionality.

Sounds like the coders that create Mastercam software!!....  ;D  :D

mowens

Quote from: YoDoug on September 12, 2025, 06:48 AMGPT is totally awesome at coding......until it isn't. I have had a few times where it has amazed me at how well it produced code and started building an app that was more than I envisioned. Then all of the sudden it would make one mistake and from that point on every time it produced a new fix or new feature it would break existing functionality. To the point where I had to go back to the previous good working code and start a new chat so it would forget all the stupid stuff it kept trying.


Back when ChatGPT first popped up I used it with mixed results. Like you said, it worked great until it didn't. It didn't take long before it was blocked here.
Now that Google has AI mode, I have been using that. It's sort of the same way, but for the most part it works well.
"I would gladly risk feeling bad at times if it also meant that I could taste my dessert." - Data

TylerBeer

Quote from: YoDoug on September 12, 2025, 06:48 AMGPT is totally awesome at coding......until it isn't. I have had a few times where it has amazed me at how well it produced code and started building an app that was more than I envisioned. Then all of the sudden it would make one mistake and from that point on every time it produced a new fix or new feature it would break existing functionality. To the point where I had to go back to the previous good working code and start a new chat so it would forget all the stupid stuff it kept trying.


Yep exactly - but it just makes me a lot faster getting to the end result.

YoDoug

Our lathe robot cells have waterjet trays for parts locations. There are about 12 different tray sizes to cover a range of diameters. We also have some cells that have two trays and some that have three. The old schedule building app required a lot more figuring of info for the operator. The new ChapGPT assisted app has visual confirmations of tray size selection, numbers of parts, and color corresponding to up to four programs/parts. When you change trays or tray config it changes the display to match number of parts/tray and rotate the trays for alternate config. This was done 100% "vibe" coding from GPT. I literally gave it the blueprints that we had the waterjet trays made from and told it what I want it to do and it created all of the code to build the display at runtime. It even created a text file that contains instructions and operation description and added a help button to launch it. Amazing. However when I tried to add more functionality to do some real time monitoring through the Okuma API and est cycle time calculations it blew up and I spent an entire day effing around with no improvements. Pics of old and new app;



Like Like x 1 Funny Funny x 1 View List
"In all my years here and on the old forum I have heard, and likely said, some pretty unhinged stuff. But congrats, you're the new leader in clubhouse."  - ghuns, 6/06/2025

Zoffen

haha ya, I often find it makes stuff work but in a kinda crazy way that makes adding functionality very difficult because you have to essentially reverse engineer how it did it to add features.
Believe none of what you hear and only half of what you see.

Safety! is no Accident!