Hey guys!I have a quick question, after I give a bit of background of myself.The languages I know include:HTML, CSS, JavaScript, PHP, Python, with a splash of knowledge on SQL.

So yeah, my programming background isn't the best. I plan on finishing SQL soon and then diving into either C++, Java, or Perl afterwards. I am not sure which one I will choose just yet.

So throughout all of my time learning these languages, (I may be using bad sources to learn from) I haven't been able to find a way to run or call on another program with a different extenstion to execute from within another.

For instance, if I had three files, test.py, test2.py, and test.pl in the same directory and tried the code below, it would not work. Assume the code below belongs to test.py and we run both python and perl as our choice for the program type. Of course the python program (test2.py) will work fine. The perl program, (test.pl) on the other hand will not. This is because it tries to pass the file and execute it as python. Does anyone know of a way to prevent this? It's been bugging me for a while now, and I want to get this stuff down better before tackling the programming challenges on this site.

program = raw_input("Which program type would you like to start?" + "\n")starting = "Starting program" + ": " + program if program == "python": print(starting) execfile("test2.py")elif program == "perl": print(starting) execfile("test.pl")else: print("Program type could not be found")

If possible, I need to know how to do this on a website. This will give it almost a GUI based feel, because it is running from the website. Such as having a input section for commands / parameters, and then a button to click that will execute the code. I am not sure if this is possible to do. If you know how you would go about making a GUI application that can run the different file types, that will work as well. In short, I know these languages, but I don't know how to bring them together or onto a single application or website. I wish to figure this out to test this on my apache server.

I have a .sh file that checks for loadbalancing, and perl script used to dos the site.First it should execute the .sh file, and if the condition (site loadbalancing == false) is met, it needs to run the perl script. This will be used on my own apache server on another local machine; strictly pen testing.

[Edit] I realized that I can use bash files with the following command:

When it comes to language choices you'll want to pick languages that are radically different. i.e., if you're a ruby guy you won't be learning as much from python vs something lower like C or assembly or something weird like erlang

When it comes to language choices you'll want to pick languages that are radically different. i.e., if you're a ruby guy you won't be learning as much from python vs something lower like C or assembly or something weird like erlang

Hey, Tgoe! Thanks for the response. I actually looked into and tried what you said above before, only to get fails, for reason I am not sure of... Hence why I thought it wasn't possible.

Aslo, I was looking into cgi and everything seemed well, until I went to my page after cgi-bin and I got a error message saying that I I was unable to access the page. Although that is due to my poor understanding of cgi-bin, so I will look into it a bit more so that I can fix it.

[Edit] I decided to take on C++ although so far it seems really similar to JavaScript and Python, with slight exceptions to syntax of course.

Thanks again,- Ninjex

Last edited by -Ninjex- on Sat Jan 19, 2013 7:46 pm, edited 1 time in total.

You have to be kiding me...It was just the permissions on the file, thanks again.I really didn't think about it because running the perl file on it's own was fine. Now I know that when trying to access a file from another I should check permissions and make sure it's executable.

I only tried to sudo because I was getting the permission denied error as you can see above.That's why I tried sudo after a regular run.

As for C++ I was looking at elance.com and C++ could come into handy...Seems pretty easy to learn anyways, due to it's similarity with JavaScript and Python (so far)

-Ninjex- wrote:You have to be kiding me...It was just the permissions on the file, thanks again.I really didn't think about it because running the perl file on it's own was fine. Now I know that when trying to access a file from another I should check permissions and make sure it's executable.

I only tried to sudo because I was getting the permission denied error as you can see above.That's why I tried sudo after a regular run.

As for C++ I was looking at elance.com and C++ could come into handy...Seems pretty easy to learn anyways, due to it's similarity with JavaScript and Python (so far)

I'm a bit tardy to the party, but based off of your background, I would actually suggest using Java and then moving over to C++, then C, then NASM. Because C++ is forced to be backwards compatible with C, it has a bit of a wonky syntax, and can't abstract everything to the level someone like you would be used to. However, Java doesn't follow such an odd paradigm, so it might feel a bit more like home to you.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook

centip3de wrote:I'm a bit tardy to the party, but based off of your background, I would actually suggest using Java and then moving over to C++, then C, then NASM. Because C++ is forced to be backwards compatible with C, it has a bit of a wonky syntax, and can't abstract everything to the level someone like you would be used to. However, Java doesn't follow such an odd paradigm, so it might feel a bit more like home to you.

Thanks, I have full days free to learning. I am at the point of OOP for C++ and still feels the same, so I could probably just switch to java and use a syntax reference when/if I need to program in C++

You and tgoe basically said the same, so I will move along to something new.

If you're understanding c++ now then don't switch to java just because cent suggested it. If anything Java will be easier after learning c++ than the other way around. C++ doesn't take care of garbage collection like Java does.

Also have no idea how you think python and c++ are similar.

The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.

fashizzlepop wrote:If you're understanding c++ now then don't switch to java just because cent suggested it. If anything Java will be easier after learning c++ than the other way around. C++ doesn't take care of garbage collection like Java does.

Also have no idea how you think python and c++ are similar.

Honestly to me, Python and C++ seem pretty similar, but I am weird so who knows...They are slightly different in their own ways, and I feel that c++ gives a bit more to work with.And maybe it's just me, but JavaScript, Python, and C++ feel pretty much the same in syntax.I will not drop C++, I think it is fun; I tried looking for good java tuts to come up empty handed. So in return, I just spent about 2 hours writting my first actual small program on C++ and decided to go ahead and finish seeing it through.I honestly do not see C++ taking me that long to figure out, so it shouldn't be long before I hop onto the java bandwagon anyways.