Printing from List Comprehensions - I'm still not getting this - Help?
You assign a list comprehension to a variable:
a = [x.name for x in objects if not x.hide and not x.parent and x.name not in mdlParent and x.type not in (&quot;MESH&quot;, &quot;CAMERA&quot;, &quot;LIGHT&quot;)]

and the variable prints correctly both when you invoke it in the terminal and when you pass it to the print statement. Why not then, replace the a in your print statement, with the expression that you assign to a? The result will be the same:
print([x.name for x in objects if not x.hide and not x.parent and x.name not in mdlParent and x.type not in (&quot;MESH&quot;, &quot;CAMERA&quot;, &quot;LIGHT&quot;)])

However, you actually tried that and got an empty list as a result:
print(([x.name for x in objects if not x.hide and not x.parent and x.name not in mdlParent and x.type not in (&quot;MESH&quot;, &quot;CAMERA&quot;, &quot;LIGHT&quot;)]))

Additional parentheses are irrelevant (and redundant), so it should work. I suspect something happened before you executed this line of code, so that it no longer produced the expected result. To confirm, just after executing this line, try to execute again the lines that work, that is
a = [x.name for x in objects if not x.hide and not x.parent and x.name not in mdlParent and x.type not in (&quot;MESH&quot;, &quot;CAMERA&quot;, &quot;LIGHT&quot;)]
a

It's very important that you execute both of these lines, as executing only the second one wouldn't recalculate the result and only display the result that has been calculated during the previous state of the project.
If you still have problems, please upload your .blend file: Blend-exchange
Some explanation on the confusing stuff: a list comprehension has a form of [... for ...]. If you don't use square or curly brackets, then it's a generator expression, which is significantly different than comprehensions, because it's not evaluated in place but instead creates a generator object, which keeps its state so you can read from it one value at a time. So if you do (don't) [i for i in range(100000000000000000)] it will hang and eventually eat all memory. Meanwhile (i for i in range(100000000000000000)) creates an object not much heavier than the single line of code defining it.
For a generalized code:
for step_variable in an_iterable:
    if condition:
        print(step_variable)

In order to mimic it exactly with a oneliner, it is a common practice to do this:
print(*[step_variable for step_variable in an_iterable if condition], sep=&quot;\n&quot;)

In this case it doesn't matter [other than performance-wise] if you use a generator expression instead, because the asterisk operator * would consume it entirely. sep argument is set to the same as end argument (which defaults to &quot;\n&quot;) to mimic multiple prints for each of the unpacked values by the asterisk operator *.