I like this Polyglot Notebooks, especially as a student tool to make notes and run code. However, and this is a big however, I have no way of passing input to the code snippets. Take a simple piece of code like this: string? ageText; Console.Write("What is your age: "); ageText = Console.ReadLine(); int age = int.Parse(ageText); I'm simply asking the the user to input their age, and returning there age as an Integer. Unless I'm missing something? Any help is appreciated.
I'll check into this as I make more content on the topic. It could be that Jupyter doesn't read input in from the console, or it could be there's an alternative way. Usually your Jupyter apps rely on variables for this type of thing rather than a user typing something. Perhaps the HTML features might help with that in Polyglot.
@@MattEland Cheers Matt, I did you some further investigations and found. string? input = await Kernel.GetInputAsync("What is your age: "); Not really same as running the console.
See newdevsguide.com/2022/12/14/polyglot-notebooks-csharp/ for a full write-up on Polyglot Notebooks as well as some additional features that didn't make the video.
Hello, Matt! Do web apis work in JS code cell? I ran into such a problem - I use fetch / axios in the js code cell and I want to display the server's response, but I can't do it - the cell starts without errors. What could be the problem? I want to output the server response to the console, for example, just like console.log(data.data) p.s. The same code in a regular js file works correctly
even the run button doesn't work as expected
How does one get syntax highlighting in jupyter/polyglot notebooks?!
Polyglot Notebooks and Jupyter Notebooks extensions in VS Code do that automagically, but sometimes you'll need to run a cell once before it kicks in.
I like this Polyglot Notebooks, especially as a student tool to make notes and run code. However, and this is a big however, I have no way of passing input to the code snippets. Take a simple piece of code like this:
string? ageText;
Console.Write("What is your age: ");
ageText = Console.ReadLine();
int age = int.Parse(ageText);
I'm simply asking the the user to input their age, and returning there age as an Integer. Unless I'm missing something? Any help is appreciated.
I'll check into this as I make more content on the topic. It could be that Jupyter doesn't read input in from the console, or it could be there's an alternative way. Usually your Jupyter apps rely on variables for this type of thing rather than a user typing something. Perhaps the HTML features might help with that in Polyglot.
@@MattEland Cheers Matt, I did you some further investigations and found.
string? input = await Kernel.GetInputAsync("What is your age: ");
Not really same as running the console.
@@adamwillis1299 no, but it might be better if you define it as a method and invoke that method.
See newdevsguide.com/2022/12/14/polyglot-notebooks-csharp/ for a full write-up on Polyglot Notebooks as well as some additional features that didn't make the video.
Hello, Matt!
Do web apis work in JS code cell?
I ran into such a problem - I use fetch / axios in the js code cell and I want to display the server's response, but I can't do it - the cell starts without errors.
What could be the problem?
I want to output the server response to the console, for example, just like console.log(data.data)
p.s. The same code in a regular js file works correctly
Interesting. JS seems to work a little differently. I know web calls from PowerShell work okay. It may be worth looking at the troubleshooting window.
"Coosto" as in jacques cousteau
Yeah, I stumbled on that association recently. Thank you.