I'm new to python.
I wrote the following code, but I get an error and am in trouble.
Kind person, please tell me!
def sleep_time (time):
pyautogui.moveTo (100, 200)
〇 Error message
Traceback (most recent call last):
File "C: \ Users \ cjrr6 \ Desktop \ scroll.py", line 8, in
File "C: \ Users \ cjrr6 \ Desktop \ scroll.py", line 6, in sleep_time
AttributeError:'int' object has no attribute'sleep'
Answer # 1
I think it has the following indentation.
def sleep_time (time): time.sleep (time)
In this case, the argument time and the name of the time module collide, and it ends up calling sleep () of "5" passed as an argument, which is an error.
Rename the formal argument time in the function definition.
- python - vim-pydocstring doesn't work
- ruby installation doesn't work
- python:about processing such as timesleep and wxpython
- python - twitteroauth doesn't fix simple errors
- python - discord teaming bot doesn't work properly
- i want to make a python array one-dimensional, but it doesn't work
- php description doesn't work
- python - i shouldn't be out of the while loop, but it doesn't print
- python - jupyter notebook doesn't work with vs code
- python - i want to use a foreign key in sqlalchemy but it doesn't work
- python - i want to train with fit_generator, but it doesn't work due to typeerror:'nonetype' object is not callable
- c ++ - if statement doesn't work
- where to write timesleep in python scraping
- python - pip install git doesn't work
- ruby - schedulerb doesn't work well
- python - the code in the module doesn't work even though i imported it
- visual c ++ - include doesn't work
- html - z-index doesn't work well
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- xcode - pod install [!] no `podfile 'found in the project directory