In which order do you run your commands ?
rostopic list is used to list current topics registered with the
rosmaster 'node', who is launched with the
The publisher and subscriber topics are registered to the rosmaster with the python function
rospy.Publisher('chatter', String, queue_size=10) for the publisher, and
rospy.Subscriber("chatter", String, callback) for the subscriber (I assume that the python file you speak about are the one from the tutorial)
So if you want to see the topics from the publisher and subscriber tutorial , you need first to launch the rosmaster with
roscore, then you can open 2 new terminals and launch the publisher and subscriber on each terminal with
rosrun beginner_tutorials talker.py and
rosrun beginner_tutorials listener.py (don't forget to source your catkin workspace on each terminal to be able to run your workspaces' nodes).
That will register the 2 nodes on the rosmaster, the talker node will register a publisher and the listener node will register a subscriber, both on the same topic.
And now, on an another terminal, if you run
rostopic list you will be able to see the topic
And if you run the command
rostopic info /chatter, you will see that this topic is used by 2 nodes, talker and listener, talker is a publisher and listener a subscriber.
If you can't see it, then there is a problem. You can use all the ros* commands to debug what's happening.
For example, run the command
rosnode list to list which nodes are actually launched (there should be 3 nodes), run the command
rostopic echo /chatter to see if your publisher is indeed publishing messages, or run the commands
rostopic pub /test std_msgs/String "Hello" -r 10 and
rostopic echo /test to see if you can indeed make 2 nodes works.
Also, you should ask your ROS question directly to the ROS Answers Forum, they are much more specialized :) .