Mailing List Archive

What to write or search on github to get the code for what is written below:
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.

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”.

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.

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.


- 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.

--
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 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




--
"Rembrandt's first name was Beauregard, which is why he never used it."
-- Dave Barry
--
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 Sat, Jan 8, 2022 at 6:50 AM NArshad <narshad.380@gmail.com> wrote:
> - 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.
>

Instead of asking how to search GitHub for the code you want, start by
actually writing code.

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 2022-01-06 18:55, 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.
>
> 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”.
>
> 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.
>
> 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.
>
>
> - 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.
>
As someone else has already pointed, Excel is the wrong way to do it,
yet it remains a popular method.

Given that, you can read Excel spreadsheets with 'openpyxl', which is on
PyPI.
--
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 ]
This entire thread seems a bit IFFY to me.
It does seme like HW to me but also a bit peripheral.
The fact that the data is in EXCEL is a detail. And unless a spreadheet is complex, it may be trivial to save the file as a .CSV and from then on read from there into Python (or anything) and when done making modifications, save it out again. EXCEL can also be used to open such a CSV and look at it. And, of course, as has been pointed out, there are ways to save data into EXCEL or read directly from it.
But the overall programming ideas required, once the data are in memory, are another story, especially if some fields are in ormats like a comma separated text string. Searching these is not trivial while expanding the data so each such "person" is on their own may simplify things, albeit not make it so easy to save it out.
I do note that unless there is a guarantee that reads and updates to where the data is stored are guaranteed to not collide with other things, there lurks danger here.
So if the request is not made more clear and focused on what is needed in mostly native Python, and accompanied by some evidence the user has shown some code they hope will do most of the work and is just stuck somewhere, I, personally, feel no need to offer any guidance. 


-----Original Message-----
From: Chris Angelico <rosuav@gmail.com>
To: python-list@python.org
Sent: Fri, Jan 7, 2022 2:57 pm
Subject: Re: What to write or search on github to get the code for what is written below:

On Sat, Jan 8, 2022 at 6:50 AM NArshad <narshad.380@gmail.com> wrote:
> - 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.
>

Instead of asking how to search GitHub for the code you want, start by
actually writing code.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
--
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 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
>
>
>
>
> --
> "Rembrandt's first name was Beauregard, which is why he never used it."
> -- Dave Barry



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.


--
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 Sat, 8 Jan 2022 23:04:20 -0800 (PST), 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
>>
>>
>>
>>
>> --
>> "Rembrandt's first name was Beauregard, which is why he never used it."
>> -- Dave Barry
>
>
>
> 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.

1st save the data from excel as a csv file

you will find the csv module makes these much easier to deal with, even if
you do not import into a db (although even then I would import into sql-
lite just for the benefits of the search algorithms)




--
Sometime in 1993 NANCY SINATRA will lead a BLOODLESS COUP on GUAM!!
--
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 ]
-Whose time??
My time
I do not have not time to switch to a database but if necessary I can use the database to make changes in Excel column entries.

-No changes??

I cannot change the column names.


-“maybe the point is that at any time one has to be able to re-export to the original excel format? (And why?? Do we actually need "reporting": then we can generate a PDF rather, otherwise we can just send out a CSV... etc.) Is that it?”

PDF is not required and I am not doing any reporting at all.


-“loading the data from the CSV file in memory into a pandas dataframe, working with that, and eventually saving back to the CSV file might be just enough... as long as there is never more than one user concurrently using the system, or you need also implement some concurrency management (you need that with a database, too, anyway): but that's tutorial number 2, and already quite less trivial, since to begin with it requires a more thorough analysis”

No need to save the CSV file once the work is done CSV file will be exited without saving. If the above is going to work then I will be requiring something to see how to do all this that’s why written tutorial. For a more thorough analysis I have written once again what I want to do.

Only the four functions that I have written below I have to make and that’s it. All the input will be entered by the user on a website:
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.

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 is less than or equal to 0 the message will be “Book finished or not present”.

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.

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.


