Comments (5)
I just finished submitting a pull-request seconds before getting this, looks similar, let me know what you think.
from cpal.
also, the parser is not an iterable item
from cpal.
Sys.argv is, no?
On Apr 1, 2014, at 5:40 PM, Yandy Ramirez [email protected] wrote:
also, the parser is not an iterable item
—
Reply to this email directly or view it on GitHub.
from cpal.
argparse library and sys.argv are way different.
argparse is meant to simplify command-line handling, not positional and can be required or optional.
if we use sys.argv, that's essentially a list of strings, so we're getting into manipulation of strings to find the place where -i is, where -m is and so forth.
something like
if sys.argv[1] == '-i' or sys.argv[1] == --ip_address:
self.address = sys.argv[2]
# 2 because 1 would be the position and 2 where the actual value you want would be,
# but that's hoping.
and you can see the chaining of if statements that would require, even if we put it in a for loop, it's not efficient, how many times do we need to iterate to find the actual values?
hence why I structured it the way I did.
from cpal.
Yup. I knew they were different, just not sure how. Have heard very good things about argpasrse though!
Will take a look later. Thanks.
On Apr 1, 2014, at 6:10 PM, Yandy Ramirez [email protected] wrote:
argparse library and sys.argv are way different.
argparse is meant to simplify command-line handling, not positional and can be required or optional.
if we use sys.argv, that's essentially a list of strings, so we're getting into manipulation of strings to find the place where -i is, where -m is and so forth.
something like
if sys.argv[1] == '-i' or sys.argv[1] == --ip_address:
self.address = sys.argv[2]2 because 1 would be the position and 2 where the actual value you want would be,
but that's hoping.
and you can see the chaining of if statements that would require, even if we put it in a for loop, it's not efficient, how many times do we need to iterate to find the actual values?
hence why I structured it the way I did.
—
Reply to this email directly or view it on GitHub.
from cpal.
Related Issues (11)
- Standardized classes for inter-vendor data structures HOT 9
- Arista eaAPI - show hostname HOT 5
- Using cpal as standalone program HOT 3
- Move device to it's own module (device.py) HOT 6
- changes to main.py --> device() as testing HOT 6
- Attribute License HOT 1
- What's the Plan? HOT 12
- Please consider an explicit license for the repo HOT 2
- Use a bit of Inheritance? - Open discussion HOT 3
- added: Initial command-line parsing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpal.