Re: [Tutor] os.popen - using commands and input %

2015-11-17 Thread Danny Yoo
On Mon, Nov 16, 2015 at 4:17 AM, Vusa Moyo wrote: > Hi Guys, > > My code is as follows > > # this list contains system process ID's > pidst=[1232, 4543, 12009] > > pmap_str=[] > command="pmap -d %s | grep private |awk '{print $1}' | awk -FK '{print $1}'" > > for i in range(len(pids)): > pmap_s

Re: [Tutor] Help - International School in Spain

2015-11-17 Thread Mike Straw
Caroline, The parentheses change the interpretation for the print statement. If you put it without the parentheses, it will work fine. print "Mashed ",veg," on the ceiling." Also, another note: the spaces at end of the first string and the start of the third string aren't necessary. When you use

Re: [Tutor] Help - International School in Spain

2015-11-17 Thread Peter Otten
Peter Otten wrote: >> print("Mashed ",veg," on the ceiling.") An unrelated note: Python automatically adds spaces between the printed values, so the output of print("Mashed", veg, "on the ceiling.") will look better. ___ Tutor maillist - Tutor@py

Re: [Tutor] Help - International School in Spain

2015-11-17 Thread Peter Otten
caroline metcalf wrote: > Hi there > > I am having an issue. This code normally works fine > > Code: > veg="carrots" > print("Mashed ",veg," on the ceiling.") > print("Green beans on the floor.") > print("Stewed tomatoes in the corner.") > print("Squash upon the door.") > > But, I am getting t

Re: [Tutor] Help - International School in Spain

2015-11-17 Thread Alan Gauld
On 17/11/15 12:27, caroline metcalf wrote: veg="carrots" print("Mashed ",veg," on the ceiling.") print("Green beans on the floor.") But, I am getting this. Result: ('Mashed ', 'carrots', ' on the ceiling.') Green beans on the floor. I have tried semi-colons instead of commas as Spain uses

Re: [Tutor] Help - International School in Spain

2015-11-17 Thread Pa Yo
Might you be using two single inverted commas '' rather than one inverted comma " Just a thought. Also check the use of acute accents and inverted commas, they are easy to mix up on a Spanish keyboard - depending on the font you use. PY On Tuesday, 17 November 2015, caroline metcalf < caroline.m

[Tutor] Help - International School in Spain

2015-11-17 Thread caroline metcalf
Hi there I am having an issue. This code normally works fine Code: veg="carrots" print("Mashed ",veg," on the ceiling.") print("Green beans on the floor.") print("Stewed tomatoes in the corner.") print("Squash upon the door.") But, I am getting this. Result: ('Mashed ', 'carrots', ' on the cei

Re: [Tutor] Debugging in Python

2015-11-17 Thread John Wong
On Mon, Nov 16, 2015 at 12:48 PM, Alan Gauld wrote: > > > The correct fix is to exit() from the python3 shell and start it again. >> > > He's tried that and didn't find it satisfactory. That's why > he wants a "better" workflow. > > Alternatively, add some main code at the end of your file and use