Re: Passing environment variable to "subprocess" causes failure

2009-02-03 Thread Miki
ONPATH"] = "C:/Documents and Settings/David Gould/workspace/ DgTools/Common/Trunk/Source" p = = subprocess.Popen(['python', '-V'], env=env, stdout=PIPE) print p.communicate() print p.returncode HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform compilation?

2009-02-03 Thread Miki
n, without having to hack all the > setup files...? Maybe http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html could help? HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Miki
(3, 5), (3, 6), (4, 1), (4, 4), (6, 6), (7, 1), (9, 6)] Points first sorted by 'x' and then by 'y'. HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading required libraries for python script from shell just once

2008-12-01 Thread Miki
t it has too > many dependencies on shell libraries and I don't want to go that route > (unless an alternative solution is impossible). One other option is to have the python libraries on local disk, but IMO the first solution is better. HTH, -- Miki <[EMAIL PROTECTED]> ht

Re: pickling a circular object inherited from list

2008-12-09 Thread Miki
output of an > easy example case of my problem. > > What did I do wrong? Old Python version? :) Seems to work in 3.0 (don't have 2.6 currently to check but IMO it's fixed there as well). HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of debigging a C extension

2008-12-11 Thread Miki
essage box asking if you want to debug the program. When you hit "OK", WinDbg should open with your code. Just point it to the source location and you should be set. HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: parse C expression?

2008-12-15 Thread Miki
ons, I use it only in internal applications. HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I return a non-zero status result from a python script?

2008-12-15 Thread Miki
Hello, > How can I return a non-zero status result from the script? Just do a > return 1? at the end? raise SystemExit(1) HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

subprocess.Popen(..., cwd=...) and Makefile $(PWD) don't play nice

2008-10-06 Thread Miki
Popen(["make"], cwd="/tmp/p") [18:07] tmp $./t /tmp The output of the "make" command should have been "/tmp/p" and not "/ tmp" TIA, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: gif creator

2008-10-06 Thread Miki
to communicate with it. This will work even when you upgrade Python. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen(..., cwd=...) and Makefile $(PWD) don't play nice

2008-10-13 Thread Miki
rking directory. Should I see it as a bug? Should subprocess change this? > Use '@pwd' instead of '@echo $(PWD)'. I'm using '$(shell pwd)', just wondered why $PWD didn't work. Thanks for the explanation. -- Miki <[EMAIL PROTECTED]> http://pythonwise

C API with *args and **kw

2008-10-14 Thread Miki
printf("no default\n"); } else { str = PyString_AsString(defval); printf("default is %s\n", str); } return Py_BuildValue(""); } However when running the test: from kw import kw kw(default="2") kw(1) kw() I get "bus err

Re: replace mothod for only one object but not for a class

2008-10-14 Thread Miki
obj, *args, **kw) return method p1 = Point(1, 2) p2 = Point(3, 4) def show(self, n): print "Not a Point: %s-%s" % (self.x, self.y) p2.show = partial(show, p2) p1.show(3) p2.show(3) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.o

Re: C API with *args and **kw

2008-10-14 Thread Miki
> > I'm try to write the C equivalent of: > > Use PyArg_ParseTupleAndKeywords() to parse the args and kwargs objects. Couldn't figure out how to get *args with ParseTupleAndKeywords. Thanks, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: C API with *args and **kw

2008-10-14 Thread Miki
> Miki <[EMAIL PROTECTED]> writes: > > However when running the test: > > from kw import kw > > kw(default="2") > > kw(1) > > kw() > > > I get "bus error" on the 2'nd call (OS X Python 2.5.2). > > When called without ke

Re: how to get the recipients addresses of an outlook mail in python...

2008-10-16 Thread Miki
>         Can some one help me in obtaining the set of recipients email > addresses from an outlook mail? I tried various options like ... message["To"] message["Cc"] HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: need to suspend/resume a child thread

2008-11-12 Thread Miki
7;t play well together. Not recommended. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: control device via USB or Parallel

2009-03-26 Thread miki
parallel port there is pyparallel, however IMO their time is gone and you should go with pyusb. HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting current screen resolution

