Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Py to Exe problem
#1
Hi
I have one python file who extracts data from internet and writes it to a excel file. Works fine, but I need to create a exe file from python and I use pyinstaller. I have one exe file bt it doesn't work I expected. I have one problem because the dos window runs fast and I can't see the messages therefore I can't find any error.
Any help to stop this DOS window?
Thank you
Reply
#2
Hello, first thing you can do right off the bat is follow the solution suggested in this SO answer, and you will get console output saved to a file.
Reply
#3
Quote:I have one problem because the dos window runs fast and I can't see the messages therefore I can't find any error.
Well first of all you should not just double click the exe and expect the error to pop up. you need to run the program from command prompt to retain the output.

Second of all have you tried any of these suggestions?
https://pythonhosted.org/PyInstaller/whe...wrong.html
Recommended Tutorials:
Reply
#4
(Mar-21-2018, 04:19 PM)mariolopes Wrote: I have one problem because the dos window runs fast and I can't see the messages therefore I can't find any error.
Add this line last in code and build again.
input('Press <Enter> to exit')
Now will windows stay until Enter or any key is pushed.
Reply
#5
Thank you
Solve the issue and now I can know what is the problem. The problem is with whois program. Please look at the following code:
import whois
url="http://cheirabem.com"
domain = whois.whois(url)
print(url)
Got some error with whois. I send the image of the output.
What kind of problem is this?

Thank you
Solve the issue and now I can know what is the problem. The problem is with whois program. Please look at the following code:
import whois
url="http://cheirabem.com"
domain = whois.whois(url)
print(url)
Got some error with whois. I send the image of the output.
What kind of problem is this?

PS
Maybe instead of using whois software I can access the information from website like
https://www.whois.com/whois/cheirabem.com
and scrap the results

Attached Files

Thumbnail(s)
       
Reply
#6
Based on pypi description itself....the whois package is a wrapper around linux's whois command. So its not going to work in windows unless tweaked.

You could try this package instead
https://pypi.python.org/pypi/python-whois/0.6.9

And yes you could scrape the site too.
Recommended Tutorials:
Reply
#7
1) [for OP]: Please don't share images. Just copy/paste the error. You're asking for our help, so try to make it easy for us to help you.
2) [for everyone else]: This is a continuation of an earlier thread, where the underlying whois issue was resolved: https://python-forum.io/Thread-Whois-not-working


You only get an error when running it as an exe, right? It works fine as just a .py file?
I don't know a whole lot about how py2exe/pyinstaller works, but it seems weird that it's trying to open a file from the temp directory.
Reply


Forum Jump:

User Panel Messages

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