Re: [Tutor] regarding checksum

2016-10-26 Thread Peter Otten
Clayton Kirkwood wrote: > Small problem: > Import zlib > For file in files: > checksum = zlib.adler32(file) > > traceback > checksum = zlib.adler32(file) > TypeError: a bytes-like object is required, not 'str' > > Obvious question, how do I make a bytes-like object. I've read through the

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-26 Thread Ed Troy
I am pretty sure I installed python3. And, also, matplotlib, scipy, and numpy. If I enter either python or python3, I get the >>> prompt, so I may have both installed. How do I verify which versions of python and numpy, matplotlib and scipy I have installed? I am pretty sure I have matplotlib,

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-26 Thread Alan Gauld via Tutor
On 26/10/16 04:19, Ed Troy wrote: > I am pretty sure I installed python3. And, also, matplotlib, scipy, and > numpy. If I enter either python or python3, I get the >>> prompt, so I > may have both installed. Yes, that's normal. Ubuntu uses python 2 for some of its utilities. > How do I verify

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-26 Thread Felix Dietrich
Ed Troy writes: > I am pretty sure I installed python3. And, also, matplotlib, scipy, > and numpy. > How do I verify which versions of python and numpy, matplotlib and > scipy I have installed? The following commandline should list the version of installed python packages required by the script

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-26 Thread Felix Dietrich
> Alan Gauld via Tutor writes: >> On 26/10/16 04:19, Ed Troy wrote: >> Would it be a help if I actually list the python program that I am >> trying to run? > > Yes. I'm assuming you just cut n paste the code from the web site but > something could have gone wrong with the formatting and Python

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-26 Thread Ed Troy
I found the problem. Originally, I was getting errors that were related to formatting, apparently. It looked fine to me, but because I had copied it from the web, there were, apparently, hidden characters. In an effort to get rid of errors, I was eliminating some lines. I finally added a line,

[Tutor] run local script on a remote machine

2016-10-26 Thread Alex Kleider
I've got three files as follows: 1: #!/usr/bin/env python3 # # file: experiment.py # # A simple python program that takes parameters. import sys info = sys.argv[1:] print(info) with open("/home/alex/junk.txt", 'w') as file_object: for item in info: file_object.write(''.join((item,'\

[Tutor] String within a string solution (newbie question)

2016-10-26 Thread Wish Dokta
Hello, I am currently writing a basic program to calculate and display the size of folders with a drive/directory. To do this I am storing each directory in a dict as the key, with the value being the sum of the size of all files in that directories (but not directories). For example: { "C:\\doc

Re: [Tutor] String within a string solution (newbie question)

2016-10-26 Thread Alan Gauld via Tutor
On 26/10/16 19:06, Wish Dokta wrote: > folders with a drive/directory. To do this I am storing each directory in a > dict as the key, with the value being the sum of the size of all files in > that directories (but not directories). > > For example: > > for "C:\\docs\\code" in key: > > Which wo

Re: [Tutor] String within a string solution (newbie question)

2016-10-26 Thread Bob Gailer
On Oct 26, 2016 2:07 PM, "Wish Dokta" wrote: > > Hello, > > I am currently writing a basic program to calculate and display the size of > folders with a drive/directory. To do this I am storing each directory in a > dict as the key, with the value being the sum of the size of all files in > that d