Skip to content

Commit

Permalink
Python commeth to this repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jserrao committed Oct 17, 2019
1 parent 4b984f3 commit 67fefe6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
23 changes: 22 additions & 1 deletion mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,25 @@ If using without `homebrew`:
03. `> db.getUser("admin")` (send string of whomever you want to find, tells you about them)
04. `> db.getCollectionNames()` (gives you a list of all the collections (aka tables) in your DB)
05. `> db.getUsers()` (gives you a list of all the users)
06. `> db.collection.update({ "key" : "old-value" },{ $set: { "key" : "new-value" }},{ multi : true })` (sets a new value for all records that match key/old-value pair
06. `> db.collection.update({ "key" : "old-value" },{ $set: { "key" : "new-value" }},{ multi : true })` (sets a new value for all records that match key/old-value pair
7. `> db.collection.count()` (returns the number of records in a collection, argument is empty - it will just natively return the number)
8. `> db.collection.find({ "key": "value" })` (finds a certain record by the key value, or a much bigger descriptive collection of records if need be, see example below)
```
db.restaurants.find(
{
"name": "The Coupe"
}
)
```

9. `> db.collection.update()

```
db.your_collection.update(
{ criteria },
{
$set: { assignments }
},
{ options }
)
```
5 changes: 0 additions & 5 deletions python-pip.md

This file was deleted.

13 changes: 13 additions & 0 deletions python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Python Commands

00. CNTL + Z (terminate the python shell)
01. `brew install pipenv` (installs pipenv, something roughly equivalent to npm for node)
2. `python` (opens `>>>` prompt to execute python commands)
3. `curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py` (downloads pip package manager for python)
4. `python get-pip.py` (runs pip you just download in above step)
5. `python -m venv env` (creates a virtual environment inside of whatever folder you start it in, python 3)
6. `source env/bin/activate` (activates your virtual environment)
7. `deactivate` (stops your virtual environment)
8. `pip install virtualenvwrapper` (gives you another set of virtual environment tools to work with)
9. `mkvirtualenv your-environment-here` (if using `virtualenvwrapper`, this starts up)
10. `workon your-environment-here` (takes your environment and makes the virtual one for you - make sure you're in the right folder)

0 comments on commit 67fefe6

Please sign in to comment.