Assistance Needed: Corrupted Python Installation Uninstallation Issue

2024-01-29 Thread Syed Hamood via Python-list
Dear Python.org Support Team,

I hope this email finds you well. I am writing to seek assistance with an
issue I'm encountering while attempting to uninstall a corrupted Python
installation on my system.

Details of my system:

   - Operating System: Windows 10
   - Python Version: 3.11.3(64-bit)
   - Installation Method: installer from Python.org

Description of the issue: [Provide a brief description of the problem
you're facing, any error messages received, or specific steps you've taken
so far.]

I have already tried the following:

   - Deleting python. removing corrupted files from command prompt with
   administrative privileges.

However, despite my efforts, I have been unable to successfully uninstall
the corrupted Python installation.

I would greatly appreciate any guidance or assistance you could provide to
help me resolve this matter and successfully uninstall Python from my
system. If there are specific steps or commands I should follow, or if
there are additional tools or resources I should utilize, please let me
know.

Thank you very much for your time and support. I look forward to hearing
from you soon.

Best regards, Syed Hamood Email: syedhamoodahmed...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Assistance Needed: Corrupted Python Installation Uninstallation Issue

2024-01-29 Thread Mats Wichmann via Python-list

On 1/29/24 05:19, Syed Hamood via Python-list wrote:

Dear Python.org Support Team,

I hope this email finds you well. I am writing to seek assistance with an
issue I'm encountering while attempting to uninstall a corrupted Python
installation on my system.

Details of my system:

- Operating System: Windows 10
- Python Version: 3.11.3(64-bit)
- Installation Method: installer from Python.org

Description of the issue: [Provide a brief description of the problem
you're facing, any error messages received, or specific steps you've taken
so far.]

I have already tried the following:

- Deleting python. removing corrupted files from command prompt with
administrative privileges.

However, despite my efforts, I have been unable to successfully uninstall
the corrupted Python installation.


The more stuff you remove by hand the harder it is for the Windows 
installer to act to do an uninstall.


This tool usually helps if things are badly messed up:

https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d

Haven't used it for a while, but after it tries basic overall repairs to 
the installation subsystem (which is probably okay), there are prompts 
you can follow to point to a specific program that doesn't want to 
uninstall.



--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list

On Fri, 12 Jan 2024, Rich Shepard via Python-list wrote:


For my use 1) the salutation and email address (always with an '@') are
sequential and 2) I'm developing the script to extract both from the same
file.


I've looked at my Python books "Python Crash Course," "Effective Python,"
and "Python Tricks The Book" as well as web pages in my searches without
finding the answer to what may be a simple question: how to specify a
variable in one file that has its values in another file.

Specifically, how to I designate the salutation holder in the message file
and pass it the name value from the name/email address file?

If this explanation is not sufficiently clear I'll re-write it. :-)

TIA,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list

On Mon, 29 Jan 2024, dieter.mau...@online.de wrote:


Have you read "https://docs.python.org/3/library/io.html#module-io";?


Dieter,

No, I hadn't ... but I am reading it now.

Many thanks,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread Dieter Maurer via Python-list
Rich Shepard wrote at 2024-1-29 08:15 -0800:
> ...
>If this explanation is not sufficiently clear I'll re-write it. :-)

Have you read "https://docs.python.org/3/library/io.html#module-io";?

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list

On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:


No, I hadn't ... but I am reading it now.


Perhaps I missed the answer to my question when reading the io module. It
explains how to open/write/read files of text and binary data, not passing
a variable's value from one file to a place-keeper in another file.

I'll keep searching for a solution.

Rich
--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files [RESOLVED]

2024-01-29 Thread Rich Shepard via Python-list

On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:


I'll keep searching for a solution.


IIRC, someone here pointed me to 
and I forgot about it ... until now.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread AVI GROSS via Python-list
Rich,

You got an overly general reply to a question many of us may not understand.

You have not hinted at how the two files are organized, perhaps with an
example.

There are several general solutions that may apply. Some involve reading in
both files into data structures and perhaps linking them together in some
way such as a data.frame or binary tree. You can then process individual
request in memory/

