Jump to content

primer on scientific programming with python, beginner help (ch 4, command line)

- - - - -

  • Please log in to reply
1 reply to this topic

#1
albertblank

albertblank

    Newbie

  • Members
  • Pip
  • 2 posts
I started a few weeks ago with (actually learning) programming by installing python and numpy, chapter 4.1 was easy, but I got stuck on chapter 4.2, 'reading from the command line'

I know the command line is the 'input' from the command prompt/interactive shell, but I can't get my head around what you actually do with the code

import sys
C = float(sys.argv[1])

etc.

In fact, I'm not even sure how this is supposed to work at all for command line interface! How does the code work in practice?

I skipped the rest of chapter 4 and read most of chapter 5 without doing any exercises in those 2 chapters so far, but it didn't reference ch 4 at all (didn't look at the curve plotting stuff). How long until chapter 4 becomes relevant in the book? what's it important for?

thanks

#2
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 890 posts
  • Location:::1
Perhaps with example you'll get a more clear picture; I have a tree script to which I can pass arguments; I can say which directory to list, or with no arguments it will list current directory, and I can even filter out (by extension or partial name match) files.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users