[CentralOH] Next-Gen Python Version Announced!!
Eric Floehr
eric at intellovations.com
Mon Apr 4 15:39:06 EDT 2016
So the REALLY cool thing about that module is the 44 line implementation of
it:
https://github.com/joshmaker/python-php/blob/master/php/__init__.py
It actually generates a php source file, passes in the arguments via a json
list, dynamically calls the referenced method within php, and returns the
output as json, and then calls the actual php interpreter on your system to
run it and return the result.
So it knows nothing about any PHP function, and does no mapping. The class
creates a "module-like object" (apparently all you need to do is implement
__getattr__) and then __getattr__ is called whenever you try to call a
method from the module.
Pretty cool!
Eric
On Sat, Apr 2, 2016 at 12:51 PM, Brian Costlow <brian.costlow at gmail.com>
wrote:
> And here's a Python "April Fools" that's actually real (sort of).
>
> Try it if you dare...
>
> https://github.com/joshmaker/python-php
>
> On Fri, Apr 1, 2016 at 5:31 PM, Andrew Kubera <andrewkubera at gmail.com>
> wrote:
>
>> In case you missed this important announcement:
>>
>> https://mail.python.org/pipermail/python-dev/2016-March/143603.html
>>
>>
>>
>> Also, for all those worried about left-padding your strings there is a
>> new module to solve this problem
>>
>> https://pypi.python.org/pypi/left-pad/0.0.3
>>
>> Make sure to add left-pad to your dependencies in your next project!
>>
>>
>> - Andrew
>>
>> _______________________________________________
>> CentralOH mailing list
>> CentralOH at python.org
>> https://mail.python.org/mailman/listinfo/centraloh
>>
>>
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20160404/44c943a4/attachment.html>
More information about the CentralOH
mailing list