User Profile

Collapse

Profile Sidebar

Collapse
peruron
peruron
Last Activity: Aug 27 '08, 08:51 AM
Joined: Aug 16 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • peruron
    replied to arguments problem
    in Perl
    Hurray! It was the "\n" at the end of the input... I've chomped it and now it's ok. Thanks a lot.
    See more | Go to post

    Leave a comment:


  • peruron
    replied to arguments problem
    in Perl
    hello again, thanks for trying to help! My code (well, relevant parts):

    Code:
    my $serial = $ARGV[0];
    my $newVal = $ARGV[1];
    ...
    print "you're about to edit ".$serial.". If it's ok, press 1, otherwise press 0\n";
    At this point, I think, the scripts takes the ARGV as input, or at least, won't wait for me to give input, but moves on and fails later. I've tried to empty ARGV, but wasn't...
    See more | Go to post

    Leave a comment:


  • peruron
    started a topic arguments problem
    in Perl

    arguments problem

    Hello!

    I'm working on a short perl script that receives 2 arguments in the command line (or at least, that's what I'd like it to do), and puts them in variables. Afterwards, the script should pop a question and wait for user input. My problem is, that it looks like one of the arguments is being taken as input, so the script won't wait for input, and later fail.

    Can anyone please tell me how can I make @ARGV invisible...
    See more | Go to post

  • Okay, thanks, but I think we have a little misunderstandin g: I'm interested in searching for a certain string inside the files, and not as a path name. If I understood correctly the glob module, it searches a given path.
    My purpose is a bit more than academic - I'm trying to convert people to Python (:
    See more | Go to post

    Leave a comment:


  • peruron
    replied to What is your OS and Python Version
    I'm using Linux Red Hat and using Python 2.1.1 (I know, I know, but it's work. At home I'm running Ubuntu and Python 2.5, I think (: )
    See more | Go to post

    Leave a comment:


  • peruron
    started a topic Searching a string in a multiple-file directory

    Searching a string in a multiple-file directory

    Hello again!

    I've been discussing the advantages of Python over C-Shell. I was asked if I can replace the use of "grep" in searching for a specific string in a multi-file directory - I have to go through all the files, and find all the occurrences of a specific string.
    Can anyone suggest an idea?

    Thanks!
    See more | Go to post

  • peruron
    replied to search to see if a file exists
    I've tried to use import os.path and then use "exists", but I get NameError: "NameError: name 'exists' is not defined"

    As the path I wrote the file name itself, since it's located as the same directory as the script: exists(FileName )

    Does anyone has an idea what is the problem here?
    See more | Go to post

    Leave a comment:


  • peruron
    started a topic using command line arguments

    using command line arguments

    Hello again!

    I've been trying to make my code more generic, and one of the things I want to do is to use a given file name, which can change (in the command line) instead of using a specific name.
    My code looks like:

    def func1
    bla bla bla

    def func2
    bla bla bla

    main code.

    My questions are:
    Should I name the main code "main" in...
    See more | Go to post

  • peruron
    replied to python interactive scripts?
    I think this is just what I mean, will put it to test very soon.
    Thanks a lot!
    See more | Go to post

    Leave a comment:


  • peruron
    replied to python interactive scripts?
    That absolutely great! I saw the C-Shell equivalent... (:
    Will it be correct (syntax-wise) to insert the whole thing in a "while" loop, until I get "y" or "n" from the user?


    Thanks again!...
    See more | Go to post

    Leave a comment:


  • peruron
    started a topic python interactive scripts?

    python interactive scripts?

    Hello!

    I wanna create a script that goes through a file, and changes whatever relevant fields. This part isn't problematic, but I've decided to add another feature to it - instead of just changing the field, I want to ask the user if he's interested in doing so before every change takes place.
    Is there an option in python to communicate with the user while running?

    Thanks very much!
    See more | Go to post
No activity results to display
Show More
Working...