I want to access the main package from another package, but this is impossible because the main file isn't in a directory. I already tried putting the main file in a directory, but when I try to import it I get this error:
import "../main" is a program, not an importable package
我之所以想要这个,是因为我有一个tcp服务器和一个Web服务器可以一起工作.Web服务器可以通过主包获取tcp服务器,tcp服务器可以通过主包获取Web服务器.
我已经让它与web服务器和tcpserver一起工作(中间没有主包),但我希望将应用程序的某些部分保留在一个位置.
我想要的东西可能(通过主包)实现吗?还是只是愚蠢.