How can we use python module in vb.net - vb.net

I want to use the python module imaplib, email in vb.net to read the gmail email with attachments. How can i use the python module in vb.net

Presuming you already looked at Brad's suggestion and didn't find it quite satisfying there is a .Net module for handling python, although this seems like the inverse of what you're looking for.

The only way that you could realistically use a Python library in .NET is to use IronPython. It is possible to embed IronPython in a C# app and the best explanation of that is in the book IronPython in Action.
However, this introduces a lot of layers in an application and may not be the wisest way to go unless you can make use of a general scripting language in your app.

Related

Standard Input in Smalltalk (Pharo) on Windows

I'm currently trying to learn the "most elegant and powerful" programming language since I'll need to be using it in about two months. However, I've been searching for an entire half-hour, and I have one simple request.
How do you read standard input with Pharo 7.0 Smalltalk on Windows? The solution I found here only works on Linux via using /dev/stdin as a file.
Getting to standard input from a GUI application on Windows is not trivial (see https://social.msdn.microsoft.com/Forums/vstudio/en-US/799cc2b6-309e-4758-8c3b-7c602bbfb736/in-a-gui-program-where-is-stdout?forum=vcgeneral) and few GUI applications support it.
Why do you want to do this? Is it so you can transfer what you've learned from C/C++/C#/Java/Python and other such console-based environments? If so, I suggest you change your approach. Instead of trying to transfer your C tutorials to Smalltalk, I suggest that you learn Pharo using https://mooc.pharo.org. If you want to look at user input in a GUI context, take a look at the UIManager.
On the other hand, if you must write a console-based application, see CommandLineUIManager.

automation of tasks

which scripting language/tool is best for automating a task?
I have an exe for which I don't know any of the list of functions used. if I know any of the functions used, then I thought I can try using those functions by referencing the exe/dll to VB or any other scripting language. I know that the exe is developed from Delphi.
Is there any way that I can automate the process.
I'm not sure what your question is here; what are you trying to automate exactly? Are you trying to call functions provided by a DLL, or are you trying to find out what functionality is actually exposed from the DLL. I'm not even sure you have a DLL, you mention a .exe most of the time...
Please refer to the guidelines and try to state your question more clearly, if I'm alone in not understanding your question then I'm sorry and I hope another more helpful SOer comes to your rescue!
EDIT: After helpful comments from OP, this question is, I believe, 'how can I automate interaction with a GUI?'
If this is a Windows GUI, then I would recommend using Python and the pyWinAuto package. This will allow you to accomplish quite a good range of basic to intermediate manipulation of a Windows GUI application. If that's not up your street, then this SO question has numerous other suggestions.
HTH

Writing a shell extension (IContextMenu) in VB.Net?

I'd like to add a group in Windows Explorer's context menu that works like 7Zip's:
I know there's the shortcut of using eg. FastExplorer, but I'd like to avoid depending on a third-party tool (besides, FE happens to be deadware).
Google seems to say that this is done through a COM DLL that implements the IContextMenu interface, but the examples I found were all done in C# or VC++.
Before I investigate further, can VB.Net gurus tell me if this can be done in VB.Net, or only C#/VC++ will do?
Thank you.
Edit : Does someone know of a third-party solution so that this can be done without requiring an upgrade to .Net 4?
Yes: if it is doable in C#, then it is doable in VB.Net.

VB6 Parser/Lexer/Scripter

I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them.
I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before.
My question is:
Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?
Use the Microsoft® Windows® Script Control because it is easy to integrate into existing VB6 applications. The control supports VBScript, JScript, or any other "Active Script" implementation.
I have used the Windows Script Control in four projects and it works extremely well. Very easy to integrate. I wish Microsoft would have given us a replacement in .NET, and made it as easy to use. (I understand the control is not needed in .NET, but having the ability to simply create an object that handles everything is nice.)
Windows Script Control
The Microsoft® Windows® Script Control
is an ActiveX® control that provides
developers with an easy way to make
their applications scriptable. This,
in turn, enables users to extend
application functionality through
scripts, much as they do with macros
today.
INFO: Where to Obtain the Script Control at http://support.microsoft.com/kb/184739. Includes links to other howto support articles.
Chapter 13: Adding Scripting Support to Your Application at http://msdn.microsoft.com/en-us/library/aa227413(VS.60).aspx
Designing a Calculator at http://msdn.microsoft.com/en-us/library/aa227421(VS.60).aspx
How To Use Script Control Modules and Procedures Collections, Inserted from http://support.microsoft.com/kb/184745
How To Use the AddObject Method of the Script Control, Inserted from http://support.microsoft.com/kb/185697
SAMPLE: SCRIPTEX.EXE Uses the ScriptControl with Visual Basic, Inserted from http://support.microsoft.com/kb/189484
Windows Script Control can be downloaded at http://www.microsoft.com/downloads/details.aspx?familyid=d7e31492-2595-49e6-8c02-1426fec693ac&displaylang=en. (Supported Operating Systems: Windows 2000; Windows 98 Second Edition; Windows ME; Windows NT; Windows Server 2003; Windows XP)
MSDN Search of "MSScriptControl.ScriptControlClass" at http://social.msdn.microsoft.com/Search/en-US?query=%22MSScriptControl.ScriptControlClass%22&ac=8
MSDN Search of "Windows Script Control" at http://social.msdn.microsoft.com/Search/en-US?query=%22Windows+Script+Control%22&ac=8
MSDN Search of "MSSCRIPT" at http://social.msdn.microsoft.com/Search/en-US?query=MSSCRIPT&ac=8
Unless you're doing it for your own instruction, you may want to try using Lua: VB6 - Lua Integration
If you're willing to use VBScript rather than VB6 you might be able to just use the MSScriptControl to run the commands rather than creating your own. Here's an article discussing using it from a .Net app, though it's an ActiveX control so should give you quite a bit of flexibility.
The control can be downloaded from here.
I've actually seen some quite reasonable implementations of compilers/interpreters in VB6[1] - It's not the language I would choose (few functional features, insufficent static type system), but with experience, you can outweigh these drawbacks and be quite productive - So why not.
You can use the GOLD parser generator that supports VB6 as a start.
[1]: Somewhere on PSC or in this download repository I think ...
Note that there is the MSScriptControl too.
There also appears to be an additonal alternative for VB6:
SadScript is an variant of VB6 most prominently used for VB6 as an scripting engine in MMORPGS .
See here for more : What is sadscript? Can I use it in vb.net? Why hasn't anyone I have asked heard of it?

calculus engine in vb?

is there an easy to use library or engine for .NET that does calculus?
I posted an early version of some code I used in one of my classes in an answer to this thread:
Generated methods for polynomial evaluation (my answer includes classes for symbolic differentiation)
If I know exactly what you're looking for, I could try to post an updated version.
Google is suggesting you look through Wikipedia's list of free libraries that can do automatic differentiation, and see if any have a .NET or COM wrapper. EDIT: High-Performance Mark has pointed out that it appears you need symbolic differentiation, in which case these libraries won't help.
If you are keen, you possibly could create a .NET wrapper for one of the C++ libraries.