How to compile python to dll/so library? - python

I intend to use php to develop an object detection but i have not yet found any source code in google. I have found a source code(Image AI) which is developed by python.
Can i compile the ImageAI into dll/so library? So that i can use in php.
I am a newbie in programming, so hope someone can answer my question.(This is my first time use stack overflow to ask question, so if mine question not fulfill the requirement, please forgive me.)
Below is the link of Image AI :
https://github.com/OlafenwaMoses/ImageAI
I am using windows 7,wamp3.1.7,php7.2.14

Related

Is there a way to compile python code in flutter apps itself?

Is there a way to compile python code in flutter apps itself ?
Note :- I did a bit of research and ended up with solutions which
wanted a dedicated server for python code to be hosted and later on I
could pass a query and get response which is not exactly I am aiming
for. Please help 🙂
Awesome So I came up with a solution for which we need to use a package named Starflut.
Just read the documentation on the first page of the package and you will understand how to implement it!
Link :- Starflut
Happy Coding ! 😉

Utilizing python code within swift using 3rd party software

so I'm pretty new to both swift and stack, but I have a problem with implimenting Pythonkit. But basically to provide a short summary, the kit basically allows you to be able to utilize python inside of swift (using certain swift functions in order to save variables, do functions, however, can execute the code of a .py file).
In the process of doing this however this error pops up
Fatal error: Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library.: file /Users/****/Library/Developer/Xcode/DerivedData/Y******L-
So I tried updating my Python software to 3.0 and above (I'm not quite sure, I think it was 3.7), however when I run python it shows it is at version 2.7. This kind of confused me a bit, however it was until the error did I notice something was wrong. Why does it show that error? What does it mean?
(I did find a similar post with a similar error in stack overflow, however I don't have enough reputation to comment as well as I don't think the answer was addressed to what I wanted so I'm just going to continue writing here)
The swift code itself has updated (xcode11) and following the steps a lot of the functions have changed within Xcode, what is it that I did wrong that caused the error? Following the link it seems I have to utilize pyto? Checking that link the functions of pyto are different than the ones pf PythonKit. In PythonKit you can utilize python within your swift code, while pyto seems to be a python integration for iOS?
Any advice? And please ask if anything needs clarification, or if there's a different solution please tell me. Thanks,Vince

Compiling a python project

I am sorry if this isn't the right place to ask such a question. If it's the case mods can remove my question.
I dont have a CS background but I am working on a python project for which I have to import many libraries (numpy, pandas, kiras, scikitlearn, etc).
My question is, how can I compile my project into a decent application with a GUI? And is it possible for the application to work on another device on which there is no python and of course no libraries installed.
Again, I am sorry If this is inappropriate of me.

Neural Network implementation using Pybrain

I am new to Python and I want to implement a simple Neural Network in Python and I am using Pycharm. I explore which library is used for this purpose and I found that Pybrain can be used. Successfully installed it on my system and configured with Pycharm.
Now I am searching a simple sample code for Neural Network using Pybrain lib but did not found a complete code. Also in doc of Pybrain some more explanation is required. Is there any way I can found detailed documentation of functionalities used in Pybrain?
As a beginner did I follow the correct path? May be you will feel that this question should not be asked but as a beginner I have to solve it. If anyone can help me in this regard I would be thankful to you.

How should I go about learning Python? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am currently learning PHP and want to learn about OOP.
I know Python is a well-organized and is all OOP, so would learning Python be a wise choose to learn OOP?
The thing is I am more towards web development then just general programming, and I know Python is just a general purpose language, but there is Django.
So how should I go about learning Python if I am lending towards web development?
Is there any good books/websites that help me learn Python for web development?
Is there any free webhosting companies that allow Python? I never used Python before, only PHP, and not sure how it works? Is there like a "xampp" for python?
I would pick up a good O'Reilly book on Python and build a strong understanding of the fundamentals before delving into more web specific ventures. Once you've got the essentials then I'd branch out to things like Django.
Here's a good starting page:
O'Reilly - Python
And here's a good tutorial if you'd rather do your research on the web:
Python Tutorial
I learned Python reading the book Learning Python. I read almost the whole thing on a plane trip, and when I got home I was able to start building applications immediately. There are newer versions out since I read it (and it's longer), but I found it very easy to follow.
As mentioned by others, Django is definitely the place to start for Web development.
Work through the examples on www.pythonchallenge.com. Refer to the language documentation when you get stuck.
As long as you stay within their quota Google Apps Engine provides free hosting for Python.
Django is a great framework when you want to do webdevelopment with Python. Django also has great documention with http://www.djangobook.com/ and the official Django website.
If you want to learn about Object Oriented Programming in general, you may want to look at the answers to this question, although many of the books are higher level (and some are aimed at Java/C# like languages instead of Python-like languages).
Here's some answers to your questions:
Python is an excellent language for beginners looking to learn OO design/programming.
As far as books and websites, the best python book I've read is available free online Mark Pilgrim's Dive into Python.
For web programming there are many many options. You mention Django which is the most popular although I like Turbogears, Cherrypy and web.py. All of these have their own webserver built-in (Based on paste or cherrypy)
For hosting, it's usually based on fastcgi or Apache's mod_python.
I've heard really good reports of webfaction for python based hosting.
Hope this helps, but if you are learning php why not go for Apress's PHP Objects, Patterns, and Practice that's a good book.
If it is your basics in OOPS that you wish to strengthen, Java is a good option(provided you know c++ or any other non-web-based language which supports OOPS). However, if you are looking towards web-development, Python should be your best option.
Yes, Python is a good option
Yes, Django is a very good web application framework(and they have awesome documentation and tutorials put up at their site)
To learn Python I definitely recommend reading "The Python Cookbook" cover-to-cover. Its fun, and covers some very important concepts. However, there really is no substitute for the standard python documentation. Its well written, but it might take a while through a major portion of it. Using it as just reference material is also a fine idea.
Well I have seen domains which allow Django to be hosted; also you should try out the GAE(google app engine) once you are comfortable with django. Its a great place to host your apps.
You could learn using books, but nothing beats practical hands-on approach - so make sure you have Python installed in a computer to help you learn. If you decide to buy a Python book, I strongly suggest you DO NOT buy a copy of Vernon Ceder's Python Book, it has very bad reviews. I bought a copy and was also disappointed.
If you'd like to join a mailing list, we have a good community at Python Tutor. Sign up and post your questions there as well.
Good luck
Get ipython. Use it as your shell. This means move, copy, view, change, edit files from ipython. Day to day shell stuff anywhere has enough little problems that one ordinarily solves by piping, but are just as easily solvable by python. The real bonus is that your eye for syntax and simple solutions will develop quickly.
Need to find files? use os.walk,
Running grep? try to 'open' the file instead, try some regex while you are there. Those uses of the language will serve you in any type of python programming.
( Good news, PHP and python use the same underlying regex lib PCRE, so although there are some additions, it'll be familiar to you, )
The nice thing about having this in the language , which is not really the case in PHP or Perl, is that you can just mess around with functions, not full programs.
Why ipython and not the standard REPL or bpython? Easier to use as a shell out of the box. That's all.
I recently learnt Python and had very little programming experience before. I found that doing a little bit of Python first then diving into Django worked for me. USing Django, looking through its reference material and Googling individual problems when I needed the help was really good.
Django has a built in Development server for you to use a bit like xampp, however, to make things like installing Django, installing Python, installing plugins etc a lot easier, use a unix based OS. I am developing on Mac OS and I have had no problems. Most Linux distributions will be the same. I wouldn't want to try Django development on Windows, there are just too many hacks you need to do to get it working, plus, it is more difficult for when you then publish the site (on a unix server).
Learn some Python, there are some good books suggested here, but don't get too deeply stuck into it if your focus will be Django. Go and do the official Django tutorial and then Google around for one or two more.
I use a book called 'The Definitive Guide to Django'. It is great for learning Django in the first place, but after the first few chapters, I stopped following it and started my own projects instead. Now it is a really good reference book to have.
It takes a while, but its worth it. I started working at a company as a Django developer recently and it is great.
Good Luck!

Categories

Resources