Re: [Tutor] Python Image Library

2017-05-19 Thread Alan Gauld via Tutor
On 19/05/17 10:29, Alan Gauld via Tutor wrote: > is something that seems to work for jpegs. I hope bmp files > will too, I didn't have any to test... I converted a few jpg to bmp. It does work but it turns out Pillow is quite fussy about the BMP format. I had to turn off colour space header info

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Michael C
for n in list(read_dictionary): > print(read_dictionary[n]) > if read_dictionary[n] == '5': > del read_dictionary[n] After doing this how do I save it back to the dictionary? then i ll do this numpy.save('loc_string_dictionary.npy', dictionary) On Thu, May 18, 2017 at 3:05 PM,

Re: [Tutor] Python Image Library

2017-05-19 Thread Alan Gauld via Tutor
On 18/05/17 18:06, Alan Gauld via Tutor wrote: > Here is some untested Tkinter code to display an image > for 2 seconds: I tried this last night and it turned out to be harder than I expected. Eventually I got to bed at 3am! But here is something that seems to work for jpegs. I hope bmp files

Re: [Tutor] Collecting output from Python scripts executed via Cron

2017-05-19 Thread George Fischhof
2017-05-19 3:48 GMT+02:00 Leo Silver : > I have written a several Python scripts to collect data from external > sources (an email account and an sftp site). > > In development I run the scripts from IDLE or the command line and can view > the output of various print

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Peter Otten
Michael C wrote: > for n in list(read_dictionary): >> print(read_dictionary[n]) >> if read_dictionary[n] == '5': >> del read_dictionary[n] > > After doing this how do I save it back to the dictionary? > then i ll do this > numpy.save('loc_string_dictionary.npy', dictionary)

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Mats Wichmann
On 05/19/2017 11:17 AM, Alan Gauld via Tutor wrote: > On 19/05/17 15:23, Michael C wrote: >> list(read_dictionary) converts the dictionary into a list right? How can >> you save the list as a dictionary? > > Nope, list() produces a new list object containing the > keys of the dictionary. In the

[Tutor] always on top

2017-05-19 Thread Michael C
Hi all: I am running a code to examine another window's activities, while I use that window to do stuff. However, the python shell keeps grabbing the Topmost position so what I do on the other window, the one that has to stay on top the whole time, keeps getting into the shell window. Is making

[Tutor] always on top

2017-05-19 Thread Michael C
nvm, the problem went away on its own :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Image Library

2017-05-19 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 18/05/17 18:06, Alan Gauld via Tutor wrote: > >> Here is some untested Tkinter code to display an image >> for 2 seconds: > > I tried this last night and it turned out to be harder > than I expected. Eventually I got to bed at 3am! But here > is something that

Re: [Tutor] Collecting output from Python scripts executed via Cron

2017-05-19 Thread Alex Kleider
On 2017-05-18 18:48, Leo Silver wrote: I have written a several Python scripts to collect data from external sources (an email account and an sftp site). In development I run the scripts from IDLE or the command line and can view the output of various print statements in the scripts which

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Michael C
list(read_dictionary) converts the dictionary into a list right? How can you save the list as a dictionary? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Alan Gauld via Tutor
On 19/05/17 15:23, Michael C wrote: > list(read_dictionary) converts the dictionary into a list right? How can > you save the list as a dictionary? Nope, list() produces a new list object containing the keys of the dictionary. In the old day(of python 2) you used to get the same effect using for

Re: [Tutor] Python Image Library

2017-05-19 Thread Alan Gauld via Tutor
On 19/05/17 15:15, Peter Otten wrote: > call the destroy() rather than the quit() method. Nice! > > However, as your code gets away without calling destroy() I'm still > puzzled... withdraw hides the window then quit ends the mainloop so the procedure falls through to the end and everything