I want to be able to write a cross-platform screensaver that works on both Windows and macOS using the Pygame 2D graphics library in Python. On Windows, this is super easy - you just write your program with three possible command line arguments: /p for preview mode, /c for the configuration dialog mode, and /s for the actual full-screen screensaver mode. Then you just use pyinstaller to build an .exe file and rename the extension to .scr, and you're good to go. However, it seems that making a screensaver on macOS is a pretty convoluted process, and there was stuff about specific Objective-C functions that you had to write, and I didn't really understand the documentation. Could you please tell me if there is any way to simply get my Python Pygame program to build as a proper .saver file? Thanks!
General
RSS for tagDive into the world of programming languages used for app development.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a string of the form “Mon 22nd April”. I’m trying to extract the day (i.e. Mon), the date (i.e. 22nd) and the month (i.e. April) using this Applescript:
set originalDateString to “Mon 22nd April”
-- Extract the components by splitting the string
set AppleScript's text item delimiters to " "
set dayOfWeekAbbrev to text item 1 of originalDateString
set dayOfMonth to text item 2 of originalDateString
set monthName to text item 3 of originalDateString
When I run this on its own it works as expected:
dayOfWeekAbbrev is set to “Mon”
dayOfMonth is set to “22nd”
monthName is set to “April”
When I run this inside a bigger script involving Numbers, the text item delimiters fails to work, no compile or run time errors occur and I end up with:
dayOfWeekAbbrev is set to “M”
dayOfMonth is set to “o”
monthName is set to “n”
I.e the first three characters of the string.
If I replace originalDateString with the literal string “Mon 22nd April” I get the same result. In other words, text items and being recognized as individual characters, no delimiter (or delimiter is null). Totally confused.
I use Kotlin Multiplayer Development to develop iOS applications. I access the methods in the Kotlin class of the shared module in the ContentView.swift file. Functions without parameters can be used normally, but functions with parameters cannot. For example, the 78th line of code on the left side of the screenshot works, but the 79th line does not. Can someone please tell me the reason? Thank you!
Hi To All.
I have recently started a course that will teach me how to use C++ coding, so I can improve my career prospects.
I have come across an obstacle when it comes to downloading a programming tool and that is, they are not compatible with Sequoia 1.15.1.
This includes Xcode, Clion, Codelite and Vs, I am at a crossroads in my decision making on how to overcome this problem please.
Can someone help withme with a solution please.
Thank you.
Topic:
Programming Languages
SubTopic:
General
I am developing a simple camera JNI interface program in Objc. I managed to compile. But I get the following link error. I use the following command. Is there anything I can add to solve this problem? Note that I use Intel MacMini.
g++ -framework Foundation -framework AVFoundation CameraMacOS.m
Undefined symbols for architecture x86_64:
"_CMVideoFormatDescriptionGetDimensions", referenced from:
_openCamera in CameraMacOS-517c44.o
_listWebcamNamesAndSizes in CameraMacOS-517c44.o
"_CVPixelBufferGetBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetBytesPerRow", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetHeight", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetWidth", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferLockBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferUnlockBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have a multi-platform application made with Delphi which uses FTDI D2XX drivers. All is well in other platforms but i have this issue in MacOS when i try to start the application:
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: libftd2xx.dylib
Referenced from: <CD2148C0-F76F-35D5-8E65-2BE51F201302> /Users/USER/*/USB_Editor.app/Contents/MacOS/USB_Editor
Reason: tried: 'libftd2xx.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibftd2xx.dylib' (no such file), 'libftd2xx.dylib' (no such file), '//libftd2xx.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS//libftd2xx.dylib' (no such file), '//libftd2xx.dylib' (no such file)
(terminated at launch; ignore backtrace)
If i try to run the executable i get a similar error which includes the users/user folder in the paths specified above. So if i copy libftd2xx.dylib to users/user the app can start from the executable and the USB library works well.
The library is bundled in Contents/Framework as this seems to be the best (or only) accepted practice. Btw the app only starts during deployment if the library is found in Contents/MacOS.
Library version is the most recent from FTDI site for the ARM architecture and followed their instructions to install.
If i try the otool command on the library i get this:
otool -L libftd2xx.dylib
libftd2xx.dylib:
libftd2xx.dylib (compatibility version 1.1.0, current version 1.4.30)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2202.0.0)
I'm a Mac user since last week so my knowledge of the system is not so good yet (:
Stiamo sviluppando una App per iOS con Flutter,
usiamo: Flutter barcode_scan2: ^4.3.3.
Gli smartphone iOS cercano di riconoscere il tipo di codice a barre letto. Se il sistema crede che il codice sia gtin13 ma le cifre risultano 12, aggiunge uno zero iniziale. Come potremmo risolvere ?
Grazie
Settore sviluppo App
Firenze Web Division
Topic:
Programming Languages
SubTopic:
General
Hi there, I’m having issue with the python3 installation provided by Xcode’s toolchain. I’m currently writing a LLDB plugin, using the LLDB python API, to allow the user to visualize audio data from the current debugged program in a GUI, using tkinter and matplotlib. I'm using those because I'm developing a cross-platform plugin, as I'm initially a Linux developer who wants to make this available to my fellow Apple audio devs.
My issue arise at least on two setups
MacOS 12.7.6 Monterey with Xcode 14.2
MacOS 14 with Xcode 15.4 (not my machine)
Because I wanna support Xcode’s toolchain, I want to use Xcode’s lldb. Xcode’s lldb uses Xcode’s provided python, which I’m having issues with when loading tkinter.The issue can be reproduced like this :
> xcrun python3 -c "import tkinter;tkinter._test()"
macOS 12 (1207) or later required, have instead 12 (1206) !
zsh: abort xcrun python3 -c "import tkinter;tkinter._test()"
On MacOS 14 the version numbers are :
macOS 14 (1407) or later required, have instead 14 (1406) !
You can see it fails to load tkinter. From what I understood so far, it looks like the tkinter/tcl/tk version distributed with Xcode is not supported by MacOS ?I checked and the imported tkinter module is definitely the one provided by Xcode’s toolchain :
# Checking where tkinter is installed
> fd "^tkinter$" /Applications/Xcode.app
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/tkinter/
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/future/moves/tkinter/
# Checking that Xcode python uses the right module - it matches
> xcrun python3 -c "import tkinter;print(tkinter.sys.modules['tkinter'])"
<module 'tkinter' from '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py'>
I can get a working tkinter working by installing it using homebrew or macports, but I’m not able to use it with Xcode’s python installation. I tried overwriting sys.path to force Xcode’s python to import homebrew’s tkinter module, but it still loads Xcode’s tkinter .so.
In the crash report I can see it indeed loads tcl/tk 8.5 and loads _tkinter.cpython-39-darwin.so from Xcode. I could disable the SIP (System Integrity Protection) to force to load another version of the library, but that wouldn’t be something I can ask the users.
On the LLDB forum, they advise against using another python interpreter that the one provided by the toolchain. So is there a way to get the provided tkinter/tcl/tk installation to work ? If not I’m confused about why it’s provided in the first place.
Thanks a lot for your time and please tell me if you have any questions.
PS: if possible i'll post the head of the crash report in the comment of this post
after updating to macOS sequoia C++ compiler on vscode is not working is it just me or it is a common issue ?