Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting py to exe
#1
Hi all,
I am using PyInstaller to convert a python script to a windows exe file.
The python script is:
#!/usr/bin/python

import requests
import random
import time
import datetime
from datetime import date
import csv
import sys
import lxml.html
import pandas as pd
from bs4 import BeautifulSoup as bs
import json
import xlwings as xw
import schedule
import os


symbol = "XAUUSD"

file = 'C:\\Users\\Admin\\Desktop\\MyFxBookAPIData.xlsm'

try:
    wb = xw.Book(file)
    sht1 = wb.sheets[0]
    sht1.copy(name = symbol)    # copy the template to a new sheet
    sht1 = wb.sheets[symbol]
    cellA = sht1.range('A2')
    cellA.value = sht1.name

except Exception as e:
    print(str(e))
    time.sleep(60)

This works perfectly as a python script but when I convert to exe and run the file I get this error:

(-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147352565), None)

Any ideas please?
Reply


Messages In This Thread
Converting py to exe - by WiPi - Feb-16-2024, 08:47 AM
RE: Converting py to exe - by sim - Mar-20-2024, 07:27 PM
RE: Converting py to exe - by WiPi - Apr-19-2024, 08:40 AM
RE: Converting py to exe - by DPaul - Apr-19-2024, 08:50 AM
RE: Converting py to exe - by WiPi - Apr-19-2024, 08:57 AM
RE: Converting py to exe - by deanhystad - Apr-19-2024, 02:07 PM
RE: Converting py to exe - by WiPi - Apr-19-2024, 03:30 PM
RE: Converting py to exe - by deanhystad - Apr-19-2024, 03:37 PM
RE: Converting py to exe - by WiPi - Apr-21-2024, 12:57 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020