# IndexException whenever using PyArgParser

**URL:** <https://forum.inductiveautomation.com/t/indexexception-whenever-using-pyargparser/62692>\
**Category:** Module Development\
**Created:** [August 4, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/indexexception-whenever-using-pyargparser/62692 "2022-08-04T18:05:10Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 5, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/indexexception-whenever-using-pyargparser/62692/10 "2022-08-05T19:29:37Z")

</div>

> [@ScriptContext through client scope does not return project, but does in Perspective](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604/12):
>
> And no, your script module cannot be your RPC handler. That way lies madness.

This kind of use case is why having the ability to treat your RPC handler and your gateway script module separately is important.

To modify my previous example to take the `projectName`:

```auto
class GatewayScriptModule {

	GatewayScriptModule(String projectName) {
		this.projectName = projectName
	}

	String getConfigImpl(String arg) {
        String value = // Gateway stuff using this.projectName
		return value
	}
}

class ModuleRPC {

    ModuleRPC(ClientReqSession session, String projectName) {
		this.session = session
		this.projectName = projectName
        this.gatewayScriptModule = new GatewayScriptModule(projectName)
    }

    String getConfigImpl(String arg) {
        return this.gatewayScriptModule.getConfigImpl(arg)
    }
}

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/indexexception-whenever-using-pyargparser/62692)._
