Python Forum
C++ programmer requests Python Web/database advice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ programmer requests Python Web/database advice
#1
Hi folks,

I am an experienced C++ desktop-app programmer. I have a moderate amount of experience with SQL but no experience with Python or Web programming. I've recently received requests from customers for what amounts to a Web interface to a database. I'd like to get some opinions on whether or not Python is the way to go for these jobs, and also get some suggestions about using Python if you're a C++ programmer. First though, let me describe the requested Web sites:

The Web site is an interface to a collection of resources on a particular topic. (The resources are PDF or text files, though this is not central to the problem I'm describing.) Information about the resources is stored in a database. The user defines what resources she is interested in by specifying a filter in the Web interface. The interface returns all records from the database that match the filter and then the user can download any of the resources (files) specified by those records.

For example, suppose the resources are files with short pieces of text that are designed to help people learn how to read. The database contains information about text, such as its word count, the author, date of publication and various technical measurements of how well the text is suitable for teaching reading. A user would go to the Web site and ask the site to fetch records that corespond to texts that, for example, have at least 200 words, were published between 2000-2019, have authors from the United States, Spain or Argentina, and have Measurement A of at least 200 and Measurement D of less than 10. The site would display those records, the user would choose which records are of interest and then download the resources associated with the chosen records.

Here are the requirements of the Web site that I want:

- the site must be able to interface with a database (preferably MySQL) stored on a server or in the cloud
- the site will need to have a large variety of UI elements, e.g., radio buttons, checkboxes, dropdown boxes, date pickers, numerical entry boxes, etc.
- the site (and database) will typically have just a small number of simultaneous users, say no more than 10
- occasionally, the site may get bursts of more simultaneous users, but never more than 50
- users will only have read-access to the database and resources. They will never be able to enter or modify records or upload resources
- the maximum number of records that would need to be displayed is in the low thousands, e.g., less than 10,000
- the typical number of records returned for display is in the tens or low hundreds, say less than 500
- high database security is not essential. The users only have read-only access to the database. In the first incarnation, access to the database will only be indirect. This means that the user will never enter SQL code. The filter will be specified via the UI elements and the site will construct an SQL statement from the elements and send that to the database. If in the future the user is able to specify a filter directly with SQL code, input validation will become much more important in order to avoid issues like SQL injection
- the site must be able to provide the capability to make simple downloads of files in common formats, such as PDF, text, JSON or XML

I have two principal questions:

1)Is Python the right tool to use to build this type of Web site? If so, is there a framework that you recommend, as there seems to be a god-awful number of Python Web frameworks! If you don't think Python is good for the job, what would you recommend, e.g., Ruby on Rails, php?

2) Do you have any recommendations for learning Python that are suitable to an experienced C++ programmer?

Thanks for wading through this large post.

Greg Reese
-
Reply
#2
Quote:1)Is Python the right tool to use to build this type of Web site? If so, is there a framework that you recommend, as there seems to be a god-awful number of Python Web frameworks! If you don't think Python is good for the job, what would you recommend, e.g., Ruby on Rails, php?
Python is the right tool if you want it to be.
It can do everything that Ruby and/or php will do, so the decision is yours.
I learned C at Bell Labs in Homedel NJ., I use python exclusively now after many years of C and C++ programming.
I have not encountered a single project that I couldn't accomplish in Python in a much shorted period of time as it would have taken in either C or C++.

Quote:2) Do you have any recommendations for learning Python that are suitable to an experienced C++ programmer?
Besides just trying to write something, you can: Most of all, have fun!
Reply
#3
Thanks Larz60+
Reply
#4
(Apr-08-2019, 03:38 PM)GregReese Wrote: 1)Is Python the right tool to use to build this type of Web site? If so, is there a framework that you recommend, as there seems to be a god-awful number of Python Web frameworks! If you don't think Python is good for the job, what would you recommend, e.g., Ruby on Rails, php?
Flask or Django are the two big one in Python.
Both have build in web-servers,so all development can be done local before getting a host.
I would advice to start with Flask and Flask-SQLAlchemy for all database stuff.
Django is also good,it's model is that a lot of stuff is build even if need or not.
Flask you start simpler(on drop at a time) closer to HTMl/CSS/JavaScript,and use plugins in need more functionality.
Have some tutorial here eg weather app,a look at DB.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  C++ programmer confused about why Python isn't working the way I intend Radical 2 692 Sep-15-2023, 04:21 AM
Last Post: Radical
  Advice for installing python app from github ? Adi44 6 1,117 Aug-07-2023, 06:34 PM
Last Post: snippsat
  python requests library .JSON() error mHosseinDS86 6 3,253 Dec-19-2022, 08:28 PM
Last Post: deanhystad
  Looking for advice on funstionality of python bradkernohan 1 1,273 Feb-21-2022, 09:26 PM
Last Post: Larz60+
  Python requests oauth2 access token herobpv 6 3,780 Sep-27-2021, 06:54 PM
Last Post: herobpv
  Advice about Python pythonman13 4 2,545 Mar-21-2021, 07:22 PM
Last Post: jefsummers
  Python Requests SSL Aussie 0 1,961 Jan-07-2021, 02:09 AM
Last Post: Aussie
  Python Requests Aussie 2 2,693 Dec-23-2020, 03:24 AM
Last Post: Aussie
  Python Requests package: Handling xml response soumyarani 1 2,103 Sep-14-2020, 11:41 AM
Last Post: buran
  Python API and requests deep_logic 9 4,184 Jul-29-2020, 03:47 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020