The second should be straightforward as long as text is text. If the first
file tells you to search for XYZ then you search the second file for XYZ and
read in whatever is associated with it and do your thing.

Without a bit more specific detail, you may not get more than a suggestion
as to how to read in files.


-Original Message-
From: Python-list  On
Behalf Of Rich Shepard via Python-list
Sent: Monday, January 29, 2024 12:38 PM
To: python-list@python.org
Subject: RE: Extract lines from file, add to new files

On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:

> No, I hadn't ... but I am reading it now.

Perhaps I missed the answer to my question when reading the io module. It
explains how to open/write/read files of text and binary data, not passing
a variable's value from one file to a place-keeper in another file.

I'll keep searching for a solution.

Rich
-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list

On Mon, 29 Jan 2024, avi.e.gr...@gmail.com wrote:


There are several general solutions that may apply. Some involve reading
in both files into data structures and perhaps linking them together in
some way such as a data.frame or binary tree. You can then process
individual request in memory/


Avi,

I found several web pages describing how to use the python email library and
tools to send individual or multiple email messages. I'll learn how to do
this based on a couple of detailed examples.

Thanks,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: Extract lines from file, add to new files

2024-01-29 Thread dn via Python-list

On 30/01/24 05:15, Rich Shepard via Python-list wrote:

On Fri, 12 Jan 2024, Rich Shepard via Python-list wrote:


For my use 1) the salutation and email address (always with an '@') are
sequential and 2) I'm developing the script to extract both from the same
file.


I've looked at my Python books "Python Crash Course," "Effective Python,"
and "Python Tricks The Book" as well as web pages in my searches without
finding the answer to what may be a simple question: how to specify a
variable in one file that has its values in another file.

Specifically, how to I designate the salutation holder in the message file
and pass it the name value from the name/email address file?

If this explanation is not sufficiently clear I'll re-write it. :-)



It seems clear - but maybe we (all) misunderstand?

The books don't cover it - but is there a reason why they don't?


(Thunderbird did not thread this message with earlier ones, and it seems 
some time has passed/memory is fading - but hopefully have remembered 
content)



As said previously, the idea of two physical-files containing 
logically-related data (without any form of cross-reference between) is 
bad design.


In the current file, there is one physical structure and each person's 
details are logically-related by proximity. A long way from ideal, but 
workable (as you've described).


However, once split into two files, there is no way to guarantee that 
the two logically-related data-items (name and address) will continue to 
be related by their physical position in the respective files. Worse: 
whilst it would seem apparent that "Alice" from the names file might be 
related to the address "al...@domain.tld", how could one know if "Bob" 
actually corresponds to "list-mem...@domain.tld"?


This is why dicts, databases, etc, offer keys (as labels for 
data-items/dependent components)!



After a quick look at Eric's Crash Course, yes, his files-intro example 
(digits of pi) is unlikely to have any practical reality (and I work 
with statisticians and quants!). However, at the end of that chapter 
(10), there is mention of JSON files. A JSON version of the existing 
single-file structure will provide human-readable labeling of 
data-items, give better separation between individuals' data, and show 
how name and address are linked. Recommend solving 'the problem' that 
way! (as previously discussed by others 'here', IIRC)


Slatkin's Effective Python doesn't seem to discuss the basics of files 
at all (presumes such knowledge of the reader). It dives into important, 
but rather technical discussions, comparing strings and bytes - somewhat 
beyond the complexity-level of this discussion. That book does however 
include discussions such as "Prefer Multiple Assignment Unpacking over 
Indexing" (Item 6 - also points to Item 19) where relative-positioning 
(indexing in other words) is advised-against.



If you wish to persist with this two-file structure, please see earlier 
responses (again, IIRC) and discussion of file-merge operations. As 
these date back to mainframes and the days of storing files on mag-tape, 
I'd be surprised to see them discussed in 'modern' texts. However, the 
principle is: read a record from each file, do-the-business, read the 
next 'pair' of physically-related records, rinse-and-repeat.


If you require further assistance: how about showing a couple of 
relevant lines of the data-file(s) and the pertinent parts of the code, 
along with a description of what's going-wrong or not making sense to you?


--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Extract lines from file, add to new files

2024-01-29 Thread Grant Edwards via Python-list
On 2024-01-29, Rich Shepard via Python-list  wrote:
> On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:
>
>> No, I hadn't ... but I am reading it now.
>
> Perhaps I missed the answer to my question when reading the io module. It
> explains how to open/write/read files of text and binary data, not passing
> a variable's value from one file to a place-keeper in another file.

It's not at all clear (to me) what you're asking about.  When you talk
about "files" are you referring to data files? Python modules within a
single program? Seperate Python programs?  Something else?

The phrase "place-keeper in another file" sounds a bit like you're
trying to do templating. There are many, many ways to do templating in
Python -- ranging from literal 'f-strings' to powerful templating
engines that are used to construct entire web sites:

  https://www.google.com/search?q=python+templating

  https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings

  https://en.wikipedia.org/wiki/Jinja_(template_engine)

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extract lines from file, add to new files

2024-01-29 Thread Thomas Passin via Python-list

On 1/29/2024 11:15 AM, Rich Shepard via Python-list wrote:

For my use 1) the salutation and email address (always with an '@') are
sequential and 2) I'm developing the script to extract both from the same
file.


