Simple Object assignment giving me errors

2014-02-12 Thread Nir
This is from the book 'dive into python'. I am trying to define jeez as being 
an instance of FileInfo.

class UserDict(object):
def __init__(self, dict = None):
self.data = {}
if dict is not None: self.update(dict)

class FileInfo(UserDict):
def __init__(self, filename=None):
UserDict.__init__(self)
self["name"] = filename


jeez = FileInfo("yo")




I get a TypeError: 'FileInfo' object doesn't support item assignment .

Am I missing something?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple Object assignment giving me errors

2014-02-12 Thread Nir
Those two classes are from this code here(pasted below). Quite frankly, I don't 
understand this code. 

Also, UserDict is a built in module. I just typed it out so as to give 
reference or any clue as to why I cant instantiate jeez.

==

"""Framework for getting filetype-specific metadata.

Instantiate appropriate class with filename.  Returned object acts like a
dictionary, with key-value pairs for each piece of metadata.
import fileinfo
info = fileinfo.MP3FileInfo("/music/ap/mahadeva.mp3")
print "\\n".join(["%s=%s" % (k, v) for k, v in info.items()])

Or use listDirectory function to get info on all files in a directory.
for info in fileinfo.listDirectory("/music/ap/", [".mp3"]):
...

Framework can be extended by adding classes for particular file types, e.g.
HTMLFileInfo, MPGFileInfo, DOCFileInfo.  Each class is completely responsible 
for
parsing its files appropriately; see MP3FileInfo for example.

This program is part of "Dive Into Python", a free Python book for
experienced programmers.  Visit http://diveintopython.org/ for the
latest version.
"""

__author__ = "Mark Pilgrim ([email protected])"
__version__ = "$Revision: 1.3 $"
__date__ = "$Date: 2004/05/05 21:57:19 $"
__copyright__ = "Copyright (c) 2001 Mark Pilgrim"
__license__ = "Python"

import os
import sys
from UserDict import UserDict

def stripnulls(data):
"strip whitespace and nulls"
return data.replace("\00", " ").strip()

class FileInfo(UserDict):
"store file metadata"
def __init__(self, filename=None):
UserDict.__init__(self)
self["name"] = filename

class MP3FileInfo(FileInfo):
"store ID3v1.0 MP3 tags"
tagDataMap = {"title"   : (  3,  33, stripnulls),
  "artist"  : ( 33,  63, stripnulls),
  "album"   : ( 63,  93, stripnulls),
  "year": ( 93,  97, stripnulls),
  "comment" : ( 97, 126, stripnulls),
  "genre"   : (127, 128, ord)}

def __parse(self, filename):
"parse ID3v1.0 tags from MP3 file"
self.clear()
try:
fsock = open(filename, "rb", 0)
try:
fsock.seek(-128, 2)
tagdata = fsock.read(128)
finally:
fsock.close()
if tagdata[:3] == 'TAG':
for tag, (start, end, parseFunc) in self.tagDataMap.items():
self[tag] = parseFunc(tagdata[start:end])
except IOError:
pass

def __setitem__(self, key, item):
if key == "name" and item:
self.__parse(item)
FileInfo.__setitem__(self, key, item)

def listDirectory(directory, fileExtList):
"get list of file info objects for files of particular extensions"
fileList = [os.path.normcase(f) for f in os.listdir(directory)]
fileList = [os.path.join(directory, f) for f in fileList \
if os.path.splitext(f)[1] in fileExtList]
def getFileInfoClass(filename, module=sys.modules[FileInfo.__module__]):
"get file info class from filename extension"
subclass = "%sFileInfo" % os.path.splitext(filename)[1].upper()[1:]
return hasattr(module, subclass) and getattr(module, subclass) or 
FileInfo
return [getFileInfoClass(f)(f) for f in fileList]

if __name__ == "__main__":
for info in listDirectory("/music/_singles/", [".mp3"]):
print "\n".join(["%s=%s" % (k, v) for k, v in info.items()])
print




