[Tutor] Collecting output from Python scripts executed via Cron

2017-05-18 Thread 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 statements in the scripts which helps me to monitor progress and confirm

Re: [Tutor] deleting elements of a dictionary

2017-05-18 Thread Peter Otten
Michael C wrote: > I am trying to remove incorrect entries of my dictionary. > I have multiple keys for the same value, > > ex, > [111]:[5] > [222]:[5] > [333]:[5} > > and I have found out that some key:value pairs are incorrect, and the best > thing to do > is to delete all entries who value

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
I'll use it when I get to it! Thanks! For now, I use this, as suggested by eryk sun: os.startfile('1.bmp') it doesn't pop the window. Thanks Alan! On Thu, May 18, 2017 at 10:06 AM, Alan Gauld via Tutor wrote: > On 18/05/17 16:43, Michael C wrote: > > os.startfile('1.bmp')

[Tutor] deleting elements of a dictionary

2017-05-18 Thread Michael C
I am trying to remove incorrect entries of my dictionary. I have multiple keys for the same value, ex, [111]:[5] [222]:[5] [333]:[5} and I have found out that some key:value pairs are incorrect, and the best thing to do is to delete all entries who value is 5. So this is what I am doing: import

Re: [Tutor] Python Image Library

2017-05-18 Thread Alan Gauld via Tutor
On 18/05/17 16:43, Michael C wrote: > os.startfile('1.bmp') > > works like a charm! > > Now I need to figure out how to close this window once I finish with it! Sadly that is manual. Unless you care to write code to search for the process and use the Windows API to kill it off. If you really

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
os.startfile('1.bmp') works like a charm! Now I need to figure out how to close this window once I finish with it! On Thu, May 18, 2017 at 8:14 AM, Michael C wrote: > Oh I have been using Pillow 4.0 the whole time alright, sorry I forgot to > mention it. > > On

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
Did you go into the source code of PIL/Pillow? Awesome!!! On Wed, May 17, 2017 at 7:52 PM, eryk sun wrote: > On Thu, May 18, 2017 at 1:58 AM, Michael C > wrote: > > when I run this, while it's called test.pyw, this pops up > > > > from PIL

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
Oh I have been using Pillow 4.0 the whole time alright, sorry I forgot to mention it. On Thu, May 18, 2017 at 1:55 AM, Alan Gauld via Tutor wrote: > On 18/05/17 02:58, Michael C wrote: > > when I run this, while it's called test.pyw, this pops up > > > > from PIL import Image

Re: [Tutor] Pyuthon 3 Combine 1 D Arrays

2017-05-18 Thread Stephen P. Molnar
On 05/17/2017 06:15 PM, Luis JM Amoreira wrote: Hi, If your arrays have shape (300,1) (single column, 300 rows right?) then M = numpy.hstack((array1, array2)) is an array with shape (300, 2) (300 rows, 2 columns) and M.T is 2 by 300 [shape (2, 300)]. Take an example: In [11]: import numpy as np

Re: [Tutor] Python Image Library

2017-05-18 Thread Alan Gauld via Tutor
On 18/05/17 02:58, Michael C wrote: > when I run this, while it's called test.pyw, this pops up > > from PIL import Image > > im = Image.open('1.bmp') > im.show() One suggestion is to use Pillow instead of PIL. So far as I know PIL is frozen and all new development is on Pillow. It is

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
when I run this, while it's called test.pyw, this pops up from PIL import Image im = Image.open('1.bmp') im.show() [image: Inline image 1] On Wed, May 17, 2017 at 6:51 PM, eryk sun wrote: > On Wed, May 17, 2017 at 10:33 PM, Michael C >

Re: [Tutor] How do I display a picture?

2017-05-18 Thread Michael C
If all PIL does with .show() is to invoke the system default image viewer, why would it pop an empty console window? the existence of this window causes the script to hang, so i have to so far manually close it before the script would continue to run. On Wed, May 17, 2017 at 6:03 PM, Alan Gauld

Re: [Tutor] Help - What is the best package to learn programming in Python?

2017-05-18 Thread Abdur-Rahmaan Janhangeer
for IDE, you have pycharm which works well i use Wing IDE personal. Nice for me. Don't forget to check the in-built IDLE tutorialspoint for python 2 or 3 is a nice quick reference. Learning how to do things the python way helps to ease jobs. else, python has become more than an average

Re: [Tutor] Python 3 Combine 1 D Arrays

2017-05-18 Thread Peter Otten
Stephen P. Molnar wrote: > I'm beginning to think that I don't know how to ask the question as > Google and Stack Overflow have resulted in nothing. All of the results > seem to deal with integers. > > I have a number of single column floating point arrays each containing > 300 entries that I