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
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
(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
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
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
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
ons, I use it
only in internal applications.
HTH,
--
Miki
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
> > 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
> 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
> 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
7;t play well together. Not recommended.
HTH,
--
Miki <[EMAIL PROTECTED]>
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
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
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
").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
> 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
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
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
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
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
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
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
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
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
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
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
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
p you.
HTH,
--
Miki <[EMAIL PROTECTED]>
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>>> 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
http://www.openbookproject.net/thinkCSpy/ ?
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
mtpd module have both?
http://twistedmatrix.com/documents/current/mail/tutorial/smtpclient/smtpclient.html
HTH,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
.org/wiki/Trie
HTH,
--
Miki
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
rent line.
You can also type "?" for help.
HTH,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
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
> method = getattr(auths[0], method_name, None)
Should be
fn = getattr(auths[0], method_name, None)
--
http://mail.python.org/mailman/listinfo/python-list
in "packages".
Any ideas why it's ignored?
Thanks,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
> 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
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
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
> 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
> 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
> 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
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
> 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
> 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(__
> 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
> 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
> 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
> 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
> 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
> 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,
Have a look at PyMedia.
--
http://mail.python.org/mailman/listinfo/python-list
> 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
> 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
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
Thanks!
> On 08/21/2012 12:44 PM, Miki Tebeka wrote:
>
> >
>
> >>> class B:
>
> > ... '''a {} string'''.format('doc')
>
> > ...
>
> >>>> B.__doc__
>
> >>>>
&
> 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
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
oin/Freeze.
HTH,
--
Miki (http://pythonwise.blogspot.com/)
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
> 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
> 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
ample project.
HTH,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
> 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
> 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
> 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
> ANNOUNCING
> Central Python Events Calendars
Thanks, a great idea.
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
> 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
> 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
> 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
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
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
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
101 - 200 of 521 matches
Mail list logo