Python thoughts?

Discussions around miscellaneous technologies and projects for the general membership.
Post Reply
davidtheweb
New Member
Posts: 8
Joined: Mon Jun 01, 2009 3:31 pm
Location: USA

Python thoughts?

#1

Post by davidtheweb »

I've been interested in Python and have been brushing up on 3. I'm just curious as to other's thoughts and experiences with Python as a tool?
KOlive43-p40
New Member
Posts: 5
Joined: Tue Jun 03, 2008 1:39 pm

Good for Quickly Needed Toolz

#2

Post by KOlive43-p40 »

I hate to sound too much like a cheerleader, but for hammering out a quickly needed tool, especially for text-file manipulation, Python rulz! Its built-in compression and decompression utilities (including zip files) are also very handy.
davidtheweb
New Member
Posts: 8
Joined: Mon Jun 01, 2009 3:31 pm
Location: USA

#3

Post by davidtheweb »

I'd noticed the text manipulation and database strengths. I'd been introduced to Python through EVE Online, so the potential for amazing visuals was the first draw.
davidtheweb
New Member
Posts: 8
Joined: Mon Jun 01, 2009 3:31 pm
Location: USA

#4

Post by davidtheweb »

One thing I'm running into is this that I can't seem to find an exe builder for Python 3 code. I can compile and run a Python 3 program on a machine that has Python 3 already installed, but can't just move that and run it on another machine unless it also has Python 3 installed.

I can do this for Python 2. There are a couple of exe builders, py2exe and pyinstaller, already out there for 2. So I guess I'll have to rewrite things for Python 2 for the time being.

Anyone else have a link to a Python 3 builder?
munaish
Member
Posts: 137
Joined: Sun Apr 01, 2012 1:58 pm

Re: Python thoughts?

#5

Post by munaish »

@davidtheweb I hear cx_freeze works for Windows for making binaries (executables), although I've only ever used it with Linux.

I believe Python is the best language for most purposes, personally. It's better on Linux, though, because pip (a tool used for automatically installing third-party libraries) is more successful at compiling stuff, like PyCrypto. Plus, on Windows you have to get the proper C++ compiler to compile stuff with pip.

Really, though, you don't even need pip most of the time. There are a lot of very useful modules that come pre-installed.

Python 3.x is particularly nice because Unicode is the default text encoding, meaning it can handle all your foreign and special characters as easily as the English alphabet.

Threading is pretty nice in Python.

Tkinter is an excellent GUI toolkit that essentially comes with Python (at least on Windows; it's a separate, but easy, install on Ubuntu). Tkinter has a couple drawbacks compared with alternatives for Python, but I think it's usually the better choice if you know how to use it.

Slices in Python are nice.

I love Python dictionaries (those are similar to associative arrays in Java). They're a great way to speed up a program that otherwise would require a bunch of looping with lists.

Python is dynamically typed, which makes it easier and more flexible, but also somewhat slower than it otherwise would be, although it is faster than most scripting languages (Lua being the only exception I should probably mention). However, you can use Cython to make it statically typed and so it compiles your code to binaries (libraries, like so and dll files--not executables).

I have a bunch of projects I'm working on with Python, to give you an idea:
· A database management system
· A very advanced text editor.
· A hypertext fiction authoring environment.
· A package for making text adventures.
· And other stuff.

Python is cross-platform. However, there are some differences in how you code a few things on different systems, but the os module helps a lot there. Like, os.sep is the separator character in path strings for whatever system you're using.

Python can be used for object-oriented programming, functional programming and more. I mean, you can make classes, objects, etc. Functions can be used like variables (passed in as arguments and such).

I like regular expressions in Python a lot. Those are used for doing nice text searches and replacements.

A lot of popular free-software is made with Python. It's very popular in the Linux community.

It's pretty easy to get Python help on Stackoverflow.com, Ubuntu forums: Programming Talk, and probably other places like daniweb, or the Freenode IRC chat for Python.

If there anything you want to know, particularly?
munaish
Member
Posts: 137
Joined: Sun Apr 01, 2012 1:58 pm

Re: Python thoughts?

#6

Post by munaish »

Negative indexing of lists (arrays) is also nice. myList[-1] is the last item in the list, for instance.
Post Reply

Return to “Other Member Technologies”