Python programming language

Big D

Well-Known Member
Messages
5,203
Reaction score
3,860
Does anyone here know python? I'm teaching myself but would love to have someone who knows a bit more than I do to bounce ideas and question off.
 

YosemiteSam

Unfriendly and Aloof!
Messages
45,858
Reaction score
22,189
CowboysZone LOYAL Fan
Asked away. I started using in 1999 professionally. (I've used both Python 2 and Python 3)
That said, I'm "management" now so I don't use it near as much as I used to. That said, I've written professional (DevOps) and (personal) games with it.
 
Last edited:

Big D

Well-Known Member
Messages
5,203
Reaction score
3,860
Thanks guys! I'm trying to read / watch everything I can on it. I want to use it in the background of a wordpress installation interacting with the mysql db. Possibly to fetch data from various sites and render it html in one of the pages. I started on python 2.7 but i just upgraded to 3 but i don't know enough and havent really noticed any differences.
 

YosemiteSam

Unfriendly and Aloof!
Messages
45,858
Reaction score
22,189
CowboysZone LOYAL Fan
My understanding is WordPress is php, not Python. Since your software stack already includes php, you are likely better served to use that for your requirements.

If you want to use Python to serve pages, you need something like WSGI in the stack unless you just want a python program to run that generates a static HTML page that can be loaded. (I do this for monitoring my mail relay server statistics.)
 
Last edited:

Reality

Staff member
Messages
31,231
Reaction score
72,767
CowboysZone ULTIMATE Fan
It really comes down to what kind of job or career you want.

If you are wanting to build web sites, I would recommend focusing more on front-end (javascript) development as that's where most of the magic will happen as web developers shift away from back-end generated sites to front-end sites that connect to APIs. That said, the front-end developer market is saturated with people, and that will continue to grow because a lot more graphics designers are learning javascript and in some cases, the graphics editing software they are using will auto-generate javascript routines for tasks and effects.

However, if your goal is to work on servers such as system or network administration, knowing a server-side scripting language is VERY important no matter what it is. While PHP will work for that, if you're looking for a job or career, especially high paying, in those areas, python will be much better mainly because a lot of companies use it and are looking for people who know it as part of their sys/net admin and/or devop openings. Python, PHP, Node.js, etc. are all good API languages as well.

Also, the world is saturated with PHP developers, most of whom self-taught without any design principles or concepts, which means ugly code. I learned PHP a long time ago mainly because a lot of the most common open source web applications are written in it including many popular CMS and forum software applications.

No matter what you do though, I think javascript is a must-learn language for any developer. With the growing popularity of Node.js and the transition to API-based web development, javascript will be integral to almost every web-based project going forward.
 

YosemiteSam

Unfriendly and Aloof!
Messages
45,858
Reaction score
22,189
CowboysZone LOYAL Fan
Don't listen to @Reality, he is like Jon Snow. He knows nothing!

3hogansheroes.jpg
 

JoeyBoy718

Well-Known Member
Messages
12,715
Reaction score
12,709
You can do a lot of things with Python and it's very easy to learn if you already know another language. I've only used it for scripting and machine learning, but there's a popular web framework called Django that you might want to look into. It's also much easier to write object-oriented code than it is with JavaScript. But for the purposes you described, a JavaScript framework like Angular/React/Ember would probably do. I'd also dump MySQL for MongoDB since it supports straight JSON (and is easily scale-able if that's important to you).
 

YosemiteSam

Unfriendly and Aloof!
Messages
45,858
Reaction score
22,189
CowboysZone LOYAL Fan
Actually, I believe as of version 5.7 and enhanced support in 8.0 JSON is a natively supported data type in MySQL.

As for dumping MySQL for MongoDB. It should never be stated as simple as that. A relational database and document-oriented database (NoSQL) have different data models and have different use cases. There are things that NoSQL absolutely cannot do that relational databases are built for and vise versa.

You build your application with the wrong one could doom it down the line. Pick your database with care!
 

Rockport

