Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

This is called a closure. Since cache exists only in function_cachier, and not in the global namespace, Python saves it in the closure of f2. You can access it with***f2.__closure__[0].cell_contents*** You should switch to Python 3. In just over a year support for 2.7 will stop.
2 years ago
Have you tried calling the function, instead of just referring to it? ie: **root.destroy()**

I don't think using global variables is a good idea. It solves the immediate issue while making the next thing more complicated.
2 years ago
The "wb truncates" means that opening a file with "w" (the "b" doesn't matter for this) resets the file to empty. Truncates is not a great choice of words because we are used to "truncate to a value" or "truncate to a precision". Here it means "truncate to 0 bytes".

There is only one place you should ever write to a file, after the end. You can do this with an empty file, or with a file that contains values. You need to be really careful when trying to write anywhere else.
2 years ago
The string.split() method is going to return a list. You don't need to return the list itself, just the count of items in the list.
2 years ago
Does
***myscan.mac_list.append(mac)***
need to be
***self.mac_list.append(mac)***
2 years ago
I connected to it using wscat (a command line utility to interact with websocket servers), and didn't get any output at all. This might not be a python issue. You might need to send a message before the server will send anything to you.
2 years ago
Use wheel from Gohlke.
**pip install mysqlclient?1.3.13..your Python version.whl**
Or better use PyMySQL it's pure Python written MySQL client library.
2 years ago
***temp_list = []
for arg_str in args.job_args:
temp_list.append(arg_str.split("="))
job_args_tuples = temp_list***

The fourth line is similar, but it is a dict comprehension instead of a list comprehension.
***temp_dict = {}
for a in job_args_tuples:
temp_dict[a[0]] = a[1]
job_args = temp_dict***
2 years ago
Thanks for pointing that out..but my program is not making it to that part because of the question I asked above.
and I can fix that part with by doing this. That was just a simple mistake on my part.
***if another_game == 'Y' or another_game == 'y':
continue
if another_game == 'N' or another_game == 'n':
print('Bye')
done = True***
2 years ago
driver needs to be same version as your chrome version.
2 years ago
The suggested code snippet is giving me below error-
AttributeError: 'list' object has no attribute 'apend'
2 years ago
I'm not sure how suitable it will be for large files, but you try do something like this with Miller
***$ TZ=UTC mlr --pprint --fs tab put -S '$c = strftime(strptime($b,"%Y-%m-%d %H:%M:%S"),"%s")' file
a b c
0 2020-03-03 15:46:52 1583250412
1 2020-03-02 11:05:17 1583147117***
(although I just noticed it appears to screw up the header alignment when the OFS is tab ...).
3 years ago