map-coloring icon indicating copy to clipboard operation
map-coloring copied to clipboard

No module named 'resource'

Open smkplus opened this issue 5 years ago • 9 comments

  File "C:\Users\Smkgames\Desktop\map-coloring-master\map_coloring.py", line 3, in <module>
    import resource, sys
ModuleNotFoundError: No module named 'resource'```

smkplus avatar Jun 17 '19 12:06 smkplus

This package is only available in Unix.

Erfaniaa avatar Jun 17 '19 16:06 Erfaniaa

I need this bro what should I do to fix can you use equivalent library for windows?

smkplus avatar Jun 18 '19 02:06 smkplus

I changed the code. Please clone/pull again to use it.

Erfaniaa avatar Jun 18 '19 06:06 Erfaniaa

thanks but I have another error:

Traceback (most recent call last):
  File "E:\Users\Smkgames\Documents\GitHub\map-coloring\map_coloring.py", line 6, in <module>
    MAP_IMAGE_PATH = sys.argv[1]
IndexError: list index out of range

smkplus avatar Jun 18 '19 10:06 smkplus

Please follow the README instructions.

python3 map_coloring.py iran.jpg

Erfaniaa avatar Jun 18 '19 10:06 Erfaniaa

works like charm! thanks

image

smkplus avatar Jun 18 '19 10:06 smkplus

You're welcome!

Erfaniaa avatar Jun 18 '19 10:06 Erfaniaa

سلام مجدد

من می خوام این طرح رو رنگ کنم ولی با ابزار شما نتونستم کار کنم image_2019-06-18_16-54-41 این دستی رنگ شده من چنین چیزی می خوام image_2019-06-18_16-54-56

smkplus avatar Jun 19 '19 04:06 smkplus

  1. Resize your image to something with almost 400px width.
  2. Increase the number of coloring colors in the code: COLORING_COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (0, 255, 255), (0, 0, 0)]
  3. Run the script and wait some minutes.
  4. You'll get this: image

Erfaniaa avatar Jun 19 '19 11:06 Erfaniaa