Модераторы: Partizan, gambit
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Python и C# 
:(
    Опции темы
Poison80
Дата 19.1.2006, 14:38 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 25
Регистрация: 14.9.2005

Репутация: нет
Всего: нет



Собсвенно в сабже вапрос.. кто знает как это сделать... раньше я в с++ без проблем мог подключать скрипты на питоне ... а вот как это на .НЕТ да и еще с С# забабахать?!
PM MAIL   Вверх
arilou
Дата 19.1.2006, 14:44 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Великий МунаБудвин
****


Профиль
Группа: Экс. модератор
Сообщений: 2646
Регистрация: 15.7.2004
Где: город-герой Минск

Репутация: 21
Всего: 61



Есть такая штука: http://boo.codehaus.org/

По синтаксису вроде совместима с Питоном и работает с .NET'ом.


--------------------
user posted imageuser posted image
PM WWW ICQ   Вверх
Poison80
Дата 19.1.2006, 14:53 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 25
Регистрация: 14.9.2005

Репутация: нет
Всего: нет



не то , совсем не то
Цитата

Boo is a new object oriented statically typed programming language for the Common Language Infrastructure with a  python  inspired syntax and a special focus on language and compiler extensibility.


а мне нужно запускать имеено питоновски скрипты из моей проги.
PM MAIL   Вверх
arilou
Дата 19.1.2006, 15:01 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Великий МунаБудвин
****


Профиль
Группа: Экс. модератор
Сообщений: 2646
Регистрация: 15.7.2004
Где: город-герой Минск

Репутация: 21
Всего: 61





--------------------
user posted imageuser posted image
PM WWW ICQ   Вверх
Poison80
Дата 19.1.2006, 17:40 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 25
Регистрация: 14.9.2005

Репутация: нет
Всего: нет



нарыл таки шото вроде похожее
Python.Net

Цитата

Embedding Python

Note: because Python code running under Python for .NET is inherently unverifiable, it runs totally under the radar of the security infrastructure of the CLR so you should restrict use of the Python assembly to trusted code.

The Python runtime assembly defines a number of public classes that provide a subset of the functionality provided by the Python C API.

These classes include PyObject, PyList, PyDict, etc. The source and the unit tests are currently the only API documentation.. The rhythym is very similar to using Python C++ wrapper solutions such as CXX.

At a very high level, to embed Python in your application you will need to:

    * Reference Python.Runtime.dll in your build environment
    * Call PythonEngine.Intialize() to initialize Python
    * Call PythonEngine.ImportModule(name) to import a module

The module you import can either start working with your managed app environment at the time its imported, or you can explicitly lookup and call objects in a module you import.

For general-purpose information on embedding Python in applications, use www.python.org or Google to find © examples. Because Python for .NET is so closely integrated with the managed environment, you will generally be better off importing a module and deferring to Python code as early as possible rather than writing a lot of managed embedding code.

Important Note for embedders: Python is not free-threaded and uses a global interpreter lock to allow multi-threaded applications to interact safely with the Python interpreter. Much more information about this is available in the Python C API documentation on the www.python.org Website.

When embedding Python in a managed application, you have to manage the GIL in just the same way you would when embedding Python in a C or C++ application.

Before interacting with any of the objects or APIs provided by the Python.Runtime namespace, calling code must have acquired the Python global interpreter lock by calling the PythonEngine.AcquireLock method. The only exception to this rule is the PythonEngine.Initialize method, which may be called at startup without having acquired the GIL.

When finished using Python APIs, managed code must call a corresponding PythonEngine.ReleaseLock to release the GIL and allow other threads to use Python.

The AcquireLock and ReleaseLock methods are thin wrappers over the unmanaged PyGILState_Ensure and PyGILState_Release functions from the Python API, and the documentation for those APIs applies to the managed versions.

PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Прежде чем создать тему, посмотрите сюда:
mr.DUDA
THandle

Используйте теги [code=csharp][/code] для подсветки кода. Используйтe чекбокс "транслит" если у Вас нет русских шрифтов.
Что делать если Вам помогли, но отблагодарить помощника плюсом в репутацию Вы не можете(не хватает сообщений)? Пишите сюда, или отправляйте репорт. Поставим :)
Так же не забывайте отмечать свой вопрос решенным, если он таковым является :)


Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, mr.DUDA, THandle.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Общие вопросы по .NET и C# | Следующая тема »


 




[ Время генерации скрипта: 0.0769 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.