Re: Return and set

2011-07-19 Thread Micah
That sounds artificially backwards; why not let getToken() reuse peekToken()? def peek(self): if self.tok is None: try: self.tok = self.gen.next() except StopIteration: self.tok = NULL return self.tok def pop(self): token = self.peek() self.

Objects versus dictionaries

2010-11-14 Thread Micah Carrick
id(): cust = { 'name': "John", 'email': "f...@bar.com" } order = { 'order_id': 1234, 'amount': 12.99 } SomeObject.some_method(stuff, cust, order) -- Micah Carrick -- http://mail.python.org/mailman/listinfo/python-list

Use company name for module

2010-11-12 Thread Micah Carrick
g modules like company.foo and company.bar even if foo and bar are not necessarily related other than being released by us? I really don't like the cryptic module names or things like foo2 and the like. -- Micah Carrick - http://www.micahcarrick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: open filename with spaces in path

2008-05-06 Thread Micah Elliott
;>> open('./test') > > works just fine. How doctored up is this example? In the above ./test should not actually exist. Did the chdir actually work? Or did you remove the .txt? -- Micah Elliott | [EMAIL PROTECTED] | http://MicahElliott.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: os.open and O_EXCL

2008-05-06 Thread Micah Elliott
On 2008-05-01 Ethan Furman wrote: > I am trying to lock a file so no other process can get read nor > write access to it. This looks promising: http://pypi.python.org/pypi/lockfile/0.2 -- Micah Elliott | [EMAIL PROTECTED] | http://MicahElliott.blogspot.com signature.asc Descr

Re: Best way to store config or preferences in a multi-platform way.

2008-05-01 Thread Micah Elliott
platform. The biggest challenge might be choosing which one to adopt: http://wiki.python.org/moin/ConfigParserShootout -- Micah Elliott | [EMAIL PROTECTED] | http://MicahElliott.blogspot.com signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding coding style

2008-03-08 Thread Micah Cowan
recommend using "descriptive names for globals, short names for locals," saying "within a function, may be sufficient, is fine, and is overkill." As you point out, even for non-super-small scopes, such as class members, it can make more sense to use single-let

Re: Regarding coding style

2008-03-07 Thread Micah Cowan
ICT, it's a (thankfully) disappearing practice in the typesetting profession. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding coding style

2008-03-07 Thread Micah Cowan
periods. Knuth's typesetting program, Τεχ, in its default "plain" format (and in the popular Laτεχ format as well), will add extra space at the ends of sentences automatically (I always disable this functionality when I write for either of those; I believe the command is "\fre

Re: Dual look-up on keys?

2008-03-05 Thread Micah Cowan
[a]= True >> assert b not in d >> #there's the hangup > > *plonk* > > key is an iterable, just like the constructors to > other collection. Um... "*plonk*" is the (imaginary) sound made by dropping someone into your plonkfile (killfile, scorefile, whatever): the action of setting your newsreader to ignore someone you perceive to be a troll. I have extreme doubts that you have actually done this to _yourself_. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes and modules are singletons?

2008-03-05 Thread Micah Cowan
appropriate objects already found in sys.modules. >>> import sys >>> ll = [] >>> for i in range(2): ... import string ... ll.append(string) ... del sys.modules['string'] ... >>> ll[0] is ll[1] False (I'm sure there are very good reasons

Re: Book Recomendations

2008-03-02 Thread Micah Cowan
27;Reillys Programming Python assumes you already have a working knowledge of basic Python programming (that is, it assumes you've read Learning Python). -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Book Recomendations

2008-03-01 Thread Micah Cowan
ell. I have found the official documentation available at python.org (including both the tutorial and references) to be very high-quality. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd behaviour with list comprehension

2008-02-29 Thread Micah Cowan
sibly could, since it just evaluates to an object that you could pass around, and return, using it the same way elsewhere. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd behaviour with list comprehension

2008-02-29 Thread Micah Cowan
ither. > Is there a way for me keep the iterating variable in list > comprehension local to the list comprehension? Not really, AFAIK. Other than to do it within a separate block, of course, but that's rather cumbersome (writing a new function would do it, but that's more trouble than it&#

Snackages [Re: is there enough information?]

2008-02-27 Thread Micah Cowan
Sacramento area), Wendy's and In-N-Out are the only "fast food" chains that sell anything that taste like real hamburgers. Way, _way_ better than the cardboard stuff at McD's and BK. Though Carl's Jr's $6 burgers are okay. And Carl's has _terrific_ ice c

Re: network programming: how does s.accept() work?

2008-02-26 Thread Micah Cowan
do) of the address/port combination. To reiterate for 7stud, accepting a new "connection socket" does _not_ change the address or port from the originally bound "for-listening" socket. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: network programming: how does s.accept() work?