-1st save the data from excel as a CSV file

you will find the CSV module makes these much easier to deal with, even if
you do not import into a DB (although even then I would import into SQL-
lite just for the benefits of the search algorithms)

If in order to do the required task it is necessary to use SQLite and without using SQLite I cannot do what I want to do then I think I have to go for SQLite otherwise CSV looks to me as fine. To do everything using CSV I will be requiring a tutorial to see how to do all this.

Anything not clear?
--
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, 9 Jan 2022 08:53:58 -0800 (PST), NArshad wrote:

> -Whose time??
> My time I do not have not time to switch to a database but if necessary
> I can use the database to make changes in Excel column entries.
>
> -No changes??
>
> I cannot change the column names.
>
>
> -“maybe the point is that at any time one has to be able to re-export to
> the original excel format? (And why?? Do we actually need "reporting":
> then we can generate a PDF rather, otherwise we can just send out a
> CSV... etc.) Is that it?”
>
> PDF is not required and I am not doing any reporting at all.
>
>
> -“loading the data from the CSV file in memory into a pandas dataframe,
> working with that, and eventually saving back to the CSV file might be
> just enough... as long as there is never more than one user concurrently
> using the system, or you need also implement some concurrency management
> (you need that with a database, too, anyway): but that's tutorial number
> 2, and already quite less trivial, since to begin with it requires a
> more thorough analysis”
>
> No need to save the CSV file once the work is done CSV file will be
> exited without saving. If the above is going to work then I will be
> requiring something to see how to do all this that’s why written
> tutorial. For a more thorough analysis I have written once again what I
> want to do.
>
> Only the four functions that I have written below I have to make and
> that’s it. All the input will be entered by the user on a website:
> 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.
>
> 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 is less than or equal to 0 the message
> will be “Book finished or not present”.
>
> 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.
>
> 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.
>
>
> -1st save the data from excel as a CSV file
>
> you will find the CSV module makes these much easier to deal with, even
> if you do not import into a DB (although even then I would import into
> SQL-
> lite just for the benefits of the search algorithms)
>
> If in order to do the required task it is necessary to use SQLite and
> without using SQLite I cannot do what I want to do then I think I have
> to go for SQLite otherwise CSV looks to me as fine. To do everything
> using CSV I will be requiring a tutorial to see how to do all this.
>
> Anything not clear?

Sql-lite is not essential to the task CSV would be sufficient, but you may
find that taking the time to learn it pays off later (even if you wait
untill after this project)




--
Trying to establish voice contact ... please ____yell into
keyboard.
--
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 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()
--
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 2022-01-09 13:08:51 -0500, Dennis Lee Bieber wrote:
> there are multiple ways to have Python access Excel -- from simple
> read and write modules xlrd/xlwt, (which is out-dated; xlrd does not
> work with .xlsx format, only the older .xls format).

