|
-
Sep 13th, 2006, 05:07 PM
#1
Thread Starter
Member
Help in python language!
Hi...
i have project in VB6 and i want to join with it python language..
So in Command prompt (DOS) i write this command:
C:\Documents and Settings>cd C:\python24
C:\Python24>buckwalter2unicode.py <infile.txt> outfile.txt
C:\Python24>
i think the run is done but i have message in outfile (notepade file) is:
(Must specify a file to use store the output! Aborting...)
and the output i want it can not be print in outfile..
please if any body Know the python language help me because i'm new in it...
thanks a lot
-
Sep 13th, 2006, 05:10 PM
#2
Re: Help in python language!
Why don't you visit some sort of Python forum??
-
Sep 13th, 2006, 05:40 PM
#3
Re: Help in python language!
 Originally Posted by gavio
Why don't you visit some sort of Python forum??
Why are you so mean to him?? lol. Just kidding. Yeah, or visit the other programing language section in the foums
My usual boring signature: Something
-
Sep 13th, 2006, 06:40 PM
#4
Re: Help in python language!
-
Sep 14th, 2006, 10:50 AM
#5
Re: Help in python language!
I know some Python. Did you write the script in question? If so, under which circumstances would you output that message? (Post code!) If not, read its documentation and possibly contact the author.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 14th, 2006, 10:54 AM
#6
Re: Help in python language!
 Originally Posted by bodoora
C:\Python24>buckwalter2unicode.py <infile.txt> outfile.txt
C:\Python24>
i think the run is done but i have message in outfile (notepade file) is:
(Must specify a file to use store the output! Aborting...)
and the output i want it can not be print in outfile..
Code:
C:\Python24>buckwalter2unicode.py outfile.txt <infile.txt
The program obviously wants the output file as a parameter.
If you get the same complaint about the input file, make it
Code:
C:\Python24>buckwalter2unicode.py infile.txt outfile.txt
Which way it should be depends on how the .py file is written - is it looking for keyboard input or a filename on the parameter list for input?
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Sep 23rd, 2006, 08:49 AM
#7
Thread Starter
Member
Re: Help in python language!
Hi... thanks for help
I used this code to get the data from (outfile.txt) file and also i want to run this data (file) in command prompt (DOS) by python code.
Code:
VB Code:
Private Sub GetData()
Dim tW As String
Dim tmp() As String
Dim Words() As String
Dim gloss() As String
Open "C:\buckwalter_morphan_1\data\outfile.txt" For Input As #1
tmp = Split(Input(LOF(1), 1), vbCrLf)
Close #1
Dim sLine As String
For x = 0 To UBound(tmp)
If UCase(Left(tmp(x), 10)) = " SOLUTION" Then
Words = Split(tmp(x), "(")
If UCase(Left(tmp(x + 1), 12)) = " (GLOSS)" Then
sLine = sLine & Left(Words(1), InStr(Words(1), ")") - 1)
gloss = Split(tmp(x + 1), "+")
sLine = sLine & " (" & Trim(gloss(1)) & ");"
Else
sLine = sLine & Left(Words(1), InStr(Words(1), ")") - 1) & ";"
End If
ElseIf UCase(Left(tmp(x), 12)) = " Comment" Then
Words = Split(tmp(x), ":")
sLine = sLine & Words(1)
ElseIf UCase(Left(tmp(x), 5)) = "INPUT" Then
If sLine <> "" Then
If Right(sLine, 1) = ";" Then
sLine = Left(sLine, Len(sLine) - 1)
End If
sLine = sLine & vbCrLf
End If
Words = Split(tmp(x), ":")
sLine = sLine & Trim(Words(1)) & ":"
ElseIf UCase(Left(tmp(x), 7)) = "LOOK-UP" Then
'nothing
End If
Next
Debug.Print sLine
WORDLIST = Split(sLine, vbCrLf)
End Sub
now i have this code but i don Know if it corect or not to open the DOS and run the outfile.txt by python code.. and if is ok where can i put it?
''open command prompt to run Python script
'Open Apath & "dos.bat" For Output As #1
'Print #1, "cd C:\python24"
'Print #1, "buckwalter2unicode.py -o outfile.txt"
'Close #1
'' ShellAndWait Apath & "dos.bat"
Shell Apath & "dos.bat"
please help...
Thanks a lot ..
Last edited by MartinLiss; Sep 23rd, 2006 at 10:06 AM.
-
Sep 23rd, 2006, 10:07 AM
#8
Re: Help in python language!
I added vbcode tags to your code to make it eaier to read.
-
Sep 23rd, 2006, 06:55 PM
#9
Re: Help in python language!
That's not at all helpful. The code you use to read the output is irrelevant if the Python script does not produce output.
This seems to have become a VB question in any case.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|