2008-02-26 Thread Micah Cowan
Grant Edwards wrote: > On 2008-02-26, Micah Cowan <[EMAIL PROTECTED]> wrote: > >> 7stud, what you seem to be missing, and what I'm not sure if anyone has >> clarified for you (I have only skimmed the thread), is that in TCP, >> connections are uniquely ident

Re: network programming: how does s.accept() work?

2008-02-26 Thread Micah Cowan
also directed at port 80 of google.com), is crucial to knowing which packets to watch for while you're looking at the traffic. -- HTH, Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Python statically on linux

2007-12-28 Thread Micah Elliott
On Dec 28, 5:44 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Can you work on the topic and write a small howto for your wiki > (http://wiki.python.org/moin/)? Good idea. I've created a placeholder (with what I know so far, not much) to track this: http://wiki.python.org/moin/BuildStatica

Re: Building Python statically on linux

2007-12-27 Thread Micah Elliott
means to do this (that anyone has documented). So now I'm open to hearing about other hacks people have done to get this to work. (Hopefully a config weenie heard my plea for --enable-all- static) -- Micah -- http://mail.python.org/mailman/listinfo/python-list

Building Python statically on linux

2007-12-27 Thread Micah Elliott
rnings during the compilation, and then "make install" mysteriously failed. Thanks for any pointers. -- Micah -- http://mail.python.org/mailman/listinfo/python-list

Re: Reversible replacement of whitespace characters with visible characters

2006-06-02 Thread Micah
James Stroud wrote: > Micah wrote: > > Hi, > > > > I'm looking for a tool to do the following 2 things: > > > > 1) Given a string (ie. file, std input, whatever), replace all > > whitespace characters with visible characters (like their Unicode value &g

Reversible replacement of whitespace characters with visible characters

2006-06-02 Thread Micah
t makes a difference. Can anyone think of a tool that already does this? I could probably whip something up, but if there's already something that does it I'd rather just use it. Micah -- http://mail.python.org/mailman/listinfo/python-list

Re: begging for a tree implementation

2006-04-26 Thread Micah
Sybren Stuvel wrote: > Micah enlightened us with: > > I'm looking for a simple tree implementation: 0-n children, 1 root. > > All the nice methods would be appreciated (getLeaves, isLeaf, > > isRoot, depthfirst, breadthfirst,...) That's really all I need. I >

begging for a tree implementation

2006-04-26 Thread Micah
ht now. Thanks! Micah -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Micah Elliott
On Dec 02, Dave Hansen wrote: > Python recognizes the TAB character as valid indentation. TAB > characters are evil. They should be banned from Python source code. AGREE! AGREE! AGREE! > The interpreter should stop translation of code and throw an > exception when one is encountered. You co

Re: get current function name

2005-12-01 Thread Micah Elliott
On Dec 02, Joe Wong (Mango) wrote: > Is this possible for a function to obtain its own name ? > >eg. >def func1(): >print "my name is " + get_my_name() > >the result will show "my name is func1" This very question was discussed recently: http://groups.google.com/group/com

Re: Nested loop

2005-11-30 Thread Micah Elliott
> Micah Elliott wrote: > > On Nov 29, viewcharts wrote: > >>I am reading two text files comparing the values in one to the other, > >>this requires two loops. > > > > Or you could have a look at difflib. > > http://docs.python.org/lib/differ-examples.

Re: import Excel csv - files

2005-11-30 Thread Micah Elliott
On Nov 30, Jürgen Kemeter wrote: >My actual Problem: >The Excel workbook contains several spreadsheets. These are >linked through Hyperlinks, and contain several cell comments. How >can I export these comments and Hyperlinks using Python? Are you just wanting read a .xls file with

Re: Nested loop

2005-11-30 Thread Micah Elliott
On Nov 29, viewcharts wrote: > I am reading two text files comparing the values in one to the other, > this requires two loops. Or you could have a look at difflib. http://docs.python.org/lib/differ-examples.html -- _ _ ___ |V|icah |- lliott <>< [EMAIL PROTECTED] "

Re: newbie question concerning formatted output

2005-11-29 Thread Micah Elliott
On Nov 29, Fredrik Lundh wrote: > inp = open("xyplan.nobreaks","r") > data = inp.read() > > import textwrap > for line in textwrap.wrap(data, 15): > print line Right -- if the data is that regular then every 15th item is the split-point. A variation on this theme then is: for i in range

Re: Extracting documentation for user relevant functions only?

2005-11-28 Thread Micah Elliott
On Nov 28, Anton81 wrote: > I've written a python script and added short docstrings. Now I'd > like to create a short overview of commands the user can use. > However I don't want the internal stuff that I also commented. Is > there a way to create a fancy documentation (e.g. pydoc) of certain > fu

Re: after sorted from the lists

2005-11-22 Thread Micah Elliott
On Nov 22, Ben Bush wrote: > I have a list: > [[1,2],[2,1],[3,1],[1,4],[3,3],[1,4]] > How to remove all the duplicate or same after sorted from the lists? > That is, [1,2] and [2,1] are the same after sorting them. > I want the result to be: > [[1,2],[3,1],[1,4],[3,3]] You've described the code in

Re: Underscores in Python numbers

2005-11-21 Thread Micah Elliott
On Nov 19, Steven D'Aprano wrote: > Perhaps Python should concatenate numeric literals at compile time: > > 123 456 is the same as 123456. +1 for readability. But in support of no change, When was the last time you looked at long sequences of python digits outside of your editor/IDE? You probab

Re: best cumulative sum

2005-11-20 Thread Micah Elliott
On Nov 21, David Isaac wrote: > What's the good way to produce a cumulative sum? >>> import operator >>> x = 1,2,3 >>> reduce(operator.add, x) 6 -- _ _ ___ |V|icah |- lliott <>< [EMAIL PROTECTED] " " """ -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding through recursion

2005-11-18 Thread Micah Elliott
On Nov 19, Ben Finney wrote: ... > This is just one of many reasons why I advocate always having a > *single* return statement, at the *end* of the function. Agreed that it's a good *general* practice, but sometimes early exit is useful and clear. This is somewhat of a religious topic. A goo

Re: Choose meaningful subjects for posts [was: Re: newb ?]

2005-11-18 Thread Micah Elliott
On Nov 18, Grant Edwards wrote: > There is an NNTP patch to allow you to use mutt to read Usenet > via an NNTP server. Yes, I'm aware of it; it's last (alpha) update was in 1999 and it probably has some fleas. :-) > Mutt users who don't do that seem to like slrn -- it has a very > similar look an

