También está Gtk, no he probado ninguna opción, pero el otro día viendo un script con Gtk, se me hizo bastante sencillo usar Gtk.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Leo Gutiérrez Ramirez, leorocko13@hotmail.com
# html2txt by Francois Granger, <fgranger@altern.org>
import sys
import re
import urllib
def Usage():
print "\nRealiza busquedas en el diccionario de la [Real Academia Española]\n";
print "\t" + sys.argv[0] + " Palabra\n";
sys.exit(1);
if len(sys.argv) <= 1:
Usage();
url = "http://buscon.rae.es/draeI/SrvltGUIBusUsual?LEMA=" + sys.argv[1]
f = urllib.urlopen(url);
texto = f.read();
f.close();
# Convierte el código HMTL a texto para ser mostrado correctamente en la consola:
p = re.compile('(<p.*?>)|(<tr.*?>)', re.I)
t = re.compile('<td.*?>', re.I)
comm = re.compile('<!--.*?-->', re.M)
tags = re.compile('<.*?>', re.M)
def html2txt(texto, hint = 'entity', code = 'ISO-8859-1'):
texto = texto.replace('\n', '') # remove returns time this compare to split filter join
texto = p.sub('\n', texto) # replace p and tr by \n
texto = t.sub('\t', texto) # replace td by \t
texto = comm.sub('', texto) # remove comments
texto = tags.sub('', texto) # remove all remaining tags
texto = re.sub(' +', ' ', texto) # remove running spaces this remove the \n and \t
# Handling of entities
result = texto;
pass;
return result;
print html2txt(texto);
sys.exit(0);
python rae.py palabra
Cita de: markus_bitman en 30 Marzo 2010, 21:56 PM
Bueno por lo menos ya me funciona en parte este codigo.
$file = FileOpen("Resultados.txt", 0)
for $i = 1 to 10
$line = FileReadLine($file, $i)
MsgBox(0, "Line read:", $line)
Next
FileClose($file)
Pero ahi vamos dandole!!!!!
public class learn :)
{
private static void printNames(String []names)
{
for(String name : names)
System.out.println("Hola " + name);
}
public static void main(String []args)
{
String []names = {"Juan", "Pedro", "Jeremias"};
printNames(names);
}
}
#!/usr/bin/python
import re
cadena = "Link(base_url='file:/home/alejandro/Escritorio/1biinox.php.html', url='http://vale.com/scripts/runner.php?IM=45b2a2ec96953.', text='* Ejemplo* aquamails', tag='a', attrs=[('href', 'http://vale.com/scripts/runner.php?IM=45b2a2ec96953.'), ('target', '_inbox')])";
print cadena, "\n\n";
t = cadena[cadena.find("http://"):]
print t,"\n";
t = t[:t.find(" ")]
print t
http://www.amk.ca/python/howto/regex/
http://docs.python.org/library/re.html#re-syntax
http://stackoverflow.com/questions/520031/whats-the-cleanest-way-to-extract-urls-from-a-string-using-python
Cita de: algorythm en 27 Marzo 2010, 15:57 PMimport math
def menor(a,b):
return a if(a <= b) else b
def raiz2(a,b):
c = a//b
if(math.fabs(b - c) <= 1):
return menor(a,b)
else:
raiz2(a,(b + c)//2)
a = 170000
b = raiz2(a,3)
print(b)
¿Por qué razón no devuelve el valor que es 412?
PD: Depuré hasta que llega al printf y ahí no hallo el error.
type file.txt | nc ....