Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96822

Re: .bat file trouble.

From Christian Gollwitzer <auriocus@gmx.de>
Newsgroups comp.lang.python
Subject Re: .bat file trouble.
Date 2015-09-18 15:45 +0200
Organization A noiseless patient Spider
Message-ID <mth4e7$atq$1@dont-email.me> (permalink)
References <d4e0dfd5-a87e-49a4-9a7c-696aabf527f2@googlegroups.com>

Show all headers | View raw


Am 18.09.15 um 11:06 schrieb bobertini@googlemail.com:
> Hi,
>
> I have two files called module_scripts.py and build_q_scripts.bat.
>
> The problem being that when I go to run the bat file it produces a
> few errors which neither myself or the original owner of the files
> could understand.
>
> Errors:
>
> https://gyazo.com/c680f0d70cefe855c21ab0882d7c17b7

The first error indicates, that you are running Python 3, and the script 
was made for Python 2. In Python 3, print is a function so you need 
parentheses around that print("Initializing...") - either fix that
or install Python 2.

The second error "TabError" also relates to it, it means that the file 
mixes tabs and spaces for indentation. Fix it by expanding all tabs to 
spaces in an editor.

> We originally thought that it was because it was missing the files:
> process_init.py and process_global_variables.py however they are
> right there in the same directory.


Concerning that, windows usually runs a .bat file in the directory where 
it is situated, so putting the python fies there /should/ work, but you 
can also set this using the right-click menu (execute in...), if you 
make a link to the desktop.

	Christian

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

.bat file trouble. bobertini@googlemail.com - 2015-09-18 02:06 -0700
  Re: .bat file trouble. Steven D'Aprano <steve@pearwood.info> - 2015-09-18 19:32 +1000
  Re: .bat file trouble. Christian Gollwitzer <auriocus@gmx.de> - 2015-09-18 15:45 +0200
    Re: .bat file trouble. eryksun <eryksun@gmail.com> - 2015-09-20 09:53 -0500
    Re: .bat file trouble. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-20 09:43 -0600

csiph-web