2

I've made a .py file through spyder in my Anaconda navigator, and it works fine when I run it in console (spyder and cmd). The script reads from a website, and appends to a text file. Through spyder and cmd, I always see the addition it's made. But when I double click, it brings up the command window, but makes no addition to the text file. What gives? I've made other .py files through spyder that work perfectly when double-clicked, bringing up the command prompt and running in there. What's the solution? Thanks!
Edit: when I try to add pythonw or python in the Anaconda file through my directory as the default application, Windows just doesn't accept it. The gist of my code, written in python is:
With dataman being a string I define earlier in the code

with open("gymful.txt", "a") as text:
text.write(dataman)
Teoman
  • 21
  • 1
  • 4
  • It would be useful if you added your script as a [mcve] – OneCricketeer Nov 01 '18 at 20:50
  • 2
    Possible duplicate of [How can I execute Python scripts using Anaconda's version of Python?](https://stackoverflow.com/questions/27005561/how-can-i-execute-python-scripts-using-anacondas-version-of-python) - https://docs.python.org/2/using/windows.html#executing-scripts – Pedro Lobito Nov 01 '18 at 20:54

1 Answers1

1

You may need something like PyInstaller. It will package you script into an executable where you can run it by double clicking.

https://www.pyinstaller.org/

Lambda1010
  • 369
  • 2
  • 3
  • 13