首页 \ 问答 \ 在Eclipse中的常春藤项目路径中包含jar(Including jars in project path from ivy in Eclipse)

在Eclipse中的常春藤项目路径中包含jar(Including jars in project path from ivy in Eclipse)

我在eclipse中有一个java项目,我在eclipse之外使用ivy依赖管理器,所以我的目录结构中充满了各种jar文件。 有没有一种简单的方法可以将我的日食项目指向常春藤dirs的路径并拿起所有的罐子?

我试图避免将每个jar拉出到我的eclipse项目目录中,并希望有更好的方法。


I have a java project in eclipse and I'm using ivy dependency manager outside of eclipse, so I have directory structures full of various jar files. Is there a simple way to point my eclipse project's path to the ivy dirs and pick up all the jars?

I'm trying to avoid pulling out each individual jar into my eclipse project directory and hope there's a better way.


原文:https://stackoverflow.com/questions/25899149
更新时间:2022-03-11 09:03

最满意答案

您应该查看PEP 8 ,Python代码样式指南:

软件包和模块名称模块应具有简短的全小写名称。 如果提高可读性,则可以在模块名称中使用下划线。 Python包也应该有简短的全小写名称,尽管不鼓励使用下划线。

由于模块名称被映射到文件名,并且某些文件系统不区分大小写,并且截断长名称,所以选择模块名称相当短 - 这在Unix上不是问题,但它可能是当代码被传输到较旧的Mac或Windows版本或DOS时出现问题。

换句话说:重命名你的文件:)


You should check out PEP 8, the Style Guide for Python Code:

Package and Module Names Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

Since module names are mapped to file names, and some file systems are case insensitive and truncate long names, it is important that module names be chosen to be fairly short -- this won't be a problem on Unix, but it may be a problem when the code is transported to older Mac or Windows versions, or DOS.

In other words: rename your file :)

相关问答

更多
  • 听起来你还没有完全理解进口的工作方式。 如果您运行: import my_module 然后my_module.py模块中包含的任何内容都被命名为my_module 。 因此,要使用此模块,您必须键入: result = my_module.some_function(1,2,3,4) object1 = my_module.SomeClass() 同样,如果你真的想使用my_module的os import,你必须通过以下方式访问它: my_module.os 如果您使用以下导入: from my_ ...
  • 您应该查看PEP 8 ,Python代码样式指南: 软件包和模块名称模块应具有简短的全小写名称。 如果提高可读性,则可以在模块名称中使用下划线。 Python包也应该有简短的全小写名称,尽管不鼓励使用下划线。 由于模块名称被映射到文件名,并且某些文件系统不区分大小写,并且截断长名称,所以选择模块名称相当短 - 这在Unix上不是问题,但它可能是当代码被传输到较旧的Mac或Windows版本或DOS时出现问题。 换句话说:重命名你的文件:) You should check out PEP 8, the St ...
  • 只需import file不带'.py'扩展名的文件。 您可以通过添加一个名为__init__.py的空文件将文件夹标记为一个包。 您可以使用__import__函数。 它将模块名称作为字符串。 (再次:没有'.py'扩展名的模块名称。) pmName = input('Enter module name:') pm = __import__(pmName) print(dir(pm)) 输入help(__import__)了解更多详情。 更新:上面的回答已经过时了 。 这是一个更新的选择: import ...
  • 你可以尝试这种方法: # tests/return_self_test.py import os import sys import pytest sys.path.insert(1, os.path.join(sys.path[0], '..')) from src.return_self import return_self def test_1(): value = return_self(1) assert value == 1 You can try this appro ...
  • 正如Python的Zen所说,“明确比隐含更好”,这是一个很好的例子。 在导入中明确列出模块的依赖关系非常有用,这意味着文件中的每个符号都可以通过简单的文本搜索跟踪到其原点。 例如,如果在文件中搜索some_identifier ,您将在文件中找到定义,或者from some_module import some_identifier 。 直接引用some_module.some_identifier更加明显。 (这也是你不应该from module import *做的一个原因。) 在不丢失上述属性的情况 ...
  • 这是一个循环导入问题。 Application.py导入解析器,导入导入h17message的h17,导入运行processImports的应用程序,然后运行解析器模块的整个代码。 在我看来,服务模块不应该导入应用程序。 您可以在application.py和h17message中创建一个包含db = connect('testdb')行的新模块common.py并从common中导入db。 This is a circular import issue. Application.py imports pa ...
  • (来自https://docs.python.org/2/library/sys.html#sys.path的信息): 要import工作,模块所在的目录必须位于路径(sys.path)中。 该路径通常包括您正在运行的脚本所在的目录,但如果Python无法确定其位置(例如,如果您执行类似python
  • 任何遇到同一问题的人都可以这样做。 1)创建新的项目,例如:StreamingApplication。 |root --StreamingApplication |-------> utils |-------------->helper.py |-------------->storage_handler.py |------->config |-------------->config.py |-------------->hook.py |------->app |-------------->app ...
  • 您可以在foo.py使用包相对导入。 from .bar import other_thing 有关详细信息,请参阅包内参考 。 请注意,如果直接运行stuff.py ,它是顶级脚本( __main__ ),并且不是包的成员。 如果某些其他模块导入b.stuff ,则会获得不同的副本。 就个人而言,我将顶级脚本放在不同的bin目录中,因此不会将它们误认为是包模块。 You can use package relative imports in foo.py. from .bar import other_ ...
  • 问题是因为Foo没有__init__.py ,因此它不被视为包。 相对导入中的每个句点都指包。 当你这样做 from ..src.output import * 在bar.py ,第一个句点指的是当前包, modules 。 第二个时期是指上面的包, Foo 。 由于Foo实际上不是一个包,因此会出错。 PS Wildcard的进口令人不悦。 特别是当您从这样一个远程相关的包导入时,我会尝试将其重构为显式导入。 The problem is because Foo has no __init__.py, ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)