User Profile
Collapse
-
Hurray! It was the "\n" at the end of the input... I've chomped it and now it's ok. Thanks a lot. -
hello again, thanks for trying to help! My code (well, relevant parts):
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...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";
Leave a comment:
-
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... -
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 (:Leave a comment:
-
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 (: )Leave a comment:
-
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! -
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?Leave a comment:
-
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... -
I think this is just what I mean, will put it to test very soon.
Thanks a lot!Leave a comment:
-
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!...Leave a comment:
-
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!
No activity results to display
Show More
Leave a comment: