Flask和Cx_Freeze模块对象没有属性rfind

时间:2016-01-19 13:41:06

标签: flask cx-freeze

我的代码存在问题,或许其中一位可以帮助我解决此问题

这是我的script.py:

#! /usr/bin/python
# -*- coding:utf-8 -*-

import jinja2.ext

import webbrowser

def main():
    from flask import Flask, flash, redirect, render_template, \
        request, url_for,escape, session
    from flask_bootstrap import Bootstrap
    app = Flask(__name__)
    webbrowser.open_new_tab('http://127.0.0.1:5000')
    Bootstrap(app)

    @app.route('/')
    def home():
      return render_template('home.html')


    @app.route('/choice')
    def choice():
      return render_template('Choice.html')


    @app.route('/src&dest')
    def GenerationPage():
      return render_template('generate.html')


    @app.route('/success')
    def successfull():
      return render_template('success.html')


    return app.run(debug=True)

if __name__ == "__main__":
    main()

和我的setup.py:

import sys
import os
from cx_Freeze import setup,Executable

path = sys.path + ["src", "src/templates"]

includes = [sys, os]
excludes = []
packages = []

include_files = ['templates']


options = {"path": path,
           "includes": includes,
           "excludes": excludes,
           "include_files": include_files
           }

if sys.platform == "win32":
  options["include_msvcr"] = True


base = None
if sys.platform == "win32":
   base = "Win32GUI"


FirstTarget = Executable(
   script="Other.py",
   base=base,
   compress=False,
   copyDependentFiles=True,
   appendScriptToExe=True,
   appendScriptToLibrary=False
   )

setup(
   name="FlaskTrapeze",
   version="0.1",
   description="Ouvre une interface web",
   author="Axel M",
   options={"build_exe": options},
   executables=[FirstTarget]
   )

当我尝试在windows

下构建它时,我遇到了这个问题

“AttributeError:'module'对象没有属性'rfind'”

感谢您的帮助!

0 个答案:

没有答案