Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: smtplib mail without subject
Post: RE: smtplib mail without subject

Instead of your line 23, you want body = MIMEText('Netcool data transfer is not sucessful, please check FTP service') msg.attach(body)
rlgoodman General Coding Help 2 2,484 Apr-23-2019, 09:36 PM
    Thread: Updating Key in JSON File
Post: RE: Updating Key in JSON File

You can't replace a key in a dictionary. You have to create a new entry in the dictionary with your new key, with the same contents as the old item. Then delete the old key/item if that's what is requ...
rlgoodman General Coding Help 4 11,529 Apr-22-2019, 03:20 PM
    Thread: read write
Post: RE: read write

Don't open a new output file every time through the loop. Just open it once before the loop starts.
rlgoodman General Coding Help 2 2,027 Apr-18-2019, 09:19 PM
    Thread: Basic Python 3 Win 10 Search Txt to File Newbie
Post: RE: Basic Python 3 Win 10 Search Txt to File Newbi...

You could have one loop do both the reading and writing; this is probably better anyway if that's all you are doing. infile = open("C:\\Users\\John\Desktop\\StuffIn.txt", "r") outfile = open(...
rlgoodman General Coding Help 6 151,286 Apr-18-2019, 09:14 PM
    Thread: Converting complex codebase from 2.7 to 3.5
Post: RE: Converting complex codebase from 2.7 to 3.5

Sorry, I should have said that this is after running the 2to3 conversion on all the code, so all the code is valid Python 3 already. It's just the import structure which is standing in my way now. Th...
rlgoodman General Coding Help 3 2,461 Apr-18-2019, 09:06 PM
    Thread: Basic Python 3 Win 10 Search Txt to File Newbie
Post: RE: Basic Python 3 Win 10 Search Txt to File Newbi...

The break ends the first loop, so you only get one matched line. You need to store the matched lines in an array (and not break after each one), then use a for loop on the array to write each of them ...
rlgoodman General Coding Help 6 151,286 Apr-18-2019, 08:59 PM
    Thread: Converting complex codebase from 2.7 to 3.5
Post: Converting complex codebase from 2.7 to 3.5

Hello smart Python people, I have been working with this code for about 12 years now and we are finally getting around to converting to Python 3.5 (Please don't remind me how late we are!) I have a ...
rlgoodman General Coding Help 3 2,461 Apr-18-2019, 08:11 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020