Hi,
I at trying to create a bunch of text files in a single directory on a
Linux system,
something like this.
import os
routers = ['adnc-6321', 'adnp-2341', 'adnw-2632']
for i in routers:
os.system('/bin/touch' %s) % i
of course this dosn't work.
Is there a simple way to get this done?
Thanks for the detailed explanation. I read it and understood a bit. Rest in the leisure time.
Enjoy the recipes..
Regards,
Asrar
On 10/5/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
Asrarahmed Kadri wrote:> What is this??? I cannot understand a single character.. Explain this in
> length
Doug Potter wrote:
> Hi,
>
> I at trying to create a bunch of text files in a single directory on a
> Linux system,
> something like this.
>
> import os
>
> routers = ['adnc-6321', 'adnp-2341', 'adnw-2632']
>
> for i in routers:
> os.system('/bin/touch' %s) % i
I think you're close, just
# This program emulates the diff command of UNIX
import sysfrom stringCompare import stringcmp # this is a module which has stringcmp function that compares two strings
fname1 = raw_input("Enter a file name to be read:\t")
fname2 = raw_input("Enter a file name to be read:\t")
fd1 = open(fname1
Hi,
Your program does not emulate the diff command of
Unix.
Please do a diff in unix and experience
yourselves.
Where is cmp_res = stringcmp(string1[i],string2[i])
stringcmp() function
written?
Moreover, if you Python Documentation install
(or python.org accessible) search for diffli
Doug Potter wrote:
> Hi,
>
> I at trying to create a bunch of text files in a single directory on a
> Linux system,
> something like this.
>
> import os
>
> routers = ['adnc-6321', 'adnp-2341', 'adnw-2632']
>
> for i in routers:
> os.system('/bin/touch' %s) % i
>
> of course this dosn't w
Some general thoughts:
> import sys
> from stringCompare import stringcmp # this is a module which has
> stringcmp
>
> fname1 = raw_input("Enter a file name to be read:\t")
> fname2 = raw_input("Enter a file name to be read:\t")
>
> fd1 = open(fname1,"r")
> fd2 = open(fname2,"r")
>
>
> done = F
Thanks Alan, but can you please explain me what this line does:
diff = [t1==t2 for t1,t2 in zip(line1,line2)].index(False)
On 10/6/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
Some general thoughts:> import sys> from stringCompare import stringcmp # this is a module which has
> stringcmp>> fname1
Can anyone direct me to some documentation on how to take variables
from one py script, execute and pass them to another script? Then I
need to get data back from the executed script? I've been searching
Google and I see information, but I am in need of some examples...
Thanks!
-Joehttp://www.d
I am writing a simple program and in that I want to add some sort of interactiveness.
I have designed a menu which gives the user an option to select one out of the following four keys: d, l, n or e.
Can any one tell me how to determine which key has been pressed by the user.
Thanks.
Regards,
Bennett, Joe wrote:
> Can anyone direct me to some documentation on how to take variables from
> one py script, execute and pass them to another script? Then I need to
> get data back from the executed script? I've been searching Google and I
> see information, but I am in need of some examples.
hi all, I would like to create a class that specializes Python
dictionary. I would like an instance of this class to store
objects representing html form data, and I would like to have an
instance of this Data_Set class be able to use the Python dictionary
method pop to remove objects as I see fit
> Thanks Alan, but can you please explain me what this line
> does:
> diff = [t1==t2 for t1,t2 in zip(line1,line2)].index(False)
>
I'll unfold it somewhat:
mix = zip(a,b)
produces a list of tuples:
[(a1,b1)(a2,b2),(a3,b3)]
t1 == t2
produces a boolean result either True or False
Asrarahmed Kadri wrote:
>
>
> I am writing a simple program and in that I want to add some sort of
> interactiveness.
> I have designed a menu which gives the user an option to select one
> out of the following four keys: d, l, n or e.
> Can any one tell me how to determine which key has been
[EMAIL PROTECTED] wrote:
> hi all, I would like to create a class that specializes Python
> dictionary. I would like an instance of this class to store objects
> representing html form data, and I would like to have an instance of
> this Data_Set class be able to use the Python dictionary metho
15 matches
Mail list logo