为 .NET 开发人员学习 Python

发布于 2024-07-25 18:49:51 字数 1432 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

怕倦 2024-08-01 18:49:52

我建议读一本关于它的书。 一本适合初学者的书。 它将包含许多您已经知道的内容,但您不会错过任何有关使用动态语言的内容。 我可以给你指出Dive into Python,这似乎非常友好,或者Python 教程 似乎非常切题(这就是我学习的方式)。

I would recommend just to read a book about it. A book for beginners. It'll contain many stuff you already know but you won't miss anything regarding using a dynamic language. I can point you to Dive into Python, which seems to be very friendly, or The Python Tutorial which seems to be very to the point (that's how I learned).

指尖上的星空 2024-08-01 18:49:52

我建议使用 IronPython 来帮助您学习。 它是 Python 在 .NET 框架上的实现。 因此,您可以通过访问 .NET 类库来使用/学习 Python。

一个好的起点是下载 IronPython 并查看 IronPython in Action,这是一本关于 .NET 框架上的 Python 的非常好的书。

编辑:由于 IronPython 不是一个选项,请忽略此答案。 不过谢谢。

I would recommend using IronPython to help you learn. It is an implementation of Python on the .NET framework. So you can use/learn Python with access to the .NET class library.

A good place to start is by downloading IronPython and looking at IronPython in Action, which is a very good book looking at Python on the .NET framework.

EDIT: Since IronPython is not an option, disregard this answer. Thanks though.

羁〃客ぐ 2024-08-01 18:49:51

Foord 和 Muirhead 的 IronPython in Action 是一本非常好的书,非常适合向 .NET 人员教授 Python以及向 Python 人员教授 .NET。 我可能有偏见,因为我是一名技术评论员,而​​福德是我的朋友,但我过去也遇到过其他情况,一位朋友写了一本书,我对它进行了技术评论——最终决定这本书是错误的,公开这么说(这样会失去朋友,但是,我不能说谎,至少在涉及 Python 的地方不能说谎!-)

编辑:如果你被禁止迁移到 IronPython(这可能会很好地支持您的旧版应用程序,顺便说一句),还有更好的答案:Mark Pilgrim 的 Dive into Python 通常是被认为是经验丰富的开发人员的最佳 Python 介绍,而我自己的 Python in a Nutshell 被称赞为超级明星开发者最快的入职方式。 我当然偏向于这些——马克是我的同事,我的妻子是他的书(也是我自己的书)的关键技术编辑,显然我偏向于这些我自己的书也有;-)。 但是,我确实倾向于偏向于许多最好的 Python 书籍,因为我要么参与过它们的编辑,要么是它们作者的朋友,或者两者兼而有之;-)。

Foord and Muirhead's IronPython in Action is an amazingly good book, perfectly suitable for teaching Python to .NET folks as well as teaching .NET to Python folks. I may be biased, as I was a tech reviewer and Foord is a friend, but I've had other cases in the past where a friend wrote a book and I tech reviewed it -- and ended up deciding the book was just wrong and publicly saying so (way to lose friends, but, I just can't tell a lie, not where Python is concerned at least!-)

Edit: If you're forbidden from moving to IronPython (which would probably support your legacy apps just fine, btw), there are better answers: Mark Pilgrim's Dive into Python is often considered the best Python intro for the experienced developer, and my own Python in a Nutshell has been praised as the fastest way onboard for superstar developers. I am of course biased in favor of these -- Mark is a colleague, and my wife was a key tech editor for his book (and my own as well), and obviously I'm biased in favor of my own book too;-). But then, I do tend to be biased towards a lot of the best Python books, as I've either had a hand in their editing, or am friends with their authors, or both;-).

久随 2024-08-01 18:49:51

在使用来自 Java 的 python 时,我遇到的最困难的事情就是如何正确地围绕 Duck Typing 的东西...起初我认为这简直太可怕了,只是把我脖子后面的头发打扮了一下。

接下来是按照惯例的范围,但这非常简单。 空白的重要性给我带来了一些障碍。

然而,一旦您熟悉了该语言的简洁性和开发速度,您就会更加欣赏它。 过了一段时间,我觉得这是发生在我身上最好的事情! :-)

这里有一些对我帮助很大的事情:

首先我从这本开始,然后掌握了该语言的基础知识以及日常使用 Python 快速参考卡 非常有帮助。 此外,控制台将是您尝试的最佳盟友快速的事情并巩固你的学习。

对于 IDE,来自 Eclipse 世界的 PyDev 对我来说是一个自然的选择,但还有更多可供选择从。 但如果您更熟悉 Visual Studio 环境,适用于 Visual Studio 的 Python 工具 就非常不错了也。

祝你好运,希望你会像我一样发现 Python 的乐趣。

Hardest thing I was confronted to in using python coming from Java was to properly wrap my head around the Duck Typing thing... At first I thought it was just plain horrible and just dressed the hairs on the back on my neck.

Next is the scope by convention, but that one is pretty easy. And the importance of white spaces gave me a few bumps.

However once you ease yourself in the language's concision and speed of development you learn to appreciate it a lot more. After a while I thought it was the best thing that ever happened to me !! :-)

here are a few things that helped me a lot :

First I started with this book and got the basics of the language and for everyday use the Python Quick Reference Card was very helpful. Also the console will be your best ally to try quick things and solidify your learning.

For IDEs, coming from the eclipse world PyDev was a natural choice for me, but there were many more to choose from. But if you are more familiar to the Visual Studio environment the Python Tools for Visual Studio is pretty darn good too.

Good luck, Hopefully you'll find Python as much fun as I did.

伴随着你 2024-08-01 18:49:51

适应动态类型有一个很大的初始障碍。 第一步是当你查看 Python 代码并意识到变量没有在任何地方定义,你只是凭空创建它们,这感觉就像跳过悬崖。 在你的悬挂式滑翔机正确捕捉空气之前,需要一段短暂的时间。

然后,你需要一段时间才能相信你新发现的动态机翼,而且你可能只能通过用它们进行特技飞行来获得它们。 了解 python 如何处理引用,享受猴子修补方法的乐趣,鸭子类型的各种动物。 尝试学习一些丑陋的技巧。

尽管您不能使用 IronPython 来实现此目的,但您没有理由不能使用它来学习 Python。

There is a big initial hurdle of getting comfortable with dynamic typing. The first step is when you look at Python-code and realize that variables aren't defined anywhere, you just create them out of thin air, which feels like jumping over a cliff. There is a brief moment before your hang glider catches the air properly.

And then it's going to take time before you trust your newfound dynamic wings, and you probably only can get their by doing aerobatics with them. Learn how python handles references, have fun with monkey-patching methods, duck type various animals. Try to learn some ugly tricks.

And although you can't use IronPython for this, there is no reason you can't use it to learn Python.

分开我的手 2024-08-01 18:49:51

从 C# 到野鸭式的 Python 内陆地区,您将经历相当多的文化冲击。 缺乏类型和智能感知可能会非常令人畏惧。 幸好您有 JavaScript 经验。 还要知道,Python 的缩进敏感块规则可能会让缺乏经验的人感到非常困惑(通常你要么喜欢它,要么讨厌它:-)

除此之外,从一种语言迁移到另一种语言的最大挑战通常是框架。 不幸的是,了解所有的类和函数需要时间。

You're going to experience quite a bit of culture-shock going from C# to the wild duck-typed outback of Python. Lack of types and intellisense can be pretty daunting. Good thing that you're experienced in JavaScript. Also know that indent-sensitive block rules of Python can be very confusing for the inexperience (usually you either love it or hate it :-)

Apart from that the biggest challenge moving from one language to another is usually the framework. Getting to know all the classes and functions Just Takes Time unfortunately.

甜心小果奶 2024-08-01 18:49:51

对于有经验的学习 Python 的开发人员来说,Dive Into Python 是一本非常好的书。

Wesley Chun 的核心 Python 编程一书采用了更“基础”的方法,对于有经验的开发人员来说可能有点慢。 但与其他语言相比,它可以非常轻松地比较基本语法和运算符。 Wesley 的写作风格非常容易阅读,而且他的示例项目并不平凡,实际上很有趣。

Python Cookbook 是学习“Pythonic”编程的绝佳参考方式。 本书包含数百(?)个如何使用 Python 解决常见日常问题的示例。 一般来说,“Cookbook”系列将比任何其他书籍更快地让您接触到该语言的习语。

每当我需要学习一门新的编程语言时,我都会开始使用它来完成所有出现的“日常维护”任务 - 所有我通常会用 shell 脚本或常见的 unix 工具解决的小事情 - 我开始使用新的语言来解决这些问题。 由于您有 .NET 经验,IronPython 可能是在学习 Python 时利用这些知识的好方法。 即使您只在个人沙箱中安装 IronPython...并将其用于所有日常繁忙的工作编码任务 - 这可能是学习 Python 语法和习惯用法的好方法。

For an experienced developer learning Python, Dive Into Python is a very good book.

Wesley Chun's Core Python Programming book takes a more "ground up" approach, which may be a little slow for an experienced developer. But it allowed for very easy comparisons of the basic syntax and operators compared to other languages. Wesley's writing style is very easy to read, and his example projects are non-trivial enough to actually be interesting.

The Python Cookbook is an excellent reference for learning to program in a 'Pythonic' way. This book contains hundreds (?) of examples of how to solve common everyday problems with Python. In general, the "Cookbook" series will expose you to the idioms of the language faster than any other book.

Whenever I need to learn a new programming language, I start using it for all the 'daily maintenance' tasks that come up - all the little things that I would normally solve with a shell script or with common unix tools - I start to use the new language to solve those problems. Since you have .NET experience, IronPython is probably a good way to leverage that knowledge while learning Python. Even if you only install IronPython in a personal sandbox...and use it for all your daily busy work coding tasks - that can be a great way to learn the syntax and idioms of Python.

半﹌身腐败 2024-08-01 18:49:51

如果您有时间,Pro IronPython 这本书也值得一读。

The book Pro IronPython is worth reading too if you have time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文