如何编辑PythonWin路径以导入自定义构建的模块??? [英] How do I edit a PythonWin path to import custom built modules???

查看:90
本文介绍了如何编辑PythonWin路径以导入自定义构建的模块???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我一直在使用以下IDE,


" Pythonwin - Python IDE和GUI Framework for Windows。


版权所有1994-2001 Mark Hammond"


关于我的工作,我创建了自己的模块(.py文件)在除了python root之外的
驱动器和文件夹中。我知道如果我需要

导入这些模块,我需要指定目录的路径

我放了我的模块。我试过了编辑Python路径

菜单中的子菜单工具 PythonWin,但是我无法添加新的路径ie-

D:\ xxxx \ xxxx \ xxxx \ ATS。


可以任意一,请让我知道如何添加一个新的访问途径

我自己的模块。


提前致谢,

Mohan Swaminathan。

解决方案

mohan写道:


我创建了我自己的模块(.py文件)在
驱动器和python root以外的文件夹中。



如果将它们全部放在一个地方,可能最容易。然后添加

" place"通过控制进入你的路径

面板|系统|高级|环境变量并添加

路径变量的路径。


希望有所帮助。


rd




BartlebyScrivener写道:


mohan写道:


我在
中创建了自己的模块(.py文件)除了python root之外的
驱动器和文件夹。



如果将它们全部放在一个地方,可能最容易。然后添加

" place"通过控制进入你的路径

面板|系统|高级|环境变量并添加

路径变量的路径。


希望有所帮助。


rd



谢谢你,


我尝试了你的建议,通过添加一个新的路径到系统变量

部分。它仍然无法正常工作。我不知道当我们还没有在解释器中更新

路径时,PythonWin

解释器怎么能查找新文件夹。对不起,我可能会在这里讨价还价。

我对这些事情不太熟悉。


还有什么想法吗?


问候,

Mohan。


mohan ha escrito:
< blockquote class =post_quotes>


我在

驱动器和文件夹中创建了自己的模块(.py文件)除了python root之外。



我尝试了你的建议,在系统变量

部分增加了一条新路径。它仍然无法正常工作。我不明白为什么PythonWin



在之前的帖子中有一个错误,你应该创建一个名为PYTHONPATH的变量

,不要更改系统路径。

或者,将模块分组并放在包装下面

lib\site-packages。


-

Gabriel Genellina


Hi Guys,

I''ve been using the following IDE,

"Pythonwin - Python IDE and GUI Framework for Windows.

Copyright 1994-2001 Mark Hammond "

With respect to my work, I had created my own modules (.py files) in
drives and folders other than the python root. I know that if I need to
import these modules, I need to specify the path of the directory where
I''ve put my modules. I''ve tried the "Edit Python Path" sub menu in the
menu "Tools" of PythonWin, but I could not add a new path i.e.-
D:\xxxx\xxxx\xxxx\ATS.

Could any one please let me know how could I add a new path to access
my own modules.

Thanks in advance,
Mohan Swaminathan.

解决方案

mohan wrote:

I had created my own modules (.py files) in
drives and folders other than the python root.

Probably easiest if you keep them all in one place. Then add that
"place" to your path by going into Control
Panel|System|Advanced|Environment Variables and adding the path to the
path variable.

Hope that helps.

rd



BartlebyScrivener wrote:

mohan wrote:

I had created my own modules (.py files) in
drives and folders other than the python root.


Probably easiest if you keep them all in one place. Then add that
"place" to your path by going into Control
Panel|System|Advanced|Environment Variables and adding the path to the
path variable.

Hope that helps.

rd

Thanks rd,

I tried your advice, by adding a new path to the "System Variable"
section. It still does not work. I don''t understand how could PythonWin
interpreter would look for new folders when we have not yet updated the
path in the interpreter. I''m sorry I might be mising something here as
i''m not too familiar with these things.

Any further ideas??

Regards,
Mohan.


mohan ha escrito:

I had created my own modules (.py files) in
drives and folders other than the python root.

I tried your advice, by adding a new path to the "System Variable"
section. It still does not work. I don''t understand how could PythonWin

There was an error in a previous post, you should create a variable
called PYTHONPATH, not change the system PATH.
Or, group your modules into packages and put them below
lib\site-packages.

--
Gabriel Genellina


这篇关于如何编辑PythonWin路径以导入自定义构建的模块???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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