Mailing List Archive

1 2 3  View All
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Sun, 23 Jan 2022 at 09:15, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> A web
> application has every action as a distinct connection and needs identifying
> tokens [cookies] to let the logic know what was done previously
>

Usually. Fortunately, we have SOME features that can make life easier,
but in general, yes, web apps need to think in discrete actions with
minimal maintained state.

Absolutely agree with making a console app first. Though I rather
suspect the OP doesn't want to write any code at all.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Sun, 23 Jan 2022 09:17:38 +1100, Chris Angelico <rosuav@gmail.com>
declaimed the following:


>
>Absolutely agree with making a console app first. Though I rather
>suspect the OP doesn't want to write any code at all.
>

Oh, it's gone beyond suspicion -- considering that, at just 10 lines
per day, over the last 16 days, they should have 160 lines of code (whether
it works or not) that could be presented for evaluation. What is considered
industry standard? 10 lines an hour? Assuming the OP isn't spending time on
requirements analysis and documentation. (My best example is something I
did back around 1990: 18 months consisting of ~600 lines F77, ~2000 lines
of C, and ~2500 lines of DECWindow UIL definition; along with learning both
DECWindow and GKS within it -- so, yes, the overall total is about 2 lines
per day, but I had to develop/document requirements, present them to the
customer, get approval, develop/document the design, present /that/ to the
customer, get approval, before even getting to the code and writing a user
manual for the system... I suspect easily half the time was spent just on
paperwork.)

