How to write a simple program in Python (opening files and parsing text)

    Question by:
    On

    Topics:

    Greetings:

    I recently was asked to become familar with Python.  I figure the best way to do that is to take a simple application in C/C++ and make it work in Python.  Hence, my questions are these:

    1)  What makes Python different from C/C++?
    2)  Will Python perform the same basic functions as C/C++ like opening files and string manipulations
    3)  Is there an editor available for download that will enable me to test a product or do I need to purchase one?

    Thanks
    Good Question?
    0

    Featured Post

    Course: Foundations of Front-End Development

    Jump-start a lucrative career in front-end web development, with zero previous coding experience required. This course covers the basic programming concepts and languages required for creating engaging websites from scratch.

    Top Expert Contributor

    Essential articles and videos from the Experts

    Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

    More valuable questions with Expert answers

    Question: Hello everybody... I am building some kind of small virtual printer with python. I read all data coming from a serial port in ASCII format and I can save into a file the prints coming. I'd need to find a method to correctly separate one...

    Answer: You should probably detect control characters related to the Start of TeXt (STX) and End of TeXt (ETX) -- see https://en.wikipedia.org/wiki/Control_character , for example.

    Question: I am analyzing the additions and deletions to a previous customer order. The analysis produces a summary COUNTER evaluation - for example, added = ({10: 3, 11: 5, 12: 8, 13: 5}) - where the keys are the course numbers ordered and the values...

    Answer: Is the source code really the code, that you execute? The error message (the back trace) does not seem to match your code. I don't see a call to confirmpurchase() in line 300 According to the error message you seem to call the function ...

    Question: I'm a Python developer but not a Django developer. I'm trying to get a feel for how, and how difficult, it would be to change the attached code from accepting JPGs files via the API to accepting PDF files. Currently it errors when accepting...

    Answer: Ok. Considering the code that you have presented, I would say that 8 hours should be enough. The breakdown for this effort would be something like this: - 2 hours for RCA (Root Cause Analysis) - 0.5 hours for unit test planning - 3 hours coding...

    Question: Running SQLServer 2014 Express on Windows 7. When i run netstat -aon i do not see 1433 included in the list of ports. When I try testing from a laptop with telnet machine 1433 there is no connection, but if i telnet machine 3306 or some of the...

    Answer: The connect more probably is tsql -H Axum\SQLExpress -U sa -P Imaster but only if the instance name is SQLExpress. You should go and look into the MSSQL installation of that server to make sure a) SQL Browser runs, if there is any port used...

    201601-LO-Qu-076

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    serialband

    1,184

    Solutions

    Expert in:

    • Mac OS X
    • Apple OS
    • Linux
    • Apple Hardware
    • Apple Networking

    eoinosullivan

    2,288

    Solutions

    Expert in:

    • Mac OS X
    • Apple Hardware
    • Apple OS
    • Apple Software
    • Apple Networking

    slobaray

    34

    Articles

    195

    Solutions

    Expert in:

    • Oracle Database
    • Databases-Other
    • Python

    pepr

    5

    Articles

    1,115

    Solutions

    Expert in:

    • Python
    • C++
    • Programming-Other
    • Programming Languages-Other
    • Scripting Languages

    Pasha Kravtsov

    2

    Articles

    40

    Solutions

    Dototot

    Raghu Mutalikdesai

    1

    Articles

    75

    Solutions

    RELATED TOPICS view all topics

    1. Scripting Languages
      (26,207)
    2. Programming-Other
      (51,581)
    3. Programming Languages-Other
      (19,530)
    4. Linux
      (63,896)
    5. Perl
      (25,904)
    6. MySQL Server
      (46,026)
    7. Shell Scripting
      (9,628)
    8. PHP
      (116,383)
    9. VB Script
      (35,969)
    10. Java
      (98,154)