from geopy.geocoders import Nominatim
df = pandas.DataFrame(columns=['City', 'lat', 'lon'])
for num,city in enumerate(arr):
nom=Nominatim(user_agent='Test app to save to csv')
n=nom.geocode(city)
data = [city,n.latitude, n.longitude]
df.loc[num] = [city, n.latitude, n.longitude]
df.to_csv(r"output.csv", index=False, header=False)
City lat lon
0 Токио 35.682839 139.759455
1 Лондон 51.507322 -0.127647
2 Берлин 52.517037 13.388860
3 Череповец 59.128696 37.916389
https://pandas.pydata.org/pandas-docs/stable/refer...
[{'title': ' Смартфон Samsung Galaxy S21 128GB Phantom Violet (SM-G991B) '}, {'title': ' Смартфон Apple iPhone 12 128GB Black (MGJA3RU/A) '}, {'title': ' Смартфон Xiaomi Mi 10T 8+128GB Black '}, {'title': ' Смартфон Huawei Mate 40 Pro Mystic Silver (NOH-NX9) '}, {'title': ' Смартфон Nokia 3.4 3+64GB Blue (TA-1283) '}, {'title': ' Смартфон Xiaomi Redmi 9 3+32GB Carbon Grey '}, {'title': ' Смартфон Apple iPhone 11 128GB Black (MHDH3RU/A) '}, {'title': ' Смартфон Apple iPhone 11 64GB Black (MHDA3RU/A) '}, {'title': ' Смартфон Apple iPhone XR 64GB Black (MH6M3RU/A) '}, {'price': '67 990 руб.'}, {'price': '84 990 руб.'}, {'price': '40 990 руб.'}, {'price': '89 990 руб.'}, {'price': '11 490 руб.'}, {'price': '9 990 руб.'}, {'price': '59 990 руб.'}, {'price': '54 990 руб.'}, {'price': '44 990 руб.'}]
@commands.has_any_role
discord.ext.commands.has_any_role(*items)
A check() that is added that checks if the member invoking the command has any of the roles specified. This means that if they have one out of the three roles specified, then this check will return True.
Similar to has_role(), the names or IDs passed in must be exact.
This check raises one of two special exceptions, MissingAnyRole if the user is missing all roles, or NoPrivateMessage if it is used in a private message. Both inherit from CheckFailure.
Changed in version 1.1: Raise MissingAnyRole or NoPrivateMessage instead of generic CheckFailure
Parameters
items (List[Union[str, int]]) – An argument list of names or IDs to check that the member has roles wise.
Example
content_copy
@bot.command()
@commands.has_any_role('Library Devs', 'Moderators', 492212595072434186)
async def cool(ctx):
await ctx.send('You are cool indeed')
FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
youdl_opts = {'format': 'bestaudio'}
with youtube_dl.YoutubeDL(youdl_opts) as youdl:
info = youdl.extract_info(video_link, download=False)
URL = info['formats'][0]['url']
voice = get(self.bot.voice_clients, guild=ctx.guild)
voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))