Re: Python serial data aquisition

2005-01-24 Thread Miki
e. Also http://tebeka.bizhat.com/Software/bitter.py HTH. Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: packaging python for install.

2005-09-12 Thread Miki
n >packaging python with an application in a single installer ? Has that >been done before ? http://starship.python.net/crew/theller/moin.cgi/ShippingEmbedded HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2004-12-16 Thread miki
#x27;s all! You'll have a working .pyd ready to rock. Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: what's with "self"?

2006-08-08 Thread Miki
n, but no-one has really spelt it out (in idiot > form!) in a way I can understand. Note that apart from what all the other pepole said, "self" is not a reserved word. It's just the wide convention that we use the name "self". If you know C++/Java then "self" i

Re: Looking for an intellisense with good help IDE for Python

2006-08-08 Thread Miki
ll on a particular data item. > > This includes % after a string. > > I would also like browseable help with good examples on whatever > methods and functions and operators it pops up. The IDLE that will come (soon) with Python 2.5 with have some intellisense. Not all that you requeste

Re: Which Python API for PostgreSQL?

2006-08-08 Thread Miki
Hello Scott, > Which one do you use? psycopg2 (http://initd.org/tracker/psycopg/wiki/PsycopgTwo) > What do you like about it? Compiles and works. Has support for Postgres array types. Also thread safe. HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/

Re: Getting previous file name

2006-08-08 Thread Miki
ctime(file1), getctime(file2)) def walktree(path): file_list = [] for root, dirs, files in walk(path): file_list += [join(root, file) for file in files] file_list.sort(cmp_file_by_ctime) return file_list[-2] HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing Yahoo Mail withtout POP

2006-08-08 Thread Miki
Hello T, > Is there a way to access yahoo mail via its web interface? If so, can > someone give some pointers? http://www.crummy.com/software/BeautifulSoup/ http://wwwsearch.sourceforge.net/ClientForm/ HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/

Re: Import module with non-standard file name

2006-08-08 Thread Miki
Hello Ben, > Question: I have Python modules named without '.py' as the extension, > and I'd like to be able to import them. How can I do that? http://docs.python.org/lib/module-imp.html (hint: load_source :) HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python

Re: Python Projects Continuous Integration

2006-08-08 Thread Miki
ruiseControl can take care of all the rest. I also found that writing a simple Continuous integration system myself was a very simple task in Python, it might be a good choice as well. (I resorted to this solution after giving up on trying to install Java on OpenBSD.) HTH, Miki http://p

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Miki
SQLObject (http://www.sqlobject.org/) and SQLAlchemy (http://www.sqlalchemy.org/) can do this work for you (IIRC). HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE with python 2.5

2006-08-22 Thread Miki
t mean that we can now debug embedded python with IDLE ? I don't think so, it just open a new "python.exe" process and communicates with it via TCP. HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: HTMLParser chokes on bad end tag in comment

2006-05-29 Thread Miki
Hello Rene, You can also check out BeautifulSoup (http://www.crummy.com/software/BeautifulSoup/) which is less strict than the regular HTML parser. HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Yet Another Python Blog

2006-06-19 Thread Miki
Hello All, Decided that there are not enough blogs out there so http://pythonwise.blogspot.com/ is up :) This blog will feature a weekly (or about) Python code examples. I'll be glad to hear your comments. Miki, http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/p

Re: can't find win32api from embedded pyrun call

2006-06-19 Thread Miki
directories including the one with win32api.pyd. > Besides, if it were an install or path problem, why would it work at > the command prompt? IIRC you need to set the path explicitly in an embedded interpreter. See the code in "site.py" (which again IMO is *not* imported when the interpreter starts). HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: need all python dialog equivalent

2006-06-20 Thread Miki
Hello Eric, > Is there anything like an all Python dialog equivalent floating around? http://www.pythonware.com/library/tkinter/introduction/ HTH, -- Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Miki
that in some rare cases sys.path[0] might not contain the script directory. For example in an executable created by py2exe). HTH. -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread Miki
://www.unixreview.com/documents/s=9133/ur0404e/ur0404e_listing1.htm -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Forgetting an import

2007-06-12 Thread Miki
f them :) >>> import my_module >>> my_module.add(1, 1) 4 [Hack] >>> reload(my_module) >>> my_module.add(1, 1) 2 HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Classification Frameworks?

