Le Sunday 29 June 2008 22:32:23 David, vous avez écrit :
> Cédric Lucantis wrote:
> > Well, you're asking the user to enter -1 after the raw_input, so if the
> > file exists your script will just print 'File exists... -1 to quit' and
> > open it anyway. See my previous post for a better way of hand
Cédric Lucantis wrote:
Well, you're asking the user to enter -1 after the raw_input, so if the file
exists your script will just print 'File exists... -1 to quit' and open it
anyway. See my previous post for a better way of handling it, but in your
case you should at least do something like t
Le Sunday 29 June 2008 21:53:17 David, vous avez écrit :
> Dave Kuhlman wrote:
> > On Sat, Jun 28, 2008 at 08:11:03PM -0400, David wrote:
> >> Hi, I am very new to python and it is my first attempt at programing
> >> except for some basic bash scripts. I came up with this;
> >> #!/usr/bin/python
>
Dave Kuhlman wrote:
On Sat, Jun 28, 2008 at 08:11:03PM -0400, David wrote:
Hi, I am very new to python and it is my first attempt at programing
except for some basic bash scripts. I came up with this;
#!/usr/bin/python
import os
filename = raw_input('Enter the filename: ')
fobj = open(filen
Le Sunday 29 June 2008 21:18:31 Dave Kuhlman, vous avez écrit :
> On Sat, Jun 28, 2008 at 08:11:03PM -0400, David wrote:
> > Hi, I am very new to python and it is my first attempt at programing
> > except for some basic bash scripts. I came up with this;
> > #!/usr/bin/python
> >
> > import os
> >
On Sat, Jun 28, 2008 at 08:11:03PM -0400, David wrote:
> Hi, I am very new to python and it is my first attempt at programing
> except for some basic bash scripts. I came up with this;
> #!/usr/bin/python
>
> import os
> filename = raw_input('Enter the filename: ')
> fobj = open(filename, 'w')
>
wesley chun wrote:
The first line, the import of the 'os' module, is superfluous: it's
not being used.
oops, good catch danny... i didn't even see that.
Python won't let you break any laws of gravity. But there are a lot
of good people here on Tutor who will be happy to be of ass
> The first line, the import of the 'os' module, is superfluous: it's
> not being used.
oops, good catch danny... i didn't even see that.
> Python won't let you break any laws of gravity. But there are a lot
> of good people here on Tutor who will be happy to be of assistance
> when the pro
>> #!/usr/bin/python
> >
> > import os
> > filename = raw_input('Enter the filename: ')
> > fobj = open(filename, 'w')
> > yourname = raw_input('What is your name: ')
> > fobj.write(yourname)
> > fobj.close()
> >
> > It seems to work Ok, I was shocked! Is it OK?
Hi David,
The fir
> Hi, I am very new to python and [...] came up with this;
> #!/usr/bin/python
>
> import os
> filename = raw_input('Enter the filename: ')
> fobj = open(filename, 'w')
> yourname = raw_input('What is your name: ')
> fobj.write(yourname)
> fobj.close()
>
> It seems to work Ok, I w
Hi, I am very new to python and it is my first attempt at programing
except for some basic bash scripts. I came up with this;
#!/usr/bin/python
import os
filename = raw_input('Enter the filename: ')
fobj = open(filename, 'w')
yourname = raw_input('What is your name: ')
fobj.write(yourname)
fobj.
11 matches
Mail list logo