What to write or search on github to get the code for what is written below:

MRAB python at mrabarnett.plus.com
Sun Jan 9 16:02:20 EST 2022


On 2022-01-09 07:04, NArshad wrote:
> On Friday, 7 January 2022 at 02:59:17 UTC+5, alister wrote:
>> On Thu, 6 Jan 2022 10:55:30 -0800 (PST), NArshad wrote: 
>> 
>> > All this is going to be in python’s flask and HTML only 
>> > 
>> > 1. First, I have to check in the Excel sheet or table whether the book 
>> > user has entered is present in the book bank or not. 
>> >
>> Excel is the wrong application for storing this data - it should be in a 
>> database
>> > 2. If a book is present and the quantity of the required book is greater 
>> > than 0 (COPIES_LEFT column in excel file) and if the user wants the 
>> > book, it will be assigned to the user which he will take from the book 
>> > bank physically. When COPIES_LEFT will is less than or equal to 0 the 
>> > message will be “Book finished or not present”.
>> Again Excel is not the correct application for processing this data
>> > 
>> > 3. The quantity of the book in the Excel file will be reduced by 1 in 
>> > the COPIES_LEFT column and the name of the borrower or user will be 
>> > entered/added in the Excel file table or sheet already made and the 
>> > column name is BORROWER’S NAME. 
>> >
>> Database!
>> > 4. The borrower’s or user name can be more than one so they will be 
>> > separated with a comma in the Excel file BORROWER’S NAME column. 
>> >
>> Database
>> > 
>> > - All functions mentioned above are to be deployed on the website 
>> > pythonhow.com so make according to 
>> > https://pythonhow.com/python-tutorial/flask/web-development-with-python- 
>> and-flask/ 
>> > 
>> > - Do you know any other websites to deploy a python web application?? 
>> > 
>> > - No time to switch from Excel to anywhere else. Please do not make any 
>> > changes to the Excel file. 
>> > 
>> > - Tutorials and repositories of the web for such problems are also 
>> > required. The same is required for python (flask, Django...) also.
>> Sorry did not spot that this was a homework assignment 
>> data should still be imported into a DB (a trivial task) It can be 
>> exported back to a compatible format just as easily if hard copy output is 
>> required 
>> 
> 
> As written no time to switch from excel to anywhere else but if a certain database is required to make changes in Excel’s cell values then which database to use (example Access or what) and after the right selection of the database, how to import data to a database and then export back to a compatible format that is to Excel cells….
> 
> I mean how to do this written below:
> 
> “data should still be imported into a DB (a trivial task) it can be exported back to a compatible format just as easily if hard copy output is required”
> 
> The reason I have written:
> 
> “What to write on GitHub or on google search to find the necessary code to start with? “
> 
> I will also be requiring a code to start with just as most people do. The same is the case with tutorials.
> 
> This is not homework and I have been checking openpyxl for the last one or two months to find what is required by me when I found nothing of what is required by me then posted on this google group.
> 
> 
Using openpyxl is pretty straightforward:


from openpyxl import load_workbook
wb = load_workbook(spreadsheet_path)
sheet = wb.active

# Reading the values in cells:
print('Cell A1 contains', sheet['A1'].value)
print('Cell A2 contains', sheet['A2'].value)
print('Cell B1 contains', sheet['B1'].value)

# Alternatively:
print('Cell A1 contains', sheet.cell(1, 1).value)
print('Cell A2 contains', sheet.cell(1, 2).value)
print('Cell B1 contains', sheet.cell(2, 1).value)

# Changing the value in a cell:
sheet.cell(1, 20).value = 'TEST'

# A value of None means that the cell is empty.

wb.save(spreadsheet_path)
wb.close()


More information about the Python-list mailing list