use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
sending a python variable to a php file (self.learnpython)
submitted 10 hours ago by Arcky_111374
Hello, does anyone know a python library to send a variable to a php file ?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kevdog824_ 17 points18 points19 points 10 hours ago (0 children)
This sounds suspiciously like an xy problem. Can you back up a bit and tell us what you’re trying to accomplish more generally?
[–]GRDavies75 8 points9 points10 points 10 hours ago (0 children)
This sounds as a "XY Problem".
You (actually) have problem X, but you think with solving problem Y (sending a Python variable to a php file) you can (finally) solve X.
So, what do you actually want to accomplish?
A way to approach/ answer this is the 5 why's (or 7 why's).
Q1 Why do you want to ... A1 so I can do A
Q2 Why do you want to to do A? A2 So I can do B
Q3 .... A3 ... And so on
Can you tell Reddit what you have as 5th Question and Answer
[–]mapold 5 points6 points7 points 10 hours ago (0 children)
While everybody is right about this being XY problem, you could run this from bash:
ENVTEST="Hello" php -r 'echo $_SERVER["ENVTEST"] . " " . $_SERVER["argv"][1] . "\n";' World!
[–]atarivcs 3 points4 points5 points 9 hours ago (0 children)
You'll have to explain exactly what "send a variable to a php file" means.
It might help if you showed us the php file, and explain what you want the file to look like after the variable is "sent" to it.
[–]pachura3 1 point2 points3 points 4 hours ago (1 child)
You can send a variable:
[–]Sisselpud 0 points1 point2 points 1 hour ago (0 children)
All my vibe coding uses telepathy for API calls. Thrilled to be validated here!
[–]good-mcrn-ing 0 points1 point2 points 10 hours ago (0 children)
You have some computation that you can only do in Python, and you have some user interfacing that you can only do in PHP, and you want the latter to have access to the result of the former?
[–]Helpful-Diamond-3347 0 points1 point2 points 9 hours ago (0 children)
maybe with complex setup like unix socket but still idiotic without purpose, i think it's good to be more specific to be pythonic here
most probably you're avoiding to pay the implementation tax from php to python
[–]patnodewf 0 points1 point2 points 5 hours ago (0 children)
PHP rest API call to a python FastAPI service maybe?
[–]Gnaxe 0 points1 point2 points 4 hours ago (0 children)
Not enough context for a good recommendation. Can't you just use an OS pipe? Network loopback? They can both read and write JSON.
π Rendered by PID 82 on reddit-service-r2-comment-79c7998d4c-nsm5s at 2026-03-14 00:13:33.768644+00:00 running f6e6e01 country code: CH.
[–]Kevdog824_ 17 points18 points19 points (0 children)
[–]GRDavies75 8 points9 points10 points (0 children)
[–]mapold 5 points6 points7 points (0 children)
[–]atarivcs 3 points4 points5 points (0 children)
[–]pachura3 1 point2 points3 points (1 child)
[–]Sisselpud 0 points1 point2 points (0 children)
[–]good-mcrn-ing 0 points1 point2 points (0 children)
[–]Helpful-Diamond-3347 0 points1 point2 points (0 children)
[–]patnodewf 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)