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.
console.quicklook() crashes when pass a sequence of paths
-
I am learning python with Pythonista.
Recently I am writing a script to download images from a website.
Now I can get the images and I want to preview all the images.
The documents says It is possible to pass a sequence of paths (e.g. a list), in order to preview multiple files at once.
It is working well when I pass one image filepath to quicklook() like this:console.quicklook(img1_path)
But when I pass a squence of image files to quicklook() like this:
console.quicklook([img1_path, img2_path])
Pythonista crashes and returns to home screen.
Is there any misunderstanding in using the function here๏ผ -
What happens when you remove
[
and]
? -
Is there any misunderstanding in using the function here?
I do not think so, the documentation of the method states clearly that you can also pass a list of paths for
file_path
. The app also does crash for me both on passing a list of relative and absolute file paths asfile_path
. -
Appears it's a bug to be reported... I also had the app crash. But can do something like the below to work around it until it's addressed.
import console img1_path = 'IMG_1265.PNG' img2_path = 'IMG_1241.JPG' lst =[img1_path, img2_path] #print(help(console.quicklook)) #print(dir(console.quicklook)) #console.quicklook(img1_path) + console.quicklook(img2_path) for img in lst: console.quicklook(img) for img in lst: console.show_image(img)
-
@Phuket2 Happy to see you back ๐
-
@cvp , thanks good to be back. but i have forgotten everything now :) I have to start all over :(
-
This does look like a bug. It seems to work in Python 2 mode though.
Welcome back, @Phuket2!
-
@Phuket2 The application will be even more profitable, with regard to the number of hours of fun for paid dollars ๐
-
Finally I found it is a bug, the function work well in python 2. And a workaround for this bug is add #!python2 before console.quicklook()
-
@nicktimebreak , I submitted a bug report