Link to home
Start Free TrialLog in
Avatar of DrDamnit
DrDamnitFlag for United States of America

asked on

Insert a dictionary into a dictionary?

I am working on building an auto-complete for readline. What I have works, but it's static.

I want it to be able to prompt me based on file contents.

Although I knew it wouldn't work, here's what I tried:
User generated image
What I want is the output of this function to be part of the dictionary at the place called out with the arrow above:
User generated image
For reference, this is how the readline completer is coded:
User generated image
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DrDamnit

ASKER

Error is:
User generated image
Code is:
User generated image
Figured it out. I was trying to pass a dict as a key instead of a value.

For future PAQers...

User generated image
OK, thanks for feedback ;)