FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/examples/hello_world.py at refs/heads/cefpython147 · linesight/cefpython · GitHub
linesight
/
cefpython
Public
forked from
cztomczak/cefpython
Notifications
You must be signed in to change notification settings
Fork
2
Star
11
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
examples
/
hello_world.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (33 loc) · 1.43 KB
Breadcrumbs
cefpython
/
examples
/
hello_world.py
Copy path
File metadata and controls
41 lines (33 loc) · 1.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Hello world example. Doesn't depend on any third party GUI framework.
# Tested with CEF Python v57.0+.
#
# ==== High DPI support on Windows ====
# To enable DPI awareness on Windows you have to either embed DPI aware manifest
# in your executable created with pyinstaller or change python.exe properties manually:
# Compatibility > High DPI scaling override > Application.
# Setting DPI awareness programmatically is problematic in Python, may not
# work and can cause display glitches.
import
sys
from
cefpython3
import
cefpython
as
cef
import
platform
def
main
():
check_versions
()
sys
.
excepthook
=
cef
.
ExceptHook
# shut down all CEF processes on error
settings
=
{}
cef
.
Initialize
(
settings
=
settings
)
cef
.
CreateBrowserSync
(
url
=
"https://www.google.com/"
,
window_title
=
"Hello World!"
)
cef
.
MessageLoop
()
cef
.
Shutdown
()
def
check_versions
():
ver
=
cef
.
GetVersion
()
print
(
"[hello_world.py] CEF Python {ver}"
.
format
(
ver
=
ver
[
"version"
]))
print
(
"[hello_world.py] Chromium {ver}"
.
format
(
ver
=
ver
[
"chrome_version"
]))
print
(
"[hello_world.py] CEF {ver}"
.
format
(
ver
=
ver
[
"cef_version"
]))
print
(
"[hello_world.py] Python {ver} {arch}"
.
format
(
ver
=
platform
.
python_version
(),
arch
=
platform
.
architecture
()[
0
]))
assert
tuple
(
int
(
x
)
for
x
in
cef
.
__version__
.
split
(
"."
))
>=
(
57
,
0
), \
"CEF Python v57.0+ required to run this"
if
__name__
==
'__main__'
:
main
()
Back
|
FazBrowse Home
|
New Git URL