How do you convert an expression that works in the console into a format a driver can make use of?
You can use a single line python expression as a driver, like an if-else statement.

1 if (bpy.context.scene.frame_current  == 1) else 0


The reason this fails, would be if python scripts have been disabled. You get this dialog after entering a python expression when python scripts are disabled. Click on "Allow Execution".



If you dismissed the dialog, enable Auto Run Python Scripts in the User Preferences under Save &amp; Load.