All we've been shown is four lines, and that wasn't complete enough to
run stand-alone (presuming we ever see a sample of the data to be
processed. There's no complete CONOPS on how this application is to be used
(the most complete we've seen is "if the book is found, decrement some
counter, add user's name to another field" -- and? no report, no one else
is going to look at this information?).

On my part (having no transportation, stuck in a neck brace after
having rolled over my late Jeep, etc.) the alternative to wasting time here
would be to dismantle an AR-10 class rifle and install an adjustable target
(but not top-end match) trigger and, if really ambitious, install an
improved trigger in my Ruger MK-II pistol (I have the parts for both --
just need to set up space and time to do the work).


--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Sun, 23 Jan 2022 09:17:38 +1100, Chris Angelico <>
declaimed the following:


>
>Absolutely agree with making a console app first. Though I rather
>suspect the OP doesn't want to write any code at all.
>

I am not writing any code because I don’t know what code to do next. Still, I have made a dictionary now searching for what to do next in which one choice is MS SSIS and the second is numpy or pandas which AGross has written. If you want to see the code of making a dictionary then below it is:

xyz = {
col[0].value: [cell.value for cell in col[1:]]
for col in sheet.columns
}
print(xyz)

Now the problem is what to do next. If I had known, I must have submitted the whole project at my earliest convenience without coming over here in google groups.



-Dennis Lee Bieber:
>
>And again... You will not find anything like you want... NOBODY is
>going to write a web application using a spreadsheet as the primary data
>storage. A spreadsheet, and custom transformation code, MIGHT be used to
>initially populate a database. (M$ SQL Server Integration Services is a
>whole system for defining import/transformation/clean-up "functions" for
>data sources to data base). A spreadsheet might be available as a
>report/extraction format from the database.
>

The problem is I don’t want Excel spreadsheet as a report/extraction format I want to UPDATE the Excel spreadsheet automatically with the latest values which are only in the two column cells and I don’t know which cells. Is it possible using SSIS?

How you know so much about guns??

Why are you not in the favor of pandas if not openpyxl but if my problem is getting solved with MS SSIS then it's fine to leave openpyxl and pandas?



Avi Gross:
>
>Now forget the plain text file and consider the following. Read the EXCEL file one unit/cell at a time
>in whatever column and row the data starts. This is doable, albeit not necessarily ideal, and
>basically can be the same algorithm with a substitution in the part that gets the next line to getting
>the cell below it. Testing for the end of the file may be different too.
>But what I think makes a bit more sense is to set up the server to have a rather long-term process
>that sits there and waits for requests. It starts by reading all the data and perhaps modifying it
>once in the ways I suggest above. In python, you would now have some data structure such as a
>list or set or even dictionary or some variation from numpy or pandas. It does not matter much. The
>data structure holding all books, or maybe all unique book names, would be there and ready and
>waiting.
>Your program now sleeps until woken up and it is given the book name being searched for. It now
>simply needs to apply whatever transformations you want to the received name and then do one of
>many kinds of lookup to see if it is in the data structure representing the titles known to the library.
>Using a set or dictionary means no search as it hashes the result and rapidly finds out if it has
>previously been stored. Other methods like lists have choices between a brute force linear search if
>the data remains in the original order or letting python do the work by asking if it is "in" the list to
>more sophisticated methods like keeping it sorted and doing a binary search.
>I am guessing that for your need, a relatively unsophisticated method may work fine and it can be
>changed if your project scales up to millions of books and multiple people searching at the same
>time.
>

What you have written is difficult to find on google search and others. That's why writing all this to get something for search.
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Mon, 24 Jan 2022 00:25:34 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>
>I am not writing any code because I don’t know what code to do next. Still, I have made a dictionary now searching for what to do next in which one choice is MS SSIS and the second is numpy or pandas which AGross has written. If you want to see the code of making a dictionary then below it is:
>
>xyz = {
> col[0].value: [cell.value for cell in col[1:]]
> for col in sheet.columns
>}
>print(xyz)
>

Since none of us have seen a reasonable representation of the
spreadsheet (export it as CSV and paste the first 5-10 lines into a post)
we have no idea if the above even produces anything useful.

You appear to be grabbing onto catchphrases in the hope that they will
provide you with some miraculous "I call this, that, and another, and look
-- it's done".

>Now the problem is what to do next. If I had known, I must have submitted the whole project at my earliest convenience without coming over here in google groups.
>

How would you do this assignment on paper? Print out your spreadsheet
and get a large pad of paper... Then write down each step you have to take
to process "one user request" in your system (make mock-ups of any
input/output screens). Make (horrors) a flow-chart showing the branch
points (book was found, book was not found).

When you get the steps (aka "algorithm") documented well enough that
someone else can follow them on paper, you are ready to translate each of
those steps into code.

>The problem is I don’t want Excel spreadsheet as a report/extraction format I want to UPDATE the Excel spreadsheet automatically with the latest values which are only in the two column cells and I don’t know which cells. Is it possible using SSIS?
>

The Excel spreadsheet is almost the WORST data structure for this
assignment (a variable length record flat file would be the worst; fixed
length record flat file is 1960s business processing but would be more
useful as it allows for in-place updates).

" I don’t know which cells" -- So how would you do this by hand, if
someone gave you a print-out of the spreadsheet? When you can describe the
operations in sufficient detail for someone else to follow them, you are
ready to convert them into code.

M$ SSIS, as I mentioned, is a system for importing, TRANSFORMING, and
clean-up of data from external sources -- for inclusion into a M$ SQL
Server database. You insist you don't want to consider database
implementation, so SSIS will do nothing for you (besides, you'd have to
learn how to program ITS work-loads).

>How you know so much about guns??

Irrelevant... Though I've owned firearms since the 1970s (well, late
60s if you count the Christmas gift of a .22 rifle while in the 7th grade).

>
>Why are you not in the favor of pandas if not openpyxl but if my problem is getting solved with MS SSIS then it's fine to leave openpyxl and pandas?

One: pandas is still a case of doing import/transform/export; just
because it has functions to directly read (and I presume, write) .xlsx
format spreadsheet files you are still transforming the data into a pandas
"dataframe" object. pandas is using openpyxl to do that read/write.