This is not true. xlrd has supported .xlsx since at least 2014 (when I
started using it). For new projects I would recommend openpyxl though,
which is much more feature-complete.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Re: What to write or search on github to get the code for what is written below: [ In reply to ]
Is this thread even close to being on track?
It is not really relevant to argue yet on whether to use EXCEL directly or a data.base. Many ways can be used to solve a problem and if the EXCEL sheet will never be updated manually or by some other program, it is sort of moot as you can ONE TIME transfer the existing data to any form you want and from then on work with that.
The higher level requirement of the project is not clear.
Is there a single application that wakes up and processes requests and eventually exits? If this is true, then there can be a discussion on how to do it, and of course the user can hire someone to do all the work if they are not willing to spend the time and learn. Getting it all done for free by volunteers is not something many are willing to do.
If multiple processes can dip in and out of the data, often concurrently, that is a whole new ball of wax. Others ahve mentioned that. It does not matter where the data is as in all cases you need ways to guarantee the data will not get messed up
But consider the simple case. Your program starts and runs ALONE. It initializes and reads in the data needed and stores it IN MEMORY. It might be in one or more pandas DataFrame structures, for example.
Now it processes requests and all the work in searching and updating data is done in memory. You can of course save a snapshot, or whatever logging, along the way in case of disaster. There are all kinds of ways to handle your needs such as searching for a record/row/whatever that contains the book you want, checking if it has been lent out, marking it appropriately and so on. The next request continues to operate on the in-memory data and your program will notice if someone else tries to take out a book no longer marked as available and so on. You can add all kinds of functionality to this loop that processes requests. Again, you design what  requests look like and how they are seen by your process and what replies it gives.
When done, or when you feel like it, you can save your data wherever you want. Here is an example of how to write to EXCEL: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html
Of course, many of us would suggest writing to a .CSV file that EXCEL can easily open and even update.
Now if you are not trusting, and want to save everything after each transaction and maybe even read it back in, fine. You may also want to not overwrite the previous file and that may mean renaming the old file or whatever makes you happy. If you have a lot of data and serious activity, as many libraries have, it could be a bit silly to read in a gigabyte of data all the time and it may indeed be a better idea to have a database back end that you send queries to and updates that typically are short and quick.
I am not sure why you are even talking about changing column names as normal ones can generally be the same. What some may have suggested is calculating additional columns from others just in Memory.
As with any tool, you need to learn enough to be dangerous. just copying snippets from the web may have drawbacks.
It sounds like one source of confusion is that your EXCEL data takes some shortcuts including lists of comma-separated values with multiple names, or something similar. That is not necessarily a barrier but may require more programming as searching for a specific user embedded within a larger amount of text may be harder than parsing the text into some other data structures that can more easily be searched individually. If you cannot change what you start with, that may be lots of extra work.
And it is not python alone what might require work but other languages like R too. 
Perhaps I missed a better description of the design.

-----Original Message-----
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
To: python-list@python.org
Sent: Sun, Jan 9, 2022 1:08 pm
Subject: Re: What to write or search on github to get the code for what is written below:

On Sun, 9 Jan 2022 08:53:58 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>
>I cannot change the column names.
>
    But you can change the values under those columns? And that implies...
>
>

>No need to save the CSV file once the work is done CSV file will be exited without saving. If the above is going to work then I will be requiring something to see how to do all this that’s why written tutorial. For a more thorough analysis I have written once again what I want to do.
>

    You probably won't find "A tutorial"... You might find some examples
