PacktPublishing / Python-3-Object-Oriented-Programming-Third-Edition

Python 3 Object-Oriented Programming – Third Edition, published by Packt
MIT License
479 stars 242 forks source link

can I ask some question? #1

Closed modernmanyxl closed 4 years ago

modernmanyxl commented 5 years ago

hello,where can I get the module which name is "path"(in chapter13→Multiprocessing→Queues→searching_with_queues.py). Neither the windows platform nor the Linux platform I can't install "path" from pip. But I really want to run the code to understand how it works

thisshri commented 5 years ago

@modernmanxxx I am not sure but I think this should work for you, from os import path.

modernmanyxl commented 5 years ago

I've tried using "from OS import path" and "from pathlib import path" and it doesn't work properly pathlib.Path():AttributeError 'WindowsPath' object has no attribute 'listdir'

os.path: TypeError 'module' object is not callable

thisshri commented 5 years ago

try exactly from os import path Its os not OS

And path is not callable, means its a module, you can't call it like a function. run dir(path) to see what are the properties and functions available in the path module.

modernmanyxl commented 5 years ago

I'm not going to dwell on this anymore. Thank you for your help.

thisshri commented 5 years ago

Read this, http://thomas-cokelaer.info/tutorials/python/module_os.html