Re: Choose meaningful subjects for posts [was: Re: newb ?]

2005-11-18 Thread Micah Elliott
On Nov 18, [EMAIL PROTECTED] wrote: > Grant> Obligatory aside: I'm completely baffled why anybody would choose > Grant> the mailing list format over Usenet. I don't even read mailing > Grant> lists via mailing lists. I recommend gmane.org's NNTP server for > Grant> all your mailin

Re: get just one character

2005-11-17 Thread Micah Elliott
On Nov 17, Sinan Nalkaya wrote: > how can i just get 1 character ? i`ve done a search but just found > getch() for windows, i need same for unix and raw_input has any > option that is not documented ? Get all the characters one at a time: >>> inp = raw_input('enter a string> ') enter a st

Re: install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Micah Elliott
On Nov 17, Ksenia Marasanova wrote: > I have python2.3, installed from port /lang/python long time ago. The > current version is 2.4, but I'd rather have two python versions, > instead of upgrading. > Is there maybe a way to somehow link installed python to > /lang/python2.3 port, and then upgrade

Re: is parameter an iterable?

2005-11-17 Thread Micah Elliott
On Nov 17, Duncan Booth wrote: > Steven D'Aprano wrote: > > What should I do when I can't rely on functions that > > don't exist in older versions of Python? > sys.exit('Archaic Python not supported, please upgrade') +1 QOTW. I recently gave up on trying to support (backport to) pre-2.2 i

Re: readline vi mode in python interactive shell

2005-11-16 Thread Micah Elliott
On Nov 16, [EMAIL PROTECTED] wrote: > Hi comp.lang.python: > New to the group and new to python, so don't tear me up too much ... > I installed the GNU readline support in python2.4, and it is working, > but there is one annoying behaviour that I am hoping to squash ... > > Namely, when I hit to

Re: creating package question

2005-11-16 Thread Micah Elliott
On Nov 16, [EMAIL PROTECTED] wrote: > I have a package directory structure as follows > > root- > | > Common (contains __init__.py file) > WindowsComponents (contains __init__.py file) > ... > > I would like modules in the WindowsComponents directory to be able > to import some mo

Re: Function - Empty list as default parameter - not acting local?

2005-11-15 Thread Micah Elliott
On Nov 15, Gregory Piñero wrote: >Hey guys, could anyone explain this behavior to me. It doesn't >seem right :-( >def testfunc(parm1,parm2={}): >print 'parm2',parm2 >parm2['key1']=5 >>>testfunc('greg') >parm2 {} >>>testfunc('greg') >parm2 {'key1': 5} ht

Re: Background process for ssh port forwarding

2005-11-15 Thread Micah Elliott
On Nov 15, Jesse Rosenthal wrote: > Whatever I do, though, I'll need to use pexpect to spawn the > processes, since I'll need to log in to ssh servers with a password. You might save yourself this effort by setting up ssh for non-interactive use with keys instead of password authentication: $

Re: replacing multiple instances of commas beginning at specific position

2005-11-14 Thread Micah Elliott
On Nov 14, striker wrote: > I have a comma delimited text file that has multiple instances of > multiple commas. Each file will contain approximatley 300 lines. > For example: > > one, two, threefour,fivesix > one, two, three,four,,eighteen, and so on. > > There is one time whe

Re: Python Countdown

2005-11-11 Thread Micah Elliott
On Nov 11, john boy wrote: >I am running the following program from the example in "how to >think like a computer scientist" >... >When I set "n"= 1000 the program runs in interpreter and stops >counting down at 14 instead of running all the way to "Blastoff". >Why is this

Re: Pythonising the vim (e.g. syntax popups) -> vimpst

2005-11-10 Thread Micah Elliott
On Nov 10, [EMAIL PROTECTED] wrote: > vim... I'll try to get it more polished/functional and put it up on > sourceforge or somewhere. Change "sourceforge or somewhere" to: http://www.vim.org/scripts/add_script.php -- _ _ ___ |V|icah |- lliott http://micah.elliott.name [EMAIL PROTECTED] " "

Re: Pythonising the vim (e.g. syntax popups)

2005-11-09 Thread Micah Elliott
On Nov 09, Christoph Haas wrote: > I'm an addicted vim user and don't really use the IDLE for anything > more than calculations where I'm too lazy to start KCalc. But one > feature is very pretty: the built-in help for function calls while > you type. Like you enter... > > var1,var2=mystring.split

Re: parse data

2005-11-09 Thread Micah Elliott
On Nov 09, Dennis Benzinger wrote: > Use the re module: > > import re > your_data = """person number 1 > > Name: bob > Age: 50 > > > person number 2 > > Name: jim > Age: 39""" > > names = [] > for match in re.finditer("Name:(.*)", your_data): > names.append(match.group(1)) > print names

Re: which feature of python do you like most?

2005-11-08 Thread Micah Elliott
[EMAIL PROTECTED] wrote: > What do you use in your dairy work with python? Cows hate snakes! > which feature of python do you like most? Various success stories: http://pythonology.org/success Eric Raymond: http://pythonology.org/success&story=esr Bruce Eckel: http://www.artima.com/intv/aboutm

File renaming recipe (was: Rename files with numbers)

2005-11-02 Thread Micah Elliott
On Nov 01, Dudu Figueiredo wrote: > I wrote a simpler script based in Micah Elliott's help... I expanded my code from this thread to be a Cookbook recipe. It has no specificity for MP3 renaming, but is generic to files with shell-unfriendly names. It should usable as-posted if anyone

Re: extracting numbers from a file, excluding words

2005-11-01 Thread Micah Elliott
On Nov 01, Mike Meyer wrote: > Kristina Kudriaðova <[EMAIL PROTECTED]> writes: > > > 1 Nov 2005 09:19:45 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > >> Hi, I have a file with this content: > >> > >> z zzz z > >> ... > >> xxx xx x 34.215 > >> zzz zz > >> ..

Re: Python's website does a great disservice to the language

2005-11-01 Thread Micah Elliott
On Nov 01, CppNewB wrote: > First comment; "I hope the language is designed better than the > site." The site is readable, but is amateurish. That's flaim bait if I ever saw it! I find the site quite lovely: very readable, no ads, well organized, nice colors, simple, easy to maintain (uses ht2ht

Re: Flat file, Python accessible database?

2005-11-01 Thread Micah Elliott
On Nov 01, Karlo Lozovina wrote: > I've been Googling around for _small_, flat file (no server > processes), SQL-like database which can be easily access from > Python. Speed and perforamnce are of no issue, most important is > that all data is contained within single file and no server binary > ha

Re: Automatically creating a HOME environ variable on Windows?

2005-11-01 Thread Micah Elliott
Maciej Dziardziel wrote: > > ...there is a group of path related functions in os.path (or > > ntpath), including expanduser, and its better to use function... On Nov 01, [EMAIL PROTECTED] wrote: > Having a function is definitely cleaner. Creating a HOME environment > variable where one does not ex

Re: Rename files with numbers

2005-10-31 Thread Micah Elliott
On Oct 31, Micah Elliott wrote: > Now I need to go beautify my collection. :-) While a fun exercise, there are probably already dozens (or thousands?) of utilities in existence that do this and much more. -- _ _ ___ |V|icah |- lliott http://micah.elliott.name [EMAIL PROTEC

Re: Rename files with numbers

2005-10-31 Thread Micah Elliott
On Oct 31, [EMAIL PROTECTED] wrote: > but my focus is to learn how to acess a folder and rename all files in > this folder. This is a little more flexible than my last post, and it does the whole job:: #! /usr/bin/env python import glob, os, string def fix_ugly_song_names(songdir, b

Re: Rename files with numbers

2005-10-31 Thread Micah Elliott
On Oct 31, [EMAIL PROTECTED] wrote: > ... > obs: the file names came this way(with spaces or apostrophes) from > the cd i imported. So remove them first. Here's a possible solution:: #! /usr/bin/env python import glob, os.path uglies = glob.glob("*.mp3") print 'uglies:', uglies

Re: Rename files with numbers

2005-10-31 Thread Micah Elliott
On Oct 31, [EMAIL PROTECTED] wrote: > I have one folder containing mp3 files, the folder is: > C:\My Shared Folder\Rubber Soul > > And the files are: > 03 you won't see me.mp3 > . > > I'm trying to rename files to: > The Beatles - You Won't See Me.mp3 > . My first suggestion is that you make bet

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-27 Thread Micah Elliott
On Oct 27, Gregory Piñero wrote: > >my goal really was to do: >try:something(1);except:pass >try:something(2);except:pass >try:something(3);except:pass >... >for about 20 lines. If you just want to ignore the exceptions while saving space/typing, you could equivalently do:

Re: distutils - distributing non-python data files

2005-10-26 Thread Micah Elliott
On Oct 25, RickMuller wrote: > I really appreciate the ease that the distutils make distributing > Python modules. However, I have a question about using them to > distribute non-Python (i.e. text) data files that support Python > modules. It's not clear from your questions whether this is user-co

Re: suggestions between these two books

2005-10-26 Thread Micah Elliott
On Oct 26, John Salerno wrote: > Hi all. I'm fairly new to programming and I thought I'd like to try > Python. I'm trying to decide between these two books: > > Learning Python (O'Reilly) > Beginning Python: From Novice to Professional (APress) Consider first reading the tutorial. If you prefer

Re: Execute C code through Python

2005-10-21 Thread Micah Elliott
On Oct 21, Grant Edwards wrote: > I'm guessing you're using Windows based on the question. +1 QOTW. -- _ _ ___ |V|icah |- lliott http://micah.elliott.name [EMAIL PROTECTED] " " """ -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-20 Thread Micah Elliott
On Oct 20, [EMAIL PROTECTED] wrote: > I am looking for the best and efficient way to replace the first word > in a str, like this: > "aa to become" -> "/aa/ to become" > I know I can use spilt and than join them > but I can also use regular expressions > and I sure there is a lot ways, but I need r

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Micah Elliott
On Oct 19, Jarek Zgoda wrote: > Micah Elliott napisał(a): > > >>How to install this structure eg. on Linux? What layout do you > >>recommend? It's tempting to use /opt hierarchy for installation > >>target (as it gives relatively much freedom withi

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Micah Elliott
On Oct 19, Jarek Zgoda wrote: > How to install this structure eg. on Linux? What layout do you > recommend? It's tempting to use /opt hierarchy for installation > target (as it gives relatively much freedom within application > directory), but many administrators are reluctant to use this > hierarc

Re: question about timestamp and MySQLdb

2005-10-19 Thread Micah Elliott
On Oct 19, Sean Berry wrote: > I am using MySQLdb to connect to a database and retrieve a timestamp > from a table. The problem is I want the timestamp as a long, > unformatted and all. > > In the table I have a timestamp like this > 20051019111617 > > But, when I retrieve the value and print it

Re: parser question

2005-10-19 Thread Micah Elliott
On Oct 19, Daniel Sch�le wrote: > I have one format with this structure > > A { > x=1 > y=3 > B { > z = "something here" > } > } > > C { > } > > A { > x=0 > y=0 > B { > z = "other" > } > } > >

Re: [newbie]Is there a module for print object in a readable format?

2005-10-19 Thread Micah Elliott
On Oct 20, Steven D'Aprano wrote: > That's not what I get. What are you using? > > py> pprint.pprint([1,2,3,4,[0,1,2], 5], width=1, indent=4) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: pprint() got an unexpected keyword argument 'width' I find it useful to have al

Re: Vim IS a capable IDE [was Re: Vim capable IDE?]

2005-10-19 Thread Micah Elliott
On Oct 19, Chris Lasher wrote: > Where do you guys go to learn all the capabilities of Vim? Just > browsing through vim.org? Just type: :h to see extensive info from the "User Manual", "Reference Manual", and any plugins. The near-comprehensive doc list: http://vimdoc.sourceforge.net/ I don

Re: Run process with timeout

2005-10-17 Thread Micah Elliott
rk/exec sleep10.sh, make it a group leader, and the parent would kill its group. Is there any way to enable Python's subprocess module to do (implicit?) group setup to ease killing of all children? If not, is it a reasonable RFE? -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Return Text from popen

2005-10-15 Thread Micah Elliott
df") >>> p >>> df_out = p.read() >>> p.close() >>> p >>> print df_out -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Well written open source Python apps

2005-10-13 Thread Micah Elliott
fine control), etc. * A PEP describing the conventions (though some will argue that PEPs should be enforcable by the compiler, so maybe just a "Cheesecake Convention" document). * And of course anything that CPANTS offers :-) I'm sure people here have more ideas for quality indicators... -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Well written open source Python apps

2005-10-13 Thread Micah Elliott
that comes to my mind is docutils <http://docutils.sourceforge.net/>. -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Profiling Python using gprof

2005-10-11 Thread Micah Elliott
uch more common to use Python's profiling facilities to "profile a Python program". So if you really want to profile the interpreter running your modules, then go ahead with gprof and follow Jeff's advice; otherwise see <http://www.python.org/doc/2.4.2/lib/profile.html>.

Re: how to check if file is in use?

2005-10-10 Thread Micah Elliott
.org/pipermail/python-list/2003-May/165908.html -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: [regex] case-splitting strings in unicode

2005-10-08 Thread Micah Elliott
ware. For programming language identifiers I wouldn't think that unicode should be an issue. Sorry I'm no help with unicode specifics. Some useful links: http://www.python.org/doc/2.4.2/lib/module-re.html http://www.amk.ca/python/howto/regex/regex.html -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do I get an import error on this?

2005-10-07 Thread Micah Elliott
/bin/python" the same? If not, it appears that "which python" can see cx_Oracle, but the latter cannot. You could mess with PYTHONPATH or get /home/.../python into the front of your PATH. -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: So far (about editing tools)

2005-10-06 Thread Micah Elliott
sibility of Eclipse becoming anywhere near standard, given any amount of time. I would suspect that the majority of Python programmers write in one of vim or emacs. Anyone got stats? -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile as static

2005-10-06 Thread Micah Elliott
;rnum=17&hl=en#c6fcc1afbd7c41b0 It might be nice to have an autoconf option to make this more obvious for guys like us. Maybe this is just a rare need. -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: What documentation "standard" to use

2005-10-05 Thread Micah Elliott
lt;http://docutils.sourceforge.net/rst.html> and it's own markup (epytext, I think). RST is the de-facto Python markup, AFAICT. You'll need something like "__docformat__ = 'restructuredtext'" in your modules. RST is great for non-Python-source code, too. Those a

Re: Extending Python

2005-10-05 Thread Micah Elliott
I felt a bit > lacking from the Python site, it seems it was only made for those > who installed the source distribution, as for the other people... > Anyways, thanks for the help! I have no experience with this, but I see that Alex Martelli's "Python In A Nutshell" has quite a

Re: Mantain IDE colors and paste them in an HTML page

2005-10-04 Thread Micah Elliott
ave a colorized version of your "IDE" display. -- Micah Elliott <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie regular expression ?

2005-10-04 Thread Micah Elliott
On Oct 04, Micah Elliott wrote: >$ man 3 fnmatch Actually "man 7 glob" would be better (assuming you've got *nix). Also note that globs are not regular expressions. "pydoc glob" is another reference. -- Micah Elliott -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie regular expression ?

2005-10-04 Thread Micah Elliott
t $ python -c ' - import glob - print glob.glob("[uU][nN][qQ]*.dat") - ' ['unq1.dat', 'UnQ1.dat', 'unQ1.dat', 'UNQ1.dat'] $ man 3 fnmatch -- Micah Elliott -- http://mail.python.org/mailman/listinfo/python-list

Re: python getopt functionality

2005-10-03 Thread Micah Elliott
resorting to using if statements? Optik (optparse) adheres to a "Tao of Option Parsing" <http://optik.sourceforge.net/doc/1.5/tao.html>, which discusses required option arguments. -- Micah Elliott -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 350: Codetags

2005-09-28 Thread Micah Elliott
tools won't be used until programmers have means/motivation to use them, a pep. But now that I have your feedback/ideas I (and maybe the lint folks) can do better job of expanding flexible tools that can prove this paradigm useful (or useless). I will continue development on the tools and encourage anyone interested in using a standard set of codetags for documentation and tracking purposes to give them a try (and provide more feedback!) as they mature. -- Micah Elliott -- http://mail.python.org/mailman/listinfo/python-list

PEP 350: Codetags

2005-09-26 Thread Micah Elliott
Please read/comment/vote. This circulated as a pre-PEP proposal submitted to c.l.py on August 10, but has changed quite a bit since then. I'm reposting this since it is now "Open (under consideration)" at <http://www.python.org/peps/pep-0350.html>. Thanks! -- Micah Elli

Pre-PEP Proposal: Codetags

2005-08-10 Thread Micah Elliott
using `WikiRestructuredText`:trac:. === Codetag PEP (*or* Tao of Codetagging) === PEP: XXX Title: Codetags Version: $Revision$ Last-Modified: $Date$ Author: Micah Elliott Status: Active Type: Informational Content-Type: text

*Python* Power Tools

2005-06-21 Thread Micah
-) ? Or would people really like to claim a pure Python set of UNIX utilities? -- Micah -- http://mail.python.org/mailman/listinfo/python-list