Saturday, December 31, 2011

Re: startproject will NOT work.

At 2011-12-31 15:01:39 -0800, Chris Kavanagh wrote:
> On Dec 31, 11:58 am, Bart Nagel <> wrote:
> > What about other Python programs? Do they have the same problem?
> >
> > Put this next paragraph in a file and run it with different numbers of
> > arguments and see what happens.
> >
> > import sys
> > print "%d arguments" % len(sys.argv)
> >
> > Save it as
> >
> > Run
> >     python
> >     python arg1
> >     python arg1 arg2
> As far as other programs, I'm not sure. I'm not a programmer (just
> learned Python over the last few months) so I haven't tried any other
> programs yet.
> Ok, so save the paragraph in a file, then run the commands from the
> command line EXACTLY as you have them? In other words, from command
> line, type in Python, then python arg1, and python
> arg 2??
> Forgive my ignorance, working from the command line with this stuff is
> new to me. And I've never understood exactly what command line args
> are. . .But I'm learning.

The command line is the dream, you'll come to love it. Well, maybe not
the Windows one.

I guess first up just run
and see if you get the interactive Python shell. Or maybe you need
since you're on Windows? Anyway, if you get the shell, the python
executable is in your path and works to at least some extent. If you
don't get the shell, and you get "command not found" or something (I
don't have a Windows box so I don't know exactly what it would look
like) you may need to use the full path to the executable, as people
before have suggested.

So those two lines ("import..." and "print...") make a very simple
Python script which just outputs the number of arguments it thinks it
was given.

Invoke the script with Python just as you're meant to do for the
Django script. On linux I just run
and it tells me "1 arguments". If I run
python something
it tells me "2 arguments" and so on.

What behaviour do you get?

The point of this is that if this python script can see the arguments
then I can see absolutely no reason why your script
would not see them, and I would be stumped.


You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment