Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6220619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:59:17+00:00 2026-05-24T07:59:17+00:00

I’ve written a very simple code in python and generated one .exe with py2exe.

  • 0

I’ve written a very simple code in python and generated one .exe with py2exe.

I’ve added the imports to see if there’s a problem with importing those modules.

import sys
import time, os, httplib2
from csv import writer, reader, DictWriter
from BeautifulSoup import BeautifulSoup

def main():
    print sys.argv[1]

if __name__ == '__main__':
    main()

when I run it as a .py file it works great.

C:\Users\User>C:\Python27\Lib\site-packages\py2exe\samples\sysargv\module3.py
justChecking justChecking

but when I run the executable py2exe had generated it does nothing –

C:\Users\User>C:\Python27\Lib\site-packages\py2exe\samples\sysargv\dist\module3.exe JustCheking

that’s the code of the setup.py

from distutils.core import setup
import py2exe

setup(
    options = {'py2exe': {'bundle_files': 1}},
    windows = [{'script': "module3.py"}],
    zipfile = None,
)

I need to use sys.argv in my program (I’m getting input from the user, things like output directory, log file path etc’)

how do I use sys.argv when using py2exe to create one executable?

another question, if I have python 2.7 32 bit installed on a win7 64 bit computer (I’ve installed the regular win’ 2.7.2 msi file from python.org) and generated a single executable on that computer, will I be able to use the .exe on win7\xp 32 bit?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:59:18+00:00Added an answer on May 24, 2026 at 7:59 am

    My guess would be that you are using the windows option instead of the console option. That is used for gui apps. If the gui option works, then it would probably spawn a new terminal, which would immediately close once your program is done executing.

    You should be able to compile it on windows 7 with 32 bit python and use it on any other 32 bit machine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.