在python ephem中,我无法获得某些星座的位置 - python

import ephem

date = '2018/9/20'

sun = ephem.Sun()
sun.compute(date)
print 'Sun in', list(ephem.constellation(sun))[1]

moon = ephem.Moon()
moon.compute(date)
print 'Moon in', list(ephem.constellation(moon))[1]

mars = ephem.Mars()
mars.compute(date)
print 'Mars in', list(ephem.constellation(mars))[1]

mercury = ephem.Mercury()
mercury.compute(date)
print 'Mercury in', list(ephem.constellation(mercury))[1]

jupiter = ephem.Jupiter()
jupiter.compute(date)
print 'Jupiter in', list(ephem.constellation(jupiter))[1]

venus = ephem.Venus()
venus.compute(date)
print 'Venus in', list(ephem.constellation(venus))[1]

saturn = ephem.Saturn()
saturn.compute(date)
print 'Saturn in', list(ephem.constellation(saturn))[1]

我已经找到了特定日期在他们家中的所有7个行星。现在,我需要在astro表中找到Rahu和Ketu的房屋。如何获得?有功能吗?

参考方案

我很确定ephem中只有真实的行星可用。我找到了这个定义

  天文学上,拉hu和克图表示
  太阳和月亮在天球上移动时的路径。

使用一些数学会告诉你要点。也许this可以帮助您在不同系统之间转换坐标。

据此,您可以在ephem中派生一个视点,称为Observer,并将其传递给ephem.constellation(o)

在python 3中使用单引号和双引号时出错 - python

使用os.system()函数时,我在python中遇到了EOL错误。以下是代码行生成错误:os.system("cat subdomains.txt | cut -d'"' -f1 ") 基本上,我试图使用分号[“]修改输出字符串(双引号) 参考方案 如果需要在带"的字符串中编写",则可…

在python-nvd3中的y轴上显示大量数字 - python

在y轴上显示大量数字的一种方法是移动边距:Y axis label not displaying large numbers - Multi-Bar Chart。如何调整python-nvd3中的margin参数?您能代替写10 ^ 6这样的顶部指数并将y轴标记为2.5,3.0等吗,而不是写25,00,000,30,00,000等。 参考方案 如果我正确理解…

找不到满足要求pip的版本-在python 2.7中的代理后面安装pip - python

我在实际要安装pip的地方使用Phyton 2.7,因此我从网站上获取了get-pip.py并尝试使用此命令安装pip:python get-pip.py 但是经过多次重试并显示此问题后它失败了Could not find a version that satisfies the requirement pip 我在不同的论坛上搜索,发现可能存在代理问题,因…

在python lxml prettyprint中更改标签间距 - python

我有一个小的脚本,可以创建xml文档,并使用prettyprint=true可以创建格式正确的xml文档。但是,制表符的缩进是2个空格,我想知道是否有办法将其更改为4个空格(我认为4个空格看起来更好)。有没有简单的方法来实现这一目标?程式码片段:doc = lxml.etree.SubElement(root, 'dependencies'…

在python flask应用程序中进行单元测试时如何避免装饰器 - python

我是python和flask的新手。我想为编写的api创建单元测试。我们已经使用jwt进行身份验证。为了进行单元测试,我不想让流程进入@jwt_required装饰器。除此之外,我还为该方法链接了其他一些装饰器。class A(): @jwt_required() @mandatory_fields_check @unlock_and_lock() def …