1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>python_import hack from root</Title>
      <Author>
      </Author>
      <Description>python fucking stupid import complementary hack from root</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>impr</Shortcut>
    </Header>
    <Snippet>  
      <Declarations>
        <Literal>
          <ID>rootPackageName</ID>   
          <ToolTip>input root package name</ToolTip>          
          <Default>package</Default>   
        </Literal>
        <Literal>
          <ID>moduleName</ID>   
          <ToolTip>import what</ToolTip>          
          <Default>module</Default>   
        </Literal>
        <Literal>
          <ID>shortName</ID>   
          <ToolTip>using name only in this module</ToolTip>          
          <Default>short</Default>   
        </Literal>
      </Declarations>    
      <Code Language="Python" Delimiter="$"><![CDATA[import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from $rootPackageName$ import $moduleName$ as $shortName$
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
cs

쉽고 빠르게 루트 패키지에서 임포트



이 짓을 안하면 파이슨은 지가 만든 모듈 임포트도 못한데요오