472,374 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

can't assign to literal

this is stopping my program from running properly. is there something
wrong in my code when that happens?
Jun 27 '08 #1
16 16563
On Jun 10, 12:53*pm, maehhheeyy <maehhhe...@gmail.comwrote:
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
Jun 27 '08 #2
On Jun 10, 1:21*pm, Matimus <mccre...@gmail.comwrote:
On Jun 10, 12:53*pm, maehhheeyy <maehhhe...@gmail.comwrote:
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
for 1 in oids, vals head_oids:
SyntaxError: can't assign to literal
Jun 27 '08 #3
On Tue, Jun 10, 2008 at 5:30 PM, maehhheeyy <ma********@gmail.comwrote:
On Jun 10, 1:21 pm, Matimus <mccre...@gmail.comwrote:
>On Jun 10, 12:53 pm, maehhheeyy <maehhhe...@gmail.comwrote:
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

for 1 in oids, vals head_oids:
SyntaxError: can't assign to literal
--
http://mail.python.org/mailman/listinfo/python-list
Wow.
http://catb.org/~esr/faqs/smart-questions.html
Jun 27 '08 #4
maehhheeyy wrote:
On Jun 10, 1:21 pm, Matimus <mccre...@gmail.comwrote:
>On Jun 10, 12:53 pm, maehhheeyy <maehhhe...@gmail.comwrote:
>>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

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 a name

in oids, vals head_ioids can't be for target as it is at least two and maybe
three different variables (I'm confused because oids <commavals <space>
head_oids) is a second syntax error. You probably need to go back and review
the Python tutorial to get the syntax of a for loop set in your mind properly.

-Larry
Jun 27 '08 #5
>
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?
Jun 27 '08 #6
On Jun 10, 10:57 pm, "Steven Clark" <steven.p.cl...@gmail.comwrote:
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 is there an editor that can display digits in a
different colour to letters?
Jun 27 '08 #7
On Jun 11, 10:32*am, MRAB <goo...@mrabarnett.plus.comwrote:
On Jun 10, 10:57 pm, "Steven Clark" <steven.p.cl...@gmail.comwrote:
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 is there an editor that can display digits in a
different colour to letters?
SciTE and Notepad++ which are just 2 of the editors installed on my PC
currently.
Jun 27 '08 #8
Lie
On Jun 11, 3:32*pm, MRAB <goo...@mrabarnett.plus.comwrote:
On Jun 10, 10:57 pm, "Steven Clark" <steven.p.cl...@gmail.comwrote:
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 is there an editor that can display digits in a
different colour to letters?
Most programmer oriented editors could, some even have full syntax
coloring, they would color keywords (like def, class, etc), literals
(1, 'hello', etc), and commonly used built-in function (int, ord,
iter, etc). It really helped if you have to read/write lots of codes
Jun 27 '08 #9
Lie
On Jun 11, 2:53*am, maehhheeyy <maehhhe...@gmail.comwrote:
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 (although they're obvious for a more
experienced programmers):
for 123 in xrange(10):
pass

I think you've realized what you've done. And there is a pretty
obvious signal that hints that you didn't know the basic syntax of
python (or at least the basic syntax of the for-loop).
Jun 27 '08 #10
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 Home : http://it.geocities.com/call_me_not_now/index.html
Jun 27 '08 #11
MRAB wrote:
On Jun 10, 10:57 pm, "Steven Clark" <steven.p.cl...@gmail.comwrote:
>>>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 is there an editor that can display digits in a
different colour to letters?
--
http://mail.python.org/mailman/listinfo/python-list
I like Vim (Vi Improved) -- multi-platform, multi-lingual (both spoken
and programmatic), and you can change the existing syntax/color/indent
files or make your own.

http://www.vim.org/
--
Ethan
Jun 27 '08 #12
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
Jun 27 '08 #13
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 don't use the line-wrapping feature myself, so I have no experience
with it.
--
Ethan
Jun 27 '08 #14
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 font and have a line length defined in "characters/line".'

lenLine= 78; newLine= ''; Words= line.split(' ')
lnWords= len(Words); norm_spc= lnWords-1; xtr_spc = lenLine -len(line)
lenChr= len(line)-norm_spc
numspc= (norm_spc+ xtr_spc)/ norm_spc
lstword= len(Words[norm_spc])
for spc in range(lnWords):
if len(newLine)+lstword + numspc lenLine : break
newLine += Words[spc]+(' '* numspc)
if xtr_spc:
newLine += ' '; xtr_spc -= 1
print newLine+ ' '+ Words[spc]

===8<======8<======8<======8<======8<======8<===== =8<======8<======8<======8<

In my mind it took me just few seconds :), but to get it working I spent
nearly *one* hour. I admit that my skill lacks of knowledge ])
--
Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html
Jun 27 '08 #15
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_me_not_now/index.html
Jun 27 '08 #16
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 character justification
regardless of its width. Monospace chars will show pretty alignment.

BTW, I'm beginner and my coding takes much try-and-test. ;)
--
Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html
Jun 27 '08 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ivan divandelen | last post by:
Hi, How can i pass a parameter SQL stored Procedure from ASP pages
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
3
by: Chris LaJoie | last post by:
I would like to be able to set my struct equal to null in a way similar to this example: struct TestStruct { public int x; } ....... public void Main() {
26
by: Paul | last post by:
public class A { public A () { // here I would like to call the second version of _ctor, how to accomplish this ? } public A (int a, int b, int c) {
5
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
0
by: DotDidIt | last post by:
Hi Everybody! I developed a Web service with IBM RAD v 6.0.1. After creating the WSDL file i have tried to develop a .Net client. But by using wsdl.exe (1.1.4322) to create a .net c# proxy i...
6
by: Fuzzyman | last post by:
What gives ? >>> a = >>> def f(): return a >>> f() >>> a.append(3) >>> f()
5
by: john | last post by:
If there is no value in 'MyFieldName' I get an error when I use this code: stMyString = MyFieldName So I use the following code: if not isnull(MyFieldName) Then stMyString = MyFieldname...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.