Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Multiple image tiles
-
pythonista uses ref counting, so no close is needed. here is a way to check, using weakref handlers:
# coding: utf-8 import io, weakref def handler(ref): print 'buffer closed' def f(): buffer = io.BytesIO() ref = weakref.ref(buffer, handler) buffer.write('something') return buffer.getvalue() for i in xrange(5): print 'before' f() print 'after'
as an aside, i think ios does allow threads, just not multiple processes.
-
@Webmaster4o Note: Garbage Collection (GC) is not a universal panacea. If, for example, you hang on to objects or handles you might (inadvertently) defeat GC.
And I like @ccc's response on GC pragmatics.
Pedagogical point: GC schemes are a big factor in (languages like) java's performance. They've evolved over the years.
-
@ccc the url is
https://itunes.apple.com/us/rss/topsongs/limit=10/json
And I'm requesting the "im:image" url
-
@Webmaster4o sounds great. I'll try this ASAP. Also what if I didn't want a cover flow, I was thinking more of a table of images.
-
@ccc i would this the ui module would be more appropriate. Isn't scene and canvas more for a game interface?
-
Part I: Get the image URLs for the Top 10 iTunes songs:
import feedparser url = 'https://itunes.apple.com/us/rss/topsongs/limit=10/xml' def get_image_urls(itunes_url): for entry in feedparser.parse(itunes_url).entries: yield entry['summary'].partition('src="')[2].partition('"')[0] print('\n'.join(get_image_urls(url)))
-
Part II: Adds a ui.View... https://github.com/cclauss/Pythonista_ui/blob/master/TopTenView.py
-
@ccc wow! I didn't know it was so simple. Thanks for the sample code!!
-
@ccc one question. Where did you get the number 128 in the image_view.x and y?
-
It has to do with the spacing between the pictures. Try adjusting the value and seeing what happens.
-
This post is deleted!