# Handy or similar pencil sketch library in Processing.py

**URL:** https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005
**Category:** Processing.py
**Created:** [December 3, 2022, 9:59am UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005 "2022-12-03T09:59:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Fosker](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fosker](https://discourse.processing.org/u/Fosker)
#### Post date: [December 3, 2022, 9:59am UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/1 "2022-12-03T09:59:53Z")

</div>

> 

Is there a way to make your sketches look more like they have been sketched by a pencil (ie rough sketch type lines)?

I’ve seen people using the Handy library in other processing modes but can’t see any info on it within Processing.py?

Thanks!

---

<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: [December 3, 2022, 8:10pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/2 "2022-12-03T20:10:25Z")

</div>

You can use most Processing (Java) libraries with Python Mode. For example, to use Handy, install it like any other library in the IDE using –

**Sketch \> Import Library \> Add Library**

Once that’s installed, you can create a Handy sketch using Python Mode like so:

```python
add_library('handy')
 
def setup():
  size(300, 200)
  global h
  h = HandyRenderer(this)
 
def draw():
  background(235, 215, 182)
  h.rect(75, 50, 150, 100)

```

This is an animated sketch, but static sketches should work fine, too.

---

<div class="post-metadata">

### Author: ![Fosker](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fosker](https://discourse.processing.org/u/Fosker)
#### Post date: [December 3, 2022, 10:25pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/3 "2022-12-03T22:25:32Z")

</div>

When I try this I get a ClassCastExeption:

java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)  
at jycessing.LibraryImporter.addJarToClassLoader(LibraryImporter.java:315)  
at jycessing.LibraryImporter.recursivelyAddJarsToClasspath(LibraryImporter.java:164)  
at jycessing.LibraryImporter.addLibrary(LibraryImporter.java:140)  
at jycessing.LibraryImporter$1. **call** (LibraryImporter.java:82)  
at org.python.core.PyObject. **call** (PyObject.java:480)  
at org.python.core.PyObject. **call** (PyObject.java:484)  
at org.python.pycode.\_pyx61.f$0(sketch\_221203c.pyde:1)  
at org.python.pycode.\_pyx61.call\_function(sketch\_221203c.pyde)  
at org.python.core.PyTableCode.call(PyTableCode.java:171)  
at org.python.core.PyCode.call(PyCode.java:18)  
at org.python.core.Py.runCode(Py.java:1614)  
at org.python.core.Py.exec(Py.java:1658)  
at org.python.pycode.\_pyx60.f$0(/var/folders/pz/\_61lfmhn4gj6g5mh6v66b7cm0000gn/T/sketch\_221203c3047145917091245605/sketch\_221203c.pyde:96)  
at org.python.pycode.\_pyx60.call\_function(/var/folders/pz/\_61lfmhn4gj6g5mh6v66b7cm0000gn/T/sketch\_221203c3047145917091245605/sketch\_221203c.pyde)  
at org.python.core.PyTableCode.call(PyTableCode.java:171)  
at org.python.core.PyCode.call(PyCode.java:18)  
at org.python.core.Py.runCode(Py.java:1614)  
at org.python.core.Py.exec(Py.java:1658)  
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)  
at jycessing.PAppletJythonDriver.processSketch(PAppletJythonDriver.java:233)  
at jycessing.PAppletJythonDriver.findSketchMethods(PAppletJythonDriver.java:613)  
at jycessing.Runner.runSketchBlocking(Runner.java:399)  
at jycessing.mode.run.SketchRunner.lambda$2(SketchRunner.java:112)  
at java.base/java.lang.Thread.run(Thread.java:833)

---

<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: [December 3, 2022, 11:00pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/4 "2022-12-03T23:00:30Z")

</div>

Are you using Processing 3.5.4? What is your OS, system, etc. setup?

---

<div class="post-metadata">

### Author: ![Fosker](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fosker](https://discourse.processing.org/u/Fosker)
#### Post date: [December 3, 2022, 11:16pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/5 "2022-12-03T23:16:58Z")

</div>

macOS Catalina, Processing 4.0.1

---

<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: [December 3, 2022, 11:50pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005/6 "2022-12-03T23:50:46Z")

</div>

For Python Mode, use Processing 3.5.4
