f



UnboundLocalError: local variable referenced before assignment

I have following code :

import os, time, re, pyodbc, Image, sys
from datetime import datetime, date, time
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import mkTable

mkTable.mkTable()

and then file mkTable.py located in same directory has :

def mkTable():
    global canvas
    canvas = canvas.Canvas(fname, pagesize=A4)
    ... and so on



this gives me following traceback:


Traceback (most recent call last):
  File "C:\py\pdf_test.py", line 36, in <module>
    mkTable.mkTable()
  File "C:\py\mkTable.py", line 38, in mkTable
    canvas = canvas.Canvas("K_lista.pdf", pagesize=A4)
UnboundLocalError: local variable 'canvas' referenced before
assignment

i haven't posted entire code, because those lines are giving me
problems. I've searched the web, and all say that I should make var
global inside function. so I did it, but still nothing...
using python 2.6.2 and reportlab 2.4
help plz :)
0
ch1zra (3)
6/8/2010 8:03:10 AM
comp.lang.python 77058 articles. 4 followers. Post Follow

9 Replies
1971 Views

Similar Articles

[PageSpeed] 1

On Jun 8, 9:03=A0am, ch1zra <ch1...@gmail.com> wrote:
> I have following code :
>
> import os, time, re, pyodbc, Image, sys
> from datetime import datetime, date, time
> from reportlab.lib.pagesizes import A4
> from reportlab.lib.units import cm
> from reportlab.pdfgen import canvas
> from reportlab.pdfbase import pdfmetrics
> from reportlab.pdfbase.ttfonts import TTFont
> import mkTable
>
> mkTable.mkTable()
>
> and then file mkTable.py located in same directory has :
>
> def mkTable():
> =A0 =A0 global canvas
> =A0 =A0 canvas =3D canvas.Canvas(fname, pagesize=3DA4)
> =A0 =A0 ... and so on
>
> this gives me following traceback:
>
> Traceback (most recent call last):
> =A0 File "C:\py\pdf_test.py", line 36, in <module>
> =A0 =A0 mkTable.mkTable()
> =A0 File "C:\py\mkTable.py", line 38, in mkTable
> =A0 =A0 canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)
> UnboundLocalError: local variable 'canvas' referenced before
> assignment
>
> i haven't posted entire code, because those lines are giving me
> problems. I've searched the web, and all say that I should make var
> global inside function. so I did it, but still nothing...
> using python 2.6.2 and reportlab 2.4
> help plz :)

The version of mkTable.py you posted is clearly different to the one
in the traceback. You might want to check that.

Richard.
0
chardster (21)
6/8/2010 8:29:48 AM
ch1zra wrote:
> I have following code :
>
> import os, time, re, pyodbc, Image, sys
> from datetime import datetime, date, time
> from reportlab.lib.pagesizes import A4
> from reportlab.lib.units import cm
> from reportlab.pdfgen import canvas
> from reportlab.pdfbase import pdfmetrics
> from reportlab.pdfbase.ttfonts import TTFont
> import mkTable
>
> mkTable.mkTable()
>
> and then file mkTable.py located in same directory has :
>
> def mkTable():
> =A0 =A0 global canvas
> =A0 =A0 canvas =3D canvas.Canvas(fname, pagesize=3DA4)
> =A0 =A0 ... and so on
>
> this gives me following traceback:
>
> Traceback (most recent call last):
> =A0 File "C:\py\pdf_test.py", line 36, in <module>
> =A0 =A0 mkTable.mkTable()
> =A0 File "C:\py\mkTable.py", line 38, in mkTable
> =A0 =A0 canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)
> UnboundLocalError: local variable 'canvas' referenced before
> assignment

Python doesn't have one global namespace. Each module (file) has its
own namespace, which is a Python dict, and 'global' means defined in
the containing module's dict. Put the import:

  from reportlab.pdfgen import canvas

in the mkTable.py file. That brings 'canvas' into the mkTable module's
namespace.

Python programs commonly import the same module multiple times. Only
the first import runs the body of the imported module. Subsequent
imports merely bring the names into the importing module's namespace.


--
--Bryan Olson
0
6/8/2010 8:59:13 AM
On Jun 8, 10:29=A0am, Richard Thomas <chards...@gmail.com> wrote:
> On Jun 8, 9:03=A0am, ch1zra <ch1...@gmail.com> wrote:
>
>
>
>
>
> > I have following code :
>
> > import os, time, re, pyodbc, Image, sys
> > from datetime import datetime, date, time
> > from reportlab.lib.pagesizes import A4
> > from reportlab.lib.units import cm
> > from reportlab.pdfgen import canvas
> > from reportlab.pdfbase import pdfmetrics
> > from reportlab.pdfbase.ttfonts import TTFont
> > import mkTable
>
> > mkTable.mkTable()
>
> > and then file mkTable.py located in same directory has :
>
> > def mkTable():
> > =A0 =A0 global canvas
> > =A0 =A0 canvas =3D canvas.Canvas(fname, pagesize=3DA4)
> > =A0 =A0 ... and so on
>
> > this gives me following traceback:
>
> > Traceback (most recent call last):
> > =A0 File "C:\py\pdf_test.py", line 36, in <module>
> > =A0 =A0 mkTable.mkTable()
> > =A0 File "C:\py\mkTable.py", line 38, in mkTable
> > =A0 =A0 canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)
> > UnboundLocalError: local variable 'canvas' referenced before
> > assignment
>
> > i haven't posted entire code, because those lines are giving me
> > problems. I've searched the web, and all say that I should make var
> > global inside function. so I did it, but still nothing...
> > using python 2.6.2 and reportlab 2.4
> > help plz :)
>
> The version of mkTable.py you posted is clearly different to the one
> in the traceback. You might want to check that.
>
> Richard.

here's full version of mkTable.py (I've cut out all the drawing code
for clarity)
http://bpaste.net/show/7003/

and it's caller :
http://bpaste.net/show/7004/

and the newest traceback (just generated):

Traceback (most recent call last):
  File "C:\py\pdf_test.py", line 36, in <module>
    mkTable.mkTable()
  File "C:\py\mkTable.py", line 38, in mkTable
    canvas.setFillColorRGB(0.8,0.8,0.8)
UnboundLocalError: local variable 'canvas' referenced before assignment
0
ch1zra (3)
6/8/2010 9:00:46 AM
On Tue, Jun 8, 2010 at 2:00 AM, ch1zra <ch1zra@gmail.com> wrote:
> On Jun 8, 10:29=C2=A0am, Richard Thomas <chards...@gmail.com> wrote:
>> On Jun 8, 9:03=C2=A0am, ch1zra <ch1...@gmail.com> wrote:
>> > I have following code :
>>
>> > import os, time, re, pyodbc, Image, sys
>> > from datetime import datetime, date, time
>> > from reportlab.lib.pagesizes import A4
>> > from reportlab.lib.units import cm
>> > from reportlab.pdfgen import canvas
>> > from reportlab.pdfbase import pdfmetrics
>> > from reportlab.pdfbase.ttfonts import TTFont
>> > import mkTable
>>
>> > mkTable.mkTable()
>>
>> > and then file mkTable.py located in same directory has :
>>
>> > def mkTable():
>> > =C2=A0 =C2=A0 global canvas
>> > =C2=A0 =C2=A0 canvas =3D canvas.Canvas(fname, pagesize=3DA4)
>> > =C2=A0 =C2=A0 ... and so on
>>
>> > this gives me following traceback:
>>
>> > Traceback (most recent call last):
>> > =C2=A0 File "C:\py\pdf_test.py", line 36, in <module>
>> > =C2=A0 =C2=A0 mkTable.mkTable()
>> > =C2=A0 File "C:\py\mkTable.py", line 38, in mkTable
>> > =C2=A0 =C2=A0 canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)
>> > UnboundLocalError: local variable 'canvas' referenced before
>> > assignment
>>
>> > i haven't posted entire code, because those lines are giving me
>> > problems. I've searched the web, and all say that I should make var
>> > global inside function. so I did it, but still nothing...
>> > using python 2.6.2 and reportlab 2.4
>> > help plz :)
>>
>> The version of mkTable.py you posted is clearly different to the one
>> in the traceback. You might want to check that.
>>
>> Richard.
>
> here's full version of mkTable.py (I've cut out all the drawing code
> for clarity)
> http://bpaste.net/show/7003/
>
> and it's caller :
> http://bpaste.net/show/7004/
>
> and the newest traceback (just generated):
>
> Traceback (most recent call last):
> =C2=A0File "C:\py\pdf_test.py", line 36, in <module>
> =C2=A0 =C2=A0mkTable.mkTable()
> =C2=A0File "C:\py\mkTable.py", line 38, in mkTable
> =C2=A0 =C2=A0canvas.setFillColorRGB(0.8,0.8,0.8)
> UnboundLocalError: local variable 'canvas' referenced before assignment