2007-06-12 Thread Miki
are there any texts that anyone can recommend to > me for learning more about this area? A good book about NLP is http://nlp.stanford.edu/fsnlp/ which have a chapter about text classification. http://www.cs.cmu.edu/~tom/mlbook.html has some good coverage on the subject as well. HTH. -- Miki Te

Re: web page text extractor

2007-07-12 Thread Miki
m from sys import argv OUTFILE = "geturl.txt" system("lynx -dump %s > %s" % (argv[1], OUTFILE)) system("start notepad %s" % OUTFILE) (You can find lynx at http://lynx.browser.org/) Note the removing sidebars is a very difficult problem. Search for &q

Re: Break up list into groups

2007-07-18 Thread Miki
, 15 ] for g in group(i): print g HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to POST to web page with cookies?

2007-07-19 Thread Miki
tes, and GOTO 1 > ... http://wwwsearch.sourceforge.net/mechanize/ HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C Embedded ! Attribute Error

2007-07-20 Thread Miki
ad\n"); Py_Finalize(); return 1; } func = PyObject_GetAttrString(module, "pr"); args = PyTuple_New(1); value = PyLong_FromLong(10); PyTuple_SetItem(args, 0, value); PyObject_CallObject(func, args); Py_Finalize(); return 0; } HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: code packaging

2007-07-20 Thread Miki
s done, start using some "continuous automation" tools (like http://cruisecontrol.sourceforge.net/, http://buildbot.net/trac and others). HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find a lable quickly?

2007-05-04 Thread Miki
bels[label] = value.strip() Another option is to use an external fast program (such as egrep): from os import popen labels = {} for line in popen("egrep 'endtest|other_label' test.txt"): label, value = line.strip().split() labels[label] = value HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie and Page Re-Loading

2007-05-04 Thread Miki
append("/path/to/my/modules") Note that your script directory is automatically added to the path. > Is there a lightweight Https Server I could run locally (WINXP), which > would run .py scripts, without lots of installation modifications ? http://lighttpd.net. Make sure "mod_cgi" is uncommented, set your document root and set right python interpreter in cgi.assign HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Typed named groups in regular expression

2007-05-16 Thread Miki
Hello Hugo, > Is it possible to "automagically" coerce the named groups to python types? > e.g.: Not that I know of, however I use the following idiom: match = my_regexp.find(some_string) def t(name, convert=str): return convert(match.group(name)) myint = t("field1

Re: how to use python to checking password on servlet

2007-05-22 Thread Miki
a GET method, just specify it using the form METHOD="GET" attribute). HTH. -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: OSError[Error 5]

2007-05-22 Thread Miki
Hello SamG, > I do this on PowerPC.. > > >>> import os > >>> os.listdir('/usr/bin') > > And endup getting this ... > > OSError: [Error 5] Input/output error:/usr/bin What happens when you run "ls /usr/bin" in the terminal? HTH, -- Mik

Re: Website data-mining.

2007-08-03 Thread Miki
7;m not even > sure if this is possible through Python. Any help? Have a look at http://www.myinterestingfiles.com/2007/03/playboy-germany-ads.html for getting the data and at http://www.crummy.com/software/BeautifulSoup/ for handling it. HTH. -- Miki Tebeka <[EMAIL PROTECTED]> http://py

Re: Website data-mining.

2007-08-04 Thread Miki
elp the OP > get data from a website... Ouch, let there be a lesson to me to *read* my posts before sending them :) Should have been http://wwwsearch.sourceforge.net/mechanize/. -- Miki (who can't paste) Tebeka [EMAIL PROTECTED] http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: import * is not allowed ??

2007-08-13 Thread Miki
s" ? http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_idx_590 HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast kNN from python

