🎅 Christmas Udemy Cupons 🎅 Ends in 1 day! 89% OFF! 🎁 Python Docx from Beginner to Winner 🎅 www.udemy.com/course/python-docx-from-beginner-to-winner/?couponCode=DECEMBER_19_22 🎁 Python PDF Handling from Beginner to Winner 2023 🎅 www.udemy.com/course/python-pdf-handling-from-beginner-to-winner/?couponCode=DECEMBER_19_22 🎁 Python TkInter from Beginner to Winner 2023 🎅 www.udemy.com/course/python-tkinter-from-beginner-to-winner/?couponCode=DECEMBER_19_22 🎁 Python ReportLab from Beginner to Winner 2023 🎅 www.udemy.com/course/python-reportlab-from-beginner-to-winner/?couponCode=DECEMBER_19_22 🎅 Cupons de Natal 🎅 Termina em 1 dia! 89% de desconto! 🎁 Python Docx de Iniciante a Vencedor 🎅 www.udemy.com/course/python-docx-de-iniciante-a-vencedor/?couponCode=DECEMBER_19_22 🎁 Python Manipulação de PDF de Iniciante a Vencedor 2023 🎅 www.udemy.com/course/python-manipulacao-de-pdf-de-iniciante-a-vencedor/?couponCode=DECEMBER_19_22 🎁 Python TkInter de Iniciante a Vencedor 2023 🎅 www.udemy.com/course/python-tkinter-de-iniciante-a-vencedor/?couponCode=DECEMBER_19_22 🎁 Gerando Arquivos PDF com Python e ReportLab 2023 🎅 www.udemy.com/course/gerando-arquivos-pdf-com-python-e-reportlab/?couponCode=DECEMBER_19_22 🎁 Python ReportLab de Iniciante a Vencedor 2023 🎅 www.udemy.com/course/python-reportlab-de-iniciante-a-vencedor/?couponCode=DECEMBER_19_22
Hi ! please help ! my code throws an exception " No module named '__future__' " And I checked but there's a future file both in my python path lib and in ironpython lib .
2022: ironpython is no longer maintained, it is better to use option 1 and compile the scripts with pyinstaller to generate an exe and be able to execute it without having Python installed on the PC, since the compilation creates the necessary files and libraries.
Good tutorial. Next time please don't record every single word in your sentence seperately. You cannot recognize when a sentence starts and when it ends.
Thank youuuu Chris!!! Now I'm making these new series: Python Multiple Choices # Season 01 # for Beginners: ru-vid.com/group/PLOGAj7tCqHx-lll9SkuU8ue_NaCIKN9pG what do you think about those?
Hi Sunil, Did you find any way to do this? Adding other python libraries like cv2, moviepy etc... I am getting some error like microsoft.scripting.syntaxerrorexception 'unexpected token 'from'' and could not find any help online 😒
After a bunch of useless tries and research, some stuff just told that IronPython is not able to import another Python libs, just native code. And there was an advise to use Python Net instead. Have a good luck, you'll need each drop of it.
Hi @AllTech , Thanks for your nice teaching. I have a question. My C# project is a WPF project instead of a windows command project. So i create a button on the wpf project and bind it with the function. I hope when user click the button, it will execute the script. Now i am using your method 1 to run python script. But there will no cmd window show up. And i also find the python script doesn't work.
Hello AllTech, I have a question uhmm i have create machine learning image recognizer using python and tensorflow library, now i instead of running it on command line and typing this following command "python scripts/label_image.py --image test.jpg" i want it to send via c# windows form. Im not actually going to display my pyhton file im just going to send a scripts that will give me back the result and i want that result to display on c# application.
Hello Lester, I'm sorry I didn't understood the question fully... In the video I'm showing 2 ways to run a script, calling it from a windows process or using IronPython and of course both options have advantages/disavantages. IronPython give you a better control over what you can do with the python script results and also allows you to access script variables from c# but (at least for now) it requires a python 2 version of the code...in the other hand calling it from a win process allows you to use the python interpreter that you have installed on your machine (so you don't need to do script adaptations) but you have to deal with a string in the c# side as the python script result which means that you need to make a string with a pattern for you to deal with it in the c# side and shape the values for your c# objects and variables (it's nothing undoable! web technologies are based on that principal and do it all the time...but it will give you some work)... Resume: IronPython, will be a pain if you don't have the code in python 2..you need to think more. Win Process, will be a pain formatting the result string for communication from python to c#..gives you more work but you don't have to think much. You also can run the script from SQL Server...can it be an option for you? ru-vid.com/group/PLOGAj7tCqHx9Add6MWzl_5Wbix9V1OjSx
@@AllTechPage i will clarify my question, uhmm okay so this is what i really mean, i have a image recognizer, create using python codes and my problem is i dont have a good user interface on it , and i found out that a python script can be called using c# application, For example i will recognize a bird using my python codes. Before recognizing it, i will still need to write a short python scripts to start recognizing that particular image. What i want on c# application is ,i will have a picturebox and a button named recognize and when i click it, it will start recognizing what's the image inside the picturebox. I'm not really good with english, hope you understand what i said. Thank you
Hello AllTeh! string str(byte[] x) => Encoding.Default.GetString(x); this line give me error. i'm using Visual Studio 2015 is there any problem with " VS 2015" or i need to install any kind of new packages from NuGet package to run C# 7 code. Please let me know what should i do.
Thank you it works ! I only watch a half,it solves my problem,what's more I can use opencv in it as well .Previously I use ScriptRuntime pyRuntime = Py.CreateRuntime(); eng = IronPython.Hosting.Python.CreateEngine() .It always Crash ! due to compatible issue. I wonder if it depends on IronPython I use anaconda
but what if I want to be able to talk back and forth with the script? c# runs comunication.py py: Hi nice to meet you what's your name? c#: its csharp py: Hey csharp, I wanna ask you a potentially personal question c#: ok go ahead py: what's your favorite color? c#: It's blue whats yours py: purple! py: thanks for your time ;) c#: :)
Hello I will receive a hardware which has native Python API to communicate through USB. Can I embed this in C# application and communicate through it? So in my case the Python engine should receive data from USB port and transfer it to C# or send data to USB device from C# to Python and then to the device. Is that also possible?
This is a nice tutorial but how to you get input? i want to get input from python and add the result... ima try change the "Open in new window to true" thing so yea.. please help
Thank you so much. I was stuck because I wanted to use my python function .Net. I was hunting for libraries to achieve this but your video made it so simple
Hi, This is a very great video, I have one question, And I am calling this sentiment.py from C#, I am getting this error. "No module named textblob" In python application sentiment.py from textblob import TextBlob def test_func(): name="Today is a good day for a picnic." blob = TextBlob(name) polarity = blob.sentiment.polarity print(polarity) print(blob.sentiment) And I am calling this sentiment.py from C#, I am getting this error. "No module named textblob" I am very hopeful.
hi, when using IronPython it is not ok to using compiled py libs such as numpy or pandas. Moreover, ironpython development work was stopped in 2012 or earlier. I think you may try pythonnet instead which could run under NET core 2 or 3.1
You're welcome Phi Bui! Also i have this mix of tutorials: Python cool tutorials: ru-vid.com/group/PLOGAj7tCqHx8UnbicOV7iI-ogWeMmkqyu what do you think? 😃
Hello, well the first option is like running on the cmd...but instead being a human typing the commands is the software. It should work as well :) Thank you Yuan :)
Hi Alltech, I tried both the approch to call python scripts from C# and none of them worked... My python scripts have imported numpy, cv2 and moviepy libraries... I ended up with this error when I tried using Ironpython method - microsoft.scripting.syntaxerrorexception 'unexpected token 'from''.... Please let me what can be done for, if you could try and let us know how to make it work it will be of great helpful and much appreciated....
Hello, I'm using your tutorial to launch Machine Learning programs by using the first method (I need Python 3). I would like to know if it was possible to retrieve the output variables of the python script. If so, I would like to have the method and an example to illustrate this. Thank you very much.
Hello Klop :) Well the first method will return a string. What you can do is...in python side convert object into a json string. And in the C# side you have to convert the returned json string (from python) into an object. :) Object to JSON String in Python? www.w3schools.com/python/python_json.asp JSON String to Object in C#? stackoverflow.com/questions/4611031/convert-json-string-to-c-sharp-object Hope this helps you ^.^
Hi@@AllTechPage here is an example : WARNING: d:\build\xgboost\xgboost-0.90.git\src\objective egression_obj.cu:152: reg:linear is now deprecated in favor of reg:squarederror.
Hi, thank you for this great video! I'm having a problem, when trying method 1 I got an ModuleNotFoundError for some packages that I'm importing in my script. How could I fix that? (I'm having problems importing my own files and another libraries as pdf2image). PS: I've tried method 2 but I got errors even importing os
Nice video. But can you give us the python script you used? I am trying to this but in windows forms. I want to plot some graphs with python and display them in my windows forms app, but I still have some questions about how to make the script in python in order to work. So can you please give me the script?
hi, i have went with the first option , am facing this error : System.ComponentModel.Win32Exception (5): Access is denied python version = 3.6, windows 10, .net core 2 project . kindly suggest me the solution
Hello That error suggests that the program you wrote don't have enough security permissions to access something...you're trying to access a folder or file in another location?
@@AllTechPage Actually ran into a problem, maybe you can help. I'd like my Python script to return a list to C# and not a string. Would this be possible?
Hello again Stef, you can convert the list in python into json string and in c# side convert from json string into objects. An example: # python side import json # dictionary _dictionary = { "name": "Jordan", "age": 30 } # list _list = ['a', 'b', 'c'] _json = json.dumps(_dictionary) print(_json) # {"name": "Jordan", "age": 30} _json = json.dumps(_list) print(_json) # ["a", "b", "c"] // c# side using System.Web.Script.Serialization; var jsonSer = new JavaScriptSerializer(); var jsonStr = ""; jsonStr = "{\"name\": \"Jordan\", \"age\": 30}"; var _dictionary = jsonSer.Deserialize(jsonStr); jsonStr = "[\"a\", \"b\", \"c\"]"; var _list = jsonSer.Deserialize(jsonStr); Console.WriteLine(_dictionary["age"]); Console.WriteLine(_list[1]); Hope this helps :)
Hello, I tried the first option with VS2012 and faced this issue: Unexpected character '$' with this line code: psi.Arguments = $"\"{script}\"\"{start}\"\"{end}\""; besides, I faced an error with opening python file [Errno 22] Invalid argument
@@AllTechPage Do you have any similar examples? infact, I'm trying to excute Excel tasks via python script and display the output on User interface designed by Visual Studio
I was also facing the same issue . resolved the error below ,look at the below code .. psi.FileName = "C:\\python39\\python.exe"; //provide script and arguments var script = @"C:\\python39\\test1.py"; var start = "2019-1-1"; var end = "2019-1-22"; psi.Arguments = string.Concat(script, " ", start.ToString(), " ", end.ToString());
Well I think you can do it: 1 - using IronPython like I show in the video - to call python functions 2 - in python side, you should learn how to connect and interact with SQLite (using python 2 because it is a limitation of IronPython)...it should be very similar to what you can see in this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aF552bMEcO4.html - NOTE this video is for SQL Server, not SQLite and also it is in Python 3. Hope this helps :)
Hi I am using first method when I run the code it is working fine but when I hosted the code on my local machine (IIS) it does not work.Please give me some ideas.
Hello Shubham, I believe it can be permissions problem. Must give permissions to your app to run external code, something like that. Hope this helps you Shubham :)
@@AllTechPage Oh... I see... according to what I heard, they will release their Python 3 version soon... maybe, it's still alive... I like to use Iron Python for game development....
Hello and thank you for the tutorial, I've diff. question for you. I've an exe ( tbh its a game and using python ) and its using python functions. How can I call them from my project?
Iron python gives you more control but limits you to python 2 syntax...running from a process, you have limitations because you need to pass parameters and receive the result from strings, but you can use python 3. There is no perfect solution :)
Uhm in that case to use iron python you need to adapt your script to Python 2 syntax. Using the process option has limitations with input parameters and output. Try to test a small script first and see if it is what you wanted :)
hello, i am executing the Exec_process option and i am encountering the Exception as "Access Denied' for the psi Start(). i have also manually given all the permissions still the error pesists. Can you help please.
@@AllTechPage Thank You for Replying !! Yes They Both are in C Drive and i am getting this error "System.ComponentModel.Win32Exception: 'Access is denied'"