<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def CreateConstMuskingumXFile(x_value, in_connectivity_file, out_x_file):
 """ Create muskingum X file from value that is constant all the way through for each river segment. Parameters x_value: float Value for the muskingum X parameter [0-0.5]. in_connectivity_file: str The path to the RAPID connectivity file. out_x_file: str The path to the output x file. Example:: from RAPIDpy.gis.muskingum import CreateConstMuskingumXFile CreateConstMuskingumXFile( x_value=0.3, in_connectivity_file='/path/to/rapid_connect.csv', out_x_file='/path/to/x.csv') """

    num_rivers = 0
    with open_csv(in_connectivity_file, "r") as csvfile:
        reader = csv_reader(csvfile)
        for _ in reader:
            num_rivers += 1

    with open_csv(out_x_file, 'w') as kfile:
        x_writer = csv_writer(kfile)
        for _ in xrange(num_rivers):
            x_writer.writerow([x_value])