![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 4
Rep Power: 0
![]() |
Anyone ever see an assembly program that could run python scripts?
*Insert what title said here*. I'd like to use that to create a command shell for the OS i'm working on. It'd be quite useful to have a high level language to program command line utilities and the command line itself for my operating system... Though unlikely, I figured I'd ask about this...
__________________
DevPortal - My website! |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Well, the standard Python interpreter is programmed in C, which compiles into machine code. What's preventing you using that?
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
An eecutable python file named helloworld (no .py extension or "python" command preceding the name is required) could look like the following and be executed after it was chmod'd to 777 on the bash linux shell:
#!/usr/bin/python -w print "Hello, this is python!";
__________________
|
|
|
|
|
|
#4 |
|
Professional Programmer
|
You really have no idea how to get an operating system off the ground do you, Datalisk.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
#5 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
when writing an operating system, you don't start with writing a command shell - it's kind of your final program. Writing a python interpreter comes even later. Writing includes more than only the visual stuff. Much more.
|
|
|
|
|
|
#6 |
|
Professional Programmer
|
Much much much much much, much much, much much much, much more.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|