Python: How do I save a graphic?
|
09-09-2023, 09:29 AM
Post: #15
|
|||
|
|||
RE: Python: How do I save a graphic?
(01-05-2023 08:44 PM)Guenter Schink Wrote: Consider you deal with a graphic G1 in Python and wish to save it as "pic.png" using the variable "b", a simple two liner would do: There is another solution, and it seems even better to me because MicroPython on HP Prime supports %-formatting of strings, which can be used here. Code: b="pic.png" It works And as you can see, there is no use of string concatenation. You can also create a string containing several placeholders marked with '%', and then specify all the variables you want to substitute into those places one by one: Code: a="number" and it prints: My text - label number: 12345 Here '%s' is used to embed strings, '%d' for integers and '%f' for floating-point values. Piotr Kowalewski |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)