"By" as a preposition indicating means or instrument:
* por: This is the most common translation for "by" in this sense.
* com: This is used when the means or instrument is a person or thing that accompanies or assists.
* através de: This is used when referring to a medium or channel.
* mediante: This is a more formal way to say "by means of".
Examples:
* I went to the store by car. - Fui à loja de carro.
* The book was written by John. - O livro foi escrito por João.
* I sent the letter by mail. - Enviei a carta pelo correio.
* The message was sent by email. - A mensagem foi enviada através de e-mail.
* The project was completed by using innovative techniques. - O projeto foi concluído mediante o uso de técnicas inovadoras.
"By" as a preposition indicating nearness or proximity:
* junto a: This means "next to" or "near".
* perto de: This means "close to".
* ao lado de: This means "beside".
Examples:
* The hotel is by the beach. - O hotel é junto à praia.
* The park is by the river. - O parque é perto do rio.
* The coffee shop is by the bookstore. - A cafeteria é ao lado da livraria.
"By" as a preposition indicating time:
* por: This is used for general time periods.
* até: This is used for specific deadlines or end points.
* para: This is used for specific times of day or events.
Examples:
* The meeting will be by 2pm. - A reunião será por 2 horas da tarde.
* The project is due by Friday. - O projeto é devido até sexta-feira.
* I will be there by tomorrow morning. - Estarei lá para amanhã de manhã.
"By" as a preposition indicating division or distribution:
* por: This is used for dividing something into equal parts.
* entre: This is used for dividing something among two or more people.
* com: This is used for dividing something with someone else.
Examples:
* The cake was cut by 12 people. - O bolo foi cortado por 12 pessoas.
* The money was divided among the three friends. - O dinheiro foi dividido entre os três amigos.
* I shared the pizza with my friend. - Eu compartilhei a pizza com meu amigo.
Note: The best translation of "by" will depend on the context of the sentence.