Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Chris Angelico
On Mon, Nov 12, 2018 at 11:20 PM Anssi Saari wrote: > > Chris Angelico writes: > > > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: > >> > >> Chris Angelico writes: > >> > >> > No helper needed. Safe against command injection. Uses the known > >> > format of the command's output; if you wan

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Anssi Saari
Chris Angelico writes: > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: >> >> Chris Angelico writes: >> >> > No helper needed. Safe against command injection. Uses the known >> > format of the command's output; if you want other information as well >> > as the type, you could get that too.

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Cousin Stanley
srinivasan wrote: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" > > Still my output is: > */dev/mmcblk1p1: LABEL="efi" UUID="1084

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Chris Angelico
On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: > > Chris Angelico writes: > > > No helper needed. Safe against command injection. Uses the known > > format of the command's output; if you want other information as well > > as the type, you could get that too. > > Can someone let me in on this

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Anssi Saari
Chris Angelico writes: > No helper needed. Safe against command injection. Uses the known > format of the command's output; if you want other information as well > as the type, you could get that too. Can someone let me in on this secret helper module? Doesn't seem to match the helper module in

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
Many Thanks a lot , I can use for reliably "lsblk %s -n -o FSTYPE" in the reused code of mine as below cmd = "lsblk %s -n -o FSTYPE" % partition_path return self._helper.execute_cmd_output_string(cmd) I really appreciate for all your support w.r.t this.. I feel I have kick start

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Ben Bacarisse
srinivasan writes: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" > > Still my output is: > */dev/mmcblk1p1: LABEL="efi" UUID="108

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Chris Angelico
On Wed, Nov 7, 2018 at 11:42 PM srinivasan wrote: > > Some I managed to fix temporarily as below, might be useful for others. Also > please correct me if anything wrong or for any improvements in the below > > cmd = "blkid -o export %s" % partition_path > out = self._helper.execut

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
Some I managed to fix temporarily as below, might be useful for others. Also please correct me if anything wrong or for any improvements in the below cmd = "blkid -o export %s" % partition_path out = self._helper.execute_cmd_output_string(cmd) var = out.split("TYPE=", 1)[1]

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Chris Angelico
On Wed, Nov 7, 2018 at 11:36 PM Qian Cai wrote: > > srinivasan wrote: > > Even after changing as per the below > > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > > or: > > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > > or: > > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" >

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Qian Cai
srinivasan wrote: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" > > Still my output is: > */dev/mmcblk1p1: LABEL="efi" UUID="1084

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
Even after changing as per the below "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" or: 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' or: "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" Still my output is: */dev/mmcblk1p1: LABEL="efi" UUID="1084-AA42" TYPE="vfat"* My expected outp

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Brian J. Oney via Python-list
On Wed, 2018-11-07 at 10:22 +0100, srinivasan wrote: > blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3 You don't need to escape the single quotes. Try either: "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" or: 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' or: "blkid -o export %s | g

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
After changing the line to *"cmd = "blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3" % fs"*, Now I dont see the error "SyntaxError: can't assign to literal" This is not returning exactly "*vfat*" instead of this, it is return

Re: SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread Rhodri James
On 06/11/2018 18:10, srinivasan wrote: root:~/qa/test_library# python3 sd.py File "sd.py", line 99 *cmd = "blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)* * ^* *SyntaxError: can't assign to literal* Look at the 'c

SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread srinivasan
Dear Python Experts Team, As am newbie to python development, I am trying to use the below function to get verify the filesystem type of the SD card parition using bash command in python using subprocess module, I ma seeing the below Error "SyntaxError: can't assign to liter

Re: can't assign to literal

2008-06-14 Thread TheSaint
On 17:06, venerdì 13 giugno 2008 Dennis Lee Bieber wrote: > -=-=-=-=-=-=- (make sure you have a fixed width client) > Very good indeed :) Specially to do with block reformatting. I just post my script to demonstrate my thoughts in what I meant as justifying. Specially considering that I meant ch

My editing style (was: can't assign to literal)

2008-06-13 Thread TheSaint
On 14:49, giovedì 12 giugno 2008 Chris wrote: > You should strip all extraneous white space from code though. For my taste, trailing spaces will be removed by my editor (Kate :) ) Other space tabulators are an issue which won't suite my needs. -- Mailsweeper Home : http://it.geocities.com/call_

Re: can't assign to literal

2008-06-13 Thread TheSaint
On 15:11, giovedì 12 giugno 2008 Dennis Lee Bieber wrote: > Word spaced line justification is only feasible if one is using a > fixed width font and have a line length defined in "characters/line". ===8<==8<==8<==8<==8<==8<==8<==8<==8<==8< line= 'fixed width f

Re: can't assign to literal

