Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 937549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:29:48+00:00 2026-05-15T21:29:48+00:00

First, I have never used SWIG, I dont know what it does… We have

  • 0

First, I have never used SWIG, I dont know what it does…

We have a python library, that as far as I can tell uses SWIG, say when I want to use this library I have to put this in my python code:

import pylib

Now if I go open this vendor’s pylib.py I see some classes, functions and this header:

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.33
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.

import _pylib
import new
new_instancemethod = new.instancemethod

Next, in the same directory as pylib.py, there is a file called _pylib.pyd, that I think is a dll.

My problem is the following:

Many classes in pylib.py look like this:

class PersistentCache(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, PersistentCache, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, PersistentCache, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        this = _pylib.new_PersistentCache(*args)
        try: self.this.append(this)
        except: self.this = this
    __swig_destroy__ = _pylib.delete_PersistentCache
    __del__ = lambda self : None;
    def setProperty(*args): return _pylib.PersistentCache_setProperty(*args)
    def getProperty(*args): return _pylib.PersistentCache_getProperty(*args)
    def clear(*args): return _pylib.PersistentCache_clear(*args)
    def entries(*args): return _pylib.PersistentCache_entries(*args)
PersistentCache_swigregister = _pylib.PersistentCache_swigregister
PersistentCache_swigregister(PersistentCache)

Say I want to use this class or it’s methods, with things like:

 *args

as parameters, I cant know how many parameters I should pass nor what they should be, with what I have is it possible to find this out, so I can use the library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:29:49+00:00Added an answer on May 15, 2026 at 9:29 pm

    SWIG is a method of automatically wrapping up a C/C++ library so it can be accessed from Python. The library is actually a C library compiled as a DLL. The Python code is just pass-through code, all autogenerated by SWIG, and you’re right that it’s not very helpful.

    If you want to know what arguments to pass, you should not look at the Python code, you should look at the C code it was generated from — if you have it, or the documentation if not. If you don’t have any code or documentation for that library, then I think you’re going to have a very difficult time figuring it out… you should contact the vendor for documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have First/Last/Previous/Next buttons that change the selected child node of a TreeViewItem. Setting
A few quick searches discovered that I'm obviously not the first person to have
First of all I have to admit that my programming skills are pretty limited
I have an application that when it first starts i need it to run
I have a big project that was first created in Borland C++ 6. We're
I have never used unit testing before, so I'm giving CxxTest a go. I
I have never used virtualization, and am trying to get up to speed. My
I have just installed C# for the first time, and at first glance it
I have just installed boost for the first time on my Intel Mac, and
I have just built up my first SVN server, along with the mod_dav_svn module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.