Effective PyCharm Transcripts
Chapter: PyCharm Projects
Lecture: Run configurations
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
As you've seen so far, in order to actually execute our programs, make them go, run them with Python
0:07
we have to create what's called a run configuration. You know you have a run configuration when you see it up here in the top right of PyCharm
0:14
it's got a little name, the play and debug buttons are not great out there, green and ready to go. If you have it like this, you're good to go
0:24
but how do you get one in the first place? Well, there's a couple of options,
0:28
first, we could pull down that drop down and we could choose edit configuration and when we edit, we can have the chance to cut a new one
0:33
or we can go and pick some existing ones, so here's what we have say on Talk Python To Me,
0:38
here's the Talk Python web app, which we can run, this is a Pyramid app, and then we have three other utility libraries,
0:44
a choose random subscriber— sometimes I do giveaways and people who are friends of the show,
0:50
I'll randomly pick out their email address and give them something like some kind of software license or something like that.
0:56
Maybe test the sponsorship slots, sometimes those change and they are kind of hard to tell in the database of what goes where,
1:02
and so this lets me verify like if I reorganize things, they don't break. And I moved from S3 to Digital Ocean
1:08
as the cloud backing store for the podcast data, so these are some things I created along the way and we also have two particular unit tests
1:16
one that runs all of them, and one that runs just a subset. So most of these were gotten by just right clicking on the file that I wanted to run
1:24
and say choose random subscriber, run that and this will create that choose random subscriber run configuration
1:31
we could also you could see debug it, profile it, things like that we'll talk more about debugging and profiling later,
1:37
but these run configurations are really powerful you can configure lots of details about them, I think you should definitely leverage them, right
1:46
make sure that you create as many as you need and that you really take advantage of them because they will be super helpful.
1:53
If we go and edit one, here you can see like Talk Python web for example you can see the source points to a config file
2:00
that is a development.ini, this is the Pyramid Web App convention, this is sort of the local non-production version
2:08
so maybe it has like a local database connections instead of production, authenticated remote server database connections and things like that.
2:15
We pick an interpreter, we pick a working directory and you can even do things like at the bottom it says, before launch activate this tool window,
2:24
so if you wanted to say run like a gulp task or you enter before you're even allowed to run your app
2:30
or you've got to do something else to prepare it to run you can add a bunch of little tools right at the bottom.