473,666 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python's Suitability?

I have some questions about the suitability of Python for some
applications I've developed in C/C++. These are 32 bit Console
applications, but they make extensive use of STL structures and
functions (Lists, Maps, Vectors, arrays) - primarily because the data
volume is high (2,500,000+ records).
The main thing I'd like to do is port one part of the system that has
a series of user menus and works with several text data files (one
_very_ large). I'm not using any database system, just my home-grown
indexed sequential file database. There's nothing but volume that
precludes this application from running from almost any text file-
processing language system (e.g. Perl, BASIC, etc.).
From what little I've seen of Python, it appears I could port this
application to Python code, but I'd do so only if I could:
1. Integrate it into a Web application in such a way that the user
could select it as an option from a main page and have it execute as a
WEB GUI application. Currently, the application's interface is only a
crude DOS window.
2. Assure that the performance isn't totally crippled by using Python,
an interpretted language. While I don't expect native C/C++
performance, I don't want to be embarrassed...
3. Make sure that the volume of stored data (2.5+ million records) can
be accommodated in Python structures (I don't know enough about Python
to answer this question...).
Note that I'm not considering using the existing C/C++ code in my Web
application, because I don't know how to write a C/C++ Windows
application - and I'm sure the learning curve here is greater than
Python's. I'm a very old procedural-based application developer (47+
years of programming experience), and developing Windows applications is
beyond me.
So, I only (?) want to take an existing application that uses a large
text file (and several smaller text indexing files) and put it into a
Web system I already have. I feel Python (or Perl) is(are) my best
option(s), and here I'm only looking for some initial guidance from the
Python users. TIA
Aug 28 '07 #1
2 2000
On 28 Aug., 02:28, mrc2...@cox.net (Michael R. Copeland) wrote:
Note that I'm not considering using the existing C/C++ code in my Web
application, because I don't know how to write a C/C++ Windows
application - and I'm sure the learning curve here is greater than
Python's. I'm a very old procedural-based application developer (47+
years of programming experience), and developing Windows applications is
beyond me.
As I see it you might separate the console frontend from your database/
model backend and reuse your database code. The next step would be
selecting a webframework that allows you to plugin your own database
driver which has to be wrapped into a Python module. For wrapping into
a Python module there are several alternatives. SWIG and BOOST.Python
are most natural solutions for wrapping C++ code and exposing its
functionality to Python. Other options are writing a C interface to
your database and use ctypes, Pythons stdlib FFI ( see Python 2.5
docs ). Not sure if there are tools yet to derive a C interface
automatically from C++ classes. If so I would prefer the FFI approach.
For database plugins: a framework like Pylons [1] seems to be
particularly suited for this option but I would recommend requesting
answers by the Pylons community directly.

[1] http://pylonshq.com/
Aug 28 '07 #2
Michael R. Copeland <mr*****@cox.ne twrote:
I have some questions about the suitability of Python for some
applications I've developed in C/C++. These are 32 bit Console
applications, but they make extensive use of STL structures and
functions (Lists, Maps, Vectors, arrays) - primarily because the data
volume is high (2,500,000+ records).
This is all bread and butter stuff to python and 10 times easier to do
in python than C++!
The main thing I'd like to do is port one part of the system that has
a series of user menus and works with several text data files (one
_very_ large). I'm not using any database system, just my home-grown
indexed sequential file database. There's nothing but volume that
precludes this application from running from almost any text file-
processing language system (e.g. Perl, BASIC, etc.).
From what little I've seen of Python, it appears I could port this
application to Python code, but I'd do so only if I could:
1. Integrate it into a Web application in such a way that the user
could select it as an option from a main page and have it execute as a
WEB GUI application. Currently, the application's interface is only a
crude DOS window.
A web application is possible. You can start your application which
would run its own embedded web server which the user could then
control. Python has a web server in the standard library. I've done
exactly this using cherrypy as a simple web application framework.

The asynchronous nature of web applications are often a pain. You
could write a windows GUI using TKinter (which comes with python) or
WxPython (which doesn't). Those toolkits make it very easy to make
GUI applications.
2. Assure that the performance isn't totally crippled by using Python,
an interpretted language. While I don't expect native C/C++
performance, I don't want to be embarrassed...
Depends exactly what you are doing. If you are IO limited then Python
is just as fast as C++.

If you are doing lots of calculation on the data then python can be
slow. You can use the numpy library which is a library of scientific
maths routines all coded in C for speed which is very quick.

http://numpy.scipy.org
http://sourceforge.net/projects/numpy
3. Make sure that the volume of stored data (2.5+ million records) can
be accommodated in Python structures (I don't know enough about Python
to answer this question...).
I wouldn't have thought that would be a problem.
Note that I'm not considering using the existing C/C++ code in my Web
application, because I don't know how to write a C/C++ Windows
application - and I'm sure the learning curve here is greater than
Python's.
You could always use ctypes from python to interface with your C
code. If you can export your code in a DLL then ctypes can use it.
(Not sure about C++ though)
I'm a very old procedural-based application developer (47+
years of programming experience), and developing Windows applications is
beyond me.
So, I only (?) want to take an existing application that uses a large
text file (and several smaller text indexing files) and put it into a
Web system I already have. I feel Python (or Perl) is(are) my best
option(s), and here I'm only looking for some initial guidance from the
Python users. TIA
Go for it! Python is such an easy language to write stuff in
(escpecially compared to C++) that you'll have the prototype done very
quickly and you can evaluate the rest of your concerns with working
code!

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Aug 28 '07 #3

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

Similar topics

226
12535
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> d1 = {'a':1} >>> d2 = {'b':2} >>> d3 = {'c':3}
36
6368
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
4
1426
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # some venture into standard modules import os # print all names exported by the module print dir(os)
68
5841
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
20
2151
by: xeys_00 | last post by:
I posted a article earlier pertaining programming for my boss. Now I am gonna ask a question about programming for myself. I just finished my first C++ Class. Next semester is a class on encryption(and it's probably gonna be a math class too). And finally back in programming in the fall with C++ and Java 1. The C++ will cover pointers, and linked lists, sorting algorithms, etc... I run linux and OS X. I have read in the old days that C was...
5
2649
by: EP | last post by:
This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script. Any insight appreciated in advance. I am trying to reduce duplicate files in storage at home - I have a large number files (e.g. MP3s) which have been stored on disk multiple times under different names or on different paths. The using applications will...
122
7335
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection outside of that class. This structured way allows visual tools to host components, and allows programmers to build applications and libraries visually in a RAD environment. The Java language has JavaBeans as its component model which allows Java...
2
1458
by: Paul Boddie | last post by:
QOTW: "c.l.python is just a small speck at the outer parts of the python universe. most python programmers don't even read this newsgroup, except, perhaps, when they stumble upon it via a search engine." -- Fredrik Lundh (on comp.lang.python, prompting the editor to offer greetings to those of you who are not reading Python-URL! via that channel) http://groups.google.com/group/comp.lang.python/msg/4d73a2da72c87226 "That's the kind of...
17
12455
by: chewie54 | last post by:
Hello, As an electronics engineer I use some very expensive EDA CAD tool programs that are scriptable using Tcl. I was wondering why these companies have choose to use Tcl instead of Python. Some of these are: Mentor Graphics ModelTech VHDL and Verilog simulator Synopsys Design Compiler and Primetime Static Timing Analyzer Actel FPGA tools.
0
8356
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
8866
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...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
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
4198
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...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.