2007-08-14 Thread Miki
search for "k-Nearest Neighbors python", yielded http://people.revoledu.com/kardi/tutorial/KNN/resources.html which pointed to http://biopython.org/DIST/docs/api/public/Bio.kNN-module.html HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread Miki
le-curses.html Another solution is to ask the user to hit CTRL-C from time import sleep try: while 1: print "BEEP" sleep(1) except KeyboardInterrupt: print "BYE BYE" HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Spell-checking Python source code

2007-09-08 Thread Miki
s). Same in Vim (:set spell) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: debugging program that uses ctypes

2007-09-08 Thread Miki
> and dateutil libraries in my program and I don't know how to make them > visible to python_d.exe > Am I using the right approach? If you are the one compiling the called module, you can add `__asm int 3` somewhere in the code. When this is reached, the windows debugger will pop up on th

Re: Using s.sort([cmp[, key[, reverse]]]) to sort a list of objects based on a attribute

2007-09-08 Thread Miki
> steps.sort(key = lambda s: s.time) This is why attrgetter in the operator module was invented. from operator import attrgetter ... steps.sort(key=attrgettr("time")) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions from an except: block

2007-03-07 Thread Miki
correct but looks the clearest to me > def wished_first(x): > try: > return a(x) > except: > return b(x) > except: > return c(x) > except: > raise CantDoIt Again, exception are for error handling, not for flow control. As a side n

Re: Subclassing: what is wrong here?

2007-03-15 Thread Miki
Hello Paulo, > What's wrong with this way of subclassing? > ... See http://sourceforge.net/tracker/index.php?func=detail&aid=1448640&group_id=5470&atid=105470 HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-21 Thread Miki
un param1 (myfun2 param5 param8) param3 If you have result = func1 func2 arg is it result = func1(func2, arg) or result = func1(func2(arg)) Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Making GIF image twice the size - in memory

2007-03-22 Thread Miki
tuple(map(lambda x: 2 * x, im.size)) new = im.resize(new_size) return new.tostring("gif", "P") # This is probably the problem, have no idea image_data = urlopen(url).read() image_data = double(image_data) code However I don't get a valid GIF image. An

Re: p2p chat framework

2007-04-02 Thread Miki
Hello Ghirai, > Are there any p2p chat/filetransfer frameworks/examples floating > around? http://divmod.org/projects/shtoom HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel ping problems python puzzler

2007-04-02 Thread Miki
Hello, >def run(self): > # -w 1 option to ping makes it timeout after 1 second > pingcmd="/bin/ping -c 2 -q -i 0.3 -w 1 %s >/dev/null" % ip Not sure, but "ip" should be "self.ip", this might cause the problem. HTH, -- Miki <[EMA

Re: stop script w/o exiting interpreter

2007-01-25 Thread Miki
raise SystemExit" is what you want. If you want to enter the debugger, you can do: from pdb import set_trace ... set_trace() # Stop and execute debugger here. ... HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Help extracting info from HTML source ..

2007-01-26 Thread Miki
scraping (IMO). from urllib import urlopen from BeautifulSoup import BeautifulSoup html = urlopen("http://www.python.org";).read() soup = BeautifulSoup(html) for link in soup("a"): print link["href"], "-->", link.contents HTH, -- Miki http://

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Miki
def aggregate(lst): items = {} # key -> values for key, value in lst: values = items.get(key) if values: if type(values) == list: values.append(value) else: items[key] = [values, value] else: items[key] = value return [list(pair) for pair in items.items()] >>> aggregate(lst) [['a', ['13', '3']], ['c', ['12', '15', '4']], ['b', '6'], ['e', ['11', '5', '16', '7']], ['d', '2']] >>> HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I print out in the standard output coloured lines

2007-02-02 Thread Miki
Hello Carlos, > I'm interested in printing out coloured lines of my application and > I don't know what to use. Can anybody give me an idea?? I use the following script: #!/usr/bin/env python '''Print message using ANSI terminal codes''' __auth