Two: pandas is optimized for numerical and "time series" processing
(think time-stamped tables of readings from, say, a weather station) on
which you want to produce smoothed trends. The documentation is explicit
that it is a bit slow when doing ad-hoc row/column indexing.

Three: in terms of increasing complexity openpyxl will be the simplest,
and M$ SSIS is way above anything you might find useful without studying a
book.


>What you have written is difficult to find on google search and others. That's why writing all this to get something for search.

Because you WON'T find it on a search engine -- especially not at your
"tutorial" level.

You need to 1) Know your programming language (since you are here, that
would be Python) including understanding any compound data structures it
supports (lists, dictionaries) and, at the least, procedural language
features (you can get by without having to do OOP, though most all
libraries are object based, you just need to invoke them, not write OOP
objects themselves); 2) Understand how to fit data structures with
algorithms; 3) be able to translate activities (as performed by a person)
into algorithms, and then from algorithms into language specific code.

At a very high level, your assignment requires:

1 obtain a title from a user
2 search a file for that title
3 report results of the search

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BYSTANDERS WILL WANT TO LOOK AWAY NOW
JUST GO TO THE NEXT POST

The following is something I hacked together yesterday, and is untested
(I don't have the outer framework set up yet). So far, the only thing it
does is INITIALIZE an SQLite3 database (create the schema definition) and
install a default Admin registration for logging into the eventual
application.

The schema is based upon the most complete description we've seen of
your data and intended processing. As such, it has an entry for each copy
of any given title (to track condition and if it is in-stock or
checked-out; check-outs are tracked as a separate relation in order to
allow for historical records).

The use case/CONOPS for regular users is:

The application will present the user with an option to log in using a
username and password, or to register a new log-in name. Registration will
verify the username is not being used by another, after which it will
obtain a password and real name from the user.

Upon a successful user log-in, the application will present the user
with the option to reserve a book, or to cancel a previously made
reservation.

For the "reserve" option, the application will present the user with a
field in which to enter search terms. Search terms are words which may
appear in the book title or author names. If the search returns more than
five items, the count of candidate books will be displayed and the
application will ask the user to enter additional or different search
terms. If the search returns five or less items, the items will be
displayed and the application will ask the user to select one of them. Upon
the user indicating which item is desired, the application will verify that
at least one copy of the item is "Available" and, if available, set the
item to "Reserved", and create a reservation record identifying the copy,
the logged in user, and the date of the reservation.

...

Unreserve is similar, except the search only includes items for which
the user has an active reservation record.

...

ADMIN functions include: granting admin privileges to registered users;
adding new books and copy counts (or increasing copy counts if a new supply
has been obtained); clearing out stale reservations (in this scheme, the
reservation is just the request by a user for a book; if they don't pick up
the book within a few days, the reservation should be cancelled); checking
out books (checking out is when the reserving user actually takes
possession of the specific book copy [numbered] that they reserved);
producing report of overdue books; checking in books (when the book has
been returned). Other functions as the whim takes me...

-=-=-=- database.py
"""
Database.py Encapsulates functions for working with the
BookDepository DataBase

"""

import sqlite3 as db
import os
import os.path as op
import datetime

import creationSql

STANDARDPRAGMAS = [ "PRAGMA foreign_references = ON;" ]
DATABASE = "BookDepository.SQ3"

def initializeDB(replace = False):
status = []
if op.exists(DATABASE):
if replace:
old = DATABASE + "-%s" %
datetime.date.isoformat((datetime.date.today()))
os.rename(DATABASE, old)
status.append("Existing %s renamed to %s" % (DATABASE, old))
else:
status.append("Can not initialize database -- %s already
exists")
return status
con = db.connect(DATABASE, detect_types=db.PARSE_DECLTYPES)
status.append("Created empty database %s" % DATABASE)
for pragma in STANDARDPRAGMAS:
con.execute(pragma)
status.append("Set PRAGMAS")
for tbl in creationSql.TABLES:
con.execute(tbl)
status.append("Created tables")
status.append("Database schema defined")
# TODO: need to create a password hashing function and random password
password = "DbaAdm1n"
user = "BRAdmin"
con.execute("""INSERT INTO USERLOGIN (Username, Password, Last_Name,
First_Name, Admin)
VALUES (%s, %s, %s, %s, %s)""",
(user, password, "Book Depository DB Admin", None, True))
status.append("Database Administrator account created -- Please record
these values")
status.append("\t\tUSER LOGIN:\t%s" % user)
status.append("\t\tPassword:\t%s" % password)
status.append("\n\n*****\tRESTART BookDepositoy application to
login\n")
con.commit()
con.close()
return status

-=-=-=- creationSql.py
"""
creationSql.py Defines SQL statements to create an empty database

SQL syntax is that of SQLite3

"""

USERLOGIN = """
-- UserLogin contains registration information for users of the
-- BookDepository system. This includes a login username,
-- hashed password, and real name (last/first),
-- along with a flag indicating if the user has administrative
-- privileges (non-admin users may only make or cancel
-- reservations for specific books

CREATE TABLE IF NOT EXISTS UserLogin (
ID INTEGER PRIMARY KEY,
UserName TEXT UNIQUE NOT NULL,
Password TEXT NOT NULL,
Last_Name TEXT NOT NULL,
First_Name TEXT,
Admin INTEGER DEFAULT FALSE NOT NULL
);
"""

PUBLISHER = """
-- Publisher contains the common name of book publishers

CREATE TABLE IF NOT EXISTS Publisher (
ID INTEGER PRIMARY KEY,
Publisher TEXT NOT NULL
);
"""

AUTHOR = """
-- Author contains the name (last/first) of authors
CREATE TABLE IF NOT EXISTS Author (
ID INTEGER PRIMARY KEY,
Last_Name TEXT NOT NULL,
First_Name TEXT
);
"""

BOOK = """
-- Book contains the ISBN (or alternate call number) for
-- book titles (SQLite3 generic TEXT type supports both
-- under one field; a more traditional RDBM would be
-- better served by creating an ISBN CHAR(13) [also for
-- ISBN-10 format], and a separate alternate-call number),
-- Title, Publisher reference, and copyright date (as
-- text, as these are normally just month and year)

CREATE TABLE IF NOT EXISTS Book (
ID INTEGER PRIMARY KEY,
ISBN_Call TEXT NOT NULL,
Title TEXT NOT NULL,
Publisher_ID INTEGER NOT NULL
REFERENCES Publisher(ID)
ON DELETE RESTRICT
ON UPDATE CASCADE,
Copyright_Date TEXT
);
"""

COPY = """
-- Copy contains a record for each copy of each book,
-- the check-out status for this copy (available,
-- out, reserved), and notes (condition) of the copy

CREATE TABLE IF NOT EXISTS Copy (
ID INTEGER PRIMARY KEY,
Book_ID INTEGER NOT NULL
REFERENCES Book(ID)
ON DELETE CASCADE
ON UPDATE CASCADE,
Copy_Number INTEGER NOT NULL,
Status TEXT DEFAULT 'A' NOT NULL
CHECK (upper(Status) in ('A', 'O', 'R')),
Notes TEXT,
UNIQUE (Book_ID, Copy_Number)
);
"""

CHECKOUT = """
-- Checkout links specific copies of books to
-- registered users, and tracks reservation date,
-- checked out date (when user received the book),
-- and due date. There is also a flag indicating
-- if the record is active, or historical.

CREATE TABLE IF NOT EXISTS Checkout (
ID INTEGER PRIMARY KEY,
Copy_ID INTEGER
REFERENCES Copy(ID)
ON DELETE SET NULL
ON UPDATE CASCADE,
User_ID INTEGER
REFERENCES UserLogin(ID)
ON DELETE SET NULL
ON UPDATE CASCADE,
Reserved DATE NOT NULL,
Checkedout DATE DEFAULT NULL,
Due DATE DEFAULT NULL,
Active INTEGER DEFAULT TRUE NOT NULL
);
"""

BOOK_AUTHOR = """
-- Book_Author links authors to book titles

CREATE TABLE IF NOT EXISTS Book_Author (
ID INTEGER PRIMARY KEY,
Book_ID INTEGER NOT NULL
REFERENCES Book(ID)
ON DELETE CASCADE
ON UPDATE CASCADE,
Author_ID INTEGER NOT NULL
REFERENCES Author(ID)
ON DELETE RESTRICT
ON UPDATE CASCADE,
UNIQUE (Book_ID, Author_ID)
);
"""

# TABLES lists the individual SQL statements for each
# database table. They are ordered such that
# referenced tables are before the referencing
# table
TABLES = [ USERLOGIN, PUBLISHER, AUTHOR,
BOOK, COPY, CHECKOUT,
BOOK_AUTHOR ]

-=-=-=-

Good thing this is a text only forum, or I'd toss in an
Entity-Relationship diagram for the database.


--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
Dennis Lee Bieber wrote:

> ....
> How would you do this assignment on paper ?
> ....

Your patience and willingness to help and guide someone else
with such a complete and understanable post is hihgly commendable.

Thanks ....

--
Stanley C. Kitching
Human Being
Phoenix, Arizona

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Fri, 28 Jan 2022 09:34:39 -0700, Cousin Stanley
<cousinstanley@gmail.com> declaimed the following:


>
> Your patience and willingness to help and guide someone else
> with such a complete and understanable post is hihgly commendable.
>
Ignoring the code spam I presume <G>

I seem to have scared off the OP with that post. Suspect the assignment
came due, and they've nothing to show for it.

I went on with the SQLite3 interpretation of the whole system,
including using pysimplegui* (wx variant) and have implemented the login
and user registration pages (though I haven't added a hash function for
password storage yet), and made a start on the actual operations of the
application (regular user: reserve book, unreserve book, list reservations,
list checkouts [.my interpretation over this long thread was that user makes
reservation, then has to report to some desk to receive the book -- I treat
the latter as the checkout stage]; admin users get: checkout for client,
checkin for client, expire stale reservations, list overdue, grant admin
privilege, add book, delete book).

C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>pygount -s py -f
summary BookDepository
Language Files % Code % Comment %
--------- ----- ------ ---- ------ ------- ------
Python 6 100.00 350 100.00 108 100.00
--------- ----- ------ ---- ------ ------- ------
Sum total 6 350 108

C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>pygount -s py
BookDepository
18 Python BookDepository BookDepository\BookDepository.py
113 Python BookDepository BookDepository\creationSql.py
94 Python BookDepository BookDepository\database.py
2 Python BookDepository BookDepository\gui.py
119 Python BookDepository BookDepository\gui_login.py
112 Python BookDepository BookDepository\gui_main.py

C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>

Taking a few days off from this exercise. 350LOC in a week, including
reading the pysimplegui documentation as I encounter things to implement vs
the <10 lines presented by the OP in over three weeks. Out of stubbornness
I'll probably continue this in the next few days.




* pysimplegui actual feels somewhat comfortable to me... being similar to
my 30 year old Amiga in terms of coding GUIs (no master event loop invoking
call-backs, rather an explicit loop with comparison for event/widget and
dispatch to handler functions)


--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
Dennis Lee Bieber wrote:

> Ignoring the code spam I presume <G>
> ....

I'm an sqlite user myself and was glad to see
the code you posted and have a couple of tiny example
book/author sql3 databases but nothing resembling
an actual library check in/out program ....

I've never used PySimpleGUI
but it does look interesting ....

https://pysimplegui.readthedocs.io/en/latest/

https://pypi.org/search/?q=pysimplegui

After you complete your BookDepository DataBase development
perhaps you would consider making it publically available
for others to learn from ....


--
Stanley C. Kitching
Human Being
Phoenix, Arizona

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Fri, 28 Jan 2022 14:31:20 -0700, Cousin Stanley
<HooDunnit@didly42KahZidly.net> declaimed the following:

>Dennis Lee Bieber wrote:
>
>> Ignoring the code spam I presume <G>
>> ....
>
> I'm an sqlite user myself and was glad to see
> the code you posted and have a couple of tiny example
> book/author sql3 databases but nothing resembling
> an actual library check in/out program ....
>

I'd modify the database significantly for library usage -- among other
things I'd remove the "Copy" table; if the library has multiple copies of a
book, it would have multiple entries at the "Book" level. There would also
be fields for short description, genre/category, maybe shelving.

The impression I got from the OPs assorted (and rather vague) posts is
something closer to school classrooms issuing books to students (vs college
level where students have to buy them, which implies no need to track who
and when), so having massive amounts of textbooks in various conditions.
The separate reservation/checkout is something I inferred, and is really a
strange concept -- at least when I was in school, the textbooks were
distributed by the instructor on the first day of class, and collected at
the end of the course.

Say a small high-school; 600 students -> 150 each 9th, 10th, 11th, 12th
grade. 30 students per class (on the high side, yes), makes five sessions
in the day... and, of course, means 150 copies of a text book. Reality may
not be quite that bad as some courses are electives or have options
(foreign language: French, German, Italian, Spanish -- probably few take
Italian, so maybe only 30-60 books, etc.).

> I've never used PySimpleGUI
> but it does look interesting ....
>

I'm not sure how I stumbled upon it... I think the older ActiveState
Python I have installed was one of those "include everything that doesn't
cause a conflict" configurations, with tons of 3rd-party packages... And I
just saw the name in a package list. I had considered doing just a console
application with curses but... Windows makes curses difficult to even get
installed.

PySimpleGUI's explicit event dispatch loops made ad-hoc forms simpler
to implement over having one master implicit event loop (app.run() or
similar).

The alternative would have been using Flask or Django (and configuring
my Raspberry-Pi nginx server for them -- right now it just serves static
web pages)

> After you complete your BookDepository DataBase development
> perhaps you would consider making it publically available
> for others to learn from ....

Unlikely -- I'd have to put in a lot more documentation to explain my
choices and design choices (I'm NOT using SQLAlchemy -- as I'd stated some
posts ago, it just confuses me; instead I'm coding explicit SQL and cursor
processing). The GUI is quick&dirty -- there is no doubt much that even
PySimpleGUI can do that I've not delved into (I really would prefer the
documentation to be available in PDF format, so I could print it in booklet
form and read while away from the computer).

There are a number of library management systems written in Python
already (though I encountered one site that only had two chapters in place
-- about enough to install Python and packages [chapter 1] and do a
"hello-world" [chapter 2] -- and nothing else).

https://data-flair.training/blogs/library-management-system-python-project/
Tkinter and MySQL
(I don't like Tkinter)

https://techvidvan.com/tutorials/python-library-management-system/
Django
(assumes school library "addstudent" function)

https://rrtutors.com/tutorials/python-library-management-system-project
MySQL, console
(Some things I'd improve -- they used a chain of IF statements to process
menu input where a dictionary look-up would be shorter and easier to
modify)

https://itsourcecode.com/free-projects/python-projects/library-management-system-project-in-python-and-mysql/
MySQL and Tkinter
(Another "school" focused example -- users are "students")

Many of them use quite a simplified schema... Storing publishers and
authors directly within the Book record -- which means the possibility for
typos from one book to another, etc. I'd pull those out into separate
tables and link via foreign keys.



--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
What about CGI?
Do you know any Library Management System based on CGI just like the one on Django?

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Tue, 1 Feb 2022 at 02:38, NArshad <narshad.380@gmail.com> wrote:
>
> What about CGI?
> Do you know any Library Management System based on CGI just like the one on Django?
>

Have you done any research, or are you just picking up a new acronym
to see if you can suck some more volunteer time out of this list?

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
On Mon, 31 Jan 2022 01:32:15 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>What about CGI?
>Do you know any Library Management System based on CGI just like the one on Django?

Pure CGI is 30 year old technology...
https://en.wikipedia.org/wiki/Common_Gateway_Interface

To use it will require a properly configured web-server and lots of
individual script files. For a monolithic Python application you may want
to study https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface (which
will still require a properly configured web-server).

https://docs.python.org/3/library/cgi.html

You'll still have write the HTML for the pages to be displayed
(possibly via template engines as used by Django, Flask, Pylons, Zope), and
maybe CSS (pure HTML just describes /what/ to render, leaving it up to the
browser to do that rendering -- CSS adds lots of overhead to control how
the rendering is done).





You have now spent a MONTH asking people to provide you with pre-built
solutions to a problem description that is so vaguely specified that no one
here would even consider a solution on that model. You have been provided
links to possible approaches and technologies which might be used by you to
write code for your requirements.

In this month you have never shown us actual sample data (export your
spreadsheet as CSV so you can paste text into a post). You have shown us
less than 10 lines of code (which, again, can not be evaluated as they were
incomplete and you provided no data against which to run them). You grab at
any acronym mentioned in replies as if it will magically create your
solution but don't seem to spend time learning about those technologies to
understand what they do (CGI is a method by which a web page can send data
to a web server, and the web server then starts a program passing the data
on to the program... THAT IS ALL IT DOES -- you still have to create the
HTML forms AND the scripts that process the data).

Your original post(s) stated you were under a time crunch and didn't
have time to write everything... But you seem to have lots of time to keep
asking others to find a solution for you to copy. A rank beginner in
Python* should have been able to write minimal code to access the data,
even if the user interface is just a text console:

ENTER USERNAME> ....
ENTER TITLE OF INTEREST> ...
# copies are available for /title/
RESERVE COPY (Y/N)> ...

****************************************************
After all this time, my recommendation is that you go to whoever gave
you this assignment and flat out tell them you are unable to provide the
solution and need to be replaced.

It's that, or do a massive editing session to produce a few hundred
lines of code that at least attempts to solve part of your assignment and
hope for an extension on the due date. You have a number of things to
consider:
User Interface:
1 text console (maybe with use of curses to create forms)
2 local GUI app (Tkinter, GTK, or wX libraries)
3 web-based app (HTML, web-framework, web-server config)
Data Storage:
1 your insistence on an Excel spreadsheet
(the most complex solution as it does not handle
concurrent access -- so you need some means of
locking it to only one user for the entire time of a
session)
2 relational database
(one time import, and need to provide functions to allow
for complete management of the data, not just one
"reserve" function. option for on-demand export for
post-process reporting)
User Management:
you need some means to control who can perform operations
on the data -- this could be additional tables in a database.

****************************************************



*
{Given the first edition O'Reilly Python book, and an Amiga port of Python
1.x -- it took me a week to produce a rudimentary SMTP sending daemon using
my ISP SMTPd for relay... I had to do this as the first SMTP sending
program I'd obtained often hung up trying to send mails (this was back in
the day when it was common to send mail directly to the destination host;
but it didn't do MX lookup; some addresses didn't run receiving SMTPd); the
second program did relay via ISP but never processed CC: or BCC: addresses,
only TO: addresses. Oh, this was also back in the days when mail clients
only handled local mailboxes, and did not send/receive messages -- one had
to invoke scripts to queue outgoing messages for sending, and others to
fetch from POP3 servers. I'll admit I couldn't do that now -- the need for
SSL/TLS protocols complicates things.}





--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list

1 2 3  View All