python


tkinter image from url without importing ImageTK, base 64 etc


Is there anyway to import a picture into the window, using only methods imported from tkinter, and nothing else? Couldnt find anything specifically about this.
Cheers.
EDIT: From url
Up to my knowledge, you cannot directly import an image from an url using only Tkinter, but you can fetch the image data first using urllib:
import tkinter as tk
from urllib.request import urlopen
root = tk.Tk()
url = "https://cdn.sstatic.net/Sites/stackoverflow/company/img/logos/so/so-logo.png?v=9c558ec15d8a"
with urlopen(url) as handle:
data = handle.read()
im = tk.PhotoImage(master=root, data=data)
tk.Label(root, image=im).pack()
root.mainloop()

Related Links

Impossibility to index some plt.text within a slider
pivot table to excel chart and append it to excel using python
Ambigouos columns 'data' in Spark Dataframe
Converting Numpy Array Element to String: TypeError: bad operand type for unary +: 'str'
python import error cx_Oracle in macOS Sierra
Select specific rows and cells in text file and put into data frame: python or R
TensorFlow dynamic_rnn regressor: ValueError dimension mismatch
Using converters in Pandas read_hdf similar to read_csv
python3 package path of local file
Viewing other user profile
Python Tkinter, Stop a threading function
Python runtime warning when move unit test to a package
UserWarning on Django website for Raven client
Organise .rst files for sphinx?
Scatter Plot of a Specific Column in Python using matplotlib
How to make difference between email html body and html attachment in python?

Categories

HOME
rest
jsf
ember.js
openssl
puzzle
sed
rotation
warnings
windows-7
ocaml
ubuntu-16.04
jasmine
adsense
iis-7.5
filter
nodemailer
netflix-feign
wicket
cartodb
cakephp-2.9
iso
gatsby
simple-injector
sign
lenskit
netezza
jquery-terminal
pyyaml
eclipselink
rails-activerecord
fop
multiplayer
delete-file
lync-2013
data-conversion
hibernate-cache
idl
rhomobile
npm-shrinkwrap
large-data
viewstate
css-counter
swagger-editor
linq-to-entities
android-preferences
ical-dotnet
excel-interop
ttcn
prototypejs
estimation
ajp
ideone
gd
chunked-encoding
sgmlreader
tiddlywiki
spell-checking
text-classification
butterknife
execl
pycurl
infinite-scroll
emgu
gulp-typescript
django-filer
gradle-release-plugin
cmocka
anythingslider
hateoas
lemoon
data-import
optionbutton
application-loader
textkit
python-winshell
built-in
calibration
harp
ubercart
twitter-rest-api
debian-based
adobe-indesign
hiera
consensus
ctrlp
c++-actor-framework
python-ggplot
collabnet
method-overriding
mfmailcomposeviewcontroll
funkload
fogbugz-api
goinstant
ng-hide
multiple-login
dig
arbor.js
tfs-power-tools
rose-db-object
driving-directions
msgbox
path-manipulation
serp
yajl
multibyte-functions
inline-if
evb
data-entry

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App