Thread: Python 3

  1. #1
    Registered User FourAngels's Avatar
    Join Date
    Aug 2015
    Location
    Canada
    Posts
    130

    Python 3

    Does Python in any way reduce the need to use shell scripts? I see that it is possible to use c/c++ with Python, it is called Cython. I was not able to confirm but I think that even though Python 2.x. is packaged with Ubuntu, the /use/bin/python3 command is available but not default. There appears to be a lot of data analysis done with Python. How seemless is the c/c++ and python merger? It also looks like Qt is available to Python programs.Has anyone used these languages together?

  2. #2
    spaghetticode
    Guest
    Quote Originally Posted by FourAngels View Post
    Does Python in any way reduce the need to use shell scripts?
    I am not sure what exactly you're aiming at here. Can you re-ask your question a little more specific?

    Quote Originally Posted by FourAngels View Post
    I see that it is possible to use c/c++ with Python, it is called Cython.
    I am not sure if you got things right here. You can use C / C++ together with Python, since the Python Interpreter is written in C and has a special interface for connecting C-Code. Cython is some kind of a different programming language derived from Python and is mainly used for integrating C libraries into your Python programs.

    However, since all of the stuff has been written in C, integration should be completely seemlessly. I have no experience with it though, I can only answer theoretically.

  3. #3
    Registered User FourAngels's Avatar
    Join Date
    Aug 2015
    Location
    Canada
    Posts
    130
    Python has been around for a long time and although I was once fluent in the c language and had basic knowledge of c++, I did not pay attention to python but instead considered learning gtk+. It looks like python has made progress into areas involving data analysis, there are many books on O'Reilly, looks like fun, and I was not aware that c is the foundation for python. Perhaps python 3 is kind of constricting c/c++ programmers and spider people as it is starting to appear in all kinds of areas. Okay so cython is more on the python side than the c/c++ side if python is the language using the wrappers however since when do languages with different capabilities work together in the same program. I don't think I've heard of that before. I don't know about python either except that it is an object oriented language.

  4. #4
    spaghetticode
    Guest
    Quote Originally Posted by FourAngels View Post
    however since when do languages with different capabilities work together in the same program. I don't think I've heard of that before. I don't know about python either except that it is an object oriented language.
    That's not so uncommon. Python aims at being easy to read and at providing very, very high level tools. Providing a C interface gives you the power to a) extend the language to your specific needs and b) to give you an easy way to go for the speed of C if needed in certain areas of your project. To me that's a logic idea in order to combine both, productivity and freedom. In fact, all those 'game engines' and GUI toolkits do the very same thing.

  5. #5
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    Quote Originally Posted by FourAngels View Post
    Does Python in any way reduce the need to use shell scripts?
    You can use Python as a shell scripting language. Usually you just put the following at the top of your script:

    Code:
    #!/usr/bin/env python
    
    #... (shell script goes here)
    Make the program executable. Voila. A shell script.

  6. #6
    Registered User FourAngels's Avatar
    Join Date
    Aug 2015
    Location
    Canada
    Posts
    130
    The snake has shed its skin a third time, and now it might consume c/c++, however I glanced over the book, Effective Modern C++ recently and it looks like there is no way to handle c++. Who is the dragon slayer! We need to find out while there is still time or else this snake will be everywhere and c++ will be nowhere.

  7. #7
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Python will not kill C++.

  8. #8
    Registered User FourAngels's Avatar
    Join Date
    Aug 2015
    Location
    Canada
    Posts
    130
    I have not had time to do much investigation, however I thought that I read that Python has now made it's way into the worlds stock trade system. It is used to run the financial investment sector. I started to look up just a couple of things. I just started to notice that this wyrm has grown to a greater proportion and I am not sure what to think about it. What side am I on.

  9. #9
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by FourAngels View Post
    The snake has shed its skin a third time, and now it might consume c/c++
    Pft. No GCed language is going to displace C++. Besides, Python 3 has been out for a while, and it would have already done so if it was going to.

  10. #10
    spaghetticode
    Guest
    Plus Python has a completely different domain. This is not war, this is about specialized tools for different jobs. I get the impression FourAngels read one John Grisham novel too much.

  11. #11
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Personally, I'm not a huge fan of Python. I guess one of the better things about Node.js is that I won't have to use Python if I wanted to write some sort of a quick and dirty script. I also like how Node's console.log() works with an actual terminal console.

  12. #12
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Nice avatar MutantJohn. We should start a group

  13. #13
    Registered User FourAngels's Avatar
    Join Date
    Aug 2015
    Location
    Canada
    Posts
    130
    That snake is going to put an aweful squeeze on the economy, it is starting to run the stock market.

  14. #14
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by FourAngels View Post
    That snake is going to put an aweful squeeze on the economy, it is starting to run the stock market.
    World wide stock markets need to perform real-time data analysis 24h/day. They are some of the most performance critical systems you can imagine. There is no way Python will ever "run the stock market". At most, and that is probably what you heard, Python has been introduced here or there as a support scripting language for reporting and non critical data analysis, for which it excels.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  15. #15
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Mario F. View Post
    World wide stock markets need to perform real-time data analysis 24h/day. They are some of the most performance critical systems you can imagine. There is no way Python will ever "run the stock market". At most, and that is probably what you heard, Python has been introduced here or there as a support scripting language for reporting and non critical data analysis, for which it excels.
    Yeah, I was gonna say...

    Also, isn't exact arithmetic more popular in the world of finance? Good luck doing that with Python...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Difference between Python 2 and Python 3?
    By OMG its Ali in forum Tech Board
    Replies: 3
    Last Post: 03-18-2014, 08:06 PM
  2. Python to C++
    By adr in forum C++ Programming
    Replies: 2
    Last Post: 12-07-2011, 03:37 PM
  3. python to c
    By ali.franco95 in forum C Programming
    Replies: 3
    Last Post: 09-06-2011, 06:57 AM
  4. C and Python
    By alexnb185 in forum Tech Board
    Replies: 5
    Last Post: 04-11-2008, 11:11 PM
  5. Python
    By mart_man00 in forum Tech Board
    Replies: 7
    Last Post: 10-06-2003, 07:24 AM