We have a tool written in C# where we write vb.net scripts. Now, I need to integrate python in it so that we can run python scripts in same tool. All, the tool does is send string command and capture the string response.
My question: do I need to write interpreter for this?How can I talk to python engine. Is there any other way I can implement this? Links to get it going would be helpful. Just started with python today!
Thanks!
Look into IronPython to fill your scripting needs. IronPython will provide you all of the features of Python but from within the .Net framework. Here is a previous question concerning embedding IronPython in C#
Michael Foord has an post on embeddeding IronPython into C#. There are several methods to achieve this goal. The simplest being to create a hosting engine from within C# and embed a string of Python code that will be executed.
Related
I am trying to make a site like Codeacademy. Where users can learn Python online,
solve problems and master theory.
Framework for the server is Ruby On Rails
I am trying to understand how can I translate python's code to the server, then execute this code on the server? Any python's interpreters created in Ruby? I totally can not understand how this should work.
Python's version: 2.7 or 3.5 (Not fundamentally)
Thank you for attention
As other have stated, there are serious security implications for letting users blindly run things on your server, but if you really wanted to, you could write the python to a file and then execute the python using system "python #{file_path}".
I'm not too familiar with python, but you could probably switch stdout and stderr to write to files and then read those files to get any print statements.
I've just started learning a bit of Python and I'm currently trying to implement a Python UI through HTML. Is there anything in vanilla Python that would allow for this, similar to how you can create UI's with Java and XML with JFX or will I have to use a framework such as Django?
I'm reluctant to use Django as there are many features that I do not need
Thanks,
Michael
In vanilla python wsgiref is very helpful for building the server-side of web-applications (possibly with str.format or string.Template and/or json) but if you want it more direct communication I would suggest XML-RPC (there are good js-clients out there).
It is also possible to execute Python Scripts right in your Website with Brython or (with strong constraints) Ironpython
For Windows you can build HTML Applications with Ironpython (have not tried but in theory it should work) or Brython (if you dont want to require the user to have ironpython installed)
You can also use Pyjs to build applications but while it uses html and javascript, i think it you dont see much of it.
There are HTML things in some ui-libraries like in wxpython (I am quite sure you will find them in many libraries)
Can we use any IRONPython editor to develop scripts for Tibco Spotfire controls.
Can we use IDLE editor to develop IRONPython scripts for Tibco Spotfire? If yes then how to integrate the tibco module with IDLE editor, Can anyone help on this??
You should be able to use any development tool (ide) which supports ironpython. One of the best in my point of view is PTVS (Python Tools for Visual Studio), just search for it. But when you want some thing very lightweight with only some syntax hilighting, i prefer using Visual Studio Code or Atom. But PTVS has a lot of nice features. One of the most important ones are those for debugging, because they prevent you from using some console printing or some thing similar as debugging tool. Just take a look at it.
EDIT
As far as i can see, it should work just fines with PTVS. Taking a look at this, is't just some API as any other api: API-Doc
Spotfre has its own IDE for developing scripts but it is very poor one when analysing its functionalities. I dont think you can use any IDE to debug the scripts but you can at least use the one suggested by BendEg to make creation of the code more 'pleasant'.
Spotfire uses IronPython, which is a .NET implementation of python. In other words, is .NET driven by python. To test simple python functions, you can use CodeSkulptor, a cloud based python interpreter. For IronPython, you can use this java based online version but again, this is to test simple scripts
I want to know if there is a way to integrate a library written in Python into my Rails application. I have always used gems to implement outside libraries so I have no idea how to do this(yet).
Is it possible to use this Python library?
This is mostly what you want:
Calling Python from Ruby
I've looked into this question before and, excepting the Heroku deploy, the answer was "easily! check this out". (On a fun note, there's a gem to let you embed Perl code in a Ruby file)
However, while I can't seem to find it right now, I remember reading that deploying both to Heroku required a custom buildpac, since one won't normally include the binaries necessary for the other.
I have written a python wrapper for a c dll.
I now wish to interact with this wrapper from an ASP classic script, served online via IIS7.
How would you recommend I do this?
If it's a Python wrapper, you need Python to use it. You can use Python as a scripting language from ASP, I recommend activestate's Python distribution, because it integrates with Windows and IIS by default.
You should be able to write an ASP page in Python and load your library in it.
Here is more info on using Python from ASP.
It should even be possible to write a page in VBscript and call a piece of Python code in a Python WSC (Windows Scripting Component). I have researched this a great deal, it works, but if you want to do this you can only pass simple data types from one language to the other (strings, booleans, numbers)