- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Software Developer
- PC Specs
- MacBook Pro OSx
91 Posted Topics
Re: can we edit any of the item in the cell ? | |
| |
Does anyone have idea how to fetch a file split into defined number of ranges using the requests module instead of urllib2 ? | |
Hi need help passing an argument through signal emitted from a function at module level, when the function is executed I want to emit a signal with an argument whose value i want to pass to the method that is connected to that signal in the class in that same … | |
when getting file from a web server or ftp server, if we use `u = urllib2.urlopen(url)` Correct me if I am wring, it is not getting downloaded to disk, i think its getting stored in buffer(RAM), is there a way that the buffer split should get saved onto disk directly … | |
I am on OSx and I am trying to exit the program by pressing CTRL+C. but it seems like even if I have a signal handler registered in main thread it doesn't exit while the thread is executing on pressing CTRL+C. Here is a piece of cake where I am … | |
I havent done this before, but I want to make a window that plots a graph looking at file structure on different server locations, and in that UI I want to add control like if i want to copy the remote the file to local if missing or if outdated, … | |
Re: when I try to resize and save with above mentioned methods i get error saying # IOError: cannot identify image file # ![]() | |
getting errror related to pkg_resources while running PIP PIP install cython Traceback (most recent call last): File "/usr/local/bin/PIP", line 6, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module> working_set.require(__requires__) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve raise DistributionNotFound(req) … | |
i am trying to recieve input from external text editor using python's `subprocess` but I am not sure why i am getting the error diff = subprocess.Popen('open(os.path.join(os.getcwd(), "foo.txt") "w")', stdout=subprocess.PIPE) pr = subprocess.Popen(sublime, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, stdin=diff.stdout) pr.wait() if pr.returncode == 0: msg = pr.stdout.read() print msg er = pr.stderr.read() … | |
books = { 'Contact':['Carl Sagan', '2'], 'End of Faith':['Sam Harris', '7'], 'on Mars':['Patrick Moore', '1'], } based on dictionary above, how can i get Modales Qdialog box that should have 3 column containing like below DialogBox BookName_Label: BookAutor_Label : Quantity_QSpinBox BookName_Label: BookAutor_Label : Quantity_QSpinBox BookName_Label: BookAutor_Label : Quantity_QSpinBox Ok Cancel | |
I have made a python script that takes path of a folder and dispalys images in gallery or slideshow made in pyqt? So how do I add a right click menu of the folder in finder to pass the same folder path as argument to python script ? | |
I have made a QTableView that displays images from disk, there are two seriously agonizing problem I am facing. First of after the windows shows up making it maximize or changing size of window is very slow, and secondly I want to display images height width dependong on what can … | |
How do I display images in QListView of size of standard thumbnail size like 250 x 200 , and file nametext should wrap to next line , right now the images displayed are very small and are not positioned under each other in proper row column order. import sys import … | |
I am trying yo create symbolic link on my mac, but when i try to run i get error saying original item searchMethod cannot be found `$ ln -s '/usr/bin/env python ~/Development/python/searchMethod/python/searchMethod.py' searchMethod` | |
I have a function in which i want to mock `os.listdir` that returns directory content to variable `dirContent` def setUp(self): self._filePaths = ["/test/file/path"] self.mox = mox.Mox() def imageFilePaths(paths): imagesWithPath = [] for _path in paths: try: dirContent = os.listdir(_path) except OSError: raise OSError("Provided path '%s' doesn't exists." % _path) for … | |
How do I rotate image in this code every n seconds http://pastebin.com/SKDzuC15 lets say i want to change the image in pixmap after 5 seconds to next image, what is happening right now the last one gets displayed. | |
It seems like the slotDirChanged is getting executed twice, becuase everything seems to be working fine, import datetime from PyQt4 import QtGui,QtCore from PyQt4.QtCore import pyqtSlot import sys import os class WatchFilesBin(QtGui.QMainWindow): def __init__(self, lookinpath=None): super(WatchFilesBin, self).__init__() self._filesBinPath = lookinpath createFilesBin(self._filesBinPath) self.filesList = os.listdir(self._filesBinPath) print self.filesList self.fileSysWatcher = QtCore.QFileSystemWatcher() def … | |
Re: the RSS feed is an XML data, so you have to know how to parse XML. You can either parse using elementTree or using minidom | |
Is there any way to start an application with python and count how much time does it take to completely load, any idea if I can do it with os.syste, or subprocess.Popen ? | |
Why is this stacking ontop of each other, as far as the index should get each of them to next row. data1 = {'PHOTOSHOP': '6.5', 'NUKE': '7.0v9', 'MAYA': '2014', 'TESTING': '1.28', 'KATANA': '1.7', 'MARI': '4.0'} data2 = {'PHOTOSHOP': '10.5', 'NUKE': '6.3v6', 'MAYA': '2012', 'TESTING': '1.28', 'KATANA': '1.0', 'MARI': '1.0'} class … | |
I have a list that contains some paths ['/users/sanfx/test1', '/users/sanfx/test2/', '/App/project/modules'] dirModel = QtGui.QFileSystemModel() dirModel.setRootPath(QtCore.QDir.currentPath()) dirModel.setFilter(QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot | QtCore.QDir.Files) # dirModel.setNameFilters(self.filter) dirModel.setNameFilterDisables(0) completer = QtGui.QCompleter(dirModel,self) completer.setModel(dirModel) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) self.addPathEdit.setCompleter(completer) i want to add both these list and completer to be set to completer for self.addPathEdit | |
How should I make an entry appended to existing entries instead of overwriting the whole file ? class ReadWriteCustomPathsToDisk(object): """docstring for ReadWriteCustomPathsToDisk""" def __init__(self, modulePath): super(ReadWriteCustomPathsToDisk, self).__init__() self.modulePath = modulePath def _xmlFileLocation(self): xmlFileLocation = os.path.join(os.path.expanduser("~"), "Documents","searchMethod","modules.xml") return xmlFileLocation if os.path.exists(xmlFileLocation): return xmlFileLocation def readXml(self): xmlFile = self._xmlFileLocation() root = etree.parse(xmlFile).getroot() … | |
I just discovered that while doing check of the functions available in `os.path` using `dir(os.path)` is not the same as shown by `dir(__import__("os.path", globals={}, locals={}, fromlist=[], level=-1))`, in the later case it is actually showing all the modules of `OS` while I just want to look inside for the modules … | |
if i try to dump from shell like this `python -c 'help("modules")' > ~/Desktop/modules.txt` but if I try to execute from within the python like this `>>os.system("python -c 'help("modules")' > ~/Desktop/modules.txt")` i get error File "<stdin>", line 1 os.system("python -c 'help("modules")' > ~/Desktop/modules.txt") ^ SyntaxError: invalid syntax once i get … | |
in the designer when i right click a widget, and i click promote to i get this window? see attached screenshot what is it for ? does that mean i can create a new class in this case inherit QLineEdit and add more methos to it ? how can i … | |
why this works `> varhelp = __import__("sys")` and this doesn't`> varhelp = __import__("sys.path")` the second one throws: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named path then how to achieve the second one? | |
I am trying to load the help on each method into a QTextEdit in PyQt4 how can I have this variable hold help on a method, example: `data = os.system('python -c "import sys; help(sys.path)"')` but data value contains `0` | |
how do I make a class return as `Namespace(filter='b', list="['hi','by']")` class NameSpace(object): """Mock for argparse's NameSpace """ def __init__(self, lst=None, flter=None): super(NameSpace, self).__init__() self._filter = flter self._lst = lst Is it possible what I am thinking, i guess we have to do something using special method call ? | |
In the scripts ddirectory of my dummy project I have created this file without extension and has given executable permission using chmod +x filterList #!/bin/env python print "Hello World!" 'python ~/Development/python/listFilter/python/filterList.py $1 $2' but still when I run this i get error message saying $ filterList -bash: filterList: command not … | |
I hav amde this alias : test='python -m nose.core --tests $1 -s --with-coverage' this runs but gives an OS Error saying: $ test test_filterList.py nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module ....E ====================================================================== ERROR: Failure: OSError (No such file /Users/sanjeevkumar/Development/python/-bash) ---------------------------------------------------------------------- Traceback (most recent call last): File … | |
I am trying to run python -m nose.core --tests test_module.py -s --with-coverage but I keep getting error message saying /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named nose but then i installed nose like this $ sudo easy_install nose Searching for nose Best match: nose 1.3.0 Adding nose 1.3.0 to easy-install.pth file Installing nosetests … | |
import unittest import filterList class TestFilterList(unittest.TestCase): """ docstring for TestFilterList """ def setUp(self): self._filterby = 'B' def test_checkListItem(self): self.flObj = filterList.FilterList(['hello', 'Boy', 1], self._filterby) self.assertRaises(filterList.ItemNotString, self.flObj.checkListItem) def test_filterList(self): self.flObj = filterList.FilterList(['hello', 'Boy'], self._filterby) self.assertEquals(['Boy'], self.flObj.filterList()) if __name__ == '__main__': unittest.main() my above test test_checkListItem() fails , for the below filterList.py … | |
I want to test the layer filtering feature that I added in the UI, so to test using mox def test_layerFilter(self): """ layer filter Knob changed """ mx = mox.Mox() mx.StubOutWithMock(self.writeTab, '_createElementTypesFilterList') mx.StubOutWithMock(self.writeTab, 'getDetails') mx.StubOutWithMock(self.writeTab, 'updateResolutions') self.writeTab.updateResolutions() # Calls self.writeTab._createElementTypesFilterList().AndReturn(['I', 'IST',]) self.writeTab.getDetails().AndReturn(['I_bar']) mx.ReplayAll() self.writeTab.refresh('layerFilter') self.assertEquals(self.writeNode['layerOption'].values(), ['I_bar']) mx.verifyMox() my test assertion … | |
import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self, items=None): super(Example, self).__init__() self.items = items or {'India':['New Delhi', 'Bangalore']} self.initUI() def initUI(self): self.combo = QtGui.QComboBox(self) self.cbBox = QtGui.QComboBox(self) self.combo.addItems(self.items.keys()) self.cbBox.addItems(self.items[str(self.combo.currentText())]) self.combo.move(50, 50) self.cbBox.move(50,80) self.combo.currentIndexChanged.connect(self.onActivated) self.setGeometry(300, 300, 300, 200) self.setWindowTitle('Learning by practice') self.show() def onActivated(self): self.cbBox.clear() self.cbBox.addItems(self.items[str(self.combo.currentText())]) def main(): … | |
I am a pythoneer, guess List is called hash in shell script , I want to know how to do this for arg in "$@"; do echo `pwd`'/'$arg; done how do i pass the collected this list of items in $args to a different applications that takes these items as … | |
can anyone please tell me the difference between a process and a service? | |
I recently got a new macbook pro, can anyone suggest me a really good free python IDE i can use on OS x ? | |
How do i finda spl character in a string and return found one..? | |
I have a source code that opens a csv file and sets up a header to value association. The source code is given below: def ParseCsvFile(source): """Parse the csv file. Args: source: file to be parsed. Returns: the list of dictionary entities; each dictionary contains attribute to value mapping or … | |
I want to know if there is anyway I can make an email alert with a balloon popup in the system tray, so far starting with I have made a system tray icon using pyqt that seemed to be simple enough, but I am not finding any starting point for … | |
I have a list of filenames fileNames = ['Aamde Mustafa Marhba (mr-jatt.com).mp3', 'Aaj Me Peeni (Ft.Sanjay Dhaliwal)(Mr-Jatt.com) 1.mp3', '01 Aal Izz Well [www.DJMaza.Com].mp3','17 Aarons Plea.mp3', 'AARIYAN.mp3','17 Aarons Plea.mp3'] i want to get rid of brackets([],{},()) as well as web addresses inside the braces but i want to keep braces and … | |
when are we supposed to use StubOutWithMock() ? | |
I have a method that does not return anything , but it makes a call to another method that returns a value like def apply(): #set some defaults try: script = _getScript() except Exception, ex: raise Exception(ex) node = [xyz for xyz in myLst] # myLst is a global list … | |
just wrote a snippet that return true if whole image sequnce exist else returns false, import os def sequenceExists(seqPath,firstFrame,lastFrame,sep=None): """ Checks if sequence exist on disk. seqPath = image sequence path example: J:/Footages/33x01_02a/33x01_02a.%04d.sgi where %04d can be any number like 0001, 231 but not KFd001 string change buildPath at line … | |
is it any different to use with in python 2.5, becuase at work i wasnt getting error, but now i am implementing the logic at home on python 2.5 i am getting error from __future__ import with_statement import nuke grp = nuke.toNode("Group1") with grp: nodes = nuke.allNodes() for node in … | |
on linux i have been using pwd to get the file owner, but how do i do for Windows in python 2.6 since pwd module is supported in linux only..? | |
i have downloaded and installed from this [page](http://sourceforge.net/projects/pywin32/) but still when I import any of the modules[win32api, win32security, win32con] i get import error, please help me if I am not downloading the right version | |
I am trying to remove a column from PyQt4 implementation of table model , however I am not able to figure it out what I am doing wrong def removeColumns(self, position, columns, parent = QtCore.QModelIndex()): self.beginRemoveColumns(parent, position, position + columns - 1) #Do removing here rowCount = len(self.__colors) for i … | |
I am using Python 2.6 with ide and i created a list with names `names = 'mark', 'raymond', 'rachel', 'matthew', 'roger', 'judith', 'charlie', 'melissa', 'betty']` and then set `names = nmls` so even if I update names, nmls gets updated... however if I do `names = deque(['raymond', 'rachel', 'matthew', 'roger', … |
The End.