Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 15th, 2004, 10:44 AM
DevHims DevHims is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 27 DevHims User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Python + COM, problem?

Hii Everybody,

Actually i am not much with COM developement. I want to make sure before get into deeply.

My requirement is to send and retrieve data from Vb to ptyhon. I dodnot know any way to do it. Then i thought of COM development in Python and use it in VB classes.

If i develope COM server in python & use VB as COM client, then can i use it in VB to send and retrieve data from python to VB and VB to python?

Can anybody provide some example or refernece or suggestion? Everything is welcome.

Thanks.

DevHims

Reply With Quote
  #2  
Old June 15th, 2004, 11:26 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 3 m 4 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Examples no since i've never used VB although as for COM you will need Mark Hammond's Win32all module - although its well worth having this installed if you on Windows, even if you never use COM.

http://starship.python.net/crew/mhammond/

You might also want to look at the VB2Py project but this seems to be more for GUI than anything. I could be wrong!

http://vb2py.sourceforge.net/

Hope this helps,

Mark.
__________________
programming language development: www.netytan.com Hula


Last edited by netytan : June 15th, 2004 at 11:29 AM.

Reply With Quote
  #3  
Old June 15th, 2004, 11:44 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,226 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 23 h 35 m 17 sec
Reputation Power: 263
You can do it all from the docs that comes with Win32All, but the docs are fairly sparse, as you have probably found out already.

I highly recommend getting hold of a copy of the book "Python Programming on Win32" by Mark Hammond and Andy Robinson. It covers using Python and COM in depth, including examples of both Python as COM servers and clients, and calling a Python COM server from VB.

Dave - The Developers' Coach

Reply With Quote
  #4  
Old June 16th, 2004, 09:30 AM
DevHims DevHims is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 27 DevHims User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Thanks Guys. I really appriciate your help. I have vry few days to finish it. so, i will go with documantation comes with win32all. I hope everything works out.

Still i need one more suggestion. Which one is good/fast/appropiate to develop? COM server in VB or COM server in Python?
My requirement is to provide enduser facility to write code in python and use data from VB. Python script develop by enduser will use by my program developed in VB at runtime.

Thanks again.

DevHims

Reply With Quote
  #5  
Old June 16th, 2004, 09:43 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 3 m 4 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
As mentioned i've never used VB but it really depends on which you are more comfortable with.

Imagine a C programmer who has done nothing else for say a year and you hand him a project to be done in Python. It will probably be faster for him to write it in C, even though Python programs are about 4 times shorter .

Good luck,

Mark.

Reply With Quote
  #6  
Old June 17th, 2004, 02:07 PM
DevHims DevHims is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 27 DevHims User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Hey Mark,

I do not have any clue how to transfer data from VB to Python or Python To VB even if u use COM. Because everytime you create Instance of COM server, it is new object. It can not access data which is created by another COM client. I tried using Both Python and VB for COM Server.

what i want is to provide functionality to user to write script in python and access data whcih are available at runtime of my VB application. For that i have to provide common interface between VB and Python, so user can access data which are available at run time.

Using COM, whichevr is COM client either VB or Python, it creates new instance and using that instance it can not get runtime data which are created by another COM client or which currently available.

Do u have any idea? or any suggestion for this. I have very less time to finish this.

DevHims

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Python + COM, problem?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT