79389429

Date: 2025-01-26 22:48:11
Score: 0.5
Natty:
Report link

Use import wikipedia. If you don't have it, use pip install wikipedia. Great. Now for the coordinates. Let's say you want to find the coordinates of Beijing, China. (You need to specify the country.)

import wikipedia as wiki
page = wiki.page("China")
coordinates = page.coordinates
print(coordinates)

This will output: (Decimal('39.90666666999999989684511092491447925567626953125'), Decimal('116.3974999999999937472239253111183643341064453125')). See! That simple. No API. I assure you, if you go to PyPI and search "wikipedia", you will find the wikipedia package.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user29377475