Re: Is there a conflict of libraries here?

2020-11-09 Thread Ethan Furman
On 11/8/20 9:20 PM, Chris Angelico wrote: Perhaps, but certainly the confusion is far less when the module is always imported as itself, and then the class is "datetime.datetime" which nicely parallels "datetime.date" and "datetime.time". I find doubled names such as "datetime.datetime" both j

How can I make this more complex?

2020-11-09 Thread Quentin Bock
grade = input("Enter your grade: ") if grade >= 90: print("You got an A ") if grade >= 80: print("You got a B ") if grade >= 70: print("You got a C") if grade >= 60: print("You got a D ") if grade >= 50: print("You failed") How can I make this to say if your grade is 90 or h

Re: How can I make this more complex?

2020-11-09 Thread inhahe
if 100 > grade >= 90: On Mon, Nov 9, 2020 at 6:01 PM Quentin Bock wrote: > grade = input("Enter your grade: ") > if grade >= 90: > print("You got an A ") > if grade >= 80: > print("You got a B ") > if grade >= 70: > print("You got a C") > if grade >= 60: > print("You got a D ")

Re: How can I make this more complex?

2020-11-09 Thread Bob Gailer
On Nov 9, 2020 5:59 PM, "Quentin Bock" wrote: > > grade = input("Enter your grade: ") > if grade >= 90: > print("You got an A ") > if grade >= 80: > print("You got a B ") > if grade >= 70: > print("You got a C") > if grade >= 60: > print("You got a D ") > if grade >= 50: > prin

Re: How can I make this more complex?

2020-11-09 Thread MRAB
On 2020-11-09 21:04, Quentin Bock wrote: grade = input("Enter your grade: ") if grade >= 90: print("You got an A ") if grade >= 80: print("You got a B ") if grade >= 70: print("You got a C") if grade >= 60: print("You got a D ") if grade >= 50: print("You failed") How

Re: How can I make this more complex?

2020-11-09 Thread dn via Python-list
On 10/11/2020 10:04, Quentin Bock wrote: grade = input("Enter your grade: ") if grade >= 90: print("You got an A ") if grade >= 80: print("You got a B ") if grade >= 70: print("You got a C") if grade >= 60: print("You got a D ") if grade >= 50: print("You failed") Firs

Changing strings in files

2020-11-09 Thread Manfred Lotz
I have a situation where in a directory tree I want to change a certain string in all files where that string occurs. My idea was to do - os.scandir and for each file - check if a file is a text file - if it is not a text file skip that file - change the string as often as it occurs in t

Re: Changing strings in files

2020-11-09 Thread Loris Bennett
Manfred Lotz writes: > I have a situation where in a directory tree I want to change a certain > string in all files where that string occurs. > > My idea was to do > > - os.scandir and for each file >- check if a file is a text file >- if it is not a text file skip that file >- chang

Re: Changing strings in files

2020-11-09 Thread Cameron Simpson
On 10Nov2020 07:24, Manfred Lotz wrote: >I have a situation where in a directory tree I want to change a certain >string in all files where that string occurs. > >My idea was to do > >- os.scandir and for each file Use os.walk for trees. scandir does a single directory. > - check if a file is