2008-06-09 Thread Miki
o Unix (which is important). > > Any ideas? Maybe one of Tkinter.Tk winfo_* methods? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice for a python newbie on parsing whois records?

2008-06-10 Thread Miki
").match for line in popen("whois google.com"): match = find_record(line) if not match: continue print "%s --> %s" % (match.groups()[0], match.groups()[1]) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: rightclick-copy in IDLE?

2008-06-22 Thread Miki
> when i rightclick in python idle i get set breakpoint or something. > > n options i dont find a way to change to the normal copy/paste options. Under "Preferences ..." menu you'll find "Keys" tab, there you can change the keys bindings to whatever you want. HTH

Re: Spell suggest for locations

2008-07-03 Thread Miki
ie? (http://en.wikipedia.org/wiki/Trie). Googling for "spell checker algorithm" yields many results. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Gnuplot and making an exe file outv the prog

2008-07-03 Thread Miki
e in the wrong mailing list). Can you be more descriptive about the problem you have with py2exe? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: running python from cmd.exe

2008-07-03 Thread Miki
eds some Python not a programmer! Can you be more specific about the error you get? Say you have a script hw.py that contains one line: print "Hello Python" and you run python hw.py What is the error you get? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: manipulating movie files with Python

2008-07-03 Thread Miki
brary which could > already perform such magic? Thanks for any suggestions. I think you'll find ffmpeg the right tool for the job. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Generating Lip-Synched animation?

2008-07-13 Thread Miki
will probably using audioop and wave modules * Generate a list of images according to the voice (using the bitrate for sync) * Generate video from images using mencoder Before I venture into this, does anybody has a better idea? Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.c

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
ave this library. > Its probably a stupid question but thanks anyway! He who asks is a fool for five minutes, but he who does not ask remains a fool forever. - Chinese Proverb HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python ver of System.arraycopy() in Java

2008-07-14 Thread Miki
e[sourcepos:sourcepos > +numelem] > > is there a built in version, or better way of doing this... This *is* the built in way :) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, > Could it be that I have to install the same python version Blender was > compiled with? I have no idea. May I suggest you ask in the blender list? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: More like a shell command.

2008-08-06 Thread Miki
k at ipython, they do something like that but for the command interpreter and not the compiler. The other option will be to write a compiler from your syntax to valid Python syntax. However this my not be simple since you need to know the context. e.g. is f("a b c") ca

Re: kill thread

2008-08-07 Thread Miki
y. Where and > how can I do this ? in __run__ ? __init__ ? a try/except stuff ? You can have a try/except KeyboardException around the thread code. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to insert multiple rows in SQLite Dbase

2008-04-01 Thread Miki
inue key, value = line.split(":", 1) mapping[key] = value return mapping HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: List open files

2008-04-08 Thread Miki
p you. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the version of a file

2008-04-14 Thread Miki
erparse(open(info_file)): if get: return element.text if (element.tag == "key") and (element.text == "CFBundleVersion"): get = 1 raise KeyError("Can't find CFBundleVersion key") if __name__ == "__main

Re: i want to add a timeout to my code

2008-04-17 Thread Miki
ps module] SERIAL PORT OPEN ON COM1:' > > can anyone help me please? Thanks. http://docs.python.org/lib/node545.html HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing log file destination in logging configuration file

2008-04-22 Thread Miki
n_log_ini(type) # type is either "deamon" or "regular" >>> atexit.register(lambda: remove(log_ini)) >>> logging.config.fileConfig(log_ini) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing dictionaries

2008-05-07 Thread Miki
t in second_dict or if it is, but has has the wrong value, > then let me know def cmp_dicts(first, second): return sorted(first.iteritems()) == \ sorted(((k[1], v) for k, v in second.iteritems())) Google for DSU (Decorate-Sort-Undecorate) HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about wx BoxSizer background

2008-08-21 Thread Miki
nction A sizer is just for layout management, it does not show on the screen. You need to set the color of the items inside the sizer or the item the this is it's main sizer. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python newbie question re Strings and integers

