I have a simple python dict why is a generator reference printed instead of the dict -


a simple dict created:

 procinfos = {"f1": f1, "f2": f2, "f3shell" : (wrap_for_process, q, f3shell, "input arg1", "input arg2")} 

then want print contents:

 print (procinfo procinfo in procinfos)  <generator object <genexpr> @ 0x7f46dccc0dc0> 

why python tell me generator? how can print contents. have read generators, intended not consume dict/list. concretized collection - makes no sense (to me @ least..) not print it. v common use case, appreciate succint way basic print of these collections. thanks.

update: want in single line / inline, not multi lines. thanks.

just use brackets instead:

print [procinfo procinfo in procinfos] 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -