How can I run a python script without using a python editor that includes the smartsheet sdk

1.9k views Asked by At

One solution I have been trying to convert python scripts into .exe files using things like py2exe and cx_Freeze, but I keep getting errors after running the cmd. Is there any other solutions you guys can think of, or should I just keep trying what I am currently working on.

Notes: I am running Spyder 3.3.1 on anaconda, and using the anaconda prompt to install files and use files I install

Example 1: I compile the program using

pyinstaller myscript.py

When it finishes running, I am left with a full build folder, but an empty dist folder.

The final Error I get before the cmd prompt stops is:

for real_module_name, six_module_name in real_to_six_module_name.items():
AttributeError: 'str' object has no attribute 'items'
2

There are 2 answers

0
adamcoolcat On BEST ANSWER

What I ended up using was an addon for python called xlwings. It was a simple install using,

conda install xlwings 

and I just used an excel spreadsheet for input (folder/sheet ids and titles).

I made a macro that allows me to push a single button that launches the code (without having to have a python interpreter open) and it works perfectly.

Thanks to everyone for their constant help and support, I greatly appreciate it!

0
Software2 On

If all you're looking to do is run the script without using an IDE, just run it from the command line.

C:\Python27\python.exe C:\script\path\my_python_script.py

If you want a double clickable icon, you could wrap this in a batch file.