Invalid Syntax from except
<p>I am receiving an invalid syntax from the line that says except: from this code...</p>

<pre><code>from .utils.dataIO import fileIO
from .utils import checks
from __main__ import send_cmd_help
from __main__ import settings as bot_settings
import discord
from discord.ext import commands
import aiohttp
import asyncio
import json
import os

class Transformice:
    """Transformice"""

    def __init__(self, bot):
        self.bot = bot

    @checks.is_owner()
    @commands.group(name="tfm", pass_context=True, invoke_without_command=True)
    async def tfm(self, ctx):
        """Get Transformice Stats"""
        await send_cmd_help(ctx)

    @checks.is_owner()
    @tfm.command(pass_context=True)
    async def mouse(self, ctx, *name):
        """Get mouse info"""

        if name == ():
            mouse = "+".join(name)
            link = "http://api.micetigri.fr/json/player/" + mouse
            async with aiohttp.get(link) as r:
                result = await r.json()
                name = result['name']
                msg = "**Mouse:** {}".format(name)
                await self.bot.say(msg)
        except:
                await self.bot.say("Invalid username!")

def setup(bot):    
    n = Transformice(bot)
    bot.add_cog(n)
</code></pre>

<p>Can someone explain why I am getting this error and how to fix it. I am confuse about some errors in python and how to fix that.</p>

<p>you should put a</p>

<p><code>try-except</code> block together but in your code. 
You have used only the <code>except block</code>... No <code>try</code> statement.</p>

<pre><code>   try:
        if name == ():
            mouse = "+".join(name)
            link = "http://api.micetigri.fr/json/player/" + mouse
            async with aiohttp.get(link) as r:
                result = await r.json()
                name = result['name']
                msg = "**Mouse:** {}".format(name)
                await self.bot.say(msg)
    except:
            await self.bot.say("Invalid username!")
</code></pre>

<p>you should use something like above if the error is only because of the <code>except</code> syntax.
or there could be you wish to use <code>else:</code> and have used <code>except</code></p>

python