I've looked at my Python books "Python Crash Course," "Effective Python,"
and "Python Tricks The Book" as well as web pages in my searches without
finding the answer to what may be a simple question: how to specify a
variable in one file that has its values in another file.

Specifically, how to I designate the salutation holder in the message file
and pass it the name value from the name/email address file?

If this explanation is not sufficiently clear I'll re-write it. :-)

TIA,

Rich


I'm assuming this is a continuation of a previous thread about working 
with alternate lines with salutation and address, and I assume you've 
got that worked out.


If you aren't going to use one or another existing template system, 
perhaps the easiest is to use unique strings in the message file.  For 
example:


Dear __##so-and-so##__:
   Please don't write this message off as mere spam.
   Respectfully, Rich

Then you just do a replace of the unique string by the salutation. Don't 
change the original (i.e., template), make the changes to a copy that 
you will output.


--
https://mail.python.org/mailman/listinfo/python-list


RE: Extract lines from file, add to new files

2024-01-29 Thread AVI GROSS via Python-list
It can be quite frustrating figuring out what someone wants, Grant,
especially when they just change it.

It is worse when instead of starting a new thread with an appropriate
subject line, it continues and old one that was also frustrating to
understand.

It sounds though like another attempt to do something perhaps a different
way. Both attempts seem to be to use some form of storage of a set of email
addresses plus other info like a name that can be used to make a customized
email.

Frankly, this should have been fairly easy to do without so much back and
forth. I don't care how the email is actually sent, but the rest could have
been done any number of ways such as storing the data as rows in a CSV file
or saved using JSON format and so on. It was never made clear why two files
were needed and then somehow linked and searched. 

If the goal is to be able to search for something like a name and THEN find
an email address, that seems quite trivial if they are I the same file in
some format. If the number of items is small, reading it all in should not
be a big deal and you can use a regular expression or other method to locate
the entry you want and extract the additional info. If you have lots of
data, reading line after line may be less useful than just using a database
and a query.

One way to stop feeling frustrated is to stop reading the thread.

-Original Message-
From: Python-list  On
Behalf Of Grant Edwards via Python-list
Sent: Monday, January 29, 2024 5:54 PM
To: python-list@python.org
Subject: Re: Extract lines from file, add to new files

On 2024-01-29, Rich Shepard via Python-list  wrote:
> On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:
>
>> No, I hadn't ... but I am reading it now.
>
> Perhaps I missed the answer to my question when reading the io module. It
> explains how to open/write/read files of text and binary data, not passing
> a variable's value from one file to a place-keeper in another file.

It's not at all clear (to me) what you're asking about.  When you talk
about "files" are you referring to data files? Python modules within a
single program? Seperate Python programs?  Something else?

The phrase "place-keeper in another file" sounds a bit like you're
trying to do templating. There are many, many ways to do templating in
Python -- ranging from literal 'f-strings' to powerful templating
engines that are used to construct entire web sites:

  https://www.google.com/search?q=python+templating

  https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings

  https://en.wikipedia.org/wiki/Jinja_(template_engine)

-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list