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
primer on scientific programming with python, beginner help (ch 4, command line)
Started by albertblank, Jul 28 2011 08:24 PM
1 reply to this topic
#1
Posted 28 July 2011 - 08:24 PM
|
|
|
#2
Posted 28 July 2011 - 10:20 PM
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


Sign In
Create Account

Back to top









