Question:
Choosing a language: questions on Python?
just "JR"
2011-07-25 11:01:15 UTC
I gave up saving VB5 sources of a 3 years development Engineering program...
I'll re-write from scratch (maybe will also improve on the old version).
Remains to choose which language, and I am tempted by Python.
Questions:
1. Does Python v3 "compile" the sources into an EXE file that can be distributed and installed on Windows OS?
2. Does Python end up with an "Application" that can run on PCs?
3. Does Python provide a lot of graphics functions (The program is a CAD design, similar to AutoCAD, but specialised to a particular engineering field).
4. Can Python access a web-server (i.e. act like a browser)?
5. For those who have been with it for a while, how reliable are successive versions? (I will never use Microsoft programs again: VB6 won't load VB5, VB.net won't load VB6, and no two successive versions are compatible.)
6. If yes to all, where can I get some start-up tutorials? (I am expert in several languages, but this one is a new...)
Four answers:
husoski
2011-07-25 12:33:41 UTC
1. Python doesn't really compile, or not very well. You end up with a subset or a dialect, and most of those efforts are based on Python v2 anyway. Two well established examples are Jython, which "compiles" to bytecodes for the Java VM, and IronPython which "compiles" to bytecodes for the .NET framework.



2. The reference implementations from www.python.org have their own bytecode structure (.pyc files for "compiled" Python) and these can be run with or without the source code being present. (If the source file is present and newer, it will be recompiled when imported.) So, you can copy out just the .pyc files to make a distributable application. As with Java or .NET, you have to have Python installed in order to run the app, though.



3. The graphics I've used have been more GUI-oriented. The tkinter module I use is part of the standard reference distribution (on WIndows anyway) and has a canvas object with simple geometric shapes. The PythonCAD package on SourceForge takes a different approach: interfacing to the Qt framework using pyqt. If they can do that, so can you.



http://sourceforge.net/projects/pythoncad/



4. You mean web CLIENT? A browser is not a server. The answer is yes, either way. There is socket-level TCP/IP and UDP networking support for low-level implementation of anything, plus higher-level support for HTTP (and HTTPS, I believe, but I haven't used that.) I don't know what support is there for parsing HTML, though. I've just used regular expressions to pick out the bits that I was looking for.



5. Aye, there's the rub. Major version are backwards-incompatible. So, most Python 2.x programs will not run on Python 3.x versions. Python 3 includes some changes that make it almost certain that source code changes are needed. So, a couple of years after the release of Python 3, Python 2 is still here. Jython and IronPython are Python 2 dialects. I still use 2, but have started to use the v3 syntax changes (print is a function now, not a statement, so print('hello monty') instead of print 'hello monty') supported in 2.7.2. Mind you, I don't use it a lot...but it is what I chose for my "Daily Doonesbury" and Sudoku-solver homebrew apps. It's very flexible in either version.



6. Not "yes to all", but even so, the Python website has a decent tutorials for either version. (http://www.python.org) Click on "Documentation" for either 2.7.2 or 3.2.1 on the left sidebar, and then click the Tutorial link. For Python 2, I found the book "Core Python Programming" by Wesley Chun very useful.
deonejuan
2011-07-25 11:22:34 UTC
Hi, JR,



My gripes with Python...

1. The White space. Cut-n-paste a chunk of source code and try to put it elsewhere. The indentation becomes a nightmare of invisible tab stops.

2. Blender runs on python. Blender 2.47 runs on a certain Python version. Blender 2.6 runs on another Python. Telling Blender where the python is for the Blender version becomes an above-difficult installation issue.

3. I was surprised, but Python is slow at number crunching. I mean way, way back in the pack.

4. Python does have a variety of graphics libraries. The end user will need them also.

5. ActiveState(sp/???) Active Python is NOT Python 100%.



Python can do anything if it can communicate with the OS -- thus the reason why they have ActiveState Python. There is Py2exe, but asfaras ActiveState, I dunno.



Windows7 is a fukkking hounddog about networking any way you slice it. I will never program on a Win7 box.



So, you've got NetBeans. You can add the python plugin for the python editor. I would opinion the NetBeans py editor is the best one flying.



BTW you aren't the first coder to notice MS makes VB a procedural library with a shelf life. The VB I learned was based upon MFC and MS moved on to .net and forgot about MFC.
vitiello
2016-10-02 04:19:49 UTC
Oh god, do no longer study LISP (i might propose FORTRAN before LISP). of those possibilities i might flow with C++. the different languages you pronounced are all scripting languages (which for my section are no longer "actual" programming languages, i.e. compiled languages). i do in contrast to PERL, under no circumstances used Ruby, and have not truly used Python (even if i've got considered Python do some distinctly stupid issues, so i do no longer propose it and have heard others voice that opinion). PERL is for string processing and parsing (i.e you have a extensive textual content cloth document and you desire to get archives out of it). Frankly, in case you desire to do string processing I lots lots desire AWK. My known advice now's C, then Java, then C++ (i.e. study a minimum of C and Java and then in case you desire study C++). yet you may pass Java and flow to C++, yet i think of C remains the perfect ingredient of initiate programming in (provided that merely approximately all cutting-part programming languages are C-based, which includes Java). while you're utilising Linux, then any programming language would be ordinary to apply.
Eli
2011-07-25 12:23:24 UTC
1- i find python 2.7 much easier than v3 probably because i learnt 2.7 first, you have to choose whether to learn v3 which would become later the supported version or v 2.7 the 2.x will always be supported because it's like COBOL , programmers prefer it because they are used to it and because it has more libraries given that it's older, note that between 2.x and 3.x there's a big difference much like C and C++ therefore 2.x will always be there.



2. python can be used for server side scripting but if you want to use it for web application go for Django, it is the web framework for python, and it has been created by php developers lol coz php isn't that great for complicated apps and you remember that prior to php 5.3, they didn't have namespaces lol



3- python can be compiled to exe, i'll pm you and tell you how



4-python has many libraries for what you need, in fact I am probably allowed to say that it has more libraries than any language ever created.



5- I'll pm you and give you a long list of tutorials when i finish writing my answer lol and the libraries that you asked for as well



6- Although I'm not the big expert of pyhon, I'm 22 years old, I've used 2.4 2.6 and now 2.7 and i can say that they are reliable, and the unreliable versions are released as subversions and not official releases. I advice you to get v2.7



note that you might have, and i say you might have some problems installing python, if so pm me, I'll tell you how to fix it, the easiest way to install python is from activepython



http://www.activestate.com/activepython



you won't have any problems installing it, the only disadvantage, it doesn't support many libraries, it supports hundreds of libraries but there are thousands of libraries out there



what can i say about python that you'd like to know? you can use netbeans for python and I'll tell you which plugin to use, but it's better to use eclipse if you have one with pydev, especially if you want to develop django because pydev generates the framework for you and some people have errors doing it from the command line ( i did lol) but netbeans is fine lol



python was called Cpython and C developers will find it easy to get into python for obvious reasons lol :D



python has many UI that you might wanna look into such as glade UI (pygtk) it feels like vb for newbies who actually use the UI, but it's fun :D



python has a version for .net developers to allow them to use python in .net apps it's called pythonnet and another for c developers that allow C developers to use it also, it's called cython, they have other libraries like that but these libraries are the one which may come handy for you someday :D



now i'm done, i can pm you lol :D


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...