0
import webbrowser
import random

idr = random.randint(10000, 9999999)
link = 'view&id='

webbrowser.open(link,idr)

with this code it generates the id and puts it at the end of the link as an id for an image however i have found that it wont work as it puts a space between the links = and the id

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Midas
  • 1
  • 2
  • 1
    This is what [f-strings](https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings) are for. – Random Davis Jun 10 '22 at 16:03
  • 1
    what happens if you try `+`. `webbrowser.open(link+str(idr))`. This should solve it – Olasimbo Jun 10 '22 at 16:04
  • 1
    [read the documentation](https://docs.python.org/3/library/webbrowser.html#webbrowser.open) - `webbrowser.open` does not concatenate mutliple string arguments into a URL. – jfaccioni Jun 10 '22 at 16:04

0 Answers0