pdf 不打开 发送 html,Webbrowser正在尝试打开PDF文件,而不是在浏览器中打开html

我正试图用Python在kivy应用程序中使用webbrowser模块在浏览器中打开一个文件。

这是我的密码:import webbrowser

import os

from kivy.app import App

from kivy.uix.button import Button

class SimpleBrowserApp(App):

def build(self):

btn = Button(text="open browser")

btn.bind(on_press=SimpleBrowserApp.OpenBrowser)

return btn

def OpenBrowser(*args):

webbrowser.open("file:///" + os.getcwd()+"/"+"map.html")

SimpleBrowserApp().run()

当我试图打开它时,我的手机返回-(PDF inaccessible(" map.html" can't open)):。你知道吗

ZcVwe.png

“我的”地图.html“与在同一文件夹中”主.py". 你知道吗

你知道吗buildozer.spec规范地址:[app]

# (str) Title of your application

title = GPSGuide

# (str) Package name

package.name = gpsguide

# (str) Package domain (needed for android/ios packaging)

package.domain = org.test

# (str) Source code where the main.py live

source.dir = .

# (list) Source files to include (let empty to include all the files)

source.include_exts =

# (list) List of inclusions using pattern matching

#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)

#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)

#source.exclude_dirs = tests, bin

# (list) List of exclusions using pattern matching

#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)

version = 0.1

# (str) Application versioning (method 2)

# version.regex = __version__ = ['"](.*)['"]

# version.filename = %(source.dir)s/main.py

# (list) Application requirements

# comma separated e.g. requirements = sqlite3,kivy

requirements = python3,kivy,android,plyer

# (str) Custom source folders for requirements

# Sets custom source for any requirements with recipes

# requirements.source.kivy = ../../kivy

# (list) Garden requirements

#garden_requirements =

# (str) Presplash of the application

#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application

#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)

orientation = portrait

# (list) List of service to declare

#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#

# OSX Specific

#

#

# author = © Copyright Info

# change the major version of python used by the app

osx.python_version = 3

# Kivy version to use

osx.kivy_version = 1.9.1

#

# Android specific

#

# (bool) Indicate if the application should be fullscreen or not

fullscreen = 0

# (string) Presplash background color (for new android toolchain)

# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:

# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,

# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,

# olive, purple, silver, teal.

#android.presplash_color = #FFFFFF

# (list) Permissions

#android.permissions = INTERNET

# (int) Target Android API, should be as high as possible.

#android.api = 27

# (int) Minimum API your APK will support.

#android.minapi = 21

# (int) Android SDK version to use

#android.sdk = 20

# (str) Android NDK version to use

#android.ndk = 17c

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.

#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)

也许我不明白什么,或者有另一种方法在浏览器中打开HTML代码。

我只需要在浏览器中打开这个文件。你知道吗

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值