python2 vs python3

2019-10-18 Thread Jagga Soorma
Hello, I am writing my second python script and got it to work using python2.x. However, realized that I should be using python3 and it seems to fail with the following message: -- Traceback (most recent call last): File "test_script.py", line 29, in test_cmd = ("diskcmd -u " + x + " | gr

Re: Print formatting

2019-10-18 Thread Jagga Soorma
I seem to have found a way to do this with the following: print('{:<12s}{:>12s}'.format((temp_list[0]),(temp_list[3]))) Still let me know if there is a better way to format this output :) Thanks, -J On Fri, Oct 18, 2019 at 10:03 AM Jagga Soorma wrote: > > Hello, >

Print formatting

2019-10-18 Thread Jagga Soorma
Hello, I am new to python and trying to write a script that outputs some data about users. I was able to write it and dump the data but can't seem to align the output in column 2 correctly. Here is what I am trying to do: -- output: user1 data1 username2 data2 user3 data3 s

Re: Basic python question

2019-10-02 Thread Jagga Soorma
3, 2019 at 12:17 PM Aldwin Pollefeyt > wrote: >> >> Oh, sorry .. please try this: >> >> >>> x,y = tuple(output.split()) >> >> On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote: >>> >>> Thanks Aldwin that helps but it looks like it is reve

Re: Basic python question

2019-10-02 Thread Jagga Soorma
reversed (x is 2 and y is 7). Am I missing something? Thanks On Wed, Oct 2, 2019 at 8:49 PM Aldwin Pollefeyt wrote: > > You could use: > > >>> x, y = set(output.split()) > > On Thu, Oct 3, 2019 at 11:44 AM Jagga Soorma wrote: >> >> Hello, >> >

Basic python question

2019-10-02 Thread Jagga Soorma
Hello, I am new to python and trying to do some basic things with python. I am writing a script that runs a df command and I need parts of that output saved in 2 different variables. Is this something that can be done? I can do this by running multiple df commands but would prefer to make only