1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Python vs C# (Discussion)

Discussion in 'General Programming Chat' started by vebxperts, Sep 30, 2012.

Thread Status:
Not open for further replies.
  1. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    1- Can we use Python for web as well as desktop (GUI) programing or which of them?
    2- Do we have to install any Python related framework/libraries on a computer, where we want to run Python based program/application? Like we can't run a C# program on a computer with no .net framework installed in it. So, what about Python?
    3- Which is the best IDE for programing in Python?
    4- Web automation (webbrowser automation) is easy in Python or in C#? (which of these two deals better with AJAX etc)
    5- Python has bigger community or C#, on internet? (For support/help)
    6- Python coding is easier or C#? ( I am using C# so its easier for me, but I need to know about Python, as compared to C# source code writing)
    7- Which is the best IDE for Python programing that has maximum built-in widgets (components in visual studio) that can be just dragged and dropped to make a GUI.
    8- Are these IDE (with widget options) limited to windows platform or can work on any platform like linux, mac, win etc?

    Basically, I am a C# programer that's why most of my questions are about Python, as I have heard a lot about Python that's why thinking to switch if I can get a better clarification about the questions and some expert suggestions about which language is better (Python or C#). For desktop and for webbrowser programing!

    Please, I would like to know your recommendation as well! (Python or C#) for professional programming.

    Thanks
     
    Last edited: Sep 30, 2012
  2. closedCaption

    closedCaption Regular Member

    Joined:
    Oct 3, 2011
    Messages:
    289
    Likes Received:
    111
    1 - Yes you can, but building desktop stuff in Python enables end-user to fairly easy reach for Python scripts used by your application
    2 - There are ways to bundle Python interpreter and other libraries in one exe, so there is no need for end-user to perform such steps.
    3 - Aptana - http://www.aptana.com/products/studio3 or Eclipse + PyDev installed separately (it is installed in Aptana)
    4 - C# was browser component, so its easier with it. However, for more complicated stuff, people use sockets, and in that case difference is almost not existing.
    5 - C# has, but more funky and crazy stuff is done in Python (IMO).

    Why don't you first use best from both worlds and start with IronPython (Python interpreter made in .NET) scripting in your C# stuff? Some extensions might not work (those written in native C),
    but generally you will see how far can you get with each tool.
     
    • Thanks Thanks x 2
  3. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    1- You mean that user can easily get the source code of my Python application? If this is it, isn't there any possible way to keep it safe?
    4- I think, it's still not clear that C# is good for automation or Python!

    You are have suggested to use IronPython in .net I think if I do this, I'll have to use .net framework as well when running IronPython created program on any computer? True?

    Personally, you are programing in which language?
     
  4. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,155
    A user can get the code of any .NET language and python, so they 're both equally disadvantageous.
     
  5. carnage_100101

    carnage_100101 BANNED BANNED

    Joined:
    Feb 17, 2011
    Messages:
    240
    Likes Received:
    163
    C# is great for automation.Python might be a little easier to learn but in the end its a scripting language...If you want to make professional grade desktop apps stick to C#,Once you get really good at that you can move onto C,C++,etc so that your apps are cross platform.
     
  6. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    If this is the case then how to obfuscate and save our source code? There must be some solution, I think.

    Okay, I am working in C# from last few years, but why people say that use Python for bot creation (automation).
    I have developed software for automation of my office tasks in C# but I get stuck when I have to automate a page which has AJAX! It really annoys!
     
  7. sirgold

    sirgold Supreme Member

    Joined:
    Jun 25, 2010
    Messages:
    1,260
    Likes Received:
    645
    Occupation:
    Busy proving the Pareto principle right
    Location:
    A hot one
    4. False. There are several webbrowser bindings just like with c#... There's a simple way to use the IE via active x on windoze and there's webkit that's vastly superior in almost in every aspect, even gecko if you feel masochistic enough (or need some pesky unit testing to also work on firefox).. Bindings for selenium are always a possibility too but that's not a specific advantage since you can use them with c# as well ;) The real advantage is that it's ALL completely cross platform with python so I have the luxury of coding once, test/deploy/recompile wherever I need... That's ONLY a theoretical possibility with mono, since most of the winforms on mac and linux are slow, crash prone and buggy for automation especially when you have to manipulate more complex DOM, traversing xpath and so forth. And it's not like my cousin told me or I read it somewhere: I have a vast experience first hand.. ;) I code 90% of my bot/automation templates in python (there are so many libraries it's not even funny) according to an event driven paradigm and -sometimes but not necessarily- oop, that depends on the complexity of the bot itself... It personally cut my development cycles in half compared to c#. If I need to hack together a quick account creator for instance event driven procedural code (good ol' spaghetti code :D) is more than enough (think of a simple imacros with the js interface or ubot, to some extent very handy for simpler tasks...) If I need to give to code to a bunch of friends I'll make a quick binary the "easy way" with the tools already mentioned, but if I need to have a more solid solution I'll take the code I wrote (actual code and logic almost verbatim most of the time) and wrap it with c++ or c# (+ anti-reverse libraries) depending on what the situation calls for. As you certainly know as long as you have some code even compiled it's always possible to disassemble it but it takes some less trivial skills than the skid next door, if that's a concern and protecting your code a priority ;) HTH
     
  8. lisper

    lisper Newbie

    Joined:
    Aug 23, 2012
    Messages:
    44
    Likes Received:
    24
    Occupation:
    Lead developer of some German research project
    Location:
    Currently Brussels, Belgium
    Code in C++ if you are worried about someone lifting your code...
     
  9. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    @sirgold: Well, you wrote everything in one line lol!
    So, bottom line of your post is that Python is better than C# for desktop programing, for web automation using webbrowser and specially when it's about AJAX handling.
    Can you please add me on skype (It's mentioned with my beneath my BHW ID on top left side of this post.
    Or otherwise let me know your Skype ID and I'll add you for future reference/guidance/help regarding Python.
    Also, do you suggest Aptana or Eclipse? Or any other IDE where I can create GUI just like I can do it in visual studio (Drag and drop components into form)
     
    Last edited: Sep 30, 2012
  10. cgimaster

    cgimaster Power Member

    Joined:
    Jun 30, 2012
    Messages:
    525
    Likes Received:
    311
    Gender:
    Male
    Yes you can, for instance http://www.py2exe.org/index.cgi/Tutorial however just like C# its reversible so your best option would be to obfuscate it or create a web solution where the user doesnt have access to the source code but you.

    Some options to obfuscate your python code:
    http://freecode.com/projects/pyobfuscate
    https://github.com/astrand/pyobfuscate

    There is also an experimental one that converts it to c++ which might be the best option:
    http://code.google.com/p/shedskin/

    As for C# the visual studio comes with dotfuscator which is not that bad, but you have other options like smart assembly, crypto obfuscator but these are not free, I dont really like the free ones but there are some decent ones.

    Yes you need to install python compiler just like php and perl needs to otherwise it won't run. Same goes to C# however with C# most windows come with .Net 2 for example, and the most new ones comes with .Net 4 or higher. Its very rare I would say 80%+ of a chance the user already have the .NET Framework installed.

    It really depends on your taste, some people love notepad++ I myself love it for php and perl, however if you like more options like autocompletion, help on functions, etc you might be better of with a IDE like komodo etc.

    I've also heard good things about:
    http://code.google.com/p/pyscripter/
    http://www.jetbrains.com/pycharm/

    I would say C# since it already comes with web browser controls that you can use at easy. On python you did need something like selenium or similar solutions to do that.

    If I had to guess C# has a bigger community around, not only that but Microsoft has invested a lot recently to make a better MSDN for C# with a lot of samples and videos etc, on top of that you can find plenty of open sources projects to nitpick on github, assembla and so on.

    Python has a pretty simple way to write things however, it is hard to compare the 2 as python and c# were deloped with complete different goals.

    You can also take the http://udacity.com/ video class for python and see for yourself it is pretty easy to use.

    I've been doing scrap and several other type of automations and I can tell you that your MAIN FRIEND here will be a tool that can analyse the packets and lots of the cases you will barelly need a webbrowser to interact with a website be it ajax or flash or w/e if the requests are openly available with the packets and/or with the data you can view with firebug and similar addons.

    However when you can also do that with webbrowser control and other solutions like watin, selenium, etc they provide a fairly extensive API for this exact reason. You can track ajax request done or in progress, wait for a specific thing on the page before moving on and more.
     
    Last edited: Sep 30, 2012
  11. sirgold

    sirgold Supreme Member

    Joined:
    Jun 25, 2010
    Messages:
    1,260
    Likes Received:
    645
    Occupation:
    Busy proving the Pareto principle right
    Location:
    A hot one
    Well, I tend not to use js in my browsers so line breaks and new lines might get a tad messy when I post.. :D "Best" and "better" are always dicey terms to evaluate, let's just say that for my own needs I find python way faster to develop and far more versatile at deploy time for the reasons I already mentioned. If your market is windows only, for instance, you might find this latter point a negligible advantage... I use a simple editor with indentation/code highlighting depending on which OS I'm on the vast majority of which is linux so I find geany (any scintilla-based is equally great, imo) to be extremely cozy. On Win I always used notepad++ and on mac textmate for the bulk of the job. Might use qtdesigner if I have to hack together a gui or qtdevelop when I port my python templates to c++ or monodevelop for c#. I might fire visualstudio when on windows to compile the resulting projects, optimize the code for the specific platform, some added intellisense fun. But if I don't end up coding and compiling the final creature in c++ I find the os-dependent optimizations kinda negligible due to the nature of these automations and I'm generally fairly happy with the speed of x-platform toolchains. That kinda makes sense for most bytecode/IL "binaries" opposed to native ones. YMMV, as always ;)
     
  12. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    Which is best GUI programing IDE for python? (with widgets)
     
  13. lisper

    lisper Newbie

    Joined:
    Aug 23, 2012
    Messages:
    44
    Likes Received:
    24
    Occupation:
    Lead developer of some German research project
    Location:
    Currently Brussels, Belgium
    BTW the best IDE for python is clearly VIM. Use it and abuse it :)
     
  14. s0ap

    s0ap Executive VIP Jr. VIP Premium Member

    Joined:
    Sep 23, 2008
    Messages:
    230
    Likes Received:
    810
    Occupation:
    :] guess
    Location:
    Congo/DRC
    I code in 1970s-style ANSI-C every day and I wouldn't recommend anyone use it unless you know exactly what you are doing and why you need it. This holds true (though to a lesser extent) for all the bastardized derivatives like C++, C#, objective C, etc.

    C# is a definite deal breaker for me as Microsoft will always be the driving force behind the language for better or for worse; with the internal shifts associated with the Windows 8 release I wouldn't put anything mission-critical on any MS driven product until that whole fiasco and the new API stabilizes. Actually I wouldn't put anything mission-critical with them ever, but that is a story for another day. While there is theoretical cross-platform support with Mono and whatever else the amount of dependencies you have to bring in to build/compile on a Linux box is retarded. Personally I develop IDE-free on Linux with vim and gdb, which is pretty easy to emulate with Python. That is more of a preference thing however.

    You might also take a look at Ruby, one of the smartest guys I know migrated to it exclusively and he loves it.
     
  15. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    Well, after your suggestion, I have searched about VIM on google and I am unable to find any widgets for VIM like I have downloaded glade 3.6.1 as it has widgets (controls, like button, frame, canvas etc).
    Also any recommended book for web automation in python (if possible its download link, if available :D )
     
  16. closedCaption

    closedCaption Regular Member

    Joined:
    Oct 3, 2011
    Messages:
    289
    Likes Received:
    111
    1 - Yes, end user can easily get your source code, but there are also exceptionally good decompilers for .NET apps. C# wins marginally here.
    4 - C# is somewhat faster and has more stuff "inline" even though as sirgold mentioned, Python is more versatile but harder to start with.

    Yes, for running IronPython you need .NET framework.

    If you are going for a long run, use Python.

     
  17. vebxperts

    vebxperts Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 15, 2008
    Messages:
    1,657
    Likes Received:
    339
    Okay, I have seen that Qt IDE is great though its not free :( Is there any IDE (Free) near to this, QT IDE and designer please?
    This IDE's name is PyCharm! (which is really charming)
     
    Last edited: Oct 1, 2012
  18. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,155
    PyCharm is great, it 's from the same company that created PHPStorm, my all time favorite PHP IDE.

    It 's not an interface designer - just code, code, code :p
     
  19. nileearls

    nileearls BANNED BANNED

    Joined:
    Aug 15, 2011
    Messages:
    260
    Likes Received:
    6
    any one who can design a automation im for sites pm me.
    i want to purchase
     
  20. valentinas25

    valentinas25 Regular Member

    Joined:
    May 7, 2010
    Messages:
    404
    Likes Received:
    114
    There are method to get python code of software,but of course there are solutions too,as there are created games with python(i0m talking about big games that earned millions)
     
Thread Status:
Not open for further replies.