# Python Compiler Missing String End Quote

**URL:** <https://forum.inductiveautomation.com/t/python-compiler-missing-string-end-quote/100171>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [December 23, 2024, 4:16pm UTC](https://forum.inductiveautomation.com/t/python-compiler-missing-string-end-quote/100171 "2024-12-23T16:16:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [December 23, 2024, 4:16pm UTC](https://forum.inductiveautomation.com/t/python-compiler-missing-string-end-quote/100171/1 "2024-12-23T16:16:04Z")

</div>

Ignition version: 8.1.39

I am creating a hard-coded dictionary on multiple lines and noticed a value was incorrect.  
Then I realized I was missing an end quote, and that fixed the issue.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7b7e8f511b00fd2a6cd7960e15656415e46f9415.png)

My question is: why did the designer environment not warn me of this issue?

I tried replicating this a few different ways and here is what I found:

- this applies in the script console
- this applies in project script modules
- this happens with single quotes
- this happens with double quotes
- finally, the only way I got an editor notification (red gutter bar) or execution exception ("SyntaxError" message) was when I tried to execute something in between the lines (see image below)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3e922b22e3bb74fd69f09595f968a9fabc259a27.png)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [December 23, 2024, 4:57pm UTC](https://forum.inductiveautomation.com/t/python-compiler-missing-string-end-quote/100171/2 "2024-12-23T16:57:40Z")

</div>

It looks like the interpreter was able to see a valid path with the `dil['b'] = "b\ndil['c']= 'c"` but also executed the next line of code which gives you the c value.

It throws the error on the `print` calls because there is a statement that actually breaks the lookup for the ' which would end the string.

This happens also with:

```Python
di1 = {}
di1['a']= 'a
di1['b']= 'b
di1['c']= 'c'
print dil

```

Sometimes interpreters do weird things in perfect storms.

The reason you don't see the gutter bar in the first picture is due to the way the code editor is doing its syntax test. Technically it is valid code since it detects the end `'`

Python is a weird language sometimes.

I recommend assigning static dictionaries like this but thats just me 🤷‍♂️ :

```Python
di1 = {
"a":"a",
"b":"b",
"c":"c"
}

```

---

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [December 23, 2024, 7:30pm UTC](https://forum.inductiveautomation.com/t/python-compiler-missing-string-end-quote/100171/3 "2024-12-23T19:30:22Z")

</div>

Ok, I figured something like that was going on. Thanks!
