So I worked out a solution to find a read node in the group, extract it and paste it outside the group and with still connected to original connection So as a part of my learning experience I implemented a simple file Explorer that uses QCompleter to complete folder path in the address bar and QTableWidget as well as QTableview to show how different is the implementation and how we can take advantage of Model View programming while implementing using QAbstractTableModel with QTableView. Click read more to see code. To get file owner in windows I have used ctypes module, see winfileOwner.py In this code below, I have used QCompleter Class with QDir model for it to auto-complete the path as the user input text, however in the similar way you can also pass a list instead of dirmodel in line 7, which means then we will not need to create the QDirModel Object. 1: def __completer(self): 2: dirModel = QtGui.QFileSystemModel() 3: dirModel.setRootPath(QtCore.QDir.currentPath()) 4: dirModel.setFilter(QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot | QtCore.QDir.Files) 5: dirModel.setNameFilters(self.filter) 6: dirModel.setNameFilterDisables(0) 7: completer = QtGui.QCompleter(dirModel,self) 8: completer.setModel(dirModel) 9: completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) 10: self.__ui.fileRead.setCompleter(completer) Raymond talks about better techniques that can make code more robust in presentation at PyCon @ US 2013 given below is the presentation you can go page by page I would probably watch this over and over to get everything he talks about in the presentation This function enVar() returns all the environment variable set on the machine or in active project.If environment variable name is passed to the enVar function it returns its values. Whatever tools you use to produce your Python application, you can see your application as a set of Python source files, which are normal text files. A script is a file that you can run directly. A module is a file that you can import to provide functionality to other files or to interactive sessions. A Python file can be both a module and a script, exposing functionality when imported, but is also suitable for being run directly. A useful and widespread convention is that Python files that are primarily intended to be imported as modules, when run directly, should execute some simple self-test operations .py - Python source code - textual representation of the program in Python Python source files normally have extension .py. Python saves the compiled bytecode file
.pyw - pyw means run the script without invoking the console window, especially if your program is GUI based. If you rename the file to py extension,you still can run it. The .pyw script is called by pythonw.exe. (as opposed to python.exe) To be noted: .py file runs on console basis that is using command prompt or terminal and .pyw files are used when you are building a GUI application and not a console application using Qt or Jython and some other tools which help in Python GUI programming To delete the modules inside the sys.modules dictionary. This is a pretty dirty solution and produces problems when you try to access data from somewhere without reimporting a deleted module but it worked very fine for me so far. Let's say that my code lies inside a package called "myPackage" I would execute following code: You can normally import your stuff and the executed code will be updated. Few days back I updated the look of my Batch Render standalone application I made in PyQt. All I had to do is just add new stylesheet, since I had the stylesheet written in external file, I wanted it to load and apply. So at the beginning I knew that self.styleSheet(..) takes the stylesheet content as string that is always end up multiline, so instead of adding it within Python module within the triple commas string, this is what I did 1: styleFile=os.path.join(os.path.split(__file__)[0],"darkorange.stylesheet") 2: with open(styleFile,"r") as fh: 3: self.setStyleSheet(fh.read())So by the year end 2012, I am done with my new reel for the post of technical artist job profile. The showreel showcases my skills in python and pyqt4. In this video I choose to showcase 3 tools that I made recently in python. 1.Pose It: Pose Manager for Autodesk Maya can run as docked or as floating window made can display thumbnail of stored poses. 2. Mini Me: Maya Project manager that lets the maya artist access files and folder from within maya without having to switch to Explorer or finder set favorite projects, fix file texture paths, email scene or selected file or upload to ftp and even perform incremental save. (both 1. Pose manager & Project manager has multi platform compatibility i.e on mac, linux and Windows) 3. Batch Renderer for Autodesk Maya and Foundry Nuke performs batch render, what unique you might find it reads the ma, mb or nk file for the setting set by the artist for rendering and this reduces the chance of a mistake of entering wrong values manually. you can also choose the render camera in case of may from dropdown similarly choose write node in case of Nuke while doing render setup. I have written plenty of other tools that can be viewed on Creative crash website here: goo.gl/xCljF |
This site contains actual content, written by an actual person. All of this stuff is mine. Even though it may read like it was written by monkeys on typewriters, I actually wrote it. If you want to use my stuff, you can't. At least, not without contacting me first. I also have a privacy policy that I guard fiercely. Any information you provide on this website will not be used by anyone else but me. Listed on High PageRank Sites Directory
Blog, Website Content, Design, VFX Showreel work & Tools & Scripts by Sanjeev Kumar is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.


Blog, Website Content, Design, VFX Showreel work & Tools & Scripts by Sanjeev Kumar is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.