mkTable.py:
# -*- coding: utf-8 -*-
def mkTable():
    global canvas
<snip>
    canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)

The only global variable defined in mkTable.py is the "mkTable"
function (partly since you don't import anything). So the reference to
the global variable "canvas" on the right-hand side of this expression
is completely undefined, resulting in the error you're getting.

In this respect, your code is akin to:
whatever.py:
# -*- coding: utf-8 -*-
def foo():
    global x
    x =3D 2 * x
foo()
# This is obviously horribly flawed since x is never given an initial value=
!
#EOF

More generally, your code uses "canvas" to refer both to the module
reportlab.pdfgen.canvas and an instance of the class
reportlab.pdfgen.canvas.Canvas; this is confusing and problematic. I
suggest you either rename one of them to something distinct (e.g.
`import reportlab.pdfgen.canvas as pdfcanvas`), or import just the
class Canvas straight from reportlab.pdfgen.canvas (i.e. `from
reportlab.pdfgen.canvas import Canvas`).

Cheers,
Chris
--
http://blog.rebertia.com
0
clp2 (1575)
6/8/2010 9:25:02 AM
On Jun 8, 10:59=A0am, Bryan <bryanjugglercryptograp...@yahoo.com> wrote:
> ch1zra wrote:
> > I have following code :
>
> > import os, time, re, pyodbc, Image, sys
> > from datetime import datetime, date, time
> > from reportlab.lib.pagesizes import A4
> > from reportlab.lib.units import cm
> > from reportlab.pdfgen import canvas
> > from reportlab.pdfbase import pdfmetrics
> > from reportlab.pdfbase.ttfonts import TTFont
> > import mkTable
>
> > mkTable.mkTable()
>
> > and then file mkTable.py located in same directory has :
>
> > def mkTable():
> > =A0 =A0 global canvas
> > =A0 =A0 canvas =3D canvas.Canvas(fname, pagesize=3DA4)
> > =A0 =A0 ... and so on
>
> > this gives me following traceback:
>
> > Traceback (most recent call last):
> > =A0 File "C:\py\pdf_test.py", line 36, in <module>
> > =A0 =A0 mkTable.mkTable()
> > =A0 File "C:\py\mkTable.py", line 38, in mkTable
> > =A0 =A0 canvas =3D canvas.Canvas("K_lista.pdf", pagesize=3DA4)
> > UnboundLocalError: local variable 'canvas' referenced before
> > assignment
>
> Python doesn't have one global namespace. Each module (file) has its
> own namespace, which is a Python dict, and 'global' means defined in
> the containing module's dict. Put the import:
>
> =A0 from reportlab.pdfgen import canvas
>
> in the mkTable.py file. That brings 'canvas' into the mkTable module's
> namespace.
>
> Python programs commonly import the same module multiple times. Only
> the first import runs the body of the imported module. Subsequent
> imports merely bring the names into the importing module's namespace.
>
> --
> --Bryan Olson

thanx so much, it worked.
I am getting some other problems now, but will use this logic to fix
it.
thanx once again :)
0
ch1zra (3)
6/8/2010 9:28:22 AM
Chris Rebert wrote:

