473,769 Members | 4,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is python for me?

Hi,

I'm planning to learn a language for 'client' software. Until now, i
'speak' only some web based languages, like php. As a kid i programmed
in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
(for me) new computer language.

I like Python. Its free, easy to learn and some favorite programs of my
are written in Python / can understand Python (like OpenOffice) etc.

But I'm not a full-time programmer. I know, that I've only time &
possibility to learn one (= 1) language good. So i ask myself is python
the language I'm looking for?

In the future, i want to write the following applications:[*] A database driven program, which can handle my clients, tasks and
places (= 3 tables, has to work relative with each other). I think,
this isn't a problem for Python[*] As a photographer i like to build a picture management system (also
db) with raw support. Raw is the raw-data from the sensor of the
camera. My questions:
- can python encode raw?
- can python head for a utility like dcraw?
- or head for a utility like IrfanView (delphi?) or something like
that?

Tnx for your help!

Nov 13 '06
22 2049
I think Python is for you.

lennart wrote:
Can you define 'large'? Is that large in code, or large in database? I
don't know which database is supported. If its a external db, like
MySql, the query is performed through the software of MySql, am I
right? If I'm correct, the 'slowness' comes from the amount of code in
python itself, not from the database.
I'm afraid dakman's comment wasn't really very helpful.

Size is not a problem in itself. Ok, if the code modules are very
large, you will have a larger startup time, but this is probably
even worse in lower level languages such as C/C++. The python byte
code works at a higher level of abstraction than machine code, so
the byte code files are much more compact than corresponding
executable binaries from e.g. C/C++/Delphi.

The Python programming language, with its classes, modules,
packages etc is in my experience much better for writing large
applications without causing a mess than e.g. C++. It's much
easier to make a mess with C/C++'s "#include" than with Python's
"import". The lack of static typing means that some problems that
the compiler/linker would find in e.g. C++ development won't turn
up until you test your code in Python, but you'll get to testing
much faster with Python, and if you don't test well, you'll fail
with any larger development project however clever your compiler
and linker is.

Due to Python's very dynamic nature, there are a lot of operations
that will be much slower than in e.g. C or C++. For instance, if
you write "a = b + c" in C, the compiler knows at compile time what
types a, b and c are, and if they for example are ints, the addition
will be translated into a few very simple and quick machine code
instructions. In Python, the types typically won't be know until
runtime. This means that the objects need to be inspected during
execution to figure out what + means for these kinds of objects.
Python also handles memory allocation etc.

The consequence of this is that some kinds of programs that do
millions of trivial things, such as cryptography applications
where there are a lot of repeated multiplications and additions,
would be much, much slower in pure Python than in pure C. This
doesn't mean that Python is bad for a large group of applications.
It means that for a large group of applications, there are some
parts (for instance computationally intensive or e.g. interfacing
with some kind of devices or third party products) that should be
handled by extensions written in e.g. C.

Whatever you plan to do, it's likely that the extensions you need
already exists. There are such extensions for databases, networking,
maths, cryptography, XML parsing, etc etc. I'm a programmer working
with C, C++, Python, SQL etc, and despite 10 years of Python coding
I never actually needed to code any C extension myself yet. It's
very likely that you'll get away using 100% pure Python too. Note
that large parts of your programs will be C code, but C code you
didn't have to write yourself, and as far as your programming is
concerned it could as well have been Python, it's just that things
will run faster than if it had been pure Python...

Have fun!
Nov 17 '06 #21
Hi,

On Thu, 16 Nov 2006 10:22:57 -0800, "dakman wrote:
Yes of course python can handle of these things, but have you actually
compared them to something written in C? Even if the app was converted
into bytecode, it's still not as fast as an executable, that's all I am
saying.
I used to routinely write gui programs (data entry and such) in python
first and then ported them down to C for speed. I stopped the downporting,
isn't worth it, I just stay in python.

Make no mistake, python itself is slow enough. Its just that with today's
CPUs, no, even with CPUs 3 years old (mine is an Athlon XP), most
of the time slow is still faster than needed.

Once you start to do heavy-lifting in python, the picture becomes bleak,
though (I tried to write a Truetype Font Repacker
http://www.scratchpost.org/hacks/tru...font-repacker/ without using any
external font libraries and its dog slow).

That said, most programming (for me also at work) consists of glue code.

And there still is that python to C++ converter, what was it called?
And python for dotnet. And Jython.
Those should help with speed a bit.

cheers,
Danny
Nov 21 '06 #22
One resource you should always keep at hand is this extremely useful
Quick Reference:

http://rgruet.free.fr/PQR24/PQR2.4.html

Study it carefully, there is a lot in there that can teach you about
how Python works. Fire up IPython as well and start hacking!

2B

Nov 22 '06 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.