Run Python Script from C#

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 196

  • @AllTechPage
    @AllTechPage  Рік тому

    🎅 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

  • @chrisaparis903
    @chrisaparis903 2 роки тому +3

    For people having errors about module import, I'm on mac and I fixed it by using @"/usr/bin/python3" instead of @"/usr/bin/python". I hope this helps!

  • @TheAjitshukla
    @TheAjitshukla Рік тому

    Worked like a charm. I used it with MVC and it worked.. cool tutorial.. saved me hours of research

  • @ashishthapliyal89
    @ashishthapliyal89 Рік тому

    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

  • @sumitdawrani4806
    @sumitdawrani4806 Рік тому +1

    Sir, Thanks for the code, in my project I want modules in iron python so how can I install it ???

  • @MrMilesfinn
    @MrMilesfinn Рік тому

    Excellent. Very well organized. Hated the pasta wallpaper--it is distracting, and it bled through the first line of your slides.

  • @expat2010
    @expat2010 5 років тому +3

    Thanks for this and also answering questions - that is rare these days.

  • @AntsaVRmusic
    @AntsaVRmusic 3 роки тому +4

    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 .

    • @bimborackete
      @bimborackete 2 роки тому

      @@FLUMBARDING i think that ironpython only supports the standard lib

  • @aleksproger_il
    @aleksproger_il Рік тому

    Thank you so much Dude, it's so useful for me!!!

  • @yesremi
    @yesremi 4 роки тому +4

    Thanks for posting, you save my time!!

  • @junyiliang4593
    @junyiliang4593 2 роки тому +1

    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.

  • @sunilanthony17
    @sunilanthony17 4 роки тому +19

    How do you add other python libraries such as NumPy, cv2, and etc?

    • @AmitKrishnaBaral
      @AmitKrishnaBaral 4 роки тому +2

      Is there any update regarding adding python libraries?

    • @chetansudeep2011
      @chetansudeep2011 4 роки тому

      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 😒

    • @sunilanthony17
      @sunilanthony17 4 роки тому +1

      @@chetansudeep2011 No, I give up after several hours of researching. I really don't think there is a way to add other libraries.

    • @yurifontoura2189
      @yurifontoura2189 4 роки тому +3

      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.

    • @alejandroreyespena2816
      @alejandroreyespena2816 3 роки тому +1

      But if you have the dependencies installed in your python, refeering to the .exe works, this worked for me and i needed the arcpy dependecy

  • @arminnabavi9568
    @arminnabavi9568 4 роки тому +1

    so useful. helped me. Thank you very much.

  • @hjw9347
    @hjw9347 3 роки тому +1

    Thanks for posting

  • @patelkunal3962
    @patelkunal3962 5 років тому +3

    thank you this is very helpfull video but i am getting error like "no module named warnings" please help me with that

  • @nathanurinovsky3819
    @nathanurinovsky3819 4 роки тому +2

    Thank you very much! That was very helpful.

    • @AllTechPage
      @AllTechPage  4 роки тому

      it's good to know it helped Nathan 😊

  •  4 роки тому +1

    thank you so much. video is very detail.

    • @AllTechPage
      @AllTechPage  4 роки тому

      You're welcome Phi Bui!
      Also i have this mix of tutorials: Python cool tutorials: ua-cam.com/play/PLOGAj7tCqHx8UnbicOV7iI-ogWeMmkqyu.html
      what do you think? 😃

  • @donyjunior
    @donyjunior 2 роки тому

    Great Tutorial!

  • @8180634
    @8180634 4 роки тому +1

    Great quick overview, thanks for posting!

  • @jamesmasonic
    @jamesmasonic 2 роки тому

    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?

  • @sandeepchavarkar
    @sandeepchavarkar 3 роки тому

    Lovely tutorial ... worked like a charm!! Thanks a lot.

  • @yuanfang2352
    @yuanfang2352 5 років тому +2

    thanks a lot for the tutorial!
    does the first option also support CPython libraries such as numpy and scipy?

    • @AllTechPage
      @AllTechPage  5 років тому +2

      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 :)

    • @yuanfang2352
      @yuanfang2352 5 років тому

      @@AllTechPage i was just thinking about how to pass the arguments... will give it a try anyway. thanks!

    • @khriz571
      @khriz571 5 років тому

      @@yuanfang2352 Could you do that? :0

  • @PrivacyNProgramming
    @PrivacyNProgramming 3 роки тому

    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

  • @rabbanishaik2363
    @rabbanishaik2363 4 роки тому +1

    helpful. Thank you.

  • @luanpham170
    @luanpham170 5 років тому +1

    Great tutorial. Thanks

  • @mr.roboter
    @mr.roboter 5 років тому +1

    Thanks dear AllTech

  • @viktoryeshchenko1181
    @viktoryeshchenko1181 5 років тому +2

    amazing tutorial

  • @tabzk9132
    @tabzk9132 4 роки тому +1

    Thanks a lot bro!

  • @huvarda
    @huvarda 5 років тому +4

    Why is the background of the slideshow a deep fried image of macaroni? Good tutorial though!

    • @AllTechPage
      @AllTechPage  5 років тому +1

      Ehehe because i like it :')))
      Thank you :)

  • @wawansetiawan1095
    @wawansetiawan1095 3 роки тому

    this great works, but fail when complex script with import module, anybody same problem ? and how solved it ? thx

  • @hxong4733
    @hxong4733 2 роки тому

    Thank you sir

  • @陳家安-e2x
    @陳家安-e2x 4 роки тому +1

    thanks you, you save the day!

    • @AllTechPage
      @AllTechPage  4 роки тому +1

      ^.^ i'm glad this helped, you're welcome :)

  • @binarybeast2685
    @binarybeast2685 4 роки тому +2

    Hey, if you could help me. How to import external libraries like numpy and pandas in ironpython.

    • @AllTechPage
      @AllTechPage  4 роки тому

      Sorry I never tried that :/
      Maybe in a future video I'll try it

    • @NgoniAlwin
      @NgoniAlwin 4 роки тому

      check this out ua-cam.com/video/9D8TXQkO948/v-deo.html

    • @sciencefeelcorner899
      @sciencefeelcorner899 4 роки тому

      ​@@NgoniAlwin Hi, were you able to import numpy/scipy libraries?
      And run them from Unity editor?

    • @Nanzai1111
      @Nanzai1111 4 роки тому +1

      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

  • @klopkerna3562
    @klopkerna3562 5 років тому +1

    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.

    • @AllTechPage
      @AllTechPage  5 років тому +2

      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 ^.^

    • @klopkerna3562
      @klopkerna3562 5 років тому +1

      @@AllTechPage thank you very much I will try it tomorrow. I hope it will work

    • @klopkerna3562
      @klopkerna3562 5 років тому

      Hi All Tech,
      Your trick worked but I needed to get rid of the warnings. Do you know how to do it automatically in C#?

    • @AllTechPage
      @AllTechPage  5 років тому

      Hello Klop, what kind of warnings do you have?

    • @klopkerna3562
      @klopkerna3562 5 років тому

      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.

  • @SkyFly19853
    @SkyFly19853 3 роки тому +1

    Thank you very much for this great tutorial!

    • @AllTechPage
      @AllTechPage  3 роки тому +1

      you're very welcome Mr. Tech Guy 🙌😊🎉

    • @SkyFly19853
      @SkyFly19853 3 роки тому

      @@AllTechPage
      (^__^)
      Btw, are there other Iron Python tutorials on your channel?
      Thank you again in advance!

    • @AllTechPage
      @AllTechPage  3 роки тому +1

      no, this is the only one.. i think ironpython is dying... i want to do one about python .net but didn't found enough time to make it yet :/

    • @SkyFly19853
      @SkyFly19853 3 роки тому +1

      @@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....

    • @AllTechPage
      @AllTechPage  3 роки тому +1

      oh I didn't knew that!!! ok maybe I'll explore that one in the near future eheheh

  • @Explorest
    @Explorest 2 роки тому

    What font is this . Its gorgeus.

  • @jnanavardhana
    @jnanavardhana 5 років тому

    Hello, do i need to make any changes in the code if i am not passing any arguments.

  • @FereshtehJourney
    @FereshtehJourney 2 роки тому

    How is possible to run python script in C# that has imported libraries inside the script ?

  • @MahiRSolmaZ
    @MahiRSolmaZ 3 роки тому

    Python 3 I use. Is version 3 still not working with Unity?

  • @ahmedkhalifa3731
    @ahmedkhalifa3731 5 років тому +1

    Thanks very Much ,

  • @TheManish2013
    @TheManish2013 5 років тому

    Which one is better ? Plz suggest

    • @AllTechPage
      @AllTechPage  5 років тому

      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 :)

    • @TheManish2013
      @TheManish2013 5 років тому

      @@AllTechPage i am using python3. so can i use Iron Pytnon or it is better than process

    • @AllTechPage
      @AllTechPage  5 років тому

      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 :)

  • @LegendarySkyHero
    @LegendarySkyHero 5 років тому +2

    Can iron python run python3 scripts?

  • @tomascarreiro4069
    @tomascarreiro4069 Рік тому

    I get an error in source.Execute(scope) saying " No module named 'datetime' "

  • @lestercasinillo9106
    @lestercasinillo9106 5 років тому +2

    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.

    • @AllTechPage
      @AllTechPage  5 років тому +1

      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?
      ua-cam.com/play/PLOGAj7tCqHx9Add6MWzl_5Wbix9V1OjSx.html

    • @lestercasinillo9106
      @lestercasinillo9106 5 років тому

      @@AllTechPage thank you for your quick respond

    • @lestercasinillo9106
      @lestercasinillo9106 5 років тому

      @@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

  • @martsummer6607
    @martsummer6607 3 роки тому +1

    Super.

  • @stef9019
    @stef9019 4 роки тому +1

    thanks!

    • @AllTechPage
      @AllTechPage  4 роки тому

      You're very welcome Stef ^.^

    • @stef9019
      @stef9019 4 роки тому

      @@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?

    • @AllTechPage
      @AllTechPage  4 роки тому +1

      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 :)

  • @XZYSquare
    @XZYSquare 5 років тому +3

    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#: :)

  • @sauziza27
    @sauziza27 4 роки тому

    Which version of python are you using?

    • @AllTechPage
      @AllTechPage  4 роки тому

      Hello Samba,
      The one from command line is 3...but like I say in the video, ironpython uses v2 sintax.

    • @sauziza27
      @sauziza27 4 роки тому +1

      @@AllTechPage oh i havent listen it

  • @meraclain674
    @meraclain674 5 років тому

    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.

  • @rumaadhikary185
    @rumaadhikary185 Рік тому

    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

  • @duckasprivate3040
    @duckasprivate3040 4 роки тому

    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?

    • @AllTechPage
      @AllTechPage  4 роки тому

      Hey Ducka's how are you?
      I didn't fully understood your question, it's an external exe?

    • @duckasprivate3040
      @duckasprivate3040 4 роки тому

      @@AllTechPage nah, its a game and using python functions and I wanna code external c# project to call python functions

    • @AllTechPage
      @AllTechPage  4 роки тому

      But it's not what I am doing in this video?

    • @duckasprivate3040
      @duckasprivate3040 4 роки тому

      @@AllTechPage lemme watch it again and again till I understand

    • @AllTechPage
      @AllTechPage  4 роки тому

      @@duckasprivate3040 you think the video is difficult to understand? I'm asking so I can see what I am doing wrong.

  • @gabrielcosta7836
    @gabrielcosta7836 4 роки тому

    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

  • @gianneflores4908
    @gianneflores4908 5 років тому

    Can I use this with unity? So for example, I have python script that will need values from a c# script and use that python script within unity ?

    • @AllTechPage
      @AllTechPage  5 років тому +1

      Hello Gianne,
      I never tried...in theory it will work since you're coding in c#. It's the best answer that I can give you at the moment :)

    • @calmjey
      @calmjey 5 років тому

      dis it work for you ? Gianne Flores?? cos its throwing error in mine ..i too am trying to run python in c# unity

    • @gianneflores4908
      @gianneflores4908 5 років тому

      @@calmjey I also ran into an error and ended up doing something else! Sorry for not being much help

  • @chrisschuller7055
    @chrisschuller7055 3 роки тому +2

    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.

    • @AllTechPage
      @AllTechPage  3 роки тому +1

      Thank youuuu Chris!!!
      Now I'm making these new series: Python Multiple Choices # Season 01 # for Beginners: ua-cam.com/play/PLOGAj7tCqHx-lll9SkuU8ue_NaCIKN9pG.html
      what do you think about those?

  • @yeguacelestial8304
    @yeguacelestial8304 5 років тому

    Is it possible to create a project with C# for the frontend and Python (SQLite) for the backend?

    • @AllTechPage
      @AllTechPage  5 років тому

      Yes it is :)

    • @yeguacelestial8304
      @yeguacelestial8304 5 років тому +1

      @@AllTechPage would it be the same method you show on this video? or what else should I learn about?

    • @AllTechPage
      @AllTechPage  5 років тому

      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: ua-cam.com/video/aF552bMEcO4/v-deo.html - NOTE this video is for SQL Server, not SQLite and also it is in Python 3.
      Hope this helps :)

  • @mykell5423
    @mykell5423 2 роки тому +3

    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.

    • @MrMilesfinn
      @MrMilesfinn Рік тому

      This looks like a great idea that solves many of the questions posed by others.

  • @chetansudeep2011
    @chetansudeep2011 4 роки тому

    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....

    • @poovarasanv440
      @poovarasanv440 2 роки тому

      hello are you solved this error now:/ if solved plz tell me:)

  • @shubhamgangrade258
    @shubhamgangrade258 5 років тому

    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.

    • @AllTechPage
      @AllTechPage  5 років тому

      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 :)

    • @shubhamgangrade258
      @shubhamgangrade258 5 років тому

      @@AllTechPage Thank you so much for reply, but I already give all the permissions to my local folder as well as on IIS. But it is not working

    • @AllTechPage
      @AllTechPage  5 років тому

      Any error message?

    • @shubhamgangrade258
      @shubhamgangrade258 5 років тому

      @@AllTechPage No any error message. My API is running perfectly but it is not able to call "main.py" python file.

    • @shubhamgangrade258
      @shubhamgangrade258 5 років тому

      Can you do me a favor ? Can you please send me a video link in which you hosted your above code on IIS and run the same?

  • @komaltarte4102
    @komaltarte4102 4 роки тому +1

    I went with the first method ang got this error :can't open file errno22 invalid argument

    • @AllTechPage
      @AllTechPage  4 роки тому

      Hello Komal, how are you?
      Can you show the command?

    • @AllTechPage
      @AllTechPage  4 роки тому

      Hello Alexander,
      Did you checked if the folder have security permissions?

    • @AllTechPage
      @AllTechPage  4 роки тому

      Oh good to know :) you're welcome

  • @admin123451212
    @admin123451212 5 років тому

    Dose IronPython require Python Enviroments?

    • @AllTechPage
      @AllTechPage  5 років тому

      Add an environment variable? No.
      I don't know if it was what you were trying to ask :D

  • @atharvadharane222
    @atharvadharane222 4 роки тому

    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
      @AllTechPage  4 роки тому

      Hello Atharva, I will try :)
      The c# project and the script are in the same drive? They are in the same drive where windows is installed?

    • @atharvadharane222
      @atharvadharane222 4 роки тому

      @@AllTechPage Thank You for Replying !! Yes They Both are in C Drive and i am getting this error "System.ComponentModel.Win32Exception: 'Access is denied'"

    • @AllTechPage
      @AllTechPage  4 роки тому

      Do you needed to restart the computer after changing permissions?

    • @atharvadharane222
      @atharvadharane222 4 роки тому

      @@AllTechPage umm it didn't ask me to restart my pc

    • @AllTechPage
      @AllTechPage  4 роки тому

      Can you restart just to exclude that possibility?

  • @virendrakumar-zp8lv
    @virendrakumar-zp8lv 3 роки тому

    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.

  • @MrBogdanel1285
    @MrBogdanel1285 5 років тому

    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?

    • @AllTechPage
      @AllTechPage  5 років тому

      Hello, the link is in the description for download :)

    • @MrBogdanel1285
      @MrBogdanel1285 5 років тому +1

      @@AllTechPage Oh, sorry, I thought it is just CS script. Thanks

  • @joseitojunior1749
    @joseitojunior1749 5 років тому +1

    Congratulation

  • @tietgiaotruong1819
    @tietgiaotruong1819 5 років тому

    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
      @AllTechPage  5 років тому

      Hello :)
      What is the C# version? Using string interpolation (the dollar sign) is a very recent feature.

    • @tietgiaotruong1819
      @tietgiaotruong1819 5 років тому

      @@AllTechPage Hi, I'm using C# version 2012

    • @AllTechPage
      @AllTechPage  5 років тому

      I think that feature is not available yet in 2012. You have to do it by concatenation or using the String.Format method to do the same job. :)

    • @tietgiaotruong1819
      @tietgiaotruong1819 5 років тому

      @@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

    • @gitakumari8627
      @gitakumari8627 2 роки тому

      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());

  • @selvapriyavijay3880
    @selvapriyavijay3880 5 років тому

    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

    • @AllTechPage
      @AllTechPage  5 років тому

      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?

    • @selvapriyavijay3880
      @selvapriyavijay3880 5 років тому +1

      @@AllTechPage thanks, now its works fine

    • @AllTechPage
      @AllTechPage  5 років тому

      I'm happy to know it worked ^.^

  • @kaushalverma4630
    @kaushalverma4630 4 роки тому

    How do you do this on a Mac

    • @AllTechPage
      @AllTechPage  4 роки тому +1

      Sorry Kaushal I don't have a Mac so I never tried that :/

  • @expat2010
    @expat2010 5 років тому

    Iron Python doesn't support request file?

    • @AllTechPage
      @AllTechPage  5 років тому

      Hello, what do you mean? Or what you are trying to do?

  • @anosuplayer6254
    @anosuplayer6254 5 років тому

    How to run a python script from the ressources? Exemple:
    Script: Accueil.py
    logicielname.Properties.Resources.Accueil
    Isn't good...

  • @manjunathknshivamogga7286
    @manjunathknshivamogga7286 5 років тому +1

    Interesting video. Could you please share the location of the source code?*

    • @AllTechPage
      @AllTechPage  5 років тому

      Hello and thank you :)
      The link for download is in the description of this video :)

  • @jayleimer3836
    @jayleimer3836 4 роки тому

    Why does it look deepfried

    • @AllTechPage
      @AllTechPage  4 роки тому

      cuz I'm deepfried too :D....kidding...
      or not...

  • @Dark-jn2pg
    @Dark-jn2pg 5 років тому

    sauce?

  • @JohnDoe-ym2oy
    @JohnDoe-ym2oy 3 роки тому

    This is a javascript guy for fricks sake

  • @Johannes00
    @Johannes00 5 років тому

    I'm sure it's a good tutorial but I just can't handle the monotonous and choppy way you talk. Your video just wasn't for me.