2008-09-18 Thread Miki
os.path import basename, splitext currentSymbol = splitext(basename(filename))[0] HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: any tool can shrink DLL?

2008-09-23 Thread Miki
thing that comes to mind is "strip" that removes strings from executables. As for UPX, does the slowdown really matter? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems running on hp dual core processor

2008-09-23 Thread Miki
ui from CMD, it might give you a better indication on which DLL is causing the problem. As suggested by Mike, run DependecyWalker on win32ui.pyd HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex Help

2008-09-23 Thread Miki
Hello, > Anybody know of a good regex to parse html links from html code? BeautifulSoup is *the* library to handle HTML from BeautifulSoup import BeautifulSoup from urllib import urlopen soup = BeautifulSoup(urlopen("http://python.org/";)) for a in soup("a"): print

Re: lint for Python?

2008-10-05 Thread Miki
he program is running. pychecker does find these kind of errors. > I've never used a language that didn't catch that type of error.  I'm > quite surprised that Python is being used by a number of major > companies.  How you catch these types of errors? By running a large test

Re: Problem: neither urllib2.quote nor urllib.quote encode the unicode strings arguments

2008-10-05 Thread Miki
de("utf-8")) -> %D0%BF%D0%B8%D0%B2%D0%BE%20M %C3%BCller HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

vxWorks port?

2006-03-26 Thread Miki
Hello All, I saw some old posts about vxWorks port of Python. Is there someone who can give me pointers to more recent efforts of porting Python to wxWorks? Thanks, Miki -- http://mail.python.org/mailman/listinfo/python-list

package_data question

