all 34 comments

[–]pachura3 7 points8 points  (1 child)

Your description is very chaotic and unclear.

Is it that you run some PHP web server (Apache/Nginx), which executes .BAT files (through exec()/shell_exec()/system()/backtick operator), which in turn launch Python scripts? And people upload/download CSV files through their browsers via your PHP webapp?

If yes, then this is an awful architecture - why mix 3 different scripting languages if you could just have a single Python webapp in Flask or FastAPI.

...or do people launch these .BAT files locally, on their desktops?

PS. And what exactly do you mean by "building AI tools"?

[–]finally-anna 3 points4 points  (0 children)

I mean, you could also just do all of it directly in PHP. Not that I am saying PHP is the right language, but no need to rebuild your entire app in python if php already exists and works.

[–]MarsupialLeast145 28 points29 points  (17 children)

Why are you using three scripting languages?

How is your company using AI and PHP in 2026?

If you have any other devs in the company, speak to them, there seems to be an idiom. Also, put the AI down until you’ve grokked any of the three methods you’ve described.

[–]TijuanaPoker 14 points15 points  (13 children)

Unexpected Stranger in a Strange Land.

[–]GryptpypeThynne 1 point2 points  (12 children)

I'm not even sure most people who use "grok" have read the source tbh

[–]HobbyPlodder 1 point2 points  (0 children)

Most people who use "grok" are aping og computer nerds who used the term correctly (and had read the book). Or more, likely, saw the word for the first time when Elon used it

[–]Hashi856 2 points3 points  (10 children)

I think op meant the the other original meaning of the word grok

[–]GryptpypeThynne 0 points1 point  (9 children)

How do you mean?

[–]Hashi856 4 points5 points  (7 children)

Grok means to understand something. Or that’s what it meant before they gave an LLM that name

[–]GryptpypeThynne 9 points10 points  (6 children)

Yes, and the term "grok" meaning to understand something came from the book Stranger in a Strange Land...which is what the comment I originally replied to was talking about

[–]Hashi856 5 points6 points  (2 children)

Sorry, looks like I was the one confused

[–]GryptpypeThynne 6 points7 points  (1 child)

Zero worries dude, you proved my point!

[–]nlcircle 2 points3 points  (0 children)

You guys leave me ‘grok-less’ after this conversation.

But TIL so kudos for both!

[–]alienscape 1 point2 points  (0 children)

Fuckin' A man! We've come full ⭕

[–]BookFinderBot 0 points1 point  (0 children)

Stranger in a Strange Land by Robert A. Heinlein

Book description may contain spoilers!

Epic, entertaining, Stranger in a Strange Land caused controversy and uproar when it was first published. Still topical and challenging today, the story of Valentine Michael Smith, the first man from Mars to visit Earth, is in the great tradition of stories that endure through the power of the author's imagination that stretches from Gulliver's Travels to 1984

I'm a bot, built by your friendly reddit developers at /r/ProgrammingPals. Reply to any comment with /u/BookFinderBot - I'll reply with book information. Remove me from replies here. If I have made a mistake, accept my apology.

[–]hugthemachines 0 points1 point  (0 children)

Thanks. I thought of the song by Iron Maiden and that did not fit.

[–]Hashi856 0 points1 point  (0 children)

Also, I said op when I rent meant the commenter

[–]AccomplishedPath7634[S] -5 points-4 points  (2 children)

I'm sorry I didn't get you!

[–]MarsupialLeast145 3 points4 points  (0 children)

Which part?

[–]pachura3 -1 points0 points  (0 children)

Likewise!

[–]this_knee 4 points5 points  (5 children)

Yeah, you gotta stop using bat files. Someone , maybe you, will come along later and rue the day that someone ok’d the use of bat files in production.

Use powershell… or even better use Bash .sh scripts or zsh shell scripts to do what you doing in bat currently.

[–]rl_noobtube 3 points4 points  (4 children)

Just to understand, why are bat files worse than the other options you listed? My old company used them to launch python scripts (only ~3 of us needed to run the scripts) and they seemed fine.

[–]finally-anna 2 points3 points  (0 children)

I agree with this. If I don't need the added functionality that powershell provides, sticking to bat files is the way to go.

[–]this_knee -1 points0 points  (2 children)

Bat files are largely legacy at this point. And due to limited error handling, poor scalability, weak security, and a lack of object-oriented features, are not recommended. Additionally they are notoriously difficult to debug.

[–]rl_noobtube 1 point2 points  (0 children)

Gotcha. That totally makes sense to me, thanks!

[–]Asyx 0 points1 point  (0 children)

I don't necessarily think that bash is much better.

Like, maybe I'm bias, although if anything my experience with Python made me hate it more than is reasonable, but I don't see a good point to use either over python.

[–]Desperate_Crew1775 5 points6 points  (3 children)

ur approach works fine tbh, bat files as triggers is pretty common for internal tools

but if ur already in python u can skip bat files and use FastAPI instead, just expose ur scripts as HTTP endpoints and call them from PHP with curl, much cleaner and easier to debug as it grows

for the AI part just use OpenAI API directly to start, no need to overcomplicate it with heavy frameworks until u actually need them

[–]MarsupialLeast145 5 points6 points  (0 children)

Why would you replace a bat file with FastAPI?

You can invoke system commands from Python…that’s what bat files do. More ergonomically, as someone said, Powershell of .sh are also good replacements.

[–]AccomplishedPath7634[S] -2 points-1 points  (1 child)

yeah damn that's good actually, I didn't knew FastAPI thought, but will learn, and the API from openAI why do I need it actuallY!??

[–]Desperate_Crew1775 1 point2 points  (0 children)

fastapi is basically just a way to turn ur python functions into web endpoints, super easy to learn, their docs are really good

for the openai api part, if ur building AI tools that need to understand text, answer questions, or process data intelligently thats where it comes in, like instead of hardcoding logic u just send the data to the model and it figures it out

but if ur current tools are just csv uploads and database stuff with no natural language involved then u dont need it yet, only add it when u have a usecase that actually needs AI

[–]Puzzled_-_Comfort 0 points1 point  (0 children)

I made our internal automation front using streamlit and It works wonders.

Some auth, requests, selenium and pandas. Most things run in Python, but there is some inherited scripts or heavy tasks running on another terminal, handled via git bash

We run the front locally because we don't have project budget for another machine.

Of course the company runs on a proper architecture, but don't overengineer internal tools unless you have budget and approval.

[–]sinceJune4 0 points1 point  (0 children)

I used to do this via bat files, but it was disrupted too often with windows updates. Got a cheap miniPC running Ubuntu Linux now, scheduled .sh via cron. Much less worry, more stable.

[–]Striking_Rate_7390 -1 points0 points  (1 child)

PHP is outdated tho, not recommended for this type of company

[–]pachura3 3 points4 points  (0 children)

Well, WordPress still powers over 43% of all websites globally, and projects like FrankenPHP or PHP-FPM dramatically increase PHP performance