|
To add to Pete reply, you could use the Speech Synthesis built into .NET:
SpeechSynthesizer speak = new SpeechSynthesizer();
speak.SpeakAsync("Number 322 please go to room 5");
You will need a reference to "System.Speech" and a using System.Speech.Synthesis statement.
It isn't perfect, but it is understandable!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I have a script in python.
I would like to call it from a winform in C#, is it possible? and how?
Thanks
|
|
|
|
|
If it works for you from a "command prompt", then Process.Start() can handle it.
|
|
|
|
|
Thanks.
and if I want to call a single function from the script, is there a way?
|
|
|
|
|
If you know how to do it from a "command prompt", then Process.Start() can handle it.
|
|
|
|
|
no I don't know, can you explain please
|
|
|
|
|
I can not.
|
|
|
|
|
I think you can. Because from Csharp we can call another dll's functions by importing them with DllImport. However your python script should be a dll that registered to the system once
|
|
|
|
|
do you know how can I turn the python script into a dll.
Or should I forward the question to the phyton forum?
|
|
|
|
|
I don't know how to do that but, if you know what that pyhon script do, you can write it yourself in csharp as a dll file.
|
|
|
|
|
Yes it is. You need to install Iron Python[^. Then you gain access to your Python functions directly from .NET.
|
|
|
|
|
You can use IronPython[^] in a C# application. A simple implementation of loading a python file using IronPython looks something like this:-
Console.WriteLine("Loading discountprice.py");
ScriptRuntime py = Python.CreateRuntime();
dynamic random = py.UseFile(@"D:\Documents\Python Scripts\discountprice.py");
Console.WriteLine("discountprice.py loaded.");
that snippet loads a basic python file called discountprice.py in my python scripts folder. To implement this you need to download IronPython and reference Microsoft.Scripting.Hosting and also IronPython.Hosting .
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks it helps. (tried it with a simple script)
my question now is:
I have a python script that import module IntelHex.
when executing the script itself it works properly.
when calling it frm my C# application, I got an exception "No module named intelHex"
Do you have a clue how can I solve this?
Thanks,
|
|
|
|
|
Hi All,
Is there a dll that deal with Intel-Hex ( http://en.wikipedia.org/wiki/Intel_HEX[^] ) file format?
I have 2 hex file (in intel-hex format) and I need to compare them.
the output must be the addresses where data differs.
Do you know if such a thing already exists?
Thanks
|
|
|
|
|
Not that I know of.
From your description, why would you process the file wide respect to byte order? If you're giving an offset into the file where there is a difference the byte order of the data in the file wouldn't make any difference at all.
|
|
|
|
|
Thanks.
I don't really undestand your answer.
I don't have the offset, I need to find it.
more than that, I need to compare address vs. address not the entire file. this is why I need to parse it.
|
|
|
|
|
object code file formats such as Intel Hex and Motorola Hex have an address field and some data fields (often worth 16 or 32 bytes) on each of the lines; the data bytes are ordered within each line, the lines themselves can come, and do come, in any order. So one can not simply do a text compare.
|
|
|
|
|
Yeah, the way he described it, I took the "address where differs" as the offset into the file.
|
|
|
|
|
As I understand it, in Entity Framework we create the backend from which the classes for our frontend code derive. Does this mean that we don't need any thoughts about classes building anymore? Doesn't this make at least a part of OOP thinking and of UML useless?
Thanks.
|
|
|
|
|
Err, no. The Entity Framework encapsulates the data access. It doesn't say anything about how your business logic and UI will look, or how those classes will be implemented.
|
|
|
|
|
UML is useless anyway
|
|
|
|
|
nstk wrote: , in Entity Framework we create the backend from which the classes for our frontend code derive
Not necessarily: it is possible to start with the object model and generate the database tables from it.
nstk wrote: Does this mean that we don't need any thoughts about classes building anymore?
Doesn't this make at least a part of OOP thinking and of UML useless?
We still need to think about the OO design: the Entity Classes are still classes and still need to be designed properly. All the EF does is handle how the object it stored.
It is also perfectly possible to write OO code without UML, even so the classes generated can be described in UML, otherwise there is something seriously wrong with the framework.
|
|
|
|
|
Hi, can I set the value of a textbox in a webpage from a windows application in my computer? For example, www.aaa.com there is a textbox (I know its variable name and it is constant) when I focus on that textbox, my windows application will appear. I will choose a text from a listbox and it will write the value to the target textbox?? Thanks.
|
|
|
|
|
Why would you want to do this from a "windows" application (.NET ?): are you attempting to modify somebody else's website ?
If you wrote the HTML, implement the solution in HTML which should be pretty simple: implement a way to make a List appear, catch the user's click on an item it, and so forth.
best, Bill
"The first principle is that you must not fool yourself, and you are the easiest person to fool." Richard Feynman
|
|
|
|
|
I want to do this because, the I don't have a chance to change the web site and I don't want to make changes on the site. For instance, I am working for an IT support of a company, we have a site that workers ask questions and we answer them. I have some constant answers so, when I focus on a textbox that for the answer, my form will appear and I will choose the constant answer for that question finally I'll send it. Thanks for the answer.
|
|
|
|