dev_appserver.py Opens a Text File, Does Not Deploy

2024/10/2 6:43:26

It works fine on my other computer, but after setting up Google App Engine and creating the main.py and app.yaml files, I run dev_appserver.py app.yaml in Windows command prompt and instead of deploying the app to localhost:8080 it just opens this text file, which I will shorten:

#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""Convenience wrapper for starting an appengine tool."""import os
import syssys_path = sys.path
try:sys.path = [os.path.dirname(__file__)] + sys.pathimport wrapper_utilfinally:sys.path = sys_pathwrapper_util.reject_old_python_versions((2, 7))_DIR_PATH = wrapper_util.get_dir_path(__file__, os.path.join('lib', 'ipaddr'))
_PATHS = wrapper_util.Paths(_DIR_PATH)

etc. etc.

What is going on here? Everything is set up identically to my other pc. It should work.

Answer

SOLVED! The .py files were all set to open with idle.bat so I had to go into Control Panel\Programs\Default Programs\Set Associations and change the .py file association to python.exe. Now everything works like a charm.

https://en.xdnf.cn/q/70878.html

Related Q&A

How to pass a list from a view to template in django

I am trying pass to list from a view to template in Django.In my file wiew.py I define the view named hour # This Python file uses the following encoding: utf-8from django.shortcuts import render from …

Probing/sampling/interpolating VTK data using python TVTK or MayaVi

I would like to visualise a VTK data file (OpenFOAM output) using python. The plot I would like to make is a 1-d line plot of a quantity between two endpoints. To do so, the unstructured data should be…

Make Sphinx generate RST class documentation from pydoc

Im currently migrating all existing (incomplete) documentation to Sphinx.The problem is that the documentation uses Python docstrings (the module is written in C, but it probably does not matter) and t…

inspect.getfile () vs inspect.getsourcefile()

I was just going through the inspect module docs.What exactly is the difference between:inspect.getfile()andinspect.getsourcefile()I get exactly the same file path (of the module) for both.

Get a row of data in pandas as a dict

To get a row of data in pandas by index I can do:df.loc[100].tolist()Is there a way to get that row of data as a dict, other than doing:dict(zip(df.columns.tolist(),df.loc[100], tolist() ))

Find duplicate records in large text file

Im on a linux machine (Redhat) and I have an 11GB text file. Each line in the text file contains data for a single record and the first n characters of the line contains a unique identifier for the rec…

Select the first item from a drop down by index is not working. Unbound method select_by_index

I am trying to click the first item from a drop down. I want to use its index value because the value could be different each time. I only need to select the 1st item in the drop down for this particul…

finding the app window currently in focus on Mac OSX

I am writing a desktop usage statistics app. It runs a background daemon which wakes up at regular intervals, finds the name of the application window currently in focus and logs that data in database.…

os.system vs subprocess in python on linux

I have two python scripts. The first script calls a table of second scripts in which I need to execute a third party python script. It looks something like this: # the call from the first script. cmd …

How can I call a python script from a python script

I have a python script b.py which prints out time ever 5 sec.while (1):print "Start : %s" % time.ctime()time.sleep( 5 )print "End : %s" % time.ctime()time.sleep( 5 )And in my a.py, …