Results 1 to 9 of 9

Thread: Help in python language!

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2006
    Location
    Arabian Gulf
    Posts
    46

    Question 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

  2. #2

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Help in python language!

    Quote 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

  4. #4

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Help in python language!

    Quote 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

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2006
    Location
    Arabian Gulf
    Posts
    46

    Question 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:
    1. Private Sub GetData()
    2.     Dim tW As String
    3.     Dim tmp() As String
    4.     Dim Words() As String
    5.     Dim gloss() As String
    6.     Open "C:\buckwalter_morphan_1\data\outfile.txt" For Input As #1
    7.     tmp = Split(Input(LOF(1), 1), vbCrLf)
    8.     Close #1
    9.     Dim sLine As String
    10.     For x = 0 To UBound(tmp)
    11.          
    12.         If UCase(Left(tmp(x), 10)) = "  SOLUTION" Then
    13.             Words = Split(tmp(x), "(")
    14.             If UCase(Left(tmp(x + 1), 12)) = "     (GLOSS)" Then
    15.                 sLine = sLine & Left(Words(1), InStr(Words(1), ")") - 1)
    16.                 gloss = Split(tmp(x + 1), "+")
    17.                 sLine = sLine & " (" & Trim(gloss(1)) & ");"
    18.             Else
    19.                 sLine = sLine & Left(Words(1), InStr(Words(1), ")") - 1) & ";"
    20.             End If
    21.         ElseIf UCase(Left(tmp(x), 12)) = "     Comment" Then
    22.             Words = Split(tmp(x), ":")
    23.             sLine = sLine & Words(1)
    24.         ElseIf UCase(Left(tmp(x), 5)) = "INPUT" Then
    25.             If sLine <> "" Then
    26.                 If Right(sLine, 1) = ";" Then
    27.                     sLine = Left(sLine, Len(sLine) - 1)
    28.                 End If
    29.                 sLine = sLine & vbCrLf
    30.             End If
    31.             Words = Split(tmp(x), ":")
    32.             sLine = sLine & Trim(Words(1)) & ":"
    33.         ElseIf UCase(Left(tmp(x), 7)) = "LOOK-UP" Then
    34.             'nothing
    35.         End If
    36.     Next
    37.     Debug.Print sLine
    38.     WORDLIST = Split(sLine, vbCrLf)
    39. 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.

  8. #8

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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
  •  



Click Here to Expand Forum to Full Width