Re: question with inspect module

2007-02-20 Thread Miki
nd_line) and (fname == filename): print "%s is from B" % name HTH, -- Miki Tebeka <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird result returned from adding floats depending on order I add them

2007-02-21 Thread Miki
gt; b = [0.2, 0.2, 0.2, 0.2, 0.1, 0.1] >>> qa = [gmpy.mpq(int(i * 10), 10) for i in a] >>> qb = [gmpy.mpq(int(i * 10), 10) for i in b] >>> sum(qa) mpq(1) >>> sum(qb) mpq(1) >>> sum(qa) == sum(qb) True HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Miki
Hello Anya, See http://docs.python.org/lib/node597.html IMO if you'll place the picture as 1'st MutliMime part the *some* email readers will show it like you want. HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any pure python webserver that can use FCGI

2006-05-14 Thread Miki
Hello llothar, IIRC trac (http://www.edgewall.com/trac/) is pure python, have a web server and support FCGI HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils and binding a script to a file extension on windows

2006-05-14 Thread Miki
Hello Alex, Not really an answer but if you use InnoSetup (http://www.jrsoftware.org/) you can set file type association (see http://www.jrsoftware.org/isfaq.php) HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile Python

2006-05-15 Thread Miki
Hello Zoidberg, > How would one compile python with Visual Studio 2005? By reading the section "Building on non-UNIX systems" in the README file (hint: chceck out the "PC" directory) Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework to recommend

2006-05-15 Thread Miki
Hello Jacky, I found CherryPy + Cheeta a good solution. See (shameless plug) http://www.unixreview.com/documents/s=10075/ur0604h/ Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Job Offer (Herzelia, Israel)

2006-05-18 Thread Miki
Job Title: Python Application Expert Company: Logia (http://www.logiamobile.com) Contact: Lior Rudnik ([EMAIL PROTECTED]) Job Description: * Design & Development of our leading product's PC client application * Development in Python Job Requirements: * At least 4 years of experience

Re: getting the value of an attribute from pdb

2006-05-18 Thread Miki
Hello Gary, > (Pdb) p root.title > > > (Pdb) p root.title[Tk.wm_title] Looks like "title" is a function, try "p root.title()" HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to make the program notify me explicitly

2006-05-18 Thread Miki
- see msnpy and other libraries HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to couple pyunit with GUI?

2006-05-18 Thread Miki
Hello volcano, http://pyunit.sourceforge.net/ has unittestgui.py (bit old though) HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: using wxPython events inside a loop

2006-05-18 Thread Miki
Hello BigSmoke, You can process one at a time in an "OnIdle" handler, this way you'll work only when the application is doing nothing. HTH, Miki, http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: pickling multiple dictionaries

2006-05-24 Thread Miki
Hello Matthew, You can try either http://docs.python.org/lib/module-shelve.html or any other database bindings with blobs. HTH, Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: ftputil.py

2006-05-24 Thread Miki
tml', 'r') # file-like object Open a file (like built-in "open") on remote site in read mode > target = host.file('newdir/index.html', 'w') # file-like object Open a file (like built-in "open") on remote site in write mode > host.copyfile

Re: Running External Commands + Seeing when they are Finished

2006-05-28 Thread Miki
Hello Tommy, Use the subprocess module (http://docs.python.org/lib/module-subprocess.html). for app in MY_APPLICATION_LIST: pipe = Popen(app) pipe.wait() HTH, http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Linking onClick event to other controls on the Frame

2006-05-28 Thread Miki
e:", self._last_name.GetValue() print >> fo, "Work Status:", self._work_status.GetStringSelection() print >> fo, "Martial Status:", self._martial_status.GetStringSelection() fo.close() HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed up this code?

2006-05-28 Thread Miki
Hello Martin, You can use gmpy (http://gmpy.sourceforge.net/) def primes(): n = 2 while 1: yield long(n) n = gmpy.next_prime(n) HTH, Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about event handlers with wxPython

2008-01-14 Thread Miki
Hello Eric, > I'd appreciate any pointer on a simple way to tell within an event handler > where the event came from. def HandleSomething(self, event): generating_control = event.GetEventObject() print generating_control HTH, -- Miki Tebeka <[EMAIL PR

Re: Is there some Python function that searches "sys.path" for a module?

2008-01-14 Thread Miki
o > "import", but not to the starting module named on the Python command > line.  Is that correct?  Thanks. http://docs.python.org/lib/module-imp.html HTH, -- Miki Tebeka <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

[OT] "Code Friendly" Blog?

2008-01-17 Thread Miki
Hello, Posting code examples to blogger.com hosted blog is not fun (need to remember alway escape < and >). Is there any free blog hosting that is more "code friendly" (easy to post code snippets and such)? Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise

Re: "Code Friendly" Blog?

2008-01-17 Thread Miki
ss up the first indentation in the section :) Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: loading dictionary from a file

2008-02-06 Thread Miki
t; could do (foreach line in file, split by ":" and then do dictionary > insert). Wondering, if some python built-in function can just read a > valid dictionary-file and load it? def load_as_dict(filename): return eval("{" + open(filename).read() + "}") Note that t

Re: Time conversion between UTC and local time

2008-02-08 Thread Miki
g time) with that data? > The date is not important, just the local time. > The format is not important, the easiest would probably be a tuple > (h,m,s) . http://labix.org/python-dateutil HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: using scons as a library

2008-02-08 Thread Miki
ne has an > example that would help to shorten my learning curve. Just have a look at the "scons" script: import SCons.Script SCons.Script.main() Looks simple enough. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: unitests don't run under pdb

2008-02-20 Thread Miki
-- > Ran 0 tests in 0.000s > > OK > --- IIRC unittest checks the __main__ module for tests to run. Once you run python with "-m pdb" the __main__ module is pdb and not your script. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib & gnupg

2008-02-20 Thread Miki
Hello Bernd, > at the moment my program sends mail with smtplib. Is there a chance to > sign and/or encode/cipher this mails with GnuPG? > If yes, does anyone have some sample code? Not exactly Python, but maybe http://codesorcery.net/old/mutt/mutt-gnupg-howto might help. HTH, -- Mik

Tkinter OSX and "lift"

2008-02-20 Thread Miki
to start as the topmost window? Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter OSX and "lift"

2008-02-21 Thread Miki
hout the user clicking on the python launcher icon). All the best, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter OSX and "lift"

2008-02-21 Thread Miki
ers don't run Python apps from the Terminal but > instead double-click an application icon. In that event, "lift" should > work fine, because the application will already have focus. Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter OSX and "lift"

2008-02-22 Thread Miki
conify) > root.mainloop() > > This was a trick that had to be done on Windows a few years back to force   > the main window to be created on top of this others. It deosn't seem to be   > needed anymore now, but maybe the trick can be used on a Mac... Don't know   > if th

Re: Getting stdout from other processes

2008-02-22 Thread Miki
read the client output and propagate it to the main loop (maybe using Queue.Queue) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: (Newbie) Help with sockets.

2008-02-28 Thread Miki
they all > communicate. IMO you should start with twisted (http://twistedmatrix.com/trac/), which simplifies socket programming very much. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: 'normal' shell with curses

2008-03-03 Thread Miki
the shameless plug in http://pythonwise.blogspot.com/2008/03/ansiprint.html HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: tools to install not in python tree?

2008-03-03 Thread Miki
y better.  Is there such > a tool? Have a look at http://docs.python.org/lib/module-distutils.html, specially http://docs.python.org/dist/node13.html and http://docs.python.org/inst/alt-install-windows.html HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CGI & Webpage with an Image

2008-03-05 Thread Miki
ippet? error page? ... My *guess* is that the web server don't know how to server the image (wrong path configuration?) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing the size of a Button

2008-03-09 Thread Miki
) def change_size(): b["text"] = "More text" b = tk.Button(root, text="Text", command=change_size) b.pack() root.mainloop() You'll see that the button changes size to accommodate the new text. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwi

Re: Parse specific text in email body to CSV file

2008-03-09 Thread Miki
t; data. import re for match in re.finditer("_([\w ]+):_(\d+)", text): print match.groups()[0], match.groups()[1] for match in re.finditer("Date: ([^=]+)=", text): print match.groups()[0] for match in re.finditer("(\w+): (\d+)", text): print match.groups()[

How to make a Tkinter widget always visible?

2008-03-11 Thread Miki
? Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Exctract GIF comment from image

2008-03-11 Thread Miki
ions? Use ImageMagick (www.imagemagick.org), "identify -verbose " should have the comments somewhere in the output. There also a python binding to ImageMagick but I have no experience with it. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make a Tkinter widget always visible?

2008-03-11 Thread Miki
bitrary resizing of the > window, there's no real way to guarantee that the widgets will be > visible at all times. Thanks. I've set a minimal size to the window. However when I resize it to be shorter, the buttons are hidden while the top frame stays visible. T

Re: How to parse this timestamp?

2008-03-12 Thread Miki
> > (PS: I have no clue why google groups thinks it should put > "gnu.gcc.help" on the from line) Just zap the end and use time.strptime: >>> s = '19-Aug-2007 07:38:43+216ms NZST' >>> strptime(re.sub("\+\d{3}ms [A-Z]{4}", "", s), "

Re: How to make a Tkinter widget always visible?

2008-03-12 Thread Miki
buttons frame first (using side=BOTTOM), it stays visible at all times. Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: C extensions question

2008-03-12 Thread Miki
current directory is always looked first in when loading DLLs). HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Miki
Any thoughts or ideas that could help me get started? Thanks! Apart from PIL, some other options are: 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object you can draw on 2. A bit of an overkill, but you can use PyOpenGL 3. ImageMagick bindings? (http://www.imagemagick.org/script

Re: Distributing Python Apps on Linux\BSD

2008-03-21 Thread Miki
installer: apt/deb, rpm, port, ... On Windows you can use one of the free installer (InnoSetup and friends). HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: what are generators?

2008-03-25 Thread Miki
On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote: > I'm looking for a cool trick using generators.  Know any exercises I > can work? Simple one the comes to mind is flattening a list: >>> list(flatten([1, [[2], 3], [[[4)) [1, 2, 3, 4] >>> HTH, --

Re: first interactive app

2008-03-26 Thread Miki
0 300 Chapter 3 (300-450 150) Chapter 4 (450-500 50) -- 300-450 250 Chapter 5 (500-600 100) -- 500-600 100 Where the user can move the divider up and down to create new volume, they can also add and delete dividers. The program will not allow to drag the

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Miki
before? Nope, compiles out of the box for me on 7.1 (IIRC easy_install worked for it as well). > Any comment/suggestion is highly appreciated. Do you have limits.h on your system? Did you install the python2.5-dev package? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

ctypes and gmp

2008-03-27 Thread Miki
("_mp_d", POINTER(c_uint)), ] gmp = cdll.LoadLibrary("libgmp.so") m = mpz() gmp.__gmpz_init(byref(m)) gmp.__gmpz_set_ui(byref(m), 27) gmp.__gmp_printf("m is %d\n", byref(m)) However, the output is: m is -1210863888 Any ideas? (gmp.h can bee view at http://t

Re: Instrumented web proxy

2008-03-27 Thread Miki
t it should be quite straightforward, but > I'm finding the code a bit opaque. > > Any suggestions? >From a quick look at the code, you need to either hook to do_GET where you have the URL (see the urlunparse line). If you want the actual content of the page, you'll need t

Re: Tips Re Pattern Matching / REGEX

2008-03-27 Thread Miki
= BeautifulSoup(html) for div in soup("div", {"class" : "special"}): ... Not sure how fast it is though. There is also the htmllib module that comes with python, it might do the work as well and maybe a bit faster. If the file is valid HTML and you need some sp

Re: first interactive app

2008-03-27 Thread Miki
stuff. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   >