# GS-Calc 21.4 has been released

**URL:** <https://community.citadel5.com/t/gs-calc-21-4-has-been-released/377>\
**Category:** GS-Calc Updates\
**Created:** [March 1, 2025, 11:20pm UTC](https://community.citadel5.com/t/gs-calc-21-4-has-been-released/377 "2025-03-01T23:20:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Citadel5](https://community.citadel5.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@Citadel5](https://community.citadel5.com/u/Citadel5)\
**Post date:** [March 1, 2025, 11:20pm UTC](https://community.citadel5.com/t/gs-calc-21-4-has-been-released/377/1 "2025-03-01T23:20:21Z")

</div>

GS-Calc 21.4 introduces initial Python integration in GS-Calc and fixes three problems listed below:

### Using Python functions as UDF()

Using the built-in UDF() (user-defined-) function you can call any Python modules/functions in formulas in GS-Calc.  
This can help you to significantly increase GS-Calc functionality thanks to the large number of various Python modules and libraries including, for example, science, finance, graphics.

(Note: The new Python UDF() functions replace the previous UDF() that was based on system automation servers registered in Windows and had very limited use.)

From GS-Calc you can pass to Python functions any type of parameters: (double precision) numbers, text strings, ranges as numeric arrays/matrices, automatically saved blocks of CSV data from ranges.

GS-Calc can accept from Python functions any type of data it supports in formulas: (double precision) numbers, text strings, numeric arrays/matrices, 2d arrays of any size and with any cell contents passed to GS-Calc as CSV data blocks to parse and finally images/graphics (that can overflow the formula cells).

The UDF() function:

**UDF(module, function, type, parameter1, parameter2, …)**

- module - Python module name with full path, for example “c:\my\_modules\some\_functions”

- function - function name as it appear in the above module, for example “my\_function”

- type - an index (0-5) specifying what type of data GS-Calc should expect from the Python procedure. Possible values are:

Python modules are plain text files with the "\*.py" extension. Below is an example of such a file containing seven simple functions.

e:\example.py :

def function1():  
return 10

def function2(a, b):  
return a + b

def function3(text):  
return ‘A new text with ’ + text + ’ inserted in the middle’

def function4():  
csvdata = ‘abc,def,ghi\n123,456,789’  
return csvdata

def function5(csvdata):  
return csvdata

def function6(csvFilePath):  
f = open(csvFilePath, ‘rb’)  
file\_content = f.read()  
f.close()  
return file\_content

def function7(imageFilePath):  
f = open(imageFilePath, ‘rb’)  
file\_content = f.read()  
f.close()  
return bytearray(file\_content)

In GS-Calc the above functions can be use as follows:

- 1.UDF("e:\example.py", "function1", 0)

- 2. UDF("e:\example.py", "function2", 0, 10, 20)

- 3. UDF("e:\example.py", "function3", 2, "a word")

- 4. UDF("e:\example.py", "function4", 4)

- 5. UDF("e:\example.py", "function5", 4 + 32, b10:d10000)

- 6. UDF("e:\example.py", "function6", 4, "e:\some\_csv\_file.csv")

- 7. UDF("e:\example.py", "function7", 5, "e:\some\_image.jpg")

### Installing Python and integrating it with GS-Calc

You can download the standard Python package, among others, from Microsoft Store or directly from the Python project home page.

You must specify which Python version you would like to use with GS-Calc, selecting a given version in GS-Calc in the "Settings \> Options \> General" dialog box.

Unless you already have Windows system variables pointed to the Python installation folder, in the "Settings \> Options \> General" dialog box you must also specify the folder where the Python core library DLL (for example python39.dll for the selected version 3.9) file is located.

Note: At the moment this initial version comes with the Python 3.9 support. Subsequent version should be added later as the bundled small gsc2pythonXX.dll proxy modules.

 ![*](https://community.citadel5.com/uploads/default/original/1X/1e99435124758ffc9ad5f52f8109533ddbda873d.png)

  

**GS-Calc 21.5 21.5.1 - update - 2025-02-08**

GS-Calc 21.5 adds newer Python version support in GS-Calc and fixes a  
problem related to saving Excel xlsx files when sheets have cells with borders/frames defined.

GS-Calc 21.5.1 fixes a problem for large pivot tables: if they were saved in the bottom pane it could cause crashes. (Pivot tables used directly in sheets are not affected.)

---

<div class="post-metadata">

**Author:** ![waltmc](https://community.citadel5.com/user_avatar/community.citadel5.com/waltmc/32/8_2.png) [@waltmc](https://community.citadel5.com/u/waltmc)\
**Post date:** [March 22, 2025, 2:32pm UTC](https://community.citadel5.com/t/gs-calc-21-4-has-been-released/377/2 "2025-03-22T14:32:45Z")

</div>

**GS-Calc 21.5.3 has been released** _2025-03-20_  
GS-Calc 21.5.3 addresses an issue with the “Open Text File” dialog box.  
When the “Maximum columns in one sheet” option was selected, only  
the first sheet displayed the expected data.

(The “Maximum rows in one sheet” option appears to function properly.)
