python可以代替vb吗,Python是否像VB一样?

随着Microsoft逐步停止支持Visual Basic,本文探讨了使用Python作为替代方案的可行性。Python不仅易于学习,而且具备强大的GUI开发能力,可通过多种工具包实现。尽管Python在某些方面与VB有所不同,但其灵活性和丰富的第三方资源使其成为一种值得考虑的选择。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

As you may or may not know, Microsoft is discontinuing Visual Basic in favor

of VB.NET and that means I need to find a new easy programming language. I

heard that Python is an interpreted language similar to VB. This means that

it doesn''t have all the hard stuff like pointers, classes and templates like

C, C++ and assembly language.

Where I work we use Microsoft Office with a lot of customization using

Visual Basic. I would like to switch to Python to do it since VB is being

discontinued. Would Python meet our requirements? I need to make lots of

GUI applications (message boxes, forms, etc.) and do the underlying business

logic too.

Thanks in advance.

解决方案First of all, discontinuing VB doesn''t mean you have to stop using it.

I worked on a project which was compiled with Visual C 1.52, for many

years after it was not supported. The project is used by nearly every

engineer at the company where I work.

We are still devleoping the project I work on now in VB6, and have no

reason to bail.

For new projects, it would make sense to look into VB.net or some

alternative.

Python has classes, but not templates. However, you don''t have to use

classes in your program, but it will make life easier if you learned

them.

Python''s classes are not as complicated as C++, it''s a much better

language to learn from.

VB has classes too, and if you haven''t used them in your programs, then

there''s a good chance you can program that way with Python too, but I

wouldn''t make a point of it.

VB has a much better IDE than the IDE''s for Python, although Eric3 is

one of the best, and is absolutely free.

VB''s ide is it''s strongpoint, not the language itsself.

If you need to do Gui''s then it is extremely usefull to learn the

basics of classes, your code will be much simpler in the long run.

There are many gui toolkits/frameworks for Python, but the foreunners

are pyQT, wxPython, pyGTK, and TK/Tkinter.

You don''t have to worry about pointers though :-)

"Would Python meet our requirements? "

Yes and no. Because Python is a very high-level language and

dynamically typed it is easy to learn. Python doesn''t make use of

pointers but you are able to write object-oriented code (as opposed to

just being object-friendly like Visual Basic is). You will find that on

its own you won''t be able to do any Office macro scripting although

there are several packages that will give you added functionality like

access to Com+ objects (see win32 modules by Mark Hammond). Now, this

may require more work than using VBA but it *is* doable. The com

portion of the win32 modules can enable one to create even a

macro-language unto itself!

Python is very powerful. There are many 3rd party modules and

frameworks (Zope, CherryPy). Also, there are many GUI toolkits

available for it (wxWindows, GTK, QT, Tk and on and on) and you can

also use it as a wrapper to write and compile to Java bytecode (see

Jython). The problem for you, however, is it may or may *not* meet

every requirement. For that you''ll have to find out for yourself. I

suggest downloading Python and giving the Python tutorial a whirl and

then taking a look at other Python-related stuff:

[For programmers:] http://docs.python.org/tut/tut.html

[For non-programmers:] http://honors.montana.edu/~jjc/easytut/easytut/

[Win32 stuff:] http://starship.python.net/crew/mhammond/

[Tk ''Tkinter'':]

http://www.pythonware.com/library/tkinter/introduction/

[wxPython:] http://www.wxpython.org/

[PyGTK:] http://www.pygtk.org/

Purusing these links will give you a very good idea of whether Python

is right for you. Naturally we''d all like to say ''YES Python is good

for you!'' but you have to investigate for yourself.

Good luck!

Harlin Seritt

On Wed, 16 Mar 2005 21:33:36 -0800, "Mike Cox"

declaimed the following in comp.lang.python:

As you may or may not know, Microsoft is discontinuing Visual Basic in favor

of VB.NET and that means I need to find a new easy programming language. I

So far as I know, VB.NET is the next version of Visual Basic,

making use of the "common language runtime" -- which, as I understand,

is M

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值