2008-06-12 Thread Ethan Furman
TheSaint wrote: On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: Do you mean indenting, or wrapping? I mean fill the line by increasing spaces between words in order to get a paragraph aligned both side, left and right on the page. So if the width is 78 chars it wouldn't have jig saw end

Re: can't assign to literal

2008-06-11 Thread Chris
On Jun 12, 8:03 am, TheSaint <[EMAIL PROTECTED]> wrote: > On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: > > > Do you mean indenting, or wrapping? > > I mean fill the line by increasing spaces between words in order to get a > paragraph aligned both side, left and right on the page. > So if t

Re: can't assign to literal

2008-06-11 Thread TheSaint
On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: > Do you mean indenting, or wrapping? I mean fill the line by increasing spaces between words in order to get a paragraph aligned both side, left and right on the page. So if the width is 78 chars it wouldn't have jig saw end to the right side,

Re: can't assign to literal

2008-06-11 Thread Ethan Furman
TheSaint wrote: On 00:15, giovedì 12 giugno 2008 Ethan Furman wrote: I like Vim (Vi Improved) What about justifying text ? Do you mean indenting, or wrapping? Vim has excellent indenting support, and Python files already included that support proper indenting, syntax coloring, etc. I

Re: can't assign to literal

2008-06-11 Thread TheSaint
On 00:15, giovedì 12 giugno 2008 Ethan Furman wrote: > I like Vim (Vi Improved) What about justifying text ? -- Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-11 Thread Ethan Furman
MRAB wrote: On Jun 10, 10:57 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: for 1 in oids, vals head_oids: SyntaxError: can't assign to literal -- 1 is a literal, you can't assign it to something. Are you trying to use it as a variable name? Slightly OT, but i

Re: can't assign to literal

2008-06-11 Thread TheSaint
On 16:47, mercoledì 11 giugno 2008 Chris wrote: > SciTE and Notepad++ Pype, spe, just to point it out. Jedit, but rather a bloatware. I'd like to know which is the litest multi platform and indipendent. Pype is very good when compiled in exe, but not doing in Linux in that way. -- Mailsweeper Ho

Re: can't assign to literal

2008-06-11 Thread Lie
On Jun 11, 2:53 am, maehhheeyy <[EMAIL PROTECTED]> wrote: > this is stopping my program from running properly. is there something > wrong in my code when that happens? That simply means you did something like this: 'hello' = 'another' 123 = 'kilo' [12, 'asd] = 123 Sometimes it's not that obvious

Re: can't assign to literal

2008-06-11 Thread Lie
On Jun 11, 3:32 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Jun 10, 10:57 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: > > > > for 1 in oids, vals head_oids: > > > SyntaxError: can't assign to literal > > > -- > > > 1 is a literal

Re: can't assign to literal

2008-06-11 Thread Chris
On Jun 11, 10:32 am, MRAB <[EMAIL PROTECTED]> wrote: > On Jun 10, 10:57 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: > > > > for 1 in oids, vals head_oids: > > > SyntaxError: can't assign to literal > > > -- > > > 1 is a literal

Re: can't assign to literal

2008-06-11 Thread MRAB
On Jun 10, 10:57 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: > > for 1 in oids, vals head_oids: > > SyntaxError: can't assign to literal > > -- > > 1 is a literal, you can't assign it to something. Are you trying to > use it as a variabl

Re: can't assign to literal

2008-06-10 Thread Larry Bates
e full error message if you want more details. Matt for 1 in oids, vals head_oids: SyntaxError: can't assign to literal That statement makes no sense (thus SyntaxError). for 1 (one) in oids, vals head_oids: has several problems: 1 - for source variable can't be a number it has to be

Re: can't assign to literal

2008-06-10 Thread Steven Clark
> > for 1 in oids, vals head_oids: > SyntaxError: can't assign to literal > -- 1 is a literal, you can't assign it to something. Are you trying to use it as a variable name? -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-10 Thread Steven Clark
there something >> > wrong in my code when that happens? >> >> yes >> >> Post your code, or at least the full error message if you want more >> details. >> >> Matt > > for 1 in oids, vals head_oids: > SyntaxError: can't assign to

Re: can't assign to literal

2008-06-10 Thread maehhheeyy
ode, or at least the full error message if you want more > details. > > Matt for 1 in oids, vals head_oids: SyntaxError: can't assign to literal -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-10 Thread Matimus
On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > this is stopping my program from running properly. is there something > wrong in my code when that happens? yes Post your code, or at least the full error message if you want more details. Matt -- http://mail.python.org/mailman/listinf

can't assign to literal

2008-06-10 Thread maehhheeyy
this is stopping my program from running properly. is there something wrong in my code when that happens? -- http://mail.python.org/mailman/listinfo/python-list