5 Replies - 888 Views - Last Post: 07 April 2013 - 10:14 PM

#1 Ratman2050  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-September 07

Creating my first API, need input on outlining the process

Posted 06 April 2013 - 12:41 PM

I'm a relatively new CS student and so far I've learned Python and am currently learning C/C++. I would like to gain some real world knowledge and apply what I've learned to better myself as a programmer so I want to create an API for free for someone I know.

Here is what I need done: I have a website that uses a contact form where people submit information (in this case, a bunch of math equations). The equations are stored and then sent to a script using Python which grabs the equations from the backend of the site and then sends them to a software that actually computes the equations.

Here is my initial outline of creating the API along with my questions:

1. Create a script using Python to communicate with the site backend and grab the equations entered in the front end contact form.
Q: I am not sure how to communicate using Python (an OS based language) to work with say PHP (a website language)...should I be using something like Django/Web.py? Also, I assume the python script will be stored in the websites directory, how will I be able to get it to communicate with the software on another computer?

2. After the python script grabs the data/equations, it sends them to the appropriate software.
Q: For this process, should the script save the equations in a text file and then send them to the software or directly send them to the software? What do you think is a better/easier idea? Also, how can I have Python communicate with an open source software, is it possible to make a python program to run another program written in C++ (the computing software is written in C++)?

I just need some guidance on how to visualize the entire process as I've never written an actual real world program before with so many variables but I really want to do this to learn more.

Any input is greatly appreciated, thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Creating my first API, need input on outlining the process

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5581
  • View blog
  • Posts: 11,934
  • Joined: 02-June 10

Re: Creating my first API, need input on outlining the process

Posted 06 April 2013 - 12:49 PM

Would someone show me how to build my program? - Read this article
Was This Post Helpful? 0
  • +
  • -

#3 Ratman2050  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-September 07

Re: Creating my first API, need input on outlining the process

Posted 06 April 2013 - 01:05 PM

View PosttlhIn`toq, on 06 April 2013 - 01:49 PM, said:



I'm not asking anyone to write my code for me, nor do I need anyone to design it for me. I already created the design, all I'm asking are a few questions that lead me to use the right tools to get this job done.

For example, I ask how you can use Python on a website, using Django or web.py, what would be better for this task or if there is another solution altogether.

Another example,

"Also, how can I have Python communicate with an open source software, is it possible to make a python program to run another program written in C++ (the computing software is written in C++)?"

Here I'm basically asking is it even possible to have one program run another program that are written in two diff languages? I have no idea whether its possible nor did anyone teach us something like this in school.

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3622
  • View blog
  • Posts: 11,290
  • Joined: 05-May 12

Re: Creating my first API, need input on outlining the process

Posted 07 April 2013 - 09:27 PM

I'm still lost on the API part. How is what you are designing an Application Programming Interface? What are the inputs? What are the outputs? How is the call made? I'm sorry if it sounds like a stupid question. I just can't get past the API part, because nothing you've described so far has sounded like an API.
Was This Post Helpful? 0
  • +
  • -

#5 Ratman2050  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-September 07

Re: Creating my first API, need input on outlining the process

Posted 07 April 2013 - 09:43 PM

View PostSkydiver, on 07 April 2013 - 10:27 PM, said:

I'm still lost on the API part. How is what you are designing an Application Programming Interface? What are the inputs? What are the outputs? How is the call made? I'm sorry if it sounds like a stupid question. I just can't get past the API part, because nothing you've described so far has sounded like an API.


Hmm, I thought it was like an API because it communicates with a website and then with software on a computer through one pythonic program.

The inputs would be information submitted to a website which would probably be stored in a DB or file on the backend of the website. The output would be that same information being transferred to a program which runs on a computer.

Sorry for the confusion.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3622
  • View blog
  • Posts: 11,290
  • Joined: 05-May 12

Re: Creating my first API, need input on outlining the process

Posted 07 April 2013 - 10:14 PM

Following that logic, then the Windows/DOS 'type', the *nix 'cat' commands would be APIs. They can read a file and transfer the contents to the console.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1