Hi,
i have got a lot of problems with my scripts because 3.4 is not supporting the bluetooth send function. (Bug in Core Bluetooth fails with PY_SSIZE_T_CLEAN macro)
Is it possible to downgrade to 3.3 to fix this?
Thanks a lot.
BR kami
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.
Hi,
i have got a lot of problems with my scripts because 3.4 is not supporting the bluetooth send function. (Bug in Core Bluetooth fails with PY_SSIZE_T_CLEAN macro)
Is it possible to downgrade to 3.3 to fix this?
Thanks a lot.
BR kami
@raavikant Hi, thanks a lot for the answer. But in the past it was working. Is there any workaround?
BR kami
@ccc Thanks a lot. I read this. But there is nothing new since January. Long Time :)
BR kami
Hi,
i am running the Testflight Version of Pythonista on my Iphone.
If i try to send a msg over Bluetooth MLDP i get this error:
PY_SSIZE_T_CLEAN macro must be defined for '#' formats
Can someone tell me how to fix this?
BR kami
@cvp Hi,
thanks a lot. After some testing i found the problem. I have to use another HTML-code for the Website to show my image. It was not a problem of the webview but of the HTML-Site
BR kami
Hi, just another question. I am loading a UI-Script in a nav-view with push. There is only a webview in the ui-View. But it is always a little bit to big for thr screen. So i can scroll in the webview. How can i reduce the width and height of the webview.
This doesn't work. It is always bigger then 100px :
nav.push_view(pushed_solveimg)
pushed_solveimg.width = 100
pushed_solveimg.height = 100
pushed_solveimg['webview1'].scales_page_to_fit = True
pushed_solveimg['webview1'].x = 0
pushed_solveimg['webview1'].y = 0
pushed_solveimg['webview1'].width = 100
pushed_solveimg['webview1'].height = 100
BR kami
@cvp Hi, thanks a lot. I will try an implement it in my python app.
BR kami
Hi, i tested you script also but if i use my https Webserver i cant get an image. The error is:
cannot identify image file <_io.BytesIO at 0...
Is it a HTTPS problem?
BR kami
@cvp Hi,
first of all Thanks a lot. I tested your example and it works but the image is always to big and not scaled to the size of my Iphone display.
Maybe you can fix it.
BR kami
@cvp Hi, thanks a lot. Can this open an URL?
BR kami
Hi,
i would like to load an animated gif from a http webserver and show it in a webview or imageview, but always without changing the aspect ratio and with the scale fit to the view. Is this possible and how could i do it on the shortest way. The pyui with a webview or imageview exists and is loaded so i just have to add the gif.
BR kami
Hi,
i am looking for a script to compare to PIL Image like show in this module.
If i try to install it with StaSh i get a mypy error.
Can someone tell me how i can get this function?
BR kami
@cvp Hi, thanks a lot. This works fine. All pictures are now in the right size and orientation.
BR kami
@cvp Hi thanks a lot for the good help, but my problem is, that if i just use your sourcecode :
import photos
assets = photos.get_assets()
asset = photos.pick_asset(assets=assets)
pil = asset.get_image()
pil.show()
exifs = pil.getexif()
orientation = exifs[274]
print(orientation)
if orientation == 6:
pil = pil.rotate(90)
pil.show()
all pictures with orientation 6 are shown like this in the Console. So the problem is before rotating.
If i take a picture with orientation 1 it is fine:
@cvp : Hi, thanks a lot this works fine but i am always getting black Bars around the corner so that it is a square. Just if i only use your script. I got this problem the first time when i switch to the new Test Flight version of pythonista. With the standard one everything was okay.
BR kami
Hi,
i am trying to resize an Image from my photo library and upload it. But there is a problem with the orientation of the picture. How can i first rotate the image in the right orientation and then resize it?
def uploadimage(sender):
mywidth = 1600
for file in vdel.items:
name = file['name']
asset = photos.get_asset_with_local_id(file['id'])
data = asset.get_image()
wpercent = (mywidth/float(data.size[0]))
hsize = int((float(data.size[1])*float(wpercent)))
data = data.resize((mywidth,hsize))
imgByteArr = io.BytesIO()
data.save(imgByteArr, format='JPEG')
imgByteArr = imgByteArr.getvalue()
uploadfile = {'file': (name, imgByteArr)}
The function is working but i have to fix the orientation.
BR kami
Hi,
i am trying this function under ios 16.3 and it is not working anymore.
def scroll() :
tvo = ObjCInstance(main['textview1'])
tvo.scrollRangeToVisible_(NSRange(len(main['textview1'].text),0))
tvo.setScrollingEnabled_(False)
tvo.setScrollingEnabled_(True)
Can someone help me with this?
BR kami
Hi,
after updating to IOS 15 i get always a SSL: CERTIFICATE_VERIFY_FAILED error.
with requests.Session() as s:
r= s.get('https://URL)
Only adding verify=False helps. Can someone tell me how to add the certificate?
Thanks a lot.
BG kami
HI,
thanks a lot for the answer, but sometimes my script is working. Is there any new feature with the right to access images in iOS14?
Cu kami