but you will have to figure out how to use the contents. For example, there
are multiple ways to have Python access Excel -- from simple read and write
modules xlrd/xlwt, (which is out-dated; xlrd does not work with .xlsx
format, only the older .xls format). Please review:
http://www.python-excel.org/ There is also the, on Windows, the potential
to use the pythonwin extensions OR ctypes module to make low-level calls
directly to the Excel DLLs (the pythonwin calls would look similar to how
Visual BASIC or C# would access Excel, and also VBA and VBS).

>Only the four functions that I have written below I have to make and that’s it. All the input will be entered by the user on a website:
>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.
>
    Where does this requirement come from? Who is providing this "Excel
sheet or table"?

    I saw nothing in your originally linked flask tutorial referencing
Excel or a book check-out system (I didn't even see much for interaction on
that tutorial -- you'll need to handle input forms for a web site of this
nature, which may get into tracking user sessions, cookie management, etc.)
The PythonHow site also does not, from what I read, host your finished
example -- they give instructions on creating a hosting account on another
service..

    If this entire project is something you've dreamed up, then I'd suggest
dropping the Excel requirement, and going directly to a database system. Of
course, that will require, at a minimum, learning the basics of SQL and
then mapping that to the dialect used by the RDBM selected -- for
simplicity I'd suggest SQLite3. Python includes a module for that.

    SQLite3 is a file-server engine -- your application directly links to
the engine library and has access to the database file; versus a
client-server engine where your application sends request to the database
engine, and the engine handles the access to the database. If there is only
one instance of the Flask application the only thing you have to handle in
SQLite3 is transaction control -- rather than also being concerned about
multiple applications all opening the same database. With client-server
(MySQL/MariaDB, SQL Server, PostgreSQL...) you have to manage the server
itself (create user account for the application, etc.).

    Learning SQL alone does not ensure a decent database design -- you
should also learn at least the first three Codd Normal Forms to decompose
your data into relations.

>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 is less than or equal to 0 the message will be “Book finished or not present”.
>
>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.

    Which means you need to update this Excel file. That could present race
conditions if multiple users try to remove the same book (or even different
books). Excel does not have transaction control, so either you keep ALL the
data in memory (or copy the entire contents to a database system on
start-up AND copy the database back to Excel on application shut-down, you
run the risk of data corruption [.and even the copy-in/copy-out could fail
if the application crashes at some stage]).

    A database using transaction control should, at the least, mean on a
crash, the uncommitted transactions never took place (may require some time
on restart for the engine to clean up garbage workspace records).
Transaction control should also prevent the application from having two
sessions trying to update the same records at once -- the second session to
attempt an update will get an error, so you code needs to have a way to
delay/retry the update (possibly advising that user of new count value).

    Note: many of the Python DB-API modules default to auto-commit for each
SQL statement executed. You'll need to ensure you've turned that off so
that multiple statement transactions can be performed. Read the
documentation for the module in use:
https://docs.python.org/3/library/sqlite3.html

https://www.google.com/search?q=sqlite+python+tutorial+pdf


>
>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.

    This is one of those spots where database normalization is pretty much
mandated. A normalized database table does not have "columns" that hold
multiple values. Instead one uses a separate table where only one value per
row is stored, but that row has an identifier (known as a foreign key) that
identifies the row in the other table carrying the rest of the information.

INVENTORY (*ID*, book details in multiple columns, Copies-on-Hand)

CHECKEDOUT (*ID*, _Inventory-ID_, name)

    *ID*        primary (unique) key for the relation
    _Inventory-ID_    foreign key pointing to inventory record



--
    Wulfraed                Dennis Lee Bieber        AF6VN
    wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
--
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 09Jan2022 13:08, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>>Only the four functions that I have written below I have to make and
>>that’s it. All the input will be entered by the user on a website:
>>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.
>>
> Where does this requirement come from? Who is providing this "Excel
>sheet or table"?

As a spectator, I have the impression that NArshad has to produce a
little web interface to update records kept in a preexisting business
system.

I've a friend who earns her $s doing data work for various corporates.
Anecdotally, _many_ of these use Excel as their storage and work
backend. Awful, but an existing situation. I infer that NArshad has to
deal with such a situation.

Cheers,
Cameron Simpson <cs@cskk.id.au>
--
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 ]
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)

"""
The cell numbers (A1 or A2 or A3 or A4……… ) are not fixed they can be any. I don't know what the cell number is going to be that's what the problem is.

The user is going to enter the book name in an HTML form present on a website then it will be checked whether the book user has entered is present or not in the Excel file. If the book is present in the book bank and the user requires that book then one will be issued to the user and the total number of books will be reduced by 1 (one) and the user or borrower’s name will be entered in the Excel’s table row in which the book name is present separated by a comma by other borrower names. The borrower's name can be more than one because more than one copies of the book are there as these are the books that are taught in schools.
"""

# 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()
--
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 2022-01-10 16:39, NArshad wrote:
>
> 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)
>
> """
> The cell numbers (A1 or A2 or A3 or A4……… ) are not fixed they can be any. I don't know what the cell number is going to be that's what the problem is.
>
> The user is going to enter the book name in an HTML form present on a website then it will be checked whether the book user has entered is present or not in the Excel file. If the book is present in the book bank and the user requires that book then one will be issued to the user and the total number of books will be reduced by 1 (one) and the user or borrower’s name will be entered in the Excel’s table row in which the book name is present separated by a comma by other borrower names. The borrower's name can be more than one because more than one copies of the book are there as these are the books that are taught in schools.
> """
>
[snip]
How are the relevant cells identified in the spreadsheet?

