A couple of years ago I have been writing a post on this blog showing how to use python on vim in order to get scientific math results. Now, a little bit overdue I am proud of show you the same solution using python3.
Maybe it will be improvements, I hope so.
Site sobre software livre, cultura, arte, gimp, inkscape, wallpapers, vim, firefox, python, e-books, algoritmos, openoffice, ubuntu, debian, gnome, inkscape, bash, shell script, música, arte, mpb, dicas em geral, Geopolítica, politica, brasil, blogsfera, ativismo, rock, english
Mostrando postagens com marcador python. Mostrar todas as postagens
Mostrando postagens com marcador python. Mostrar todas as postagens
Android: Nada de Airdroid ou Whatsappweb
Cabra macho que usa linux cria um http server usando python:
$ cd /home/somedir
$ python -m SimpleHTTPServer
Depois ele pega o ip da máquina
ifconfig
no meu caso o ip é: 192.168.25.151
Daí basta digitar no seu celular:
http://192.168.25.151:8000
daí no seu android da vida baixa o arquivo sem maiores problemas
$ cd /home/somedir
$ python -m SimpleHTTPServer
Depois ele pega o ip da máquina
ifconfig
no meu caso o ip é: 192.168.25.151
Daí basta digitar no seu celular:
http://192.168.25.151:8000
daí no seu android da vida baixa o arquivo sem maiores problemas
Python: Pequeno script para alterar o tempo de legendas no formato SRT
Publiquei no github um pequeno script que tem
como propósito retardar ou adiantar o tempo de legendas nor formato "srt". Quem desejar fazer sugestões sinta-se a vontade.OBS: Antes de rodar o script instale as bibliotecas descritas no código.
Conheça o ack um concorrente matador para o grep
http://betterthangrep.com/
Para instala-lo na sua pasta ~/bin (caso tenha) é moleza
O parâmetro final pega o nome do executável como parâmetro do chmod
Há uma ferramenta similar feita em python
http://pypi.python.org/pypi/grin
Leia mais sobre o grin aqui.
Para instala-lo na sua pasta ~/bin (caso tenha) é moleza
curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3 O parâmetro final pega o nome do executável como parâmetro do chmod
Top 10 reasons to use ack instead of grep.
- It's blazingly fast because it only searches the stuff you want searched.
- ack is pure Perl, so it runs on Windows just fine.
- The standalone version uses no non-standard modules, so you can put it in your ~/bin without fear.
- Searches recursively through directories by default, while ignoring .svn, CVS and other VCS directories.
- Which would you rather type?
$ grep pattern $(find . -type f | grep -v '\.svn')
$ ack pattern
- Which would you rather type?
- ack ignores most of the crap you don't want to search
- VCS directories
- blib, the Perl build directory
- backup files like foo~ and #foo#
- binary files, core dumps, etc
- Ignoring .svn directories means that ack is faster than grep for searching through trees.
- Lets you specify file types to search, as in --perl or --nohtml.
- Which would you rather type?
$ grep pattern $(find . -name '*.pl' -or -name '*.pm' -or -name '*.pod' | grep -v .svn)
$ ack --perl pattern
- Which would you rather type?
- File-filtering capabilities usable without searching with ack -f. This lets you create lists of files of a given type.
$ ack -f --perl > all-perl-files - Color highlighting of search results.
- Uses real Perl regular expressions, not a GNU subset.
- Allows you to specify output using Perl's special variables
- Example: ack '(Mr|Mr?s)\. (Smith|Jones)' --output='$&'
- Many command-line switches are the same as in GNU grep:
-w does word-only searching
-c shows counts per file of matches
-l gives the filename instead of matching lines
etc. - Command name is 25% fewer characters to type! Save days of free-time! Heck, it's 50% shorter compared to grep -r.
Há uma ferramenta similar feita em python
http://pypi.python.org/pypi/grin
Leia mais sobre o grin aqui.
Documentação do py3k e python em formato de ajuda do vim
Ajuda para a biblioteca do python 2
http://www.vim.org/scripts/script.php?script_id=3277#1.0
para py3k
http://www.vim.org/scripts/script.php?script_id=3278#1.0
http://www.vim.org/scripts/script.php?script_id=3277#1.0
| Installing this help file will give you access to the Python 2.7 standard library documentation as a Vim help file (available from within Vim by typing ":help py2stdlib"). For this release I've only tagged the module names (otherwise the help tagspace becomes too cluttered). |
| install details |
| 1. Download the file. 2. Change to your $VIMRUNTIME directory (e.g., "cd ~/.vim"). 3. Unarchive the file (e.g., "unzip ~/Downloads/py2stdlib.zip"). 4. Change to the "doc" subdirectory (e.g., "cd doc"). 5. Rebuild the tags: "vim -c ":helptags . | :q" |
para py3k
http://www.vim.org/scripts/script.php?script_id=3278#1.0
| description |
| Installing this help file will give you access to the Python 3.1 standard library documentation as a Vim help file (available from within Vim by typing ":help py2stdlib"). For this release I've only tagged the module names (otherwise the help tagspace becomes too cluttered). |
| install details |
| 1. Download the file. 2. Change to your $VIMRUNTIME directory (e.g., "cd ~/.vim"). 3. Unarchive the file (e.g., "unzip ~/Downloads/py3stdlib.zip"). 4. Change to the "doc" subdirectory (e.g., "cd doc"). 5. Rebuild the tags: "vim -c ":helptags . | :q" |
Primeiro Curso de Python PugCE
O grupo de usuários Python do Estado do Ceará PUG-CE promove o seu primeiro curso presencial:
Inscrições
Interessados em se inscrever devem ler e preencher o seguinte formulário.Mais informações sobre o curso.
Já é possível rodar python no android
Veja a notícia no Br-linux
http://br-linux.org/2009/python-comeca-a-rodar-no-android/
http://br-linux.org/2009/python-comeca-a-rodar-no-android/
videos Python para Manipulação de Áudio e Música Experimental
O Renato Fabbri criou alguns vídeos sobre manipulação de Audio e Música em python, estou divulgando seu trabalho
Python para Manipulação de Áudio e Música Experimental
1 - Página de rosto (alguns minutos)
Infos sobre a palestra que originou o vídeo e sobre o autor.
http://ubuntuone.com/p/DBL/
2- Linhas gerais da série de videos (alguns minutos)
Sobre os tópicos abordados e sua sequencia.
http://ubuntuone.com/p/DBM/
3- Introdução (alguns minutos)
Python e interesses da linguagem para áudio e música.
http://ubuntuone.com/p/DBN/
4- Bibiotecas (uma hora e uns 20 min)
Os módulos de interesse da biblioteca padrão vistos com código e
terminal interativo IPython. Falácia rápida sobre módulos externos a
serem abordados no próximo video.
http://ubuntuone.com/p/DBO/
Python para Manipulação de Áudio e Música Experimental
1 - Página de rosto (alguns minutos)
Infos sobre a palestra que originou o vídeo e sobre o autor.
http://ubuntuone.com/p/DBL/
2- Linhas gerais da série de videos (alguns minutos)
Sobre os tópicos abordados e sua sequencia.
http://ubuntuone.com/p/DBM/
3- Introdução (alguns minutos)
Python e interesses da linguagem para áudio e música.
http://ubuntuone.com/p/DBN/
4- Bibiotecas (uma hora e uns 20 min)
Os módulos de interesse da biblioteca padrão vistos com código e
terminal interativo IPython. Falácia rápida sobre módulos externos a
serem abordados no próximo video.
http://ubuntuone.com/p/DBO/
Baixe videos do youtube via terminal
apt-cache search youtube-dl
ou simplesmente:
sudo apt-get install youtube-dl
O projeto é em python
http://bitbucket.org/rg3/youtube-dl/wiki/Home
Conhece o "detox"?
Detox is a utility designed to clean up filenames. It replaces difficult to work with characters, such as spaces, with standard equivalents. It will also clean up filenames with UTF-8 or Latin-1 (or CP-1252) characters in them.
sudo apt-get install detox
site: http://detox.sourceforge.net/
python solution: active-state
sudo apt-get install detox
site: http://detox.sourceforge.net/
python solution: active-state
Calculando numeros primos em python
Este post surge inicialmente à partir do Project Euler: Diversão com programação e matemática, calculando números primos. Guardei a notícia no google reader e hoje estive lendo o site do José Lopes de Oliveira Júnior mais especificamente neste link sobre calculo de numeros primos, no exemplo é citado o "Crivo de Eratóstenes".
Fuçando na web achei um código que quero melhorar com a ajuda dos nobres leitores e saber se ele se enquadra na definição do Crivo de Eratóstens. Segue o código:
Obs: Nos comentários do post original -->>; Dica: use o crivo de eratóstenes. Dá pra fazer a solução rodar em menos de 1 segundo.
Veja este post.
Fuçando na web achei um código que quero melhorar com a ajuda dos nobres leitores e saber se ele se enquadra na definição do Crivo de Eratóstens. Segue o código:
Obs: Nos comentários do post original -->>; Dica: use o crivo de eratóstenes. Dá pra fazer a solução rodar em menos de 1 segundo.
Veja este post.
Assinar:
Postagens (Atom)
linux-cookbook
|
|
| Participe do grupo linux-cookbook |
| Visitar este grupo |
