473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Batch execution problem with the executable

440 256MB
Hi,

I have created a Executable ( Exe) of an Python application using Py2Exe.I have implemented for Batch or Interactive application run in the source code.But I able run the interactive application when I run the executable (or) by giving the option 'gui'

Interactive:
---------------

C:\Sample\Main.exe

(or)
C:\Sample\Main.exe gui

Graphical User Interface will be displayed.

Batch:
--------
C:\Sample\Main.exe C:\Test.in

Nothing is displayed.I have given the print statement also for printing the data
print ' Batch'

Help:
-------
C:\Sample\Main.exe help

It should display the message for executing the application in Btach/Interactive.

When I run the application with *.py or *.pyc , I am able to execute both Interactive or Batch options successufly

I will post a sample snippet of the program,to understand the Batch and Interactive option execution

Thanks
PSB
Jun 6 '07 #1
2 1525
psbasha
440 256MB
I have fixed this problem ,by changing the setup file
Expand|Select|Wrap|Line Numbers
  1. Setup.py
  2.  
  3. import glob
  4. import os
  5. import sys
  6. from distutils.core import setup
  7. import py2exe
  8.  
  9. def files(folder):
  10.     for path in glob.glob(folder+'/*'):
  11.         if os.path.isfile(path):
  12.             yield path
  13.  
  14. data_files=[
  15.             ('.', glob.glob(sys.prefix+'/DLLs/*.dll')), 
  16.             ('tcl/Tix8.4.2', files(sys.prefix+'/tcl/Tix8.4.2')),
  17.             ('tcl/Tix8.4.2/bitmaps', files(sys.prefix+'/tcl/Tix8.4.2/bitmaps')),
  18.             ('tcl/Tix8.4.2/pref', files(sys.prefix+'/tcl/Tix8.4.2/pref')),
  19.            ]
  20.  
  21. setup(
  22.       script_args=['py2exe'],
  23.       #windows=['C:\Test\Main.py'],
  24.       console=['C:\Test\Main.py'],
  25.       data_files=data_files,
  26.      )
  27.  
We have to change the 'winows' variable to 'console'
Jun 6 '07 #2
bartonc
6,596 Expert 4TB
Thank you very much for the py2exe setup script!

The first post made this look like a question, so I have moved it from the Articles section. I will soon be compiling an article on py2exe and will be sure to include your script.

Thanks, again,
Barton
Jun 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: KRK | last post by:
I am having one batch file and using this I can start my Server. It will execute all exes while starting. Now my question is how to debug my exe using this batch file?? Is it possible to execute this...
3
by: JoelBrimm | last post by:
I have a batch file that executes a command line utility to do a secure file copy from our server to a 3rd party server. The batch file works fine, but when I call it from the web service the log...
0
by: ee_stevek | last post by:
hi guys, here is my problem: i have to maintain a web vb.net application developped some times ago. The application was developped on Windows2000 SP3 with Visual Studio 2003 (7.1). and the...
15
by: polas | last post by:
Hi everyone - I have a question. I am just playing around with C (I realise there are better ways to do what I want, but I would like to do it this way to increase my understanding of C) and would...
4
ck9663
by: ck9663 | last post by:
hi guys this is a little challenging, at least for me...here goes... i have to run a DOS batch file from a server. with some parameters that i need to pass. these parameters can be found on a...
5
by: sqlgirl | last post by:
Hi, We are trying to solve a real puzzle. We have a stored procedure that exhibits *drastically* different execution times depending on how its executed. When run from QA, it can take as...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
1
by: bravo | last post by:
hi using mysql 4.1 i wish to update records using batch update but for a batch of 100, records and table having only 5000 records execution time is approx 2.4 sec i want to know whether this time...
2
by: abhaybhat | last post by:
I run a batch file, which is nothing but a make file of my project. It also does linting for me. Hence the execution of the batch file in the DOS window can be seen, which is very huge(i have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.