Answer the question
In order to leave comments, you need to log in
How to get data from 1C from a python script?
In general, the task is to extract data from 1C using Python.
Platform 1C 8.3, SCP 1.3.
To begin with, I would like to understand how, for example, you can bypass all entries in the Nomenclature Directory and return their values (for example, output to the console).
I establish a COM connection with the 1C base using V83.COMConnector:
#coding=cp1251
import pythoncom
import win32com.client
V83_CONN_STRING = 'File="C:\\Users\\user\\Documents\\InfoBase\\";Usr="Иванов Иван";Pwd="123456";'
pythoncom.CoInitialize()
V83 = win32com.client.Dispatch("V83.COMConnector").Connect(V83_CONN_STRING)
q = '''
Пример запрса???
'''
query = V83.NewObject("Query", q)
selection = query.Execute().Choose()
Answer the question
In order to leave comments, you need to log in
q = '''
ВЫБРАТЬ
Номенклатура.Наименование КАК NAMENOM,
Номенклатура.Код КАК KODNAME
ИЗ
Справочник.Номенклатура КАК Номенклатура
'''
query = V83.NewObject("Query", q)
sel = query.Execute().Choose()
while sel.next():
print(sel.NAMENOM)
print(sel.KODNAME)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question