Tag: python

How can I calculate week number and year in Python in NiceForm?

Sometimes you need to have a year and/or week number on a label or in a form. The following script calculates both. import sys if sys.platform == ‘silverlight’: import System from System.Globalization import * culture = System.Globalization.CultureInfo.CurrentCulture; dt = System.DateTime.Now

Posted in NiceForm, NiceLabel Breeze, NiceLabel Portal Tagged with: , , , ,

Formatting numbers and date/time using current locale in NiceForm and NiceLabel Portal

Locale is a set of parameters that defines the user’s language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a

Posted in NiceForm, NiceLabel Portal Tagged with: , , , , ,

How can I work with files in NiceLabel Portal?

NiceLabel Portal uses Microsoft Silverlight as its underlying technology. Because Silverlight is a browser-based plug-in, it has by default the lowest security privileges to ensure a safe browsing experience. This restriction introduces a number of challenges, especially when it comes

Posted in NiceLabel Portal Tagged with: , , , ,

Chaining comparison operators in Python

One of the little known facts about Python that can come handy is a possibility to chain comparison operators like this: x = 5; print 3 < x < 10; print x < 10 < x*10; or x == y

Posted in Misc Tagged with: , ,

Manipulating date and time using Python in NiceForm and NiceLabel Portal

Time values are represented with the time class. Times have attributes for hour, minute, second, and microsecond. They can also include time zone information. A time instance only holds values of time, and not a date associated with the time.

Posted in NiceForm, NiceLabel Portal Tagged with: , , ,