It's often the case that the cells on the first row contain text as
column labels. If that's what you have in your spreadsheet, then read
the cells on the first row for the column labels and put them in a dict
to map from column label to column number.
--
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 ]
-“How are the relevant cells identified in the spreadsheet?”
The column headings are:
BOOK_NAME
BOOK_AUTHOR
BOOK_ISBN
TOTAL_COPIES
COPIES_LEFT
BORROWER’S_NAME
ISSUE_DATE
RETURN_DATE


-“It's often the case that the cells on the first row contain text as column labels.”

These I have written above.


-“If that's what you have in your spreadsheet, then read the cells on the first row for the column labels and put them in a dict to map from column label to column number.”

This written above I do not understand how to code.
--
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 ]
*** Apologies for the repost. Since Gmane made the list a read-only
group, I finally broke down and reinstated Giganews comp.lang.python.
Unfortunately I'd missed that this came back with X-NoArchive active and
Google doesn't even let such messages show up for a day -- so the OP hasn't
seen any of my responses.

As a courtesy, I will NOT be reposting the other four responses I've
made over the last few days. {If I do, it will be as a single consolidated
response} ***

On Mon, 10 Jan 2022 22:31:00 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>-“How are the relevant cells identified in the spreadsheet?”
>The column headings are:
>BOOK_NAME
>BOOK_AUTHOR
>BOOK_ISBN
>TOTAL_COPIES
>COPIES_LEFT
>BORROWER’S_NAME
>ISSUE_DATE
>RETURN_DATE
>

So... Besides "BORROWER'S_NAME" you also have a pair of dates you have
to track in parallel, and which should also need to be updated whenever you
change the borrower field. Furthermore, if you plan to separate those with
commas, you'll need to escape any embedded commas or you'll find that names
like "John Doe, Jr" will mess up the correspondence as you'd treat that as
two names on reading the borrower field. Also you need to be aware of the
limits for Excel text cells -- while you could stuff 32kB of text into a
cell, Excel itself will only display the first 1024 characters. That might
be sufficient if the average name is around 31 characters (32 with your
comma separator) as it would allow 32 names to be entered and still display
in Excel itself. Oh, and to track multiple dates in a cell, you'll have to
convert from date to text when writing the cell, and from text back to date
when reading the cell -- since you can't comma separate multiple dates.

Total_Copies - Copies_Left should be equal to the number of names (and
dates). In short, this is a very messy structure to be maintaining. If not
using an RDBM, at the very least borrower/issue date/return date should be
moved to a separate sheet which also has "Book ID" (the row number in the
first sheet with the book). That way you'd have one record per borrower,
and can easily add new records at the bottom of the sheet (might need to
use a "Book ID" of "0" to indicate a deleted record (when a borrower
returns the book) so you can reuse the slot, since you'd need some way to
identify the end of the data -- most likely by a blank record..

>-“If that's what you have in your spreadsheet, then read the cells on the first row for the column labels and put them in a dict to map from column label to column number.”
>
>This written above I do not understand how to code.

Have you gone through the Python Tutorial? Dictionaries are one of
Python's basic data structures. https://docs.python.org/3/tutorial/

You are unlikely to find anything near to your application on-line --
pretty much anyone doing something like a library check-out system will be
using a relational database rather than spread sheets. At worst, they may
have a spread sheet import operation to do initial population of the
database, though even that might be using SQL operations (Windows supports
Excel files as an ODBC data source). See:
https://docs.microsoft.com/en-us/cpp/data/odbc/data-source-managing-connections-odbc?view=msvc-170
They are unlikely to be dong any exports to Excel -- that's the realm of
report logic. According to
https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.5/dmpdmsug/Content/dfDMStd_T_Excel_ODBC.html
"""
Note: You cannot use a DSN to write output to Excel format. You can,
however, use a Text File Output node in a data job to write output in CSV
format. You can then import the CSV file into Excel.
"""
A Java-biased (old Java -- the interface to ODBC has been removed from
current Java) example that doesn't seem to need "named ranges" is
https://querysurge.zendesk.com/hc/en-us/articles/205766136-Writing-SQL-Queries-against-Excel-files-using-ODBC-connection-Deprecated-Excel-SQL-

Or...
https://www.red-gate.com/simple-talk/databases/sql-server/database-administration-sql-server/getting-data-between-excel-and-sql-server-using-odbc/
(which also indicates that it is possible to update the file via ODBC...
But note the constraints regarding having 64-bit vs 32-bit drivers).
Obviously you'll need to translate the PowerShell syntax into Python's ODBC
DB-API interface (which is a bit archaic as I recall -- does not match
current DP-API specifications).



--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/


--
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 ]
*** Going back to the post in the thread as I've other concerns (and
have turned off the old X-NoArchive setting ***

