Doubt C and Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • praba kar

    #1

    Doubt C and Python

    Dear All,
    I want to know the link between c and python.
    Some people with C background use Python instead
    of programming in C.why?



    regards
    Prabahar






    _______________ _______________ _______________ _______
    Send a rakhi to your brother, buy gifts and win attractive prizes. Log on to http://in.promos.yahoo.com/rakhi/index.html
  • James

    #2
    Re: Doubt C and Python

    > Some people with C background use Python instead[color=blue]
    > of programming in C.why?[/color]

    Becuase it is much more efficient.

    -James

    Comment

    • Will McGugan

      #3
      Re: Doubt C and Python

      praba kar wrote:[color=blue]
      > Dear All,
      > I want to know the link between c and python.
      > Some people with C background use Python instead
      > of programming in C.why?
      >[/color]

      Because I can create software many times faster. And its more fun.

      Will McGugan
      --
      z6mg人生就是博官方网站【✅ ZL5.NET ✅】 始终秉持“技术引领、用户至上”的核心理念,致力于构建全球领先的安全公平、稳健高效的数字娱乐殿堂。我们引入金融级防护体系与 24/7 全时金牌客服,为您的每一份热爱保驾护航。平台汇聚精品真人、竞技棋牌、经典彩票及巅峰体育等全品类内容,支持移动与 PC 端无缝切换。高清丝滑的交互界面,让您随时随地开启极致奢华的娱乐盛宴。

      Comment

      • Sybren Stuvel

        #4
        Re: Doubt C and Python

        Will McGugan enlightened us with:[color=blue]
        > Because I can create software many times faster. And its more fun.[/color]

        Same here. And because it's very easy to write unittests, for
        instance.

        Sybren
        --
        The problem with the world is stupidity. Not saying there should be a
        capital punishment for stupidity, but why don't we just take the
        safety labels off of everything and let the problem solve itself?
        Frank Zappa

        Comment

        • Jeff Schwab

          #5
          Re: Doubt C and Python

          praba kar wrote:[color=blue]
          > Dear All,
          > I want to know the link between c and python.
          > Some people with C background use Python instead
          > of programming in C.why?[/color]

          For me, the choice is typically among C++, Perl, Python, and Java. The
          arguments for Python relative to these languages are:

          1. Python's standard library includes a lot of functionality not in the
          C++ standard library.

          2. Python's syntax is the cleanest of these languages.

          3. I don't have to compile Python, so I can test changes much more
          quickly that with C++ or Java.

          4. System calls made from Python are more likely to be portable among
          the platforms I use most (WindowsXP, AIX, Linux, and MacOSX) than system
          calls from C++.

          5. Scripting is easier in Python than in Java, particularly with regard
          to environment variables and process control.

          Of course, these are only my opinions. I am particularly not an expert
          on Python or Java.

          Comment

          • Guest's Avatar

            #6
            Re: Doubt C and Python

            On 23 Aug 2005 01:22:31 -0700
            James wrote:
            [color=blue][color=green]
            > > Some people with C background use Python instead
            > > of programming in C.why?[/color]
            >
            > Becuase it is much more efficient.[/color]

            It's rather because _they_ are much more efficient (that is, with Python).

            --
            jk

            Comment

            • Grant Edwards

              #7
              Re: Doubt C and Python

              On 2005-08-23, praba kar <prabapython@ya hoo.co.in> wrote:
              [color=blue]
              > I want to know the link between c and python.
              > Some people with C background use Python instead
              > of programming in C.why?[/color]

              Because C is a dangerous, low-level language unsuitable for
              general-purposed application programming.

              I use C for:

              1) Real-time, embedded stuff where memory is measured in KB
              rather than MB.

              2) Device drivers where the other choice is assembly.


              --
              Grant Edwards grante Yow! I will invent "TIDY
              at BOWL"...
              visi.com

              Comment

              • Wouter van Ooijen

                #8
                Re: Doubt C and Python

                > I want to know the link between c and python.

                Apart from the fact that the inner part of Python is written in C I
                know no link?
                [color=blue]
                > Some people with C background use Python instead
                >of programming in C.why?[/color]

                I use Python when my time is most valuable (in most cases it is), in
                the very few cases the computer's time is more valuable I write in
                C/C++.


                Wouter van Ooijen

                -- ------------------------------------

                Webshop for PICs and other electronics

                Teacher electronics and informatics

                Comment

                • Wouter van Ooijen

                  #9
                  Re: Doubt C and Python

                  >For me, the choice is typically among C++, Perl, Python, and Java. The[color=blue]
                  >arguments for Python relative to these languages are:
                  >[/color]

                  add: I develop on my platform (which happens to be XP, but that is
                  irrelevant), I put the Python source on my website, and I never worry
                  about the platform my users will be using. An those users don't need
                  to know how to compile a program, it will just run.
                  Wouter van Ooijen

                  -- ------------------------------------

                  Webshop for PICs and other electronics

                  Teacher electronics and informatics

                  Comment

                  • Terry Hancock

                    #10
                    Re: Doubt C and Python

                    On Tuesday 23 August 2005 06:28 am, Will McGugan wrote:[color=blue]
                    > praba kar wrote:[color=green]
                    > > I want to know the link between c and python.
                    > > Some people with C background use Python instead
                    > > of programming in C.why?[/color][/color]

                    For the same reason that people acquainted with assembly
                    language nevertheless chose to write software in C. It is a
                    higher level language.

                    That generally translates to:

                    1) Gettng much more done in much less time.

                    2) Being able to think about the problem at a more
                    abstract level, and not getting befuddled with trivia.

                    3) Fewer bugs (there is a claim that bugs are directly
                    proportional to lines of code, so that any language that
                    allows you to get the job done with fewer LOC will also
                    allow you to do it with fewer bugs).

                    4) The result is usually slower and bulkier, being less
                    hand optimized.

                    1,2, & 3 are definitely advantages.

                    4 is a disadvantage, but there are reasons not to worry
                    about it:

                    * CPU time and memory progress rapidly enough
                    that wasting expensive programmer time on reducing
                    them is often a poor trade.

                    * The claim that a Human can optimize code better than
                    the compiler assumes a very smart and talented Human,
                    and/or a very dumb compiler. Compilers are getting smarter,
                    and since a lot more people find the need to program, the
                    average programmer is not that talented. I'm pretty I'm
                    not, for example -- I'll take my chances with the compiler. ;-)

                    Cheers,
                    Terry

                    --
                    Terry Hancock ( hancock at anansispacework s.com )
                    Anansi Spaceworks http://www.anansispaceworks.com

                    Comment

                    • michael

                      #11
                      Re: Doubt C and Python

                      On Tue, 23 Aug 2005 06:15:03 +0100, praba kar wrote:
                      [color=blue]
                      > Dear All,
                      > I want to know the link between c and python.
                      > Some people with C background use Python instead
                      > of programming in C.why?
                      >
                      >
                      >
                      > regards
                      > Prabahar
                      >
                      >
                      >
                      >
                      >
                      >[/color]
                      Just my $.02

                      I am a long time c/c++ programmer (by profession). I fell in love with
                      python about 2 years ago. I use python for many things now, and I always
                      have said, "When it is too slow, I will write it in c++".

                      I have not hit that point yet. For some reasons that are hard to explain,
                      even though python "should" be slower and maybe even is sometimes, it
                      never is an issue.

                      One reason is that python has so much better data structures built in, and
                      THEY are written in C, I end up with faster code. For example, if I am
                      doing a bunch of string compares in C, I would use a dictionary in python.
                      Python ends up faster because I can get to a better algorithm FASTER.

                      The other reason is that so many times, a hardware I/O device is really
                      the limiting factor (such as a hard disc, or a serial/network connection,
                      or waiting for the user).

                      I have found that GUI programs written in python/wxpython to be every bit
                      as fast as pure C++. I guess you could say that because the LIBRARIES of
                      python are in C, and because you are never very far from a library call,
                      you end up running C code a large percentage of the time, even when you
                      are writing in Python.

                      My advice is to just TRY python and resolve the "slow" speed if you ever
                      hit it. I never have and I write a lot of code, even hardcore math and
                      image processing (See PIL - python Imaging Library).

                      Michael


                      Comment

                      • Uwe Schmitt

                        #12
                        Re: Doubt C and Python

                        >[color=blue]
                        > On Tue, 23 Aug 2005 06:15:03 +0100, praba kar wrote:
                        >[color=green]
                        > > Dear All,
                        > > I want to know the link between c and python.
                        > > Some people with C background use Python instead
                        > > of programming in C.why?
                        > >
                        > >
                        > >
                        > > regards
                        > > Prabahar
                        > >
                        > >
                        > >
                        > >[/color]
                        > Just my $.02
                        >
                        > I am a long time c/c++ programmer (by profession). I fell in love with
                        > python about 2 years ago. I use python for many things now,
                        > and I always
                        > have said, "When it is too slow, I will write it in c++".
                        >
                        > I have not hit that point yet. For some reasons that are hard
                        > to explain,
                        > even though python "should" be slower and maybe even is sometimes, it
                        > never is an issue.[/color]

                        I made the same experience. The only reason I have for using C++
                        is number crunching. And I love boost python for building the bridge.

                        Greetings, Uwe.


                        Comment

                        • James Kim

                          #13
                          Re: Doubt C and Python

                          Jeff Schwab wrote:[color=blue]
                          > 5. Scripting is easier in Python than in Java, particularly with
                          > regard to environment variables and process control.
                          >
                          > Of course, these are only my opinions. I am particularly not an expert
                          > on Python or Java.[/color]

                          Note that for Java experts, Jython can be used for interpreting works.
                          Jython has the same grammer to Python, or CPython, and is also able to
                          call Java codes very simply.

                          See, for example: http://www.jython.org/docs/usejava.html

                          -James (^o^)

                          Comment

                          • James Kim

                            #14
                            Re: Doubt C and Python

                            Wouter van Ooijen (www.voti.nl) wrote:[color=blue]
                            > I use Python when my time is most valuable (in most cases it is), in
                            > the very few cases the computer's time is more valuable I write in
                            > C/C++.[/color]

                            In cases when the computer's time is more valuable, why not use CPython
                            with C/C++ API? Only most time consuming parts can be replaced to C/C++
                            codes so as to increase the speed up to native C/C++ programs).

                            -James (^o^)

                            Comment

                            • Wouter van Ooijen

                              #15
                              Re: Doubt C and Python

                              >> I use Python when my time is most valuable (in most cases it is), in[color=blue][color=green]
                              >> the very few cases the computer's time is more valuable I write in
                              >> C/C++.[/color]
                              >
                              >In cases when the computer's time is more valuable, why not use CPython
                              >with C/C++ API? Only most time consuming parts can be replaced to C/C++
                              >codes so as to increase the speed up to native C/C++ programs).[/color]

                              That assumes that one knows which are the most time-consuming parts,
                              that they are few (which is typically, but not always, the case) and
                              that they are 'fit' to be transferred to the C/C++ domain. The one
                              application I have written the last few years that probably would not
                              be fit to this approach is a compiler (Jal). It spends most of its
                              time walking the annotated syntax tree, with a lot of code
                              contributing rather evenly to the CPU time.

                              Don't take me wrong, IIRC that is the *only* PC program I have written
                              the last few years for which I selected the language and the language
                              was not Python :)

                              But I mainly program PICs. Where is the 10F200 Python interpreter when
                              you need one?


                              Wouter van Ooijen

                              -- ------------------------------------

                              Webshop for PICs and other electronics

                              Teacher electronics and informatics

                              Comment

                              Working...