Le Mardi 06 Juin 2006 08:36, Fredrik Lundh a écrit :
> > *26. You observed that some of your group members are fiddling with your
> > file "myfile" and you wanted to remove the read permission to your
> > group. How do you do? (1)
>
> >>> os.chmod("myfile.txt", 0404)
rather,
>>> os.chmod("myfile
Fredrik Lundh wrote:
>> *24. Display recent 10 java files, (with *.java extension) , in
>> descending order by time, latest to oldest time. (1) *
>
> >>> files = sorted(glob.glob("*.py"), key=os.path.getmtime)[-10:]
> >>> files.reverse()
(to display the files, use print)
--
http://mail.py
Carlos Lopez wrote:
> Please help i am losing my mind ... UNIX Newbee
>
> *23. How do you add a line to the end of an existing file "myfile" with
> date stamp. (1) *
>>> f = open("myfile", "a+")
>>> f.write(datestamp)
>>> f.close()
> *24. Display recent 10 java files, (with *.java extension
Please help i am
losing my mind ... UNIX Newbee
23. How do you add a line to the end of an existing file "myfile" with
date stamp. (1)
Ans : /home/clopez ed test.txt $a The last line of text. . w
q
24. Display recent 10 java files, (with *.java extensi
Another option is zsh, which is very much like bash, but better ;)
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote:
>* To create an empty __init__.py file I do 'vim __init__.py' then
>immediately exit vim, is there a shell or vim command which will create
>an empty file without opening the editor?
man touch
>* If I want to do :
>
On Sat, Mar 25, 2006 at 03:45:56AM -0800, Gerard Flanagan wrote:
[...]
> * If I want to do :
>
> mv mypackage-1.0.2.tar.gz subdir/mypackage-1.0.2.tar.gz
>
> then tab-completion gives me the first occurrence of the file, but I
> have to type the second occurrence - is there a way of
> * I'm using the tcsh shell and have no problems with it, but bash seems
> more popular - any reason to change? (I don't intend writing many shell
> scripts)
You can do this in bash:
$ python myprog > stdout.txt 2> stderr.txt
and have output to sys.stdout and sys.stderr go in separate files.
> * If I want to do :
>
> mv mypackage-1.0.2.tar.gz subdir/mypackage-1.0.2.tar.gz
>
> then tab-completion gives me the first occurrence of the file, but I
> have to type the second occurrence - is there a way of not having to
> type it?
No need to give it the name the second time.
Gerard Flanagan:
>* To create an empty __init__.py file I do 'vim __init__.py' then
>immediately exit vim, is there a shell or vim command which will create
>an empty file without opening the editor?
touch __init__.py
>* cd ~ brings me to my home directory, is there a means by which I can
>set up
Hello all
Some basic unix questions which pure laziness prevents me from googling
for. Anyone feeling charitable? I'm using FreeBSD 6.0:
* To create an empty __init__.py file I do 'vim __init__.py' then
immediately exit vim, is there a shell or vim command which will create
an empty file without
11 matches
Mail list logo