On Thu, 6 Jan 2022 10:55:30 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>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.
>
>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”.
>
>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.
>
>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.
>
>
>- 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??

There are likely plenty -- How much do you want to pay? How much
support do you need? How much traffic do you expect.

Note that the PythonHOW tutorial is suggesting creating a student/hobby
account on Heroku (free, and fairly limited). Heroku provides Linux
containers, and for Python you can only make use of add-ons that can be
installed using PIP. As Linux, none of the Windows specific modules will be
available (no Excel ODBC, no use of pythonwin extensions calling directly
into the Excel DLLs).

Who is going to be using the Excel file? and how are they going to get
to it? Your Heroku container does not run Excel, and I'm not even sure how
you would get it to the Heroku container (possibly it can be done as part
of the Python application upload).

I don't even know if SQLite3 is viable -- as I recall, Linux Python
installs rely upon system installed SQLite3 libraries, not installed via
PIP. Heroku pushes PostgreSQL for data storage. It may cost to add others
(MariaDB/MySQL).


https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-python

>
>- No time to switch from Excel to anywhere else. Please do not make any changes to the Excel file.
>

Again, if you are deploying to something like Heroku for the
application -- the Excel file will have to be deployed also, and no one
except your application will be able to see it there. Under this situation,
there is no reason/excuse to keep the data in the very inefficient format
you've defined in the most recent message. Import into some supported
database and normalize the data to make updates easier.


--
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 2022-01-11 06:31, NArshad wrote:
> -“How are the relevant cells identified in the spreadsheet?”
> The column headings are:
> BOOK_NAME
> BOOK_AUTHOR
> BOOK_ISBN
> TOTAL_COPIES
> COPIES_LEFT
> BORROWER’S_NAME
> ISSUE_DATE
> RETURN_DATE
>
>
> -“It's often the case that the cells on the first row contain text as column labels.”
>
> These I have written above.
>
>
> -“If that's what you have in your spreadsheet, then read the cells on the first row for the column labels and put them in a dict to map from column label to column number.”
>
> This written above I do not understand how to code.

Well, you know how to read the contents of a cell, and how to put items
into a dict (the key will be the cell contents and the value will be the
column number).

The column numbers will go from 1 to sheet.last_column, although some of
them might be empty (their value will be None), which you can remove
from the dict afterwards.
--
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 ]
- “if you are deploying to something like Heroku for the application -- the Excel file will have to be deployed also, and no one except your application will be able to see it there. Under this situation, there is no reason/excuse to keep the data in the very inefficient format you've defined in the most recent message. Import into some supported database and normalize the data to make updates easier.”

Ok with deploying the Excel file also. Next time I will switch to another database.



-“Well, you know how to read the contents of a cell, and how to put items into a dict (the key will be the cell contents and the value will be the column number).”

No, I don’t know. I tried but still the same.



-“The column numbers will go from 1 to sheet.last_column, although some of them might be empty (their value will be None), which you can remove from the dict afterward.”

