无法将 window 的大小和应用程序选项与 Eel 一起使用
Unable to use both size of the window and application options together with Eel
我尝试编写一个简单的应用程序来检查 Eel 的工作原理(我是 Eel 的新手)并对应用程序选项进行了一些自定义并请求了特定的大小。 Python 代码如下所示:
import eel
app_options = {
'mode': "chrome",
'host': "localhost",
'port': 0
} #'mode' as 'chrome-app' also has same issue
eel.init('web')
eel.start('main.html', size=(600,600), options=app_options)
对于上面的 Python 代码和下面的 main.html 文件,我无法看到 window 根据我的要求调整大小.如果我从“start”方法中删除“options”参数,那么应用程序的大小就是指定的大小。因此,当 'size' 和 'options' 参数都被给出时,只有 'options' 被荣幸。 如何确保大小和选项都按规定工作?
下面是main.html
<html>
<head>
<title>Test Eel page</title>
<script type="text/javascript" src="eel.js"></script>
</head>
<body>
<p>Hello World</p>
</body>
</html>
Python版本:3.7.2
鳗鱼版本:0.10.4
Chrome 版本:73.0.3683.75(正式版)(64 位)
我们可以使用 eel 中的预定义函数来获取力 chrome-app 模式并设置大小。
if eel.chrome.get_instance_path() is not None:
eel.start('main.html', size=(650, 612), options={'port': 0})
else:
eel.start('main.html', size=(650, 612), options={
'port': 0, 'mode': 'user selection'})
我尝试编写一个简单的应用程序来检查 Eel 的工作原理(我是 Eel 的新手)并对应用程序选项进行了一些自定义并请求了特定的大小。 Python 代码如下所示:
import eel
app_options = {
'mode': "chrome",
'host': "localhost",
'port': 0
} #'mode' as 'chrome-app' also has same issue
eel.init('web')
eel.start('main.html', size=(600,600), options=app_options)
对于上面的 Python 代码和下面的 main.html 文件,我无法看到 window 根据我的要求调整大小.如果我从“start”方法中删除“options”参数,那么应用程序的大小就是指定的大小。因此,当 'size' 和 'options' 参数都被给出时,只有 'options' 被荣幸。 如何确保大小和选项都按规定工作?
下面是main.html
<html>
<head>
<title>Test Eel page</title>
<script type="text/javascript" src="eel.js"></script>
</head>
<body>
<p>Hello World</p>
</body>
</html>
Python版本:3.7.2
鳗鱼版本:0.10.4
Chrome 版本:73.0.3683.75(正式版)(64 位)
我们可以使用 eel 中的预定义函数来获取力 chrome-app 模式并设置大小。
if eel.chrome.get_instance_path() is not None:
eel.start('main.html', size=(650, 612), options={'port': 0})
else:
eel.start('main.html', size=(650, 612), options={
'port': 0, 'mode': 'user selection'})