AmberBeer
Messages
46,580
Reaction score
46,004
CowboysZone LOYAL Fan
You can do a lot of things with Python and it's very easy to learn if you already know another language. I've only used it for scripting and machine learning, but there's a popular web framework called Django that you might want to look into. It's also much easier to write object-oriented code than it is with JavaScript. But for the purposes you described, a JavaScript framework like Angular/React/Ember would probably do. I'd also dump MySQL for MongoDB since it supports straight JSON (and is easily scale-able if that's important to you).
Drop Myself fir Mongo? That's absurd as your going from relational RDBMS to no SQL.
 

Reverend Conehead

Well-Known Member
Messages
9,953
Reaction score
11,858
I used to write freeware in Visual BASIC 6 (classic, not to be confused with dot net). I'm interested in learning a new language so I can write freeware again, but I want to also be able to write Linux and Mac versions this time. Is Python a good choice? Or would I be better off with C++?
 

YosemiteSam

Unfriendly and Aloof!
Messages
45,858
Reaction score
22,189
CowboysZone LOYAL Fan
@Reverend Conehead, that is completely dependent on what the product is!

I can write in both Python and C/C++, but most of the time I just Python for my games, tasks, glue etc. If I were writing a huge GUI application (like a browser, etc) or something that is required to process a lot of information or OS level really fast I would likely write it in C/C++ or even more probable Java. Also, if you intend for it to not be open source, Python wouldn't be your top choice.

Yes, I'm aware you can package python apps into binaries where it packs the bytecode and the Python executable and libraries into a single binary file, though I do not like those implementations most of the time.
 

Reality

Staff member
Messages
31,231
Reaction score
72,767
CowboysZone ULTIMATE Fan
I used to write freeware in Visual BASIC 6 (classic, not to be confused with dot net). I'm interested in learning a new language so I can write freeware again, but I want to also be able to write Linux and Mac versions this time. Is Python a good choice? Or would I be better off with C++?
I agree with Sam .. if you are trying to create applications that people run on common devices like smartphones, Macs, Windows PCs, etc, I would avoid learning scripting languages such as PHP, python, javascript, etc.

As for which language you choose, it will depend on the target devices/operating systems you want to support. Whichever language you choose though, I would make sure to focus heavily on materials that teach design principles along with the language itself.
 

Reverend Conehead

Well-Known Member
Messages
9,953
Reaction score
11,858
@Reverend Conehead, that is completely dependent on what the product is!

I can write in both Python and C/C++, but most of the time I just Python for my games, tasks, glue etc. If I were writing a huge GUI application (like a browser, etc) or something that is required to process a lot of information or OS level really fast I would likely write it in C/C++ or even more probable Java. Also, if you intend for it to not be open source, Python wouldn't be your top choice.

Yes, I'm aware you can package python apps into binaries where it packs the bytecode and the Python executable and libraries into a single binary file, though I do not like those implementations most of the time.

I thought of Python because a lot of Linux applications are written in it, for example, CherryTree. On the other hand, other Linux apps like LibreOffice are written in C++ (though I'm told some parts are written in Java or Python, something that doesn't make sense to me). But, yes, I was going to make what I write open source. It's the reason I rejected Xojo, even though that BASIC language is most similar to what I've used before.
 

JoeyBoy718

Well-Known Member
Messages
12,715
Reaction score
12,709
I agree with Sam .. if you are trying to create applications that people run on common devices like smartphones, Macs, Windows PCs, etc, I would avoid learning scripting languages such as PHP, python, javascript, etc.

As for which language you choose, it will depend on the target devices/operating systems you want to support. Whichever language you choose though, I would make sure to focus heavily on materials that teach design principles along with the language itself.

Yep. Some of my favorite books are by Martin Fowler (NoSQL Distilled, Refactoring, Enterprise Patterns) and Robert "Uncle Bob" C Martin (the Clean trilogy, Agile practices). Important to know how to write code that is easy to read, change, extend and test.
 
Top