请生成一个包含10个元素的随机整数列表，每个整数在1到50之间。请按升序排序并输出结果。
Here is Python 3 code to generate a list of 10 random integers between 1 and 50, sort them in ascending order, and print the result:

```python
import random

# generate a list of 10 random integers between 1 and 50
nums = [random.randint(1, 50) for _ in range(10)]

# sort the list in ascending order
nums.sort()

# print the sorted list
print(nums)
```

Example output:
```
[4, 12, 16, 21, 23, 30, 32, 39, 40, 47]
```