1

I am trying to write a very first simple code using FLASK framework and to print hello world on the browser. The problem is every time I use sublime text 3 or pycharm it works and displays output only the first time and then when I make changes lets say hello world to hello universe, but all I get the old output. The only way I get the updated output if I restart my laptop or uninstall and install the software again. I tried chrome, safari, and IE. I also tried to clear the cache but I really don't know where the problem is

MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
awais umar
  • 23
  • 7
  • Try changing the port number – whackamadoodle3000 Sep 12 '17 at 00:47
  • do i need to change the port in code or just in broswer? – awais umar Sep 12 '17 at 00:49
  • Try changing both, and make sure to save your new code – whackamadoodle3000 Sep 12 '17 at 00:50
  • ok so i change the port by this code app.run(host='0.0.0.0', port=6000) but its not accessing the page on this port and still working on port 5000 – awais umar Sep 12 '17 at 00:54
  • Did you stop the previous program with control-c? – whackamadoodle3000 Sep 12 '17 at 00:57
  • i am using sublime text3 and there is only option i see to build the program but yeah in pycharm i see the option to sop the program and i stopped it made changes in code but i dont see any changes when i open the browser – awais umar Sep 12 '17 at 01:00
  • And you saved the code too right? – whackamadoodle3000 Sep 12 '17 at 01:01
  • yes offcourse i saved it .i just noticed that even when i run sublime text3 whose files i saved on desktop and pycharm files saved in pycharmproject folder. both are accessing same file whenever i open the browser means from PycharmProjects. but when i restart the pc then for the first time everything works perfect – awais umar Sep 12 '17 at 01:02
  • Try saving the file in a different folder, and run it from Terminal/Command Prompt. Then we will know if it is a problem with the editor or the code – whackamadoodle3000 Sep 12 '17 at 01:07
  • so i did a one more restart and its working in pycharm now but not in sublime.and now its working fine ...but i really dont know why i face this unexpected behavior lolz.anyway thanks for your time – awais umar Sep 12 '17 at 01:20

0 Answers0