Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jul 20th, 2006, 4:44 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 936
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Serial Communication: BASIC to Python

This thread is essentially a continuation of this one; however, my problem now is translating BASIC code to Python.

I got ahold of a small piece of BASIC code someone was using to communicate with the device I described which connected to the serial port:

INPUT ; "Enter filename to save data- ", outfile$
OPEN outfile$ FOR OUTPUT AS #1

OPEN "COM1:9600,O,7,1" FOR RANDOM AS #2
PRINT #2, "01,TEMP?"
INPUT #2, A$, B$
INPUT #2, C$, D$, E$, F$

PRINT #1, TIME$, C$, D$, E$, F$
If it's possible to do this in just a few lines of BASIC code, it doesn't make sense to me that it should require an entire module (eg, PySerial) to do the same thing in Python. Is there a simpler way to translate this? Thanks for any input.
titaniumdecoy is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[tutorial] Python for programming beginners coldDeath Python 30 Dec 14th, 2005 12:35 PM
Advanced Python Tricks Arevos Python 19 Sep 24th, 2005 8:39 AM
[ANN] New script engine (Basic sintax) MKTMK C++ 3 Sep 1st, 2005 6:51 PM
Python - A Programmers Introduction coldDeath Python 17 Aug 19th, 2005 1:41 PM
Serial Communication Automatik C++ 2 May 19th, 2005 10:30 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:10 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC