# \[TUTORIAL\]Running Python Mode in VScode

**URL:** <https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716>\
**Category:** Processing.py\
**Created:** [January 21, 2019, 10:45pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716 "2019-01-21T22:45:57Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [September 20, 2020, 11:52am UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716/21 "2020-09-20T11:52:11Z")

</div>

You mean, like, the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) code-completion? I don’t think this is possible, because there’s no Python file that you’ve imported that contains all of the Processing.py definitions for VScode to use.

But you might work around this somehow. One (very hacky and gross) solution is to create a file named _codecompletion.py_ with the following code:

> **EXPAND for codecompletion.py code**
>
> ```auto
> # functions
> 
> def abs(*arg): return 1
> def acos(*arg): return 1
> def add_library(*arg): return 1
> def alpha(*arg): return 1
> def applyMatrix(*arg): return 1
> def arc(*arg): return 1
> def asin(*arg): return 1
> def atan(*arg): return 1
> def atan2(*arg): return 1
> def background(*arg): return 1
> def beginContour(*arg): return 1
> def beginShape(*arg): return 1
> def bezier(*arg): return 1
> def bezierDetail(*arg): return 1
> def bezierPoint(*arg): return 1
> def bezierTangent(*arg): return 1
> def bezierVertex(*arg): return 1
> def blend(*arg): return 1
> def blendColor(*arg): return 1
> def blendMode(*arg): return 1
> def blue(*arg): return 1
> def brightness(*arg): return 1
> def ceil(*arg): return 1
> def circle(*arg): return 1
> def clear(*arg): return 1
> def color(*arg): return 1
> def colorMode(*arg): return 1
> def constrain(*arg): return 1
> def copy(*arg): return 1
> def cos(*arg): return 1
> def createFont(*arg): return 1
> def createShape(*arg): return 1
> def cursor(*arg): return 1
> def curve(*arg): return 1
> def curveDetail(*arg): return 1
> def curvePoint(*arg): return 1
> def curveTangent(*arg): return 1
> def curveTightness(*arg): return 1
> def curveVertex(*arg): return 1
> def day(*arg): return 1
> def degrees(*arg): return 1
> def dist(*arg): return 1
> def ellipse(*arg): return 1
> def ellipseMode(*arg): return 1
> def endContour(*arg): return 1
> def endShape(*arg): return 1
> def exp(*arg): return 1
> def fill(*arg): return 1
> def filter(*arg): return 1
> def floor(*arg): return 1
> def frameRate(*arg): return 1
> def fullScreen(*arg): return 1
> def get(*arg): return 1
> def green(*arg): return 1
> def hour(*arg): return 1
> def hue(*arg): return 1
> def image(*arg): return 1
> def imageMode(*arg): return 1
> def keyPressed(*arg): return 1
> def keyReleased(*arg): return 1
> def keyTyped(*arg): return 1
> def lerp(*arg): return 1
> def lerpColor(*arg): return 1
> def line(*arg): return 1
> def loadFont(*arg): return 1
> def loadImage(*arg): return 1
> def loadPixels(*arg): return 1
> def loadShape(*arg): return 1
> def loadStrings(*arg): return []
> def log(*arg): return 1
> def mag(*arg): return 1
> def map(*arg): return 1
> def max(*arg): return 1
> def millis(*arg): return 1
> def min(*arg): return 1
> def minute(*arg): return 1
> def month(*arg): return 1
> def mouseClicked(*arg): return 1
> def mouseDragged(*arg): return 1
> def mouseMoved(*arg): return 1
> def mousePressed(*arg): return 1
> def mouseReleased(*arg): return 1
> def mouseWheel(*arg): return 1
> def noCursor(*arg): return 1
> def noFill(*arg): return 1
> def noise(*arg): return 1
> def noiseDetail(*arg): return 1
> def noiseSeed(*arg): return 1
> def norm(*arg): return 1
> def noSmooth(*arg): return 1
> def noStroke(*arg): return 1
> def noTint(*arg): return 1
> def point(*arg): return 1
> def popMatrix(*arg): return 1
> def pow(*arg): return 1
> def printMatrix(*arg): return 1
> def pushMatrix(*arg): return 1
> def quad(*arg): return 1
> def quadraticVertex(*arg): return 1
> def radians(*arg): return 1
> def random(*arg): return 1
> def randomGaussian(*arg): return 1
> def randomSeed(*arg): return 1
> def rect(*arg): return 1
> def rectMode(*arg): return 1
> def red(*arg): return 1
> def requestImage(*arg): return 1
> def resetMatrix(*arg): return 1
> def rotate(*arg): return 1
> def rotateX(*arg): return 1
> def rotateY(*arg): return 1
> def rotateZ(*arg): return 1
> def round(*arg): return 1
> def saturation(*arg): return 1
> def save(*arg): return 1
> def saveFrame(*arg): return 1
> def scale(*arg): return 1
> def second(*arg): return 1
> def set(*arg): return 1
> def shape(*arg): return 1
> def shapeMode(*arg): return 1
> def shearX(*arg): return 1
> def shearY(*arg): return 1
> def sin(*arg): return 1
> def size(*arg): return 1
> def smooth(*arg): return 1
> def sq(*arg): return 1
> def sqrt(*arg): return 1
> def square(*arg): return 1
> def stroke(*arg): return 1
> def strokeCap(*arg): return 1
> def strokeJoin(*arg): return 1
> def strokeWeight(*arg): return 1
> def tan(*arg): return 1
> def text(*arg): return 1
> def textAlign(*arg): return 1
> def textFont(*arg): return 1
> def textLeading(*arg): return 1
> def textMode(*arg): return 1
> def textSize(*arg): return 1
> def texture(*arg): return 1
> def textureMode(*arg): return 1
> def textWidth(*arg): return 1
> def tint(*arg): return 1
> def translate(*arg): return 1
> def triangle(*arg): return 1
> def updatePixels(*arg): return 1
> def vertex(*arg): return 1
> def year(*arg): return 1
> 
> # variables
> 
> displayHeight = 1
> displayWidth = 1
> focused = 1
> frameCount = 1
> frameRate = 1
> HALF_PI = 1
> height = 1
> key = 1
> keyCode = 1
> keyPressed = 1
> mouseButton = 1
> mousePressed = 1
> mouseX = 1
> mouseY = 1
> pixels = 1
> PI = 1
> pmouseX = 1
> pmouseY = 1
> QUARTER_PI = 1
> TAU = 1
> TWO_PI = 1
> width = 1
> 
> # arguments
> 
> ADD = 1
> BLEND = 1
> BLUR = 1
> CENTER = 1
> CLOSE = 1
> DARKEST = 1
> DIFFERENCE = 1
> HSB = 1
> LEFT = 1
> LIGHTEST = 1
> MULTIPLY = 1
> PIE = 1
> PROJECT = 1
> RGB = 1
> RIGHT = 1
> ROUND = 1
> SCREEN = 1
> SQUARE = 1
> SUBTRACT = 1
> 
> # classes
> 
> class PFont():
> def list(): return 1
> 
> class ControlP5():
> pass
> 
> class PVector(x, y):
> def __add__ (a, b): return a
> def __sub__ (a, b): return a
> def limit(self): return self
> 
> ```

Save this _codecompletion.py_ file in the same directory as your sketch file; then import it using:

```auto
if False: from codecompletion import *

```

You can refine the _codecompletion.py_ file for better hinting (adding arguments, etc.). You can also add [iGeo](http://igeo.jp/doc/) definitions.

I’m sure there are far better ways to do this …

---

<div class="post-metadata">

**Author:** ![villares](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/villares/32/3166_2.png) [@villares](https://discourse.processing.org/u/villares)\
**Post date:** [January 27, 2021, 5:09pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716/22 "2021-01-27T17:09:22Z")

</div>

Can you expand on this? a friend is having trouble making the PDF lib work on the command line.  
Could you point out where exactly it should be placed?

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [January 27, 2021, 9:12pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716/23 "2021-01-27T21:12:58Z")

</div>

I figured you could do it like this: [https://py.processing.org/tutorials/command-line/#external-libraries](https://py.processing.org/tutorials/command-line/#external-libraries)

Never tested it, though …

---

<div class="post-metadata">

**Author:** ![Xarbenence](https://avatars.discourse-cdn.com/v4/letter/x/b5a626/32.png) [@Xarbenence](https://discourse.processing.org/u/Xarbenence)\
**Post date:** [June 16, 2022, 7:20pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716/24 "2022-06-16T19:20:13Z")

</div>

Hello. I have been having a lot of trouble with downloading the processing-py.jar file. Following the link you provided leads to the Processing.py website, but the link they provide for the Mac OSX download does not lead anywhere. Do you have this same issue? Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [June 16, 2022, 7:42pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716/25 "2022-06-16T19:42:49Z")

</div>

Welcome @Xarbenence

The _Mac OS X_ link listed on the [Processing.py command line](https://py.processing.org/tutorials/command-line/) page points to a valid file. I could download it fine: [http://py.processing.org/processing.py-macosx.tgz](http://py.processing.org/processing.py-macosx.tgz)

The _processing-py.jar_ file is in that archive (with the rest of the files for the command-line version).

[Previous page](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716.md?page=1)