If this makes sense to you, great. I am trying to break it down so that I can 
make sense of it. As you mentioned self["name"] = filename doesn't work unless 
I built a class to handle it. I guess my question then, is how is the class 
handling it in this code? If you can show me by stripping it down to the bare 
minimum or write an example that would be awesome.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple Object assignment giving me errors

2014-02-12 Thread Nir
Thank you Jerry. 

And thank you to the rest of you. You all have been tremendously helpful.

PS Chris, next time I will do just that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Nir
>>> k = ['hi','boss']
>>>
>>> k
['hi', 'boss']
>>> k= [s.upper for s in k]
>>> k
[, ]

Why doesn't the python interpreter just return
['HI, 'BOSS'] ?

This isn't a big deal, but I am just curious as to why it does this.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pdb attach?

2007-09-21 Thread Nir
On Sep 20, 3:26 pm, Hynek Hanke <[EMAIL PROTECTED]> wrote:
> Hello,
>
> please, is there something like 'attach' in pdb yet? My application uses
> threads
> and when it freezes (e.g. due to a deadlock situation), I'd like to get
> the traceback
> of all threads and inspect at which point did the application get into
> problems.
> Or could I send a signal to such a python process so that it would
> output backtraces
> from all threads before terminating?
>
> Because currently, if a thread runs into deadlock problems (or a thread
> fails on
> an exception and the other thread can't join it), I have no way of
> determining
> what went wrong.
>
> Such processes are not possible to terminate via CTRL-C in the
> interpreter, so
> I can't get the backtrace this way. Furthermore, I also need todebug
> subprocesses,
> so these are difficult to invoke interactively.
>
> I'm happy for any suggestions.
>
> Thank you,
> Hynek Hanke

Try to debug with winpdb:
http://www.digitalpeers.com/pythondebugger/

Any feedback will be appreciated.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a good Python environment

2007-11-13 Thread Nir
On Nov 11, 11:39 pm, Paul Rubin  wrote:
> Russell Warren <[EMAIL PROTECTED]> writes:
> > Wing now has multi-threaded debugging.
>
> Cool, is it windows-only?  I'm using Linux.
>
> > A quick look at the current state of SPE shows that it now has multi-
> > threaded debugging viaWinPDB(what I used to use for debugging thread
> > issues).  Interesting.  Worth a look to see if it is integrated well.
>
> Same issue: this also sounds windows-specific.  Thanks though.

Winpdb may sound to you as windows specific but it actually googles up
as platform independent. Those of you who dare work with a bunch of
separate development tools (oh, the terror, ugh...) instead of an IDE
will find it to be one of the best Python debuggers around.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to debug Python program with GUI (Tkinter)?

2007-12-05 Thread Nir
On Nov 28, 11:18 am, Davy <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> How todebugPython program with GUI, especially Tkinter? Mydebug
> environment is PythonWin.
>
> For example, when I single step in the program, the step will go to
> mainloop() and always loop there. How can I know where the program is
> processed?
>
> Any suggestions are welcome!
> Best regards,
> Davy


Try Winpdb
http://www.digitalpeers.com/pythondebugger/

With Winpdb you can pause (break into) and inspect the state of the
Python script even if it is doing some C code.

Nir

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to Python Would like debug advice

2007-12-20 Thread Nir
On Dec 17, 9:17 pm, PatrickMinnesota <[EMAIL PROTECTED]>
wrote:
> Yep, I'm new to the language, it's been a couple of months.
>
> I opted for gvim and console window for developing on a Windows XP
> box.  I'm not a huge fan of IDEs except for when I need some
> debugging.  I've done my googling and see a bunch of options out there
> for a debugging solution for Python on Windows.
>
> I've used Eclipse for a few years for Java development and I
> understand there is a Python module for it that might make sense.
>
> What I'm looking for is advice on what to use todebuggeneral Python
> programs at the source level, some will be graphical.  If the eclipse
> route is the way to go, that's fine, but I'm wondering what other
> options people have good luck with.  Keep in mind I will probably
> continue to use Vi/Emacs and a console window for my main development.
>
> Thanks.

Try Winpdb (On Linux as well).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I don't understand what is happening in this threading code

2008-01-20 Thread Nir
On Jan 19, 2:43 am, Matthew Wilson <[EMAIL PROTECTED]> wrote:
> In this code, I tried to kill my thread object by setting a variable on it
> to False.
>
> Inside the run method of my thread object, it checks a different
> variable.
>
> I've already rewritten this code to use semaphores, but I'm just curious
> what is going on.
>
> Here's the code:
>
> import logging, threading, time
> logging.basicConfig(level=logging.DEBUG,
> format="%(threadName)s: %(message)s")
>
> class Waiter(threading.Thread):
> def __init__(self, hot_food):
> super(Waiter, self).__init__()
> self.should_keep_running = True
> self.hot_food = hot_food
>
> def run(self):
> while self.should_keep_running:
> logging.debug("Inside run, the id of should_keep_running is %s."
>   % id(self.should_keep_running))
> self.hot_food.acquire()
>
> def cook_food(hot_food):
> i = 5
> while i >= 0:
> logging.debug("I am cooking food...")
> time.sleep(1)
> hot_food.release()
> logging.debug("Andiamo!")
> i -= 1
>
> def main():
>
> hot_food = threading.Semaphore(value=0)
>
> chef = threading.Thread(name="chef", target=cook_food, args=(hot_food, ))
> chef.start()
>
> w = Waiter(hot_food)
> logging.debug("Initially, the id of w.should_keep_running is %s."
>   % id(w.should_keep_running))
> w.start()
> logging.debug("After start, the id of w.should_keep_running is %s."
>   % id(w.should_keep_running))
>
> # Wait for the chef to finish work.
> chef.join()
>
> # Now try to kill off the waiter by setting a variable inside the waiter.
> w.should_keep_running = False
> logging.debug("Now, the id of w.should_keep_running is %s."
>   % id(w.should_keep_running))
>
> if __name__ == "__main__":
> main()
>
> And here's what I get when I execute it.  I have to suspend the process
> with CTRL=Z and then kill -9 it.
>
> $ python foo.py
> MainThread: Initially, the id of w.should_keep_running is 135527852.
> MainThread: After start, the id of w.should_keep_running is 135527852.
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> chef: I am cooking food...
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> chef: Andiamo!
> Thread-1: Inside run, the id of should_keep_running is 135527852.
> MainThread: Now, the id of w.should_keep_running is 135527840.
>
> [1]+  Stopped python foo.py
>
> $ kill -9 %1
>
> [1]+  Stopped python foo.py
>
> The memory address of should_keep_running seems to change when I set it
> from True to False, and inside the run method, I keep checking the old
> location.
>
> I am totally baffled what this means.
>
> Like I said earlier, I already rewrote this code to use semaphores, but
> I just want to know what is going on here.
>
> Any explanation is welcome.
>
> TIA
>
> Matt

It does not check a different variable.
You can open a Python session and try the following:

Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = True
>>> id(a)
135527852
>>> a = False
>>> id(a)
135527840

The problem is that the waiter is locked waiting for new food and
never looks at the variable.
You should add hot_food.release() after you set the keep running flag
to False.

Nir

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting a Foothold on the IDLE Debugger

2008-02-12 Thread Nir
On Feb 12, 7:15 am, "W. Watson" <[EMAIL PROTECTED]> wrote:
> I thought I try to step through some simplePythoncode I wrote with IDLE
> using Debug. I'm at the early stages of learningPython. I used the shell to
> Run, then clicked on Debug->Debugger. That brought up a window with Stack
> and Locals checked. The buttons Go, Step, etc. are greyed out. How do I
> proceed?

Proceed to the Winpdb Python debugger.
http://www.winpdb.org

(Runs on Linux as well)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About reading Python code

2008-03-17 Thread Nir
On Mar 17, 5:54 am, WaterWalk <[EMAIL PROTECTED]> wrote:
> Hello. I wonder what's the effective way of figuring out how a piece
> ofpythoncode works. With C I often find it very useful to be able to
> run the code in step mode and set breakpoints in adebuggerso I can
> watch how the it executes, how the data change and how the code jumps
> from one function to another. But withPython, thedebuggeris a
> little primitive. The default IDLE doesn't even allow me to set a
> breakpoint. When the code is long, I am often lost in it.
>
> So I'm curious how to read code effectively. I agree thatpythoncode
> is clear, but when it becomes long, reading it can still be a hard
> work.

Try Winpdb - www.winpdb.org (works on Linux as well). Don't forget to
send feedback.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-06 Thread Nir
You seem to be having a problem with the import path of the embedded
interpreter. I suppose the embedded interpreter includes some modules
in a particular folder and _socket is not one of them. For the sake of
debugging try adding the c:\python25\lib path to the sys.path variable
of the interpreter before attempting to import rpdb2.

Does this work?

Nir


On Jun 5, 2:52 pm, [EMAIL PROTECTED] wrote:
> I am embedding Python in a MSVC++ (2005) application. The application
> creates some environment and then launches a Python script that will
> call some functions exported from the MSVC++ application.
>
> I want to be able to debug the Python script by using a debug server,
> likeWinpdb(winpdb.org).
>
> I use ActivePython 2.5.2.2, Microsoft Visual Studio 2005, andWinpdb
> 1.3.8.
>
> When I launch a script like "e:>python test.py" everything is O'K and
> I can useWinpdbto trace/debug.
>
> When I run the same script from the MSVC++ application, there is
> always a complain "ImportError: No module named _socket".
>
> Here is the basic test script I use:
>
>
>
> def Process( something ):
> print "\n\nStarted debugging\n=\n"
> #pydevd.settrace()
> import rpdb2; rpdb2.start_embedded_debugger("1")
> print "\n\nStopped debugging\n=\n"
>
> if __name__ == '__main__':
> Process( "test" )
> <<<
>
> In the MSVC++ application I tried many approaches, as suggested by
> many people, and all of them work to launch the script, but none of
> them works withWinpdb(or PyDev for Eclipse - same problem). Just for
> completeness - here is one:
>
>
>
>   PyRun_SimpleString("import sys");
>   PyRun_SimpleString("import os");
>   PyRun_SimpleString( "fullpath = os.path.abspath(\"E:/Test.py\")" );
>   PyRun_SimpleString( "g = globals().copy()" );
>   PyRun_SimpleString( "g['__file__'] = fullpath");
>   PyRun_SimpleString( "execfile(fullpath, g) ");
> <<<
>
> If I use pdb (import pdb + pdb.runcall(something) ) everything works
> fine, but I need the performance and convinience ofWinpdb.
>
> What am I doing wrong?
>
> Your help is highly appreciated!
>
> Best regards,
> Chris

--
http://mail.python.org/mailman/listinfo/python-list


Re: Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-06 Thread Nir
Can you check another hypothesis?

I currently do not have a Python installation to verify this but if my
memory does not fail me there is a DLL library somewhere under c:
\python25 and _socket might be there as well. Copy any DLLs you find
there to the same folder as your embedded interpreter DLL and see if
the problem is resolved.

Nir


On Jun 6, 11:25 am, [EMAIL PROTECTED] wrote:
> On Jun 6, 1:13 am, Nir <[EMAIL PROTECTED]> wrote:
>
>
>
> > You seem to be having a problem with the import path of the embedded
> > interpreter. I suppose the embedded interpreter includes some modules
> > in a particular folder and _socket is not one of them. For the sake of
> > debugging try adding the c:\python25\lib path to the sys.path variable
> > of the interpreter before attempting to import rpdb2.
>
> > Does this work?
>
> > Nir
>
> > On Jun 5, 2:52 pm, [EMAIL PROTECTED] wrote:
>
> > > I am embedding Python in a MSVC++ (2005) application. The application
> > > creates some environment and then launches a Python script that will
> > > call some functions exported from the MSVC++ application.
>
> > > I want to be able to debug the Python script by using a debug server,
> > > likeWinpdb(winpdb.org).
>
> > > I use ActivePython 2.5.2.2, Microsoft Visual Studio 2005, andWinpdb
> > > 1.3.8.
>
> > > When I launch a script like "e:>python test.py" everything is O'K and
> > > I can useWinpdbto trace/debug.
>
> > > When I run the same script from the MSVC++ application, there is
> > > always a complain "ImportError: No module named _socket".
>
> > > Here is the basic test script I use:
>
> > > def Process( something ):
> > > print "\n\nStarted debugging\n=\n"
> > > #pydevd.settrace()
> > > import rpdb2; rpdb2.start_embedded_debugger("1")
> > > print "\n\nStopped debugging\n=\n"
>
> > > if __name__ == '__main__':
> > > Process( "test" )
> > > <<<
>
> > > In the MSVC++ application I tried many approaches, as suggested by
> > > many people, and all of them work to launch the script, but none of
> > > them works withWinpdb(or PyDev for Eclipse - same problem). Just for
> > > completeness - here is one:
>
> > >   PyRun_SimpleString("import sys");
> > >   PyRun_SimpleString("import os");
> > >   PyRun_SimpleString( "fullpath = os.path.abspath(\"E:/Test.py\")" );
> > >   PyRun_SimpleString( "g = globals().copy()" );
> > >   PyRun_SimpleString( "g['__file__'] = fullpath");
> > >   PyRun_SimpleString( "execfile(fullpath, g) ");
> > > <<<
>
> > > If I use pdb (import pdb + pdb.runcall(something) ) everything works
> > > fine, but I need the performance and convinience ofWinpdb.
>
> > > What am I doing wrong?
>
> > > Your help is highly appreciated!
>
> > > Best regards,
> > > Chris
>
> Nir,
>
> > Does this work?
>
> Unfortunately, not.
>
> I did some experiments to check the sys.path hypothesis:
>
> - In my MSVC++ application I did PyRun_SimpleString("import cgi"); -
> it complained about missing _socket.
>
> - Did PyRun_SimpleString("print sys.path") to get the sys.path as seen
> from within the application environment (that does not find _socket)
>
> - Did the same in "test.py" and ran ...>Python test.py to get the
> sys.path for the environment that _does_ find _socket
>
> - Compared the two - the working environment had two more paths:
>
>   C:\\WINDOWS\\system32\\python25.zip
>   C:\\Python25\\lib\\plat-win
>
> - Added the missing path to the embedded environment:
>
>   PyRun_SimpleString("import sys");
>   PyRun_SimpleString("import os");
>
>   PyRun_SimpleString("sys.path.append(\"C:\\WINDOWS\\system32\
> \python25.zip\")");
>   PyRun_SimpleString("sys.path.append(\"C:\\Python25\\lib\\plat-win
> \")");
>
>   PyRun_SimpleString("print sys.path");
>
>   PyRun_SimpleString("import cgi");
>
> Not all paths that are in the working environment are present in the
> embedded environment, but still there is a problem:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Python25\Lib\cgi.py", line 40, in 
> import urllib
>   File "c:\Python25\lib\urllib.py", line 26, in 
> import socket
>   File "c:\Python25\lib\socket.py", line 45, in 
> import _socket
> ImportError: No module named _socket
>
> Chris

--
http://mail.python.org/mailman/listinfo/python-list


Re: debugger on system with Python 2 and 3

2009-11-29 Thread Nir
rpdb2 should be compatible with Python 3.x.
And once you start a debugging session with rpdb2 (running with Python
3.x)
you can attach to it from a winpdb instance (running with Python 2.x)


On Nov 29, 2:29 pm, Yo Sato  wrote:
> If there's no other choice I don't mind using winpdb, but it is
> installed (through Yum) under Python2 library and invokes Py2 at
> default... Don't quite know how to adapt it to Py3 or install the
> right version under the right directory, yet. It seems as if some
> environmental variable change is necessary. On the whole it doesn't
> seem that there's much support in the third-party debuggers in general
> as yet...
>
> In the meantime I might ask if it is possible to adapt pydb (or
> perhaps, IDLE) for Py3. Might be just a change in a env variable or
> two...
>
> Yo


-- 
http://mail.python.org/mailman/listinfo/python-list


Packaging multiple wheels in the same package

2016-07-06 Thread Nir Cohen
Hey all,

As part of working on Cloudify (http://github.com/cloudify-cosmo) we've had to 
provide a way for customers to install our plugins in an environment where PyPI 
isn't accessible. These plugins are sets of Python packages which necessarily 
depend on one another (i.e. a regular python package with dependencies).

We decided that we want to package sets of wheels together created or 
downloaded by `pip wheel`, add relevant metadata, package them together into a 
single archive (tar.gz or zip) and use the same tool which packs them up to 
install them later on, on the destination hosts.

We came up with a tool (http://github.com/cloudify-cosmo/wagon) to do just that 
and that's what we currently use to create and install our plugins.

While wheel solves the problem of generating wheels, there is no single, 
standard method for taking an entire set of dependencies packaged in a single 
location and installing them in a different location.

We thought it would be a good idea to propose a PEP for that and wanted to get 
your feedback before we start writing the proposal.

The logic behind the PEP is that there's a standard for creating a single 
python package and we would like to propose a layer above it to package 
multiple python packages either for offline environments or any other 
requirement a user may have.

We're currently working on a new rearchitected version of that tool to make it 
more pythonic and clean but the base stays the same.


We would greatly appreciate your feedback on this.

Thanks!


P.S. We encourage you to take a look at the repo (see the `rearchitecture` 
branch) and read the README.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging multiple wheels in the same package

2016-07-06 Thread Nir Cohen
On Wednesday, July 6, 2016 at 10:09:01 PM UTC+3, Ethan Furman wrote:
> On 07/06/2016 11:43 AM, Nir Cohen wrote:
> 
> > We decided that we want to package sets of wheels together created or 
> > downloaded
>  > by `pip wheel`, add relevant metadata, package them together into a 
> single archive
>  > (tar.gz or zip) and use the same tool which packs them up to install 
> them later on,
>  > on the destination hosts.
> >
> > We came up with a tool (http://github.com/cloudify-cosmo/wagon) to do just 
> > that
>  > and that's what we currently use to create and install our plugins.
> 
> Sounds like a great idea!
> 
> Once you have your feed-back from here you'll want to take your PEP over 
> to the dist-utils sig:
> 
> https://mail.python.org/mailman/listinfo/distutils-sig
> 
> --
> ~Ethan~

Happy to hear :)

btw, pull requests are certainly welcome to make whichever changes required to 
make Wagon PEP-worthy.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging multiple wheels in the same package

2016-07-13 Thread Nir Cohen
On Thursday, July 7, 2016 at 7:47:22 AM UTC+3, Nir Cohen wrote:
> On Wednesday, July 6, 2016 at 10:09:01 PM UTC+3, Ethan Furman wrote:
> > On 07/06/2016 11:43 AM, Nir Cohen wrote:
> > 
> > > We decided that we want to package sets of wheels together created or 
> > > downloaded
> >  > by `pip wheel`, add relevant metadata, package them together into a 
> > single archive
> >  > (tar.gz or zip) and use the same tool which packs them up to install 
> > them later on,
> >  > on the destination hosts.
> > >
> > > We came up with a tool (http://github.com/cloudify-cosmo/wagon) to do 
> > > just that
> >  > and that's what we currently use to create and install our plugins.
> > 
> > Sounds like a great idea!
> > 
> > Once you have your feed-back from here you'll want to take your PEP over 
> > to the dist-utils sig:
> > 
> > https://mail.python.org/mailman/listinfo/distutils-sig
> > 
> > --
> > ~Ethan~
> 
> Happy to hear :)
> 
> btw, pull requests are certainly welcome to make whichever changes required 
> to make Wagon PEP-worthy.


Sorry to bump this up.. but I'm not sure exactly how I should go about getting 
as much feedback as possible on this. Any suggestions?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging multiple wheels in the same package

2016-07-14 Thread Nir Cohen
Appreciate it! Will do!
-- 
https://mail.python.org/mailman/listinfo/python-list


A bioinformatics module similar to DEseq in R

2016-08-08 Thread nir . yakovi1
Hi!
is there a Python module equivalent\as similar as possible to 'DEseq' in R?
It's just that my team's (many) scripts use it, and to start modifying them all 
to support some different bioinformatics module would be a nightmare.
Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Python 3.7 - Reading text from Terminal window

2019-07-25 Thread nir . zairi
Hi,

I want it to wait for a specific text on the terminal window that it opens 
(putty.exe), how can i do it? 

from pywinauto.application import Application
from pynput.keyboard import Key, Controller
 
print('Configuring')
 
app = Application().start(cmd_line=u'"C:\\...putty.exe" ')
puttyconfigbox = app.PuTTYConfigBox
puttyconfigbox.wait('ready')
listbox = puttyconfigbox.ListBox
listbox.select(u'COM5')
button = puttyconfigbox[u'&Load']
button.click()
button2 = puttyconfigbox[u'&Open']
button2.click()
 
keyboard = Controller()
keyboard.press(Key.enter)
 
keyboard.type('password1')
keyboard.press(Key.enter)
keyboard.type('enable\nconf t\n')

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Looking for a Python mentor

2005-10-13 Thread Nir Aides
Hello Len,

You should try the #python IRC room.
It is always very active and helpful.

Nir



LenS wrote:
> Hello
> 
> Was wandering if there is any place where some one could go to get
> mentoring on python coding.  I have started coding in python but I am
> the only one in the shop  using it.  So there is no one around to look
> over my code give suggestions on improvement, in style, logic, easier
> ways of doing things etc.  I am not really looking for hand holding as
> much mentoring.  I have purchased about every python book out and have
> a list a mile long on my internet bookmarks.  I believe I have a good
> grasp of the fundamentals procedurally and I am fighting my way through
> OOP.  I am more at the stage of trying to pull things together into
> programs that perform real world tasks.  At one point I thought I saw
> some place on one of the web site that did this kind of thing but I
> can't find it now.
> 
> Any help or suggestions welcomed
> Len Sumnler
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


sys.path and unicode folder names

2006-02-07 Thread Nir Aides
Hello,

Is there a solution or a work around for the sys.path problem with 
unicode folder names on Windows XP?

I need to be able to import modules from a folder with a non-ascii name.

Thanks,
Nir
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sys.path and unicode folder names

2006-02-07 Thread Nir Aides
I can not restrict the name to CP_ACP.
I am interested in the general case of Unicode.
Windows XP is a native Unicode OS.


Martin v. Löwis wrote:
> Nir Aides wrote:
>> Is there a solution or a work around for the sys.path problem with
>> unicode folder names on Windows XP?
>>
>> I need to be able to import modules from a folder with a non-ascii name.
> 
> If the name is restricted to the CP_ACP code page (i.e. more than ASCII,
> less then full Unicode), using the "mbcs" encoding should work fine.
> 
> Regards,
> Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sys.path and unicode folder names

2006-02-08 Thread Nir Aides
Actually, I already managed to make a Patch for this problem.
I will post it soon on my website and in this group.

But I find it strange that this problem even exists, and that I could 
not find any workarounds on the Internet.

Nir


Martin v. Löwis wrote:
> Nir Aides wrote:
>> I can not restrict the name to CP_ACP.
>> I am interested in the general case of Unicode.
> 
> So you should implement a patch, and contribute this
> to sf.net/projects/python.
> 
> Regards,
> Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sys.path and unicode folder names

2006-02-09 Thread Nir Aides
If few people use file names not in their respective CP_ACP as you say, 
why did Microsoft bother to make Windows XP a unicode OS?
It does not make any sense.

The existence of such bugs is the source of the problem itself.

It is because of this situation that people in non-English speaking 
countries prefer to install English Windows XP. After all why should 
they get all messed up with incompatible software?

And from my experience a considerable percent of these 
stay-on-the-safe-side users have their CP_ACP pages setup incorrectly.

My software installs per-user Python modules in a sub-folder of the 
User's Application-Data folder. The software itself resides under 
Program-Files. The User's Application-Data folder will contain unicode 
characters if the User's account name contains unicode characters.

You can argue that the design is good or wrong or can be altered to work 
around the problem, but the fact remains:

Python is Broken.



Martin v. Löwis wrote:
> Nir Aides wrote:
>> Actually, I already managed to make a Patch for this problem.
>> I will post it soon on my website and in this group.
>>
>> But I find it strange that this problem even exists, and that I could
>> not find any workarounds on the Internet.
> 
> Very few people use file names not in their respective CP_ACP (why
> do you need such filenames?), and virtually nobody wants to put such
> a file name on Python's sys.path (why do you want to? - just rename
> the directory and be done).
> 
> Regards,
> Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sys.path and unicode folder names

2006-02-09 Thread Nir Aides
Martin v. Löwis wrote:
> Nir Aides wrote:
>> If few people use file names not in their respective CP_ACP as you say,
>> why did Microsoft bother to make Windows XP a unicode OS?
> 
> Because it simplifies their implementation, in the long run.
> 
>> It is because of this situation that people in non-English speaking
>> countries prefer to install English Windows XP. After all why should
>> they get all messed up with incompatible software?
> 
> I see. Why do these people then refuse to change the code page of
> their system (which *is* possible, even in English XP)?
> 

They don't refuse. You assume they actually know about its existence. I 
think that in  most cases they are not aware of that thing. Sometimes 
they call their 10 year old neighbors to fix their computer if they are 
tired of seeing garbage on their screen instead of readable characters, 
but their computer usually crashes under the heavy load of dozens of 
viruses and spy-ware long before that kid neighbor gets a chance to look 
at it anyway.

>> Python is Broken.
> 
> I agree. Please contribute a patch.
> 

I will do my best.

> Regards,
> Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter and Windows XP themes (via manifest files)

2005-05-03 Thread Nir Aides
Hello,

How do I make Tkinter use windows XP themes?
ordinary root Tkinter windows ignore the manifest file (which is placed 
by wxPython for the same purpose)

but message dialogs popped with tkMessageBox.Message do use the Windows 
Theme, so it should be possible.

Does anyone has a clue?
Thanks,
Nir
-- 
http://mail.python.org/mailman/listinfo/python-list


tkinter and threads

2005-05-04 Thread Nir Aides
Hello,

In Tkinter, is it safe to call widget.after(time, callback) from another 
thread (other than the gui thread)?

Thanks,
Nir
-- 
http://mail.python.org/mailman/listinfo/python-list


tracing crash

2005-05-29 Thread Nir Aides
Hi,

I am facing a strange problem.
I will appreciate an explanation and a work around for the problem.

Look in the following code paste. It seems that taking a reference to 
the frame object crashes python in some scripts:

#
# trace_hell.py
#
# crashes with spe (stani's python editor) v0.7.3.a
#
# to see the crash add "import trace_hell; trace_hell.unleash_hell()" as
# the first line in spe.py
#
# 1. The statement that triggers the crash is "g_frame = frame"
#

import sys

g_frame = None

def tracer(frame, event, arg):
 global g_frame
 g_frame = frame
 return None

def unleash_hell():
 sys.settrace(tracer)
-- 
http://mail.python.org/mailman/listinfo/python-list