No need to do with the whole spreadsheet only the first column is enough
--
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 Thu, 13 Jan 2022 10:44:01 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

Please arrange to use some client that does proper quote attribution.
It gets difficult to read these when you have snippets from multiple posts
with no attribution of who wrote the snippet, and when it was posted, etc.

>
>- “if you are deploying to something like Heroku for the application -- the Excel file will have to be deployed also, and no one except your application will be able to see it there. Under this situation, there is no reason/excuse to keep the data in the very inefficient format you've defined in the most recent message. Import
into some supported database and normalize the data to make updates easier.”
>
>Ok with deploying the Excel file also. Next time I will switch to another database.
>

There is still that lingering question of who can see the data. Once
deployed, the only way to access that Excel file will be either by the
owner of the Heroku instance (you -- using the deployment process; FTP? I
presume if you can upload, you'll be able to download) or via your
application.

As you've described this system, the only thing your application will
do is record "check-outs" by tracking available copies of books, and the
name (and dates?) of the person doing the check-out. There is no reporting
function -- not even a print-out for the user of which books they've just
reserved, so how does anyone actually verify they are to receive a physical
book after reserving it. Is there any logic to prevent someone from
reserving multiple copies of a book... You'll also need logic to ensure
that multiple borrowers connecting to the application at the same time
can't both reserve the same copy of any book, or that one borrower doesn't
block others from reserving other books at the same time. Spreadsheets are
not "multiple user" files, and if each session (borrower connecting to the
application) results in the application trying to open the spreadsheet
you'll have conflicts.


>
>
>-“Well, you know how to read the contents of a cell, and how to put items into a dict (the key will be the cell contents and the value will be the column number).”
>
>No, I don’t know. I tried but still the same.
>

Tried what?

All throughout this thread you have never shown us a sample of code
you've written. When asking for help about a Python feature, It is common
courtesy to provide a minimal complete example (ie, something that readers
can cut&paste into their environment to test) that reproduces whatever
problem one is having.

Other posters have provided snippets of how to read from an Excel file.

If you don't know how to put stuff into a dictionary ("dict") structure
you need to step back from this application and study a Python tutorial as
dicts, lists, tuples are core data structures available in the language
(whereas in my ancient days, we'd have had to learn how to code a
dictionary from scratch -- look up "hashed head multiply linked list"
someday <G>)



>
>
>-“The column numbers will go from 1 to sheet.last_column, although some of them might be empty (their value will be None), which you can remove from the dict afterward.”
>
>No need to do with the whole spreadsheet only the first column is enough

Really? Per your earlier post

-=-=-=-
On Mon, 10 Jan 2022 22:31:00 -0800 (PST), NArshad <narshad.380@gmail.com>
declaimed the following:

>The column headings are:
>BOOK_NAME
>BOOK_AUTHOR
>BOOK_ISBN
>TOTAL_COPIES
>COPIES_LEFT
>BORROWER’S_NAME
>ISSUE_DATE
>RETURN_DATE
>
-=-=-=-

... the first column is just "book names"... Don't you need to access the
various copy count columns along with borrower names (and dates)?

The purpose of the dictionary is to map your column headings to the
actual spreadsheet access (either "A".."<whatever>" letters, or numeric
1..<whatever> indices). That way, later in the code, instead of having to
keep track of cryptic column IDs ("I need the 'copies_left' column -- is
that column 5 or 6?") you'd use, say, column_dict["COPIES_LEFT"] where the
dictionary has something like
{ ..., "COPIES_LEFT" : 5, ... }



--
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 Thu, 13 Jan 2022 15:22:50 -0500, Dennis Lee Bieber
<wlfraed@ix.netcom.com> declaimed the following:

Talking to myself in public again... Bad habit...

> As you've described this system, the only thing your application will
>do is record "check-outs" by tracking available copies of books, and the
>name (and dates?) of the person doing the check-out. There is no reporting
>function -- not even a print-out for the user of which books they've just
>reserved, so how does anyone actually verify they are to receive a physical
>book after reserving it. Is there any logic to prevent someone from
>reserving multiple copies of a book... You'll also need logic to ensure
>that multiple borrowers connecting to the application at the same time
>can't both reserve the same copy of any book, or that one borrower doesn't
>block others from reserving other books at the same time. Spreadsheets are
>not "multiple user" files, and if each session (borrower connecting to the
>application) results in the application trying to open the spreadsheet
>you'll have conflicts.
>

Perhaps
https://data-flair.training/blogs/library-management-system-python-project/
can provide some clues -- though it is tkinter based, not a web
application... (Though they don't seem to be tracking issue/due dates <G>).

Or, for a web application (using Django, not Flask) see
https://techvidvan.com/tutorials/python-library-management-system/

If you need more examples to purloin, rather than developing your own
implementation, just hit Google...
https://www.google.com/search?q=python+library+reservation+system which is
how I found the above two examples.


--
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 Fri, Jan 14, 2022 at 7:56 AM Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>
> On Thu, 13 Jan 2022 15:22:50 -0500, Dennis Lee Bieber
> <wlfraed@ix.netcom.com> declaimed the following:
>
> Talking to myself in public again... Bad habit...

Not as bad as singing choruses in public, which - or so I'm told, by a
mad girl in opera - is quite, quite mad.

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 Fri, 14 Jan 2022 08:24:43 +1100, Chris Angelico <rosuav@gmail.com>
declaimed the following:

>On Fri, Jan 14, 2022 at 7:56 AM Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>>
>> On Thu, 13 Jan 2022 15:22:50 -0500, Dennis Lee Bieber
>> <wlfraed@ix.netcom.com> declaimed the following:
>>
>> Talking to myself in public again... Bad habit...
>
>Not as bad as singing choruses in public, which - or so I'm told, by a
>mad girl in opera - is quite, quite mad.
>

I usually put "eighth notes" (emulated as o/~) around the "talking to
myself in public"...
https://www.google.com/search?q=talking+to+myself+in+public+lyrics


--
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 ]
I am not replying to anything below so I have removed it.
So I need to remind people of the topic and how it has wandered.
Someone has data in a not particularly great format in an EXCEL spreadsheet. They want to somehow use an external language like Python to manipulate the contents from outside and keep the results inside the same or perhaps another EXCEL file.
Now EXCEL has had programming available for a long time within the spreadsheet and perhaps some of that was once used within the actual spreadsheet and stored as macros or whatever using something like VBA. Or perhaps someone used to update by hand.
So the suggestions to copy the data ONCE into something else (a CSV, database, whatever) that can be used externally are reasonable but seem to be resisted. I would guess some of the "missing" functionality others wonder about such as making reports, may still be available within other sheets or parts of the EXCEL .xlsx or other format file.
An interesting third option that has not been mentioned would be to port the data into another application like Google Sheets which has a fairly similar spreadsheet format with very different internals but many ways for a program to read and adjust the contents such as Google Apps Script that can also do things like send out emails and so on.
Instead, someone suggested Python which indeed, with lots of work, can open just about ANY nonsensical file and diddle around and rewrite it, but WHY? Unless you find the right modules and use them carefully, it seems the hard way to go. Sure, you can in theory do it but the amount of learning and work involved seems excessive  for what you get. And when you are done with what was requested here, you probably need to add other features that will again be painful. If you were hiring someone with experience, you might be paying more and more and end up with a package hard for anyone else to understand, let alone maintain and expand.
An intermediate solution seems to be to copy the darn data from EXCEL and modifies it to be easy to use and make changes  but make available functionality that saves the data when needed back into an EXCEL file, but most of the time manipulates it the easy way. 
As such, if the request continues to be to do it the hard way, i may be among those who ignores this thread any further.
--
https://mail.python.org/mailman/listinfo/python-list

1 2 3  View All