> On Tue, Jun 8, 2010 at 2:00 AM, ch1zra <ch1zra@gmail.com> wrote:
>> On Jun 8, 10:29 am, Richard Thomas <chards...@gmail.com> wrote:
>>> On Jun 8, 9:03 am, ch1zra <ch1...@gmail.com> wrote:
>>> > I have following code :
>>>
>>> > import os, time, re, pyodbc, Image, sys
>>> > from datetime import datetime, date, time
>>> > from reportlab.lib.pagesizes import A4
>>> > from reportlab.lib.units import cm
>>> > from reportlab.pdfgen import canvas
>>> > from reportlab.pdfbase import pdfmetrics
>>> > from reportlab.pdfbase.ttfonts import TTFont
>>> > import mkTable
>>>
>>> > mkTable.mkTable()
>>>
>>> > and then file mkTable.py located in same directory has :
>>>
>>> > def mkTable():
>>> > global canvas
>>> > canvas = canvas.Canvas(fname, pagesize=A4)
>>> > ... and so on
>>>
>>> > this gives me following traceback:
>>>
>>> > Traceback (most recent call last):
>>> > File "C:\py\pdf_test.py", line 36, in <module>
>>> > mkTable.mkTable()
>>> > File "C:\py\mkTable.py", line 38, in mkTable
>>> > canvas = canvas.Canvas("K_lista.pdf", pagesize=A4)
>>> > UnboundLocalError: local variable 'canvas' referenced before
>>> > assignment
>>>
>>> > i haven't posted entire code, because those lines are giving me
>>> > problems. I've searched the web, and all say that I should make var
>>> > global inside function. so I did it, but still nothing...
>>> > using python 2.6.2 and reportlab 2.4
>>> > help plz :)
>>>
>>> The version of mkTable.py you posted is clearly different to the one
>>> in the traceback. You might want to check that.
>>>
>>> Richard.
>>
>> here's full version of mkTable.py (I've cut out all the drawing code
>> for clarity)
>> http://bpaste.net/show/7003/
>>
>> and it's caller :
>> http://bpaste.net/show/7004/
>>
>> and the newest traceback (just generated):
>>
>> Traceback (most recent call last):
>> File "C:\py\pdf_test.py", line 36, in <module>
>> mkTable.mkTable()
>> File "C:\py\mkTable.py", line 38, in mkTable
>> canvas.setFillColorRGB(0.8,0.8,0.8)
>> UnboundLocalError: local variable 'canvas' referenced before assignment
> 
> mkTable.py:
> # -*- coding: utf-8 -*-
> def mkTable():
>     global canvas
> <snip>
>     canvas = canvas.Canvas("K_lista.pdf", pagesize=A4)
> 
> The only global variable defined in mkTable.py is the "mkTable"
> function (partly since you don't import anything). So the reference to
> the global variable "canvas" on the right-hand side of this expression
> is completely undefined, resulting in the error you're getting.

The above would produce a NameError, not an UnboundLocalError:

>>> def foo():
....     global x
....     x = x
....
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in foo
NameError: global name 'x' is not defined

To get the latter you'd have to omit the global declaration.

Peter
0
Peter
6/8/2010 10:41:33 AM
Peter Otten wrote:
> Chris Rebert wrote:
[...]
> > The only global variable defined in mkTable.py is the "mkTable"
> > function (partly since you don't import anything). So the reference to
> > the global variable "canvas" on the right-hand side of this expression
> > is completely undefined, resulting in the error you're getting.
>
> The above would produce a NameError, not an UnboundLocalError:

Ah, yes. The OP's code produces a NameError.

[...]
> To get the latter you'd have to omit the global declaration.

Not hard to diagnose: The OP got the UnboundLocalError, so he looked
stuff up and tried various things, such as the global declaration, but
still got an exception. In writing it up, he copied the initial
exception, but a latter version of the function.


--
--Bryan
0
Bryan
6/8/2010 1:30:06 PM
ch1zra a �crit :
> On Jun 8, 10:59 am, Bryan <bryanjugglercryptograp...@yahoo.com> wrote:
>> Python doesn't have one global namespace. Each module (file) has its
>> own namespace, which is a Python dict, and 'global' means defined in
>> the containing module's dict. Put the import:
>>
>>   from reportlab.pdfgen import canvas
>>
>> in the mkTable.py file. That brings 'canvas' into the mkTable module's
>> namespace.
>>
> 
> thanx so much, it worked.
> I am getting some other problems now,

Yeps. One of them being rebinding mkTable.canvas on the first call to 
mkTable.mkTable...

Get rid of the 'global canvas' at the beginning of the mkTable.mkTable 
function, and rename your local var to something else than canvas.

0
Bruno
6/8/2010 1:58:03 PM
Le 08/06/2010 10:03, ch1zra a �crit :
> import os, time, re, pyodbc, Image, sys
> from datetime import datetime, date, time
> from reportlab.lib.pagesizes import A4
> from reportlab.lib.units import cm
> from reportlab.pdfgen import canvas
> from reportlab.pdfbase import pdfmetrics
> from reportlab.pdfbase.ttfonts import TTFont
> import mkTable
>
> mkTable.mkTable()
>
> and then file mkTable.py located in same directory has :
>
> def mkTable():
>      global canvas
>      canvas = canvas.Canvas(fname, pagesize=A4)
>      ... and so on

Hello,

It does not really make sense to redefine an object you've imported, 
like in
 > import mkTable
 > def mkTable():

or like in :
 > from reportlab.pdfgen import canvas
 > canvas = ...

You must use differents names for the variables you wan't to use, or the 
function you wan't to import

 > from reportlab.pdfgen import canvas
 > ....
 > import mkTable
 > ...
 > def MYmkTable():
 >      ...
 >      MYcanvas = canvas.Canvas(fname, pagesize=A4)

Daniel
0
danieldelay
6/8/2010 6:59:08 PM
Reply:

Similar Artilces:

HELP:UnboundLocalError: local variable '_nntp' referenced before assignment
Hi all, I am in the process of writing an app that will handle news feeds and therefore using the 'nntplib' When I issue the connect command all goes will but when I issue the 'quit()' command I get the following error message: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__ return self.func(*args) File "./pnews.py", line 26, in callconnect _nntp.quit() UnboundLocalError: local variable '_nntp' referenced before assignment The code below illustrates...

UnboundLocalError: local variable '_[1]' referenced before assignment
Hello everyone, I get this error on python 2.6.1 on mac os x 10.6 : UnboundLocalError: local variable '_[1]' referenced before assignment here's the code that raises this: params = [ self.__formatData(paramProcFunc, query, p) for p in params ] what I don't get is that it worked on mac os x 10.5 (python 2.5.x) but it no longer works. I tried the following and it works : r = [] for p in params: r.append(self.__formatData(paramProcFunc, query, p)) params = r Does anyone understand what is going on here? Thank you, Gabriel On Dec 9, 10:17=A0am, G...

What's wrong with this code? (UnboundLocalError: local variable referenced before assignment)
Hi there! I'm quite new to programming, even newer in python (this is actually the first thing I try on it), and every other topic I've seen on forums about my problem doesn't seem to help. So, the following lines are intended to draw a white square (which it does), turn it to blue when you click on it, and back to white when you click on it again (and so on). Here's what I wrote (python 3 syntax): from tkinter import * root = Tk() root.geometry("500x500") w = Canvas(root, width=500, height=500) w.pack() coords = (x1, y1, x2, y2) = (100, 100, 200, ...

Error: UnboundLocalError: local variable 'PfFlag' referenced before assignment
$$ TestCase ID : 001 Step : deleteDvc,206268 Result Eval type : XmlChk Step : deleteDvc,206269 Result Eval type : XmlChk Traceback (most recent call last): File "C:\UDR2\UDRxmlGateway.py", line 388, in <module> ParseAll() File "C:\UDR2\UDRxmlGateway.py", line 371, in ParseAll if (PfFlag =3D=3D 1): UnboundLocalError: local variable 'PfFlag' referenced before assignment =20 =20 PfFlag gets assigned in a for loop in line 365 for i in range(PfFlagArrSize): if (PfFlagArr[i] =3D=3D 1): ---> PfFlag =3D int(1) ...

What? Assigning a session variable also assigns the local variable?
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is burns. Here is the code: $frank = "burns"; $_SESSION['frank'] = "black"; echo "DEBUG: frank's last name is is $frank"; What is coming into play here? I thought of register_globals but I thought that only dealt with GET, POST, REQUEST, etc. thecrow wrote: > Alright, what the hell is going on here? > > In the following code, I expect the printed ...

local variable referenced before assignment
I cannot make sense of what's happening here ... I'm getting the following error: initializing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time Traceback (most recent call last): File "/home/john/Dropbox/Projects/python/scripts/src/file-watch.py", line 42, in <module> time.sleep(10000) File "/home/john/Dropbox/Projects/python/scripts/src/file-watch.py", line 18, in handler if modifiedTime <> lastM...

local variable referenced before assignment #2
Quick question, probably quite a simple matter. Take the follow start of a method: def review(filesNeedingReview): for item in filesNeedingReview: (tightestOwner, logMsg) = item if (logMsg != None): for logInfo in logMsg.changed_paths: This generates the error: UnboundLocalError: local variable 'logMsg' referenced before assignment I thought I'd assigned it in the "(tightestOwner, logMsg) = item" line - so in the python interpreter complaining about the fact this assignment might not go well? Thanks! On 2007-10-25, Pete...

local variable 'juveniles' referenced before assignment
def menu(): option = int(input("Please select an option: \n 1: Set Generation 0 Values \n 2: View Generation 0 Values \n 3: Run Model \n 4: Print values")) if option == 1: juveniles,adults,seniles = setGen() elif option == 2: displayGen() elif option == 3: runModel(juveniles,adults,seniles) elif option == 4: print(juveniles,adults,seniles) menu() def setGen(): #enter number of juveniles juveniles = int(input("How many juveniles are in the total popluation?")) #enter number of adults ...

UnboundLocalError: local variable 'colorIndex' referenced
Can you please tell me what is the meaning this error in general? UnboundLocalError: local variable 'colorIndex' referenced before assignment In my python script, I have a variable define and init to 0, like this colorIndex = 0 and in one of my functions, I increment it by 1 def myFunc colorIndex += 1 silverburgh.meryl@gmail.com wrote in news:1140987642.195734.187540 @t39g2000cwt.googlegroups.com: > Can you please tell me what is the meaning this error in general? > > UnboundLocalError: local variable 'colorIndex' referenced before > assignment > ...

python variable assignement
I work at an application witch has embeded python. We have an python type X. # a != b a = b # at this point both variables have the same value b = select_other() # steel the same values but both have the new value of b What might be the cause for this behavior? The type of a and b variable is the same, and is defined using PyTypeObject structure. I hope I was explicit. Thank you in advance, Mihai. On Mon, 2007-09-24 at 10:13 +0000, mihai wrote: > I work at an application witch has embeded python. > > We have an python type X. > > # a != b > > a = b # at this ...

(local-variables/warning) Error in File local-variables
Hi below is the error message that I get when opening some verilog and systemC files with Xemacs on a Fedora 8 x86 machine I have no clue what all these errors mean. I guest it is related to my .init.el file. I just took a file that I used many years ago. I have include the complete file below too. Thanks for any hint. nike (1) (local-variables/warning) Error in File local-variables: Symbol's value as variable is void: compile-command Backtrace follows: verilog-modify-compile-command() run-hooks(verilog-modify-compile-command) # bind (force) hack-local-variables(...

Assignment to a variable variable
Sometimes I want to assign a value to a variable whose name is a parameter. For example =E2=88=87 GetVar varname [1] slot=E2=86=90DIR=E2=8D=B3varname [2] =E2=8D=8Evarname,'=E2=86=90=E2=8E=95FREAD 1 slot' =E2=88=87 Line [2] is unpleasant, as execute often is. The awkward part is that the language forces me to execute a whole statement -- to artificially construct a character version of some code -- including the assignment arrow. Here's a proposed language enhancement that seems natural to me: (=E2=8D=8Evarname)=E2=86=90=E2=8E=95FREAD 1 slot Pro...

(local-variables/warning) File local-variables error: Symbol's value as variable is void: compile-command
Hi I get the following error message when I start my xemacs in a directory containing a desktop file (see below). (local-variables/warning) File local-variables error: Symbol's value as variable is void: compile-command I have tried starting xemacs with -init_debug but I did not get any further info. Thanks for any hint. GA ;;;;;;;;;;;;;;;;;;;;;;;;; desktop file begins here ;; -------------------------------------------------------------------------- ;; Desktop File for Emacs ;; -------------------------------------------------------------------------- ;; Created Wed A...

confusion with local variable assignment
When you write a = b # error. As b is not defined as a method or local variable But if you try - a = a or b = b, MRI parse it without error. How the `a` or `b` on the right side is allowed, where as I didn't define them earlier. Thanks On 11.04.2014 15:24, Arup Rakshit wrote: > When you write > > a = b # error. As b is not defined as a method or local variable > > But if you try - > > a = a or b = b, MRI parse it without error. How the `a` or `b` on the > right side is allowed, where as I didn't define them earlier. There was recently a...

Web resources about - UnboundLocalError: local variable referenced before assignment - comp.lang.python

Resources last updated: 2/6/2016 11:14:18 PM