2009-12-04 Thread Miki
pied. build/lib.linux-x86_64-2.6 `-- p |-- __init__.py |-- a | `-- __init__.py |-- b | `-- __init__.py `-- c `-- __init__.py Any idea how to fix this? (Changing the directory structure is not possible - not my project). Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Introspection

2010-01-06 Thread Miki
ines(obj) readline = iter(lines).next return [t[1] for t in generate_tokens(readline) if is_literal(t)] if __name__ == "__main__": class A: def f(self): print "A", "B" print get_lieterals(A) HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of the N largest values

2010-12-28 Thread Miki
>>> from collections import deque >>> d = deque([], 3) >>> for i in range(10): d.append(i) >>> d deque([7, 8, 9], maxlen=3) >>> HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Just Starting in on programming

2011-01-05 Thread Miki
http://www.openbookproject.net/thinkCSpy/ ? -- http://mail.python.org/mailman/listinfo/python-list

Re: wx Just Print!

2011-01-14 Thread Miki
I think you need to create a wxApp first. Try adding app = wx.PySimpleApp() at the beginning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Use the Source Luke

2011-01-29 Thread Miki
Clojure a "source" that shows the source of a function (doh!). It's probably easy to implement in Python with the inspect module. Sadly this won't work for built-ins. Clojure's irc clojurebot will answer "source " with a link to github that points to the first line of definition. -- http://mail

Re: Would like to add an "upload" facility to my web site

2011-01-31 Thread Miki
One way is http://pythonwise.blogspot.com/2007/03/pushing-data-easy-way.html :) This list a good place to ask, you can try StackOverflow as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Smtpd module

2010-04-23 Thread Miki
mtpd module have both? http://twistedmatrix.com/documents/current/mail/tutorial/smtpclient/smtpclient.html HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: using python2.6 on windows without installation

2010-04-29 Thread Miki
e http://www.dependencywalker.com/ to find out which DLLs are needed. HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: print executed query

2010-04-29 Thread Miki
> Is there a way to print a query for logging purpose as it was or will > be sent to database, if I don't escape values of query by myself? > ... > Im using psycopg2, btw http://initd.org/psycopg/docs/advanced.html#connection-and-cursor-factories HTH, -- Miki http://python

Re: matching strings in a large set of strings

2010-04-29 Thread Miki
.org/wiki/Trie HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to show the current line number with pdb.set_trace()

2010-05-23 Thread Miki
rent line. You can also type "?" for help. HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Like __getattr__ but with args and kwargs as well

2010-05-28 Thread Miki
ttr method = getattr(auths[0], method_name, None) if not fn: raise ValueError("Unknown attribute - %s" % method_name) return fn(user) HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Like __getattr__ but with args and kwargs as well

2010-05-28 Thread Miki
>         method = getattr(auths[0], method_name, None) Should be fn = getattr(auths[0], method_name, None) -- http://mail.python.org/mailman/listinfo/python-list

"python setup.py sdist" does pick one directory

2010-06-05 Thread Miki
in "packages". Any ideas why it's ignored? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: I need a starter ptr writing python embedded in html.

2010-08-07 Thread Miki
> Can someone tell me what I should look at to do this? Is mod_python where I > should start or are there things that are better? Have a look at http://www.crummy.com/software/BeautifulSoup/. All the best, -- Miki http://mikitebeka.com The only difference between children and adults is the price of the toys -- http://mail.python.org/mailman/listinfo/python-list

Re: I need a starter ptr writing python embedded in html.

2010-08-09 Thread Miki
or are there things that are better? > > Have a look athttp://www.crummy.com/software/BeautifulSoup/. > > Thanks. But what I'm not seeing is any example of how to make this allowed to > generate the html at run time. Oh, I misunderstood you. You probably want one of the templating systems out there, such as Mako, Jinja2, Cheetah, ... Maybe http://cherrypy.org/wiki/intro/1 will be of help. All the best, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting with the format string syntax

2010-09-14 Thread Miki
You can use ** syntax: >>> english = {'hello':'hello'} >>> s.format(**english) On Sep 14, 9:59 am, Andre Alexander Bell wrote: > Hello, > > I'm used to write in Python something like > >  >>> s = 'some text that says: %(hello)s' > > and then have a dictionary like > >  >>> english = { 'hello': 'h

Re: distributing a binary package

2013-05-06 Thread Miki Tebeka
> Basically, I'd like to know how to create a proper setup.py script http://docs.python.org/2/distutils/setupscript.html -- http://mail.python.org/mailman/listinfo/python-list

Re: distributing a binary package

2013-05-07 Thread Miki Tebeka
> I already have the .so files compiled. http://docs.python.org/2/distutils/setupscript.html#installing-package-data ? -- http://mail.python.org/mailman/listinfo/python-list

Re: python call golang

2013-05-10 Thread Miki Tebeka
> Now! I have written a python script . I want to call a golang script in > python script. > Who can give me some advices? See http://gopy.qur.me/extensions/examples.html and http://www.artima.com/weblogs/viewpost.jsp?thread=333589 -- http://mail.python.org/mailman/listinfo/python-list

Re: Any speech to text conversation python library for Linux and mac box

2013-06-13 Thread Miki Tebeka
On Wednesday, June 12, 2013 8:59:44 PM UTC-7, Ranjith Kumar wrote: > I'm looking for speech to text conversation python library for linux and mac Not a Python library, but maybe you can work with http://cmusphinx.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Imports (in Py3), please help a novice

2013-06-16 Thread Miki Tebeka
> Is there an import / distutils tutorial out there? I'm looking for it, but > perhaps one of you already knows where to find it. Thanks! Did you have a look at http://docs.python.org/3.3/distutils/examples.html? Another thing to do is to look at what other packages on PyPi are doing. -- http

Re: Perl __DATA__ construct.

2012-06-25 Thread Miki Tebeka
> Is there a way to do the same thing in Python? Not without some clever tricks. Either you store data at the beginning of the file or you have another file with the data. If you really need one file and data at the end, you can roll your own. Something like: def data(): with open(__

Re: exe made by py2exe do not run certain computer

2012-07-03 Thread Miki Tebeka
> It works fine on my computer and some other computer don't have python > interpreter(it's Windows 7). > But the same file also do not work on another computer(it's Windows xp) > why does it happen? My *guess* is that you're missing some DLLs (probably some Visual Studio runtime ones). You can

Re: howto do a robust simple cross platform beep

2012-07-14 Thread Miki Tebeka
> How do others handle simple beeps? http://pymedia.org/ ? I *think* the "big" UI frameworks (Qt, wx ...) have some sound support. -- http://mail.python.org/mailman/listinfo/python-list

Re: Diagramming code

2012-07-16 Thread Miki Tebeka
> Is there any software to help understand python code ? For module dependency you can try http://furius.ca/snakefood/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python pynotify with textbox input

2012-08-04 Thread Miki Tebeka
> how can i made a notification for gnome-shell with a textbox input ?? > library: pynotify? You can do it in many ways. You can use one of the Python GUI frameworks - Qt, wx, GTK ... You can use utilities like zenity ... -- http://mail.python.org/mailman/listinfo/python-list

Re: find out whether a module exists (without importing it)

2012-08-06 Thread Miki Tebeka
> imp.find_module(), but > it didn't find any module name containing a '.' The docs (http://docs.python.org/library/imp.html#imp.find_module) clearly say: "This function does not handle hierarchical module names (names containing dots). In order to find P.M, that is, submodule M of package P, use

Re: Todo app help

2012-08-08 Thread Miki Tebeka
> Can someone point me a good tutorial about making a Todo app or similar apps? What do you mean by "app"? For a web app - there are many frameworks out there. Django is the big kid in the block but there are many others (flask, bottle, cherrypy, ...) For GUI application, look at PyQt, wxPython,

Re: How to uncompress a VOB file? (Win XP)

2012-08-13 Thread Miki Tebeka
Have a look at PyMedia. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing code between different projects?

2012-08-15 Thread Miki Tebeka
> In plus I'm using perforce which doesn't have any svn:externals-like You can probably use views to this (http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.views.html). > Second problem is that one of the two projects has a quite insane > requirement, which is to be able to re-run itself o

Re: How to convert base 10 to base 2?

2012-08-21 Thread Miki Tebeka
> You get the binary by doing bin(x), where x is an integer. Note that Python also support binary number literals (prefixed with 0b): In [1]: 0b101 Out[1]: 5 -- http://mail.python.org/mailman/listinfo/python-list

Why does dynamic doc string do not work?

2012-08-21 Thread Miki Tebeka
e's a reason for this? I know I can do: >>> class B: ...__doc__ = '''a {} string'''.format('doc') And it'll work, but I wonder why the first B docstring is empty. Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does dynamic doc string do not work?

2012-08-21 Thread Miki Tebeka
Thanks! > On 08/21/2012 12:44 PM, Miki Tebeka wrote: > > > > > >>> class B: > > > ... '''a {} string'''.format('doc') > > > ... > > >>>> B.__doc__ > > >>>> &

Re: Dynamically scheduling Cron Jobs for Python Scripts.

2012-09-06 Thread Miki Tebeka
> I want to re run the script at that schedule time to send me a email. Calculate how much time until the meeting. And spawn the script that will sleep that amount of time and then send email. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Miki Tebeka
I'd look also into dateutil.parser.parse and feedparser._parse_date On Thursday, September 6, 2012 1:34:18 PM UTC-7, John Nagle wrote: > On 9/6/2012 12:51 PM, Paul Rubin wrote: > > > John Nagle writes: > > >> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been > > >> updated

Re: Compile python code into a dll

2012-09-10 Thread Miki Tebeka
oin/Freeze. HTH, -- Miki (http://pythonwise.blogspot.com/) -- http://mail.python.org/mailman/listinfo/python-list

Creating socket.connect while in epoll loop

2012-09-12 Thread Miki Tebeka
connect), I get the following error (on line 34): socket.error: [Errno 115] Operation now in progress I tried moving the socket creation to a different thread, but same problem. Any ideas how to so fix this? (keep in mind I'm a total newbie in this area). Thanks, -- Miki -- http://mai

Re: Add a "key" parameter to bisect* functions?

2012-09-12 Thread Miki Tebeka
> I've just noticed that the bisect module lacks of the key parameter. > ... > Is there some reason behind this lack? See full discussion at http://bugs.python.org/issue4356. Guido said it's going in, however there's no time frame for it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Add a "key" parameter to bisect* functions?

2012-09-12 Thread Miki Tebeka
> Correct me if I'm wrong, but the reason for this absence is that people could > think that doing repeated bisects using keys would be fast, even though keys > has to be recomputed? I think the main point Raymond had was: If we added key= to bisect, it would encourage bad design and steer

Re: Creating socket.connect while in epoll loop

2012-09-12 Thread Miki Tebeka
> You cannot synchronously set up a new TCP connection using a non-blocking > > socket. Instead, you begin the connection attempt and it fails with > EINPROGRESS and then you use epoll to find out when the attempt completes. OK. > I suggest reading the implementation of a Twisted reactor to see

Re: Python presentations

2012-09-13 Thread Miki Tebeka
ample project. HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe deal with python command line inside a program

2012-09-28 Thread Miki Tebeka
> sys.executable was printed out as ''C:\\Python25\\python.exe'', how > can I make this work in executable package through py2exe? Does http://www.py2exe.org/index.cgi/WhereAmI help? -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the state of an object

2012-10-07 Thread Miki Tebeka
> Is there a simple way to get the *ordered* list of instance Here's one way to do it (weather doing it is a good idea or not is debatable): from operator import attrgetter def __init__(self, a, b, c, d): self.a, self.b, self.c, self.d = a, b, c, d get = attrgetter('a', 'b

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Miki Tebeka
> I want to fix an error in some code I have installed, ... Apart from all the reasons why it's bad (see the Python Zen #10). One way to do it is: return [i or '' for i in a] -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Central Python Events Calendar

2012-10-22 Thread Miki Tebeka
> ANNOUNCING > Central Python Events Calendars Thanks, a great idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with ThreadingTCPServer Handler

2012-10-23 Thread Miki Tebeka
According to the docs (http://docs.python.org/library/socketserver.html#requesthandler-objects) there's self.server available. -- http://mail.python.org/mailman/listinfo/python-list

Re: lazy properties?

2012-11-01 Thread Miki Tebeka
> If you're using Python 3.2+, then functools.lru_cache probably > ... And if you're on 2.X, you can grab lru_cache from http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/ -- http://mail.python.org/mailman/listinfo/python-list

Re: fabric question

2012-11-09 Thread Miki Tebeka
> local$ fab remote_info > [remote] Executing task 'remote_info' > [remote] run: uname -a > [remote] out: remote@path$ What happens when you ssh to the machine and run 'uname -a'? (The out: ... is the output) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simpler way to modify all arguments in a function before using the arguments?

2012-11-09 Thread Miki Tebeka
> Is there a simpler way to modify all arguments in a function before using the > arguments? You can use a decorator: from functools import wraps def fix_args(fn): @wraps(fn) def wrapper(*args): args = (arg.replace('_', '') for arg in args) return fn(*args) return wr

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Miki Tebeka
> But i dont know how to pass the "echo t | " in subprocess.check_output while > calling a process. You need to create two subprocess and connect the stdout of the first to the stdin of the 2'nd. See http://pythonwise.blogspot.com/2008/08/pipe.html for a possible solution. -- http://mail.python

Re: Regular expression for different date formats in Python

2012-11-26 Thread Miki Tebeka
On Monday, November 26, 2012 8:34:22 AM UTC-8, Michael Torrie wrote: > http://pypi.python.org/pypi/python-dateutil > ... > I don't believe the library is updated for Python 3 yet, sadly. dateutil supports 3.x since version 2.0. -- http://mail.python.org/mailman/listinfo/python-list

"non central" package management

2012-11-27 Thread Miki Tebeka
package). 2. Have a "lib" directory in each application with versioned packages (we use something like that with svn:externals for version management). 3. Write my own package manager. Anyone had the same problem? Any known solutions? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: "non central" package management

2012-11-27 Thread Miki Tebeka
then do > "pip install -r requirements.txt". 1. Do you do that for every run? 2. Our ops team don't like to depend on pypi, they want internal repo - but I guess I can do that with "pip install -f". Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >