简体   繁体   English

打包在Eclipse中组织python项目

[英]organize python project in Eclipse in packages

I have an eclipse python project. 我有一个蚀python项目。 In this project i had a package called PX. 在这个项目中,我有一个名为PX的软件包。 Now i have created 2 new packages PXTest and PXProd for different development "stages". 现在,我为不同的开发“阶段”创建了2个新软件包PXTest和PXProd。 When i develope something in PX, I copy the modified source to PXTest and when it's working, I copy it to PXProd: 当我在PX中开发某些东西时,我将修改后的源代码复制到PXTest,并且在工作时,我将其复制到PXProd: 在此处输入图片说明

I have a problem now: 我现在有一个问题:

all the imports reference the package name and I would need to replace them everytime I copy sources. 所有导入都引用包名称,每次复制源时都需要替换它们。 like: 喜欢:

from PX.functions import send_email 从PX.functions导入send_email

is there a way to reference the import within the package automatically? 有没有一种方法可以自动引用包中的导入内容? since the package structure is the same, I hope to find a way to use relative paths or something like that. 由于包的结构是相同的,所以我希望找到一种使用相对路径或类似路径的方法。

any suggestions? 有什么建议么?

thanks and best wishes, E. 感谢和最良好的祝愿,E。

So after googling i found out, that there are relative paths in python/eclipse. 因此,在谷歌搜索之后,我发现,python / eclipse中存在相对路径。 but i prefered creating 3 separate projects with the same package name. 但我更喜欢使用相同的包名称创建3个独立的项目。 thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM