Code Monkey home page Code Monkey logo

Comments (5)

yandy-r avatar yandy-r commented on September 28, 2024

I just finished submitting a pull-request seconds before getting this, looks similar, let me know what you think.

from cpal.

yandy-r avatar yandy-r commented on September 28, 2024

also, the parser is not an iterable item

from cpal.

jedelman8 avatar jedelman8 commented on September 28, 2024

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.

yandy-r avatar yandy-r commented on September 28, 2024

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.

jedelman8 avatar jedelman8 commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.