Differences between revisions 4 and 5
Revision 4 as of 2022-09-26 09:02:56
Size: 249
Editor: CarissaAba
Comment:
Revision 5 as of 2022-09-26 15:27:45
Size: 2037
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
My name is Carissa Abate. I life in Kobenhavn K (Denmark).<<<BR>>
><<<BR>>
>
<<<BR>>
><<<BR>>
>
Look into my web site; [[https://www.reddit.com/r/FashionReps/comments/uwwh3g/review_of_my_order_from_judy/|lululemon define jacket pink lychee]]
Use attribute '''ctypes_com_server''' of method '''setup''' to create a com dll server.
Unlike the case with win32com, with ctypes.com only a dll server will be created.
Also see: [[Py2exeAndWin32com]] & [[Py2exeAndCtypesComExeServer]]

You can define and instantiate a '''Target''' class to explicitly add
version info resources that get attached to the file as metadata.

file '''setup.py''' would look something like this:
{{{
#!python
# This is the distutils script for creating a Python-based com dll
# server using ctypes.com. This script should be run like this:
#
# % python setup.py py2exe
#
# After you run this (from this directory) you will find two directories here:
# "build" and "dist". The .dll file in dist is what you are looking for.
##############################################################################

from distutils.core import setup
import py2exe
import sys

class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the version info resources (Properties -- Version)
        self.version = "0.0.1"
        self.company_name = "my company"
        self.copyright = "© 2006, my company"
        self.name = "my com server name"

my_com_server_target = Target(
    description = "my com server",
    # use module name for ctypes.com dll server
    modules = ["dir.my_com_server"],
    # the following line embeds the typelib within the dll
    other_resources = [("TYPELIB", 1, open(r"dir\my_com_server.tlb", "rb").read())],
    # we only want the inproc (dll) server
    create_exe = False
    )

setup(
    name="my_com_server",
    # the following two parameters embed support files within dll file
    options={"py2exe": {"bundle_files": 1, }},
    zipfile=None,
    version="0.0.1",
    description="my com server",
    # author, maintainer, contact go here:
    author="First Last",
    author_email="some_name@some_company.com",
    packages=["dir"],
    ctypes_com_server=[my_com_server_target]
    )
}}}

Use attribute ctypes_com_server of method setup to create a com dll server. Unlike the case with win32com, with ctypes.com only a dll server will be created. Also see: Py2exeAndWin32com & Py2exeAndCtypesComExeServer

You can define and instantiate a Target class to explicitly add version info resources that get attached to the file as metadata.

file setup.py would look something like this:

   1 # This is the distutils script for creating a Python-based com dll
   2 # server using ctypes.com.  This script should be run like this:
   3 #
   4 #  % python setup.py py2exe
   5 #
   6 # After you run this (from this directory) you will find two directories here:
   7 # "build" and "dist".  The .dll file in dist is what you are looking for.
   8 ##############################################################################
   9 
  10 from distutils.core import setup
  11 import py2exe
  12 import sys
  13 
  14 class Target:
  15     def __init__(self, **kw):
  16         self.__dict__.update(kw)
  17         # for the version info resources (Properties -- Version)
  18         self.version = "0.0.1"
  19         self.company_name = "my company"
  20         self.copyright = "© 2006, my company"
  21         self.name = "my com server name"
  22 
  23 my_com_server_target = Target(
  24     description = "my com server",
  25     # use module name for ctypes.com dll server
  26     modules = ["dir.my_com_server"],
  27     # the following line embeds the typelib within the dll
  28     other_resources = [("TYPELIB", 1, open(r"dir\my_com_server.tlb", "rb").read())],
  29     # we only want the inproc (dll) server
  30     create_exe = False
  31     )
  32 
  33 setup(
  34     name="my_com_server",
  35     # the following two parameters embed support files within dll file
  36     options={"py2exe": {"bundle_files": 1, }},
  37     zipfile=None,
  38     version="0.0.1",
  39     description="my com server",
  40     # author, maintainer, contact go here:
  41     author="First Last",
  42     author_email="some_name@some_company.com",
  43     packages=["dir"],
  44     ctypes_com_server=[my_com_server_target]
  45     )

Py2exeAndCtypesComDllServer (last edited 2022-09-26 15:27:45 by JimmyRetzlaff)