现实世界计划如何运作? [英] how does a real world program work ?

查看:72
本文介绍了现实世界计划如何运作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经学习了python的概念,可以在其中做一些编码。我正在寻找的是创建一个真实的基于GUI的程序。其中计划创建程序文本,然后将其转换为GUI wxpython。


所以在我开始之前我想清除我的概念/疑惑:

1)创建单片程序的最佳方式是什么(如同Linux内核一样)或者像微内核(所有服务器相​​互通信以形成单个程序或操作系统) of Mach内核)?


2)是否有基于上述内容的真实世界示例或开源项目,我可以将其引向。

3)创建基于文本的程序然后转换为GUI是一种好的编程方式吗?


4)查看基于GUI的跨平台程序,是wxpython正确的方法?


5)当菜单驱动时,使用什么函数将相同文件夹中的文件调用到相应的选择文件。


示例:


c:\ myprog \ mainmenu.py

c:\ myprog\menu_option1.py

c:\ myprog\menu_option1.py


print" \\ \\ n主菜单:

打印-----------"


#打印菜单:

打印请输入选项:"

print" 1 - menu_option1"

print" 5 - menu_option2"



#输入功能都提示用户输入并取出...

input_choice = int(输入("> " ))



如果input_choice == 1:

print(" menu_option1 choosen")

打印(我如何调用menu_option2.py)

else:

print(" menu_option2 choosen")

打印(我如何调用menu_option2.py)



任何帮助都会很精彩。在此先感谢!

hello people,
Im have learned python''s concepts and can do a fair bit of coding in it. What I''m looking at is to create a real world GUI based program. Of which is plan to create the program text based and then convert it to GUI wxpython.

So before I did go ahead with that I thought of clearing my concepts/doubts:
1) what is the best way to create a program monolithic(Like in the Linux kernel all in one) or like the Micro Kernel (All servers communicating with each other to form a single program or Operating system in the case of the Mach kernel)?

2) Are there any real world examples or open source projects based on the above, which I could be directed towards.?

3) Is creating the programs Text based and then converting to GUI a good way to program ?

4) looking a cross-platform GUI based program, is wxpython the right way to go?

5) When going Menu Driven what function to use to call a file within the same folder to the corresponding choice file.

example:

c:\myprog\mainmenu.py
c:\myprog\menu_option1.py
c:\myprog\menu_option1.py


print "\nMain Menu:"
print "-----------"

# Print out the menu:
print "Please enter choice:"
print "1 - menu_option1"
print "5 - menu_option2"


# The input function both prompts the user for input and fetches it...
input_choice = int(input( "> " ))



if input_choice == 1:
print("menu_option1 choosen")
print("how do i call menu_option2.py")
else:
print("menu_option2 choosen")
print("how do i call menu_option2.py")


Any help would be wonderful. Thanks in advance!

推荐答案

好的!我不知道能不能帮助的人是否已经查看了这个问题。


但是我找到了我对第5个问题的回答,其中包括:


temp_file_path =" c:\\myprog\\menu_option1.py"

temp_file_path =" c:\\myprog \\\ \\ menu_option1.py"



这就是它的调用方式,但如果有人有更好的建议,我们将不胜感激。因为这仍然是静态的,我正在寻找一个动态的解决方案。



print" \ nMain Menu:"

打印-----------"


#打印菜单:

打印请输入选项:" ;

打印" 1 - menu_option1"

打印" 5 - menu_option2"


temp_file_path =""


#输入功能都会提示用户输入并提取它...

input_choice = int(输入(">"))

temp_file_path =" c:\\myprog\\menu_option1.py"

execfile(temp_file_path)



如果input_choice == 1:


else:

temp_file_path =" c:\\myprog\\menu_option2.py" ;

execfile(temp_file_path)


再次感谢!
Ok! I don''t Know if the people who can help have viewed the question or not.

but I''v found my answer to my 5th question, which is:

temp_file_path="c:\\myprog\\menu_option1.py"
temp_file_path="c:\\myprog\\menu_option1.py"



This is how it would be called, though if anyone has a better suggestion it would be appreciated. As this is still static and I''m looking at a dynamic solution.


print "\nMain Menu:"
print "-----------"

# Print out the menu:
print "Please enter choice:"
print "1 - menu_option1"
print "5 - menu_option2"

temp_file_path=""

# The input function both prompts the user for input and fetches it...
input_choice = int(input( "> " ))
temp_file_path="c:\\myprog\\menu_option1.py"
execfile(temp_file_path)


if input_choice == 1:

else:
temp_file_path="c:\\myprog\\menu_option2.py"
execfile(temp_file_path)


Thanks once again!


w嗷嗷!我很震惊29次观看!没有一个回复.. Neway认为我应该澄清第二个问题..


2)是否有基于上述的真实世界示例或开源项目,我可以指示朝着?


我知道/在sourceforge找到了很多,但却没有找到一个简单的小程序/项目。这可以清除我的怀疑。而且大多数项目依赖于许多其他项目,这使得跟踪实际发生的事情变得更加困惑。


希望这个澄清有帮助!

谢谢! :)
wow!! I''m shocked 29 Views! Not a single reply.. Neway Thought i should Clarify the 2nd question..

2) Are there any real world examples or open source projects based on the above, which I could be directed towards?

I know/found many on sourceforge but have''nt really found a small simple program/project. which could clear my doubts. And most projects depend on many other projects which makes it even more confusing to keep track of what''s actually happening.

Hope this clarification helps!
Thanks! :)


没有帮助?奇怪!我误以为我会得到一个快速而有用的回复。
No help ? Surprising! I was under the misconception that I would get a quick and helpful reply.


这篇关于现实世界计划如何运作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