# Help call a dictionary from a file

**URL:** <https://discuss.python.org/t/help-call-a-dictionary-from-a-file/14052>\
**Category:** Python Help\
**Tags:** help\
**Created:** [March 4, 2022, 2:02am UTC](https://discuss.python.org/t/help-call-a-dictionary-from-a-file/14052 "2022-03-04T02:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nutrealm](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nutrealm](https://discuss.python.org/u/nutrealm)\
**Post date:** [March 4, 2022, 2:02am UTC](https://discuss.python.org/t/help-call-a-dictionary-from-a-file/14052/1 "2022-03-04T02:02:59Z")

</div>

Hi, I am trying to make a dictionary from other file, but when I call it I can’t.

ooloa.py:

```auto
import time
import os
import sys
import user

time.sleep(2)

osfile = os.getcwd()
customdata = input(f"\nDashboard\n\nCurrent directory: {osfile}\nWelcome to ooloa.py!")

if customdata == "-changestats":
    data = str(input(f"Gender\n{user.genderchange}\nDeveloper\n"))

def datacheck():
    if data == "Gender":
        str(input(f"Change"))

datacheck()

```

user.py:

```auto
genderchange = {
    "Gender": "Male",
    "Female": "Female"
}

developerchange = {
    "Developer": "Game",
    "Developer": "Website",
    "None": "None"
}

```

---

<div class="post-metadata">

**Author:** ![steven.daprano](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steven.daprano/32/1083_2.png) [@steven.daprano](https://discuss.python.org/u/steven.daprano)\
**Post date:** [March 4, 2022, 6:42am UTC](https://discuss.python.org/t/help-call-a-dictionary-from-a-file/14052/2 "2022-03-04T06:42:07Z")

</div>

The call to `time.sleep(2)` seems to be unnecessary, it just pauses the  
program for two seconds.

In two different places you call

```
str(input( ... ))

```

but input already returns a string, so calling `str()` to turn a string  
into a string is just a waste of time.

In your `datacheck()` function, you call str(input( … )) but you don’t  
do anything with the answer. You need to assign it to a variable or else  
it will be lost.
