As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 13 years ago.
Or any other normal scripting language for that matter. I know there is VBScript and JScript. But I don't really like those for any kind of computing.
I would really love to have python or ruby (or perl) interpreter installed with windows by default so when I write small console applications I wouldn't need to distribute whole python installation with it via py2exe(or similar).
Do you know if there is such incentive? Do you think this would be possible? Or it's not acceptable for Microsoft?
Microsoft makes it pretty obvious they want you to use their version of everything. So what is in it for them to have Python or any other language as part of their Windows operating system?
They want you to program for Microsoft Internet Explorer using Microsoft Active Server Pages with Microsoft Visual Basic on Microsoft Internet Information Server, back-ended by Microsoft SQL Server running on top of Microsoft Windows. It goes on and on like this...
It makes perfect sense from a business perspective when you think about it.
So... Will we see competing "products"--even open source ones--installed by default on Windows? Not gonna happen anytime soon.
The Microsoft scripting tool is Powershell. It is a standard part of Windows 7.
You could create your own Windows Installation-Disc with the wished script or programming language installed on default..
Perhaps search on SuperUser.com (or Google) for this matter.
Because Windows doesn't need those languages to run, by default ?
(While, for instance, many basic Linux utilities depend on some script-languages, like Perl)
I would add that JScript and VBScript have been implemted by Microsoft -- so Microsoft can distribute their implementation ; on the other hand, there is no Microsoft implementation of either Python, PHP, or Perl, ...
Firstly, Windows doesn't need them to run, and to be honest, most people buying Windows have no knowledge of - let alone interest in - scripting languages.
It then comes down to ownership and support. There's nothing ships as part of a default Windows installation which isn't owned, designed and developed by Microsoft. They own everything, so the buck stops with them. If they shipped any third-party packages as part of the installer who would pick up support if something goes wrong?
Finally, there's the competitive advantage of providing your own products over third-party tools or packages in a default installation.
Install Python/Perl on your development server, do your programming/coding there, test and compile them into executables, using tools such as py2exe (Python) or perl2exe (Perl). then distribute them (without the interpreter). That's one way.
Another way to do it is to distribute your apps with an installer such as NSIS and if python is not installed, install it.
Microsoft have no incentive to install {your favourite tool here} unless:
Someone pays them to,
They are required to by law (browser ballot screen here in the EU being one example)
Microsoft includes PowerShell and Microsoft's own development libraries (like VC, previously msvbvmXX.dll's, .net) because these are Microsoft products, part of their development tools. This is to encourage use of their tools and make it easier for people using their tools to deploy, compared to other languages. Why? They're in a competitive business.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am quite comfortable with C/C++ but I felt that another language would surely help me. So, I decided that Python would be good language to start as I have heard many people talking about Python. I have the following questions :
Where do I start for Python ?
Do I have a compiler like Visual Studio for Python ? I use VS2010 for C/C++
Thanks in Advance.
Like most languages, reading a book might help
lpthw
is the suggested book for learning python. It will guide you through setup and more :)
Dive into python is a great one, will get you upto speed if you are already familiar to programming, which you are. Learn by building small and useful projects in each chapter.
Python website provides the python interpreter. which can be used. Python is not compiled like c/c++ but interpreted.
I'd suggest Head First Python. Even it seems a little childish when you start reading, it turns out to be very, very well suited to learn not only the basic concepts but to get an idea what the language is capable of and is used for (google app engine, python on android,...).
I think there are lots of python information throug internet, if you are a C++ programmer and already have programming knowlege you can just search for info there. Although you can just install the interpreter and start playing arround, by my experience its a fairly simple way of learning (interpreter + documentation)
Some interesting webpages:
http://www.python.org/
http://docs.python.org/py3k/tutorial/index.html
Some IDEs as visual studio but for python:
http://wingware.com/
http://www.eclipse.org/
A while ago, I wrote a blog post addressing the first part of your question:
http://codelike.com/blog/2011/07/07/a-jump-start-for-learning-python/
As for the second part: No, you don't need a compiler. Code is interpreted on the fly, which means you can type code in the Python shell (that comes with a Python installation) and instantly see what it does. That's a great way for exploring some language features. If you install iPython on top of Python, you even get auto-completion inside that shell.
It depends on what way of learning you prefer. I would recommend to read theory, play a little and write something useful using python.
Below are several points where to start at your choice.
Theory:
Official tutorial
Dive into Python book (for python 2)
Dive into Python 3
Learn Python The Hard Way by Zen A. Shaw
Learning Python: Powerful Object-Oriented Programming by Mark Lutz
Programming Python by Mark Lutz
Think Python by Allen B. Downey
Courses and video:
Google's Python Class
Python track at Codeacademy
Coursera's Introduction to Interactive Programming in Python
Playgrounds:
checkio.org - platform for competing in python programming, lots of tasks from easy to hard ones
pythonchallenge.com
I would recommend to read official tutorial and start playing with online tutorials that will guide you from simple "hello world" programs to more complex one, if you were newbie in programming. Then read Dive Into Python and go deeper.
In regards of IDEs there are several options, and you can try them to find what fits best for your goals.
IDE's: PyCharm, Eclipse + PyDev, Wing IDE.
Just Editor: vim or sublime or notepad++, I have used all of them and stopped on sublime.
Interactive interpreter: ipython - there are options to run it as a console or like a notebook on localserver. This is awesome tool and truly interactive programming experience. Watch some tutorials first. There are several very powerful things like matplotlib, numpy, scipy supported that makes this tool very efficient.
Also you have to take a look at virtualenv and virtualenvwrapper to configure your virtual environments.
I really enjoyed learning python from the python essential reference
As for the compiler part: Visual Studio is not a compiler. It's an IDE that uses the MSVC compiler. Python on the other hand is a interpreted dynamic language (well... it's not actually interpreted, as the interpreter compiles a module into bytecode when it imports it for the first time, so it's a bit of both, but these are technicalities that you need not worry about when you start learning the language)
For python you need:
the python iterpreter: http://www.python.org/getit/
an editor of your choice. I personally enjoy emacs, but if you're into the IDEs, then you could use PyDev or komodo or many many others.
To answer your second question, Python is an interpreted language so you don't need a compiler. So long as you have Python installed, just run the script.
You can use whatever IDE you prefer to write the code.
As swair said Dive into python is a great resource for experienced programmers in other languages.. If you want to stay in Windows Visual Studio environment you can give a chance to Iron Python http://ironpython.net/tools/ It is built in Visual Studio 2010.
But for a fresh start i recommend Python shell, iPython or PyCrust. PyCrust is my favorite.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am reading a little bit on Objective-C, and since it comes from Smalltalk, like Ruby does, so I wonder, is it true that if using Ruby, (if Apple change XCode to support it), to develop iPhone or Mac app, it is not suitable really because of the speed? For example, Angry Birds probably isn't as smooth as it is now if using Ruby, vs if Objective-C, it is compiled and running as machine code.
But currently, is there any way of compiling Ruby or Python code into machine code so that it is running in the similar speed zone as Objective-C programs can?
On desktop those are fine languages to use, and for Python you could use py2app to deploy your app. You wouldn't want to write low-level graphics routines in an interpreted language, but that's what libraries like PyGame are for.
(Not that this is a particular advantage, but note that one of the most popular 2D game frameworks on iOS is a port of a 2D game framework for Python: http://cocos2d.org/ )
Until recently the iOS developer terms specifically disallowed running an interpreter, so nobody used Ruby or Python on iPhone. Apps programmed in those languages will probably start showing up, but you won't find much about that just yet.
Ruby/Python can be fast enough for Mac and even iOS development. It depends on performance requirements for your applications. It should be acceptable for most use cases.
Apple is developing Ruby implementation specifically targeted for Mac application development - MacRuby. Another option would be to use RhoMobile, a mobile development framework using Ruby.
Also OS X is bundled with Python and PyObjC library by default, which enables developing cocoa applications with python.
Possible ways to speed up your Python applications:
Use Cython. A python-like language, that compiles to c, to ease interoperability with c code.
Use Pyrex or Shedskin. The former compiles a subset of python to C, the latter to C++.
Use PyPy or Psyco. Both compile Python code to machine code on the fly.
For Ruby you might want to look at Rubinius - Ruby implementation that compiles to native code on the fly.
Python and Ruby themselves are not too fast, but many programs today are written to basically do none of the heavy lifting alone. For instance, if you want to save a PNG file as a JPG, you are certainly going to use the built in system calls to do it. In that case it does not really matter if it takes 0.00001 seconds in Obj-C, or 0.001 seconds in Python to process the mouse click, when the optimized system code to convert the image is the exact same code in both programs, and takes, say 1/2 a second to run. On the other hand if you are making a low level data munger of your own design, then you might want some C. Basically all languages that you would use on a Mac allow you to write something in C, and call it from that language, so even that does not slow you down.
Pick the language for the task based usually on what everyone else is doing for that problem, intersected with your abilities.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools.
The scripts would be used to trigger processes such as wget etc to call web services, or other applications/tools that need to run in a specific order with specific parameters.
We primarily work with the Windows stack, but there is a good chance we will need to support Unix in the future.
Python works as a great, all-purpose tool if you're looking to replace CMD and BAT scripts on your Windows boxes, and can also be written to run scripts on your (L)inux boxes, too. It's a great, flexible language and can handle many tasks you throw at it.
That being said, PowerShell is an amazingly versatile tool for administering all manner of Windows boxes; it has all the power of .NET, with many more interfaces into MS products such as Exchange and Active Directory, which are a timesaver. Depending on your situation, you may get more use of of PS than other scripting languages just because of the interfaces available to MS products, and I know MS seems to have made a commitment to providing those APIs in a lot of products. PowerShell comes installed on all current versions of Windows (Windows 7+, Windows Server 2008+), and is fairly easily installed on older versions.
To address your edit that your scripts will be used to launch other processes, I think in that case either of the tools fit the bill. I would recommend PS if you plan on adding any admin-ish tasks to the scripts rather than just service calls, but if you stick to what you described, Python is good.
We would like to standardize our scripting and are currently using bat and cmd files as the standard.
It sounds like Windows is your predominate environment.
If so, PowerShell would be much better than Python.
PowerShell is included with Windows
Server 2008. No need to
deploy/install Python runtime on
every new server that rolls in.
The entire Microsoft server related software (Exchange, Systems Center, etc) is transitioning to PowerShell cmdlets for functionality and extensions
3rd party vendors (e.g. SCOM plugins) will also use PowerShell scripts/cmdlets to expose functionality
I have more experience with Python than PowerShell but the writing is on the wall as far as the Microsoft ecosystem is concerned: go with PowerShell. Otherwise, you'll just be going against the grain and constantly interop-ing between Python and everyone else's cmdlets.
Just because you can code import win32com.client in Python does not put it on equal footing with PowerShell in the Windows environment.
IronPython has access to all of the same .NET assemblies as any other .NET language for writing system dependent scripts on Windows. But the same knowledge of Python can be used to write similar scripts on Linux, Solaris, BSD, or OS/X. If you use the standard C Python on Windows, then you can access any COM objects and it is straightforward to translate VBA examples into Python code. The SPAMBayes Outlook plugin is a good example of how far you can go with that. http://spambayes.sourceforge.net/
Python's best feature is the "batteries included" standard library, and even though this is not distributed with IronPython, much of it will work if you just point IronPython to the installed library folder from CPython. In fact, most pure Python libraries, i.e. no compiled C or C++ modules, will work fine with IronPython. On Windows, you also have the choice of installing Python through Cygwin.com which then allows you to use a lot of modules that are normally considered UNIX-only. This can be of use if you have to maintain cross-platform scripts and you prefer consistency rather than special case coding for each OS.
And if you should need to leverage some Java classes, then Jython allows you to use the same Python language that you know to leverage this. Combine this with a nice message queuing system like RabbitMQ, and you can have Python, Jython and IronPython scripts on multiple machines all cooperating in getting the job done.
There is also a huge selection of 3rd party Python modules out there and you could spend several months trawling through delicious.com before you run out of new discoveries. This means that when you need something not part of standard Python libraries, a bit of Googling often comes up with a solution.
Some useful Python modules for scripting to replace bash, CMD and BAT files are PEXPECT http://www.noah.org/wiki/Pexpect and Python WMI http://timgolden.me.uk/python/wmi/index.html
But, in the end, Python also works just fine for simple straightforward scripts that don't need any special features... yet!
If all you do is spawning a lot of system specific programs with no or little programming logic behind then OS specific shell might be a better choice than a full general purpose programming language.
One advantage to Python is the availability of third-party libraries and an extensive built-in standard library. You can do a lot of powerful operations quickly and easily with Python on a variety of operating systems and environments. That's one reason we use Python here at the office not only as a scripting language but for all of our database backend applications as well.
We also use it for XML and HTML scraping, using ElementTree and BeautifulSoup, which are very powerful and flexible Python-specific libraries for this sort of work.
I find it sad no one yet mentioend good ol' Perl.
The questions is kind of vague, but Python is much more portable than PowerShell; however, Python isn't that prevalent on Windows. But on the other hand, I don't believe PowerShell scripts will work on a Windows machine that doesn't have PowerShell. Meaning they may not work in the old fashioned cmd shell. I think you'll find more documentation and libraries for Python as well.
PowerShell is more like Bash than it is a programming language like Python.
Maybe you could explain what you want to do with your scripts and you'll probably get better answers.
If you are working with web based scripting, then ActiveState's ActivePython seems to have a lot of support for Windows specific API's that would suit you and it has tons of great portable libraries for doing web based work.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to set up my development environment at home for writing Windows applications in Python.
For my first piece, I'm writing a simple, forms-based application that stores data input as XML (and can read that information back.) I do want to set up the tools I'd use professionally, though, having already done a round of didactic programming.
What tools are professional python developers using these days? In order to have a working python environment, what version of the compiler should I be using? What editor is common for professionals? What libraries are considered a must-have for every serious python developer?
Specifically, which Windowing and XML libraries are de rigeur for working in Windows?
I like Eclipse + PyDev (with extensions).
It is available on Windows, and it works very well well. However, there are many other IDEs, with strengths and weakness.
As for the interpreter (Python is interpreted, not compiled!), you have three main choices: CPython, IronPython and Jython.
When people say "Python" they usually refer to "CPython" that is the reference implementation, but the other two (based, respectively, on .Net and Java) are full pythons as well :-)
In your case, I would maybe go on IronPython, because it will allow you to leverage your knowledge of .Net to build the GUI and treating the XML, while leaving the implementation of business logic to Python.
Finally, should you decide to use CPython, finally, there are several choices for working with xml:
minidom; included in the standard library
lxml, faster and with a better API; it means an additional installation on top of Python.
Lots of questions, most hard to answer correctly. First of all, most of python development happens on unix-like platforms. You will hit many walls during development on Windows box.
Python is not a compiled lanugage, current preferred version for production is 2.5. For environement setup you should take a look at virtualenv. Editor is a personal choice, many Python developers use Vim, you can customize it pretty well to suite your needs.
About libraries, Python is very strong around this area and it's really hard to say what is a must to know. If you want to handle XML, I would preffer lxml.
If you go for CPython, make sure you get the win32 extensions by Mark Hammond, either as a separate download which you install on top of the vanilla Python installation, or as part of ActiveState's ActivePython. It includes an integrated editor and debugger.
Jython has recently reached 2.5 compliancy, but we quickly ran into recursion limit issues.
The standard distribution includes IDLE, a graphical editor and debugger.
I like shells, so I'm using IPython for interactive work, and pydb as debugger (unfortunately, I had problems getting pydb to work under Windows).
"What tools are professional python developers using these days?"
Lots
"In order to have a working python environment, what version of the compiler should I be using?"
["compiler" is meaningless. I'll assume you mean "Python"]
We use 2.5.4. We'll be upgrading to 2.6 as soon as we've done the testing.
"What editor is common for professionals?"
We use Komodo Edit.
"What libraries are considered a must-have for every serious python developer?"
We use Django, XLRD, PIL, and a few others. We don't plan this kind of thing in advance. As our requirements arrive, we start looking for libraries. We don't "pre-load" a bunch of "must-have" libraries. The very idea is silly. We load what we need to solve the problems we have.
There are no set standards in these matters, and for good reasons:
there is a fair amount of good choice
different people are productive with different tools
different tools and libraries are suited for solving different problems
That said, I think it's a valid question exactly because there is a fair amount of good choice. When there is too much choice people often do not chose at all and move on. You still need to do your own research to decide what is best for you but you may find here some good starting points.
Here is what I use professionally on windows:
python 2.5.4
latest wxPython
XRC Resource Editor from the wxPython docs & demos for the grunt of the tedious GUI design
lxml or gnosis utils for xml
WingIDE Professional
Taking the headline question literally, the answer has to be IronPython. The 2.0 releases are equivalent to CPython 2.5, and the 2.6 release (currently at beta2) is intended to match CPython 2.6 (full 2.6 release some time in the next couple of months). With either you can use the state of the art in Windows GUI frameworks, i.e. WPF; and you get the whole .net XML support libraries (excepting Linq to XML, which relies on clever bits of C# that IronPython cannot yet emulate).
I've used NetBeans Python plug-in happily as an IDE for IronPython using WPF.
The answer would depend on what you want to do with Python. If you want to do web programming, Python is blessed with many web frameworks. The most popular ones are: Django, Pylons, and Turbogears. There's also Google App Engine, where you can deploy your Python webapp (based on GAE framework) to Google's infrastructure. If you want to do Desktop programming then there is PyQT and TkInter, or you can even try using Java Swing with Jython. And if you want to do Mobile app programming then there is Python for S60 which is backed by Nokia.
Python is interpreted language, so there is no compiler (although the interpreter also compiles your python module into bytecode). I would recommend using Python 2.6 as it has some syntax and libraries that is different compared to 2.5. You can also start learning Python 3.0 too.
There is several IDE that is good for Python. You don't have to get yourself attached into one editor/IDE because most of them are good ones. For the commercial ones there is WingIDE which is really focus on making IDE for Python and I would really recommend IntelliJ IDEA with Python plugin which is really nice if you often look at the libraries in your Python environment. For the free ones (as others have said) there is Komodo Edit or you can also try Netbeans with Python plugin.
As for the must-have libraries, this is depending on what you want to do. What kind of application you want to develop with Python. But I think every Python developer should consider PIL for imaging library. I also use simplejson quite often, because I prefer using JSON rather than XML. If you are using XML though, you can use lxml as it is really fast in parsing XML.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either
WingIDE
KomodoIDE
which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs which is a mishmash of various templating languages and Python itself.
One con i have to raise about WingIDE on Windows is that it has an AWFUL interface (probably cos of the GTK+ toolkit?)
I have been using e-text editor all the while and increasingly been dissatisfied with it especially when its unable to do correct syntax highlighting at times. Furthermore I am hoping syntax coloration can be done for Mako templates.
Thank you very much all and have a great day!
Did you try Eclipse with PyDev plugin? Which is FREE plus works for any OS.
Screenshots at the PyDev website.
(source: sourceforge.net)
+1 for WingIDE, It supports debugging pylons app.
Netbeans has implemented beta support of python development. It unfortunately doesn't specifically support any templating languages that I know of, but I've been satisfied so far with its syntax highlighting and auto-complete (especially from imported modules).
Since everyone has a different preference for their coding environment, I suggest you just try out every IDE/editor you can get your hands on; so you can find the best mix-match of features that you're specifically looking for.
I use Stani's Python Editor for most Python-esque editing tasks on Windows & Linux. I use Notepad++ for editing HTML, XML, CSV, and other text based "code like" files on Windows. They are both free, and meet my needs for home based weekend projects.
I have used Wing IDE 101, but I never the full versions. I did not do enough with WingIDE to develop any muscle memory, so it still feels a little artificial to me. YMMV.
To a certain degree, the IDE will influence how you think about the process of creating and debugging code. So you should take some time to try a few different options and see which makes the most sense to you.
Try Aptana Studio... It's eclipse+pydev+web stuff, it doesnt have any specific pylons stuff or mako support. But eclipse+pydev alone is great + all the nice jscript+html+css stuff aptana adds.
+1 for Spyder. Never heard of it before reading this page. Working great so far.
after very very careful comparison, KomodoIDE 5.1 is most suitable for my purposes.
Reasons:
Extensibility
Support for Mako and YUI (required by me)
Native interface support (no GTK unfamiliarity)
Support for Mercurial SCM (required by me)
thats all I guess. I am extremely satisfied with KomodoIDE and have just shelled out some money to buy it.
I figured when making a choice of tools, spend a day or two (yes, it takes time) trying them out and choosing what best suits your day-to-day purposes. If its just your first time coding, using a standard free tool or open source tool is far more useful than expending the time to find out the best tool.
Only after some degree of expertise is acquired, you have a very narrow spectrum of requirements/preferences which will make choosing a tool far easier.
Wow, I've also been looking for a good Pylons web app IDE. Seems like KomodoIDE 5.1 kicks some serious ass. I love the support for Mako and that it supports pretty much all of the SCMs.
I've been using Textmate, but KomodoIDE will take over from now onwards
I'v been using Spyderlib for some time, its really worth trying.
http://code.google.com/p/spyderlib/
http://groups.google.com/group/pylons-discuss/browse_thread/thread/4f41aef28be741e5