Title
stringlengths
15
150
A_Id
int64
2.98k
72.4M
Users Score
int64
-17
470
Q_Score
int64
0
5.69k
ViewCount
int64
18
4.06M
Database and SQL
int64
0
1
Tags
stringlengths
6
105
Answer
stringlengths
11
6.38k
GUI and Desktop Applications
int64
0
1
System Administration and DevOps
int64
1
1
Networking and APIs
int64
0
1
Other
int64
0
1
CreationDate
stringlengths
23
23
AnswerCount
int64
1
64
Score
float64
-1
1.2
is_accepted
bool
2 classes
Q_Id
int64
1.85k
44.1M
Python Basics and Environment
int64
0
1
Data Science and Machine Learning
int64
0
1
Web Development
int64
0
1
Available Count
int64
1
17
Question
stringlengths
41
29k
Running IPython after changing the filename of python.exe
7,727,290
0
0
550
0
python,windows,interpreter,ipython
instead of renaming python.exe, make sure the path to the python you want to run is before the path to other pythons
0
1
0
0
2011-10-11T13:42:00.000
4
0
false
7,727,017
1
0
0
4
If I rename the python interpreter from C:\Python27\python.exe to C:\Python27\python27.exe and run it, it will not complain. But if I now try to run C:\Python27\Scripts\ipython.exe, it will fail to start because now the python interpreter has a different filename. My question is: how do I configure IPython (ms windows) to start up a python interpreter which has a different filename than python.exe?
Macports duplicate packages
7,730,290
1
0
156
0
python,macos,macports,homebrew
Macports installs the packages in /opt/local/ and /opt/local/bin. You can always find your default OS package installation in /bin and /usr/bin. OS default python installation: /usr/bin/python Of course, you can choose the macports by having /opt/local/bin first in your path. Macport installation works very well for me.
0
1
0
0
2011-10-11T17:45:00.000
1
1.2
true
7,730,207
1
0
0
1
I have already Python 2.7 on my Mac Os 10.7 and i tried to install py27-mysql package that contains MySQLdb interface for Python. I had run sudo ports install py27-mysql and macports began to install all dependencies for that package python2.7, mysql5, etc that I already has. Now the questions: Why that happens? Where is now native Mac Os python and mysql? Which one I use after installation if I work from command shell? Is brew better?
pydev: find all references to a function
7,742,529
42
35
10,065
0
python,pydev
Ctrl+Shift+G will find all the references to a function in PyDev (F3 will go to the definition of a function).
0
1
0
0
2011-10-11T19:20:00.000
2
1.2
true
7,731,324
1
0
0
1
This has probably been asked before but I can't seem to find the answer. I've moved from windows to Linux and started using PyDev (Aptana) recently but what I cannot seem to find is how to find all references to a function.
Get modified date of file on web site without using the Last-Modified header value
7,732,882
0
3
2,597
0
python,html,bash,shell
If you're retrieving data over http, there is no guarantee that what you're requesting corresponds to a physical file or anything else with a concept of a "last modified" date, so within the http protocol there's no way (other than Last-Modified) to know. You will probably want to retrieve the file if you don't have a sufficiently recent local copy - and you will have to decide for your purposes what "sufficiently recent" is. If you have a user account on the host and can remotely log in via ssh or similar, it may be possible to inspect an actual file for mod date.
0
1
0
0
2011-10-11T21:31:00.000
3
0
false
7,732,779
0
0
0
1
I am attempting to write a bash shell script that will evaluate the modified date of a file on a remote web site and download the file if it is more recent than the local copy. Part of the script is already written. The part that has been developed uses the header Last-Modified parameter. I need to have an alternative in case the Last-Modified parameter is not available in the header. Does anyone know of a way using bash shell scripting or python to get the last modified date of as file on a website without using the Last-Modified parameter in the header? Thanks. James
Channel disconnect notification in channel api in google app engine
7,741,709
4
4
1,617
0
javascript,python,google-app-engine,channel-api
The amount of time it takes the Channel API front-end servers to "realize" that a channel is disconnected is contingent on browser implementation. On well-behaved browsers, we catch the beforeunload event and post a message to our front-end that says, "this client is going away." On other browsers, we may not get the event (or we may not be able to listen to it for various implementation reasons, like the browser sends it too often (FFFUUUU IE)) or once we get the event the XHR we send may get swallowed. In those cases, the frontend server realizes the client is gone because it fails to receive a heartbeat -- this is what's happening on your phone. (out of curiousity, what phone?) Your case is interesting because you're explicitly calling onclose. The only thing this does is dispose the iframe that has the Channel FE code -- in other words, onclose just behaves as if the whole browser window was closed; it doesn't take advantage of the fact that the browser is still in a good state and could wait to close until a message is sent. So I recommend two things: add a custom handler to your code (that does the same thing as your /_ah/disconnect handler) so you can just make an XHR when you know you're manually closing the channel. This is kludgy but functional. The bummer about this is you'll need to explicitly know your client id in your javascript code. Second, add an issue to our issue tracker (http://code.google.com/p/googleappengine/issues/list) to request better disconnect notification when onclose is called explicitly. Hope that helps; sorry there's not an easy answer right now.
0
1
1
0
2011-10-12T06:29:00.000
1
1.2
true
7,736,105
0
0
1
1
Im using my GAE application on my phone. I face a problem in getting the disconnect notification to /_ah/channel/disconnected in channels api even if i manually close the socket by socket.close() function. the post occurs after a delay of say one minute. Does anyone know the way to speed things up? In my case socket.close() doesnt produce the channel disconnect notification(only in phone though.. it works perfectly from a laptop)!
identifying the format of files
7,736,514
0
4
211
0
python,file,identification,imghdr
There are standard modules imghdr and sndhdr for graphic and sound files, respectively.
0
1
0
0
2011-10-12T07:13:00.000
3
0
false
7,736,480
1
0
0
1
In linux, we have a utility called “file”, which helps us to determine the identification of a file. Is there any python module that can do the same job? I don't prefer to use subprocess.Popen(['file', 'blah.blah']), because it is platform dependent. For instance, windows do not have “file” (although it can be downloaded).
Can't set Python environment PATH variable?
10,164,902
3
1
15,504
0
python,variables,path,environment
I know it's been a while, but I hope this could help someone else. I had the same problem and the only way to making it work was running cmd or powershell as administrator.
0
1
0
0
2011-10-12T16:23:00.000
5
0.119427
false
7,743,281
1
0
0
2
So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have: C:\Python32; listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interpreter (I assume because I have an environment variable for that separately...? As you can see, I don't quite understand how to customize this stuff. Any help would be appreciated!
Can't set Python environment PATH variable?
53,708,878
4
1
15,504
0
python,variables,path,environment
I faced the same issue. However, in my case, I went through the documentation from python and found where I was making mistake. In the latest python versions, if you type 'python' in cmd, it will show error. At the same time, the command that worked for me was 'py'. So I recommend anyone facing a similar problem to try this - 'py'
0
1
0
0
2011-10-12T16:23:00.000
5
0.158649
false
7,743,281
1
0
0
2
So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have: C:\Python32; listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interpreter (I assume because I have an environment variable for that separately...? As you can see, I don't quite understand how to customize this stuff. Any help would be appreciated!
AppEngine: switching to Python 2.7
7,744,371
5
4
839
0
python,google-app-engine
There is no way to avoid changing the app ID, but you can request that the old ID be aliased so requests to old_appid.appspot.com will be handled by the new application. If you're serving the application on your own domain, of course, the app ID is irrelevant. The Master/Slave datastore will almost certainly never be supported on Python 2.7; Google doesn't recommend its use at all (I wouldn't use the term deprecated, since they've expressed no plans to actually remove it and kill the huge number of existing applications using it, but they certainly want to do as much as they can to discourage its use.)
0
1
0
0
2011-10-12T16:54:00.000
1
1.2
true
7,743,653
0
0
1
1
For tons of reasons, I would like to go ahead and switch to Python 2.7. The new python version requires using the High Replication Datastore. As far as I can see, converting to it is not really possible: the only way is to create a new app, with new ID, and copy over the datastore. Changing my app ID is something I am not keen on doing. Is there a way around App ID changing? Or is a workaround expected in the near future? Will the 2.7 version eventually support the Master/Slave Datastore? I suppose not all AppEngine users will be that happily changing their id...
Python quit unexpectedly while running Django
7,747,494
0
1
1,009
0
python,django,crash,interpreter,osx-lion
It looks like its the mysql-extension that crashes, if you have XCode you can try to make sure you have the latest one compiled locally and installed.
0
1
0
0
2011-10-12T20:13:00.000
1
0
false
7,745,997
0
0
1
1
I'm running Python 2.7.1 on 64-bit Mac OSX Lion. Python keeps crashing while I'm running my local Django 1.3 development server. The error log is below. This is starting to get annoying. Any ideas? Process: Python [22917] Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: ??? (???) Code Type: X86-64 (Native) Parent Process: Python [22635] Date/Time: 2011-10-12 15:01:21.968 -0500 OS Version: Mac OS X 10.7.1 (11B26) Report Version: 9 Interval Since Last Report: 293584 sec Crashes Since Last Report: 6 Per-App Crashes Since Last Report: 5 Anonymous UUID: AF6F3F62-2520-45F9-AD9C-B5D08053AE23 Crashed Thread: 1 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000058 VM Regions Near 0x58: --> __TEXT 0000000101d94000-0000000101d95000 [ 4K] r-x/rwx SM=COW /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Application Specific Information: objc[22917]: garbage collection is OFF Thread 0:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff91c41386 close + 10 1 libmysqlclient.18.dylib 0x00000001028330dc vio_close + 60 2 libmysqlclient.18.dylib 0x00000001028329db vio_delete + 33 3 libmysqlclient.18.dylib 0x0000000102818069 end_server + 50 4 libmysqlclient.18.dylib 0x0000000102818174 mysql_close + 101 5 _mysql.so 0x00000001028006a3 _mysql_ConnectionObject_close + 65 6 _mysql.so 0x0000000102802274 _mysql_ConnectionObject_dealloc + 39 7 org.python.python 0x0000000101df1a85 0x101d9d000 + 346757 8 org.python.python 0x0000000101dd1caa 0x101d9d000 + 216234 9 org.python.python 0x0000000101dd473a PyDict_DelItem + 186 10 org.python.python 0x0000000101e5255c 0x101d9d000 + 742748 11 org.python.python 0x0000000101da4d32 PyObject_Call + 97 12 org.python.python 0x0000000101da4eed PyObject_CallFunctionObjArgs + 178 13 org.python.python 0x0000000101df5818 0x101d9d000 + 362520 14 org.python.python 0x0000000101df5946 PyObject_ClearWeakRefs + 246 15 org.python.python 0x0000000101e51b61 0x101d9d000 + 740193 16 org.python.python 0x0000000101dd1caa 0x101d9d000 + 216234 17 org.python.python 0x0000000101e3e235 PyThreadState_Clear + 129 18 org.python.python 0x0000000101e3e44c PyInterpreterState_Clear + 41 19 org.python.python 0x0000000101e3fb7f Py_Finalize + 344 20 org.python.python 0x0000000101e3fd90 0x101d9d000 + 667024 21 org.python.python 0x0000000101e3fdc7 PyErr_PrintEx + 41 22 org.python.python 0x0000000101e403f4 PyRun_SimpleFileExFlags + 730 23 org.python.python 0x0000000101e502af Py_Main + 2715 24 org.python.python 0x0000000101d94e88 0x101d94000 + 3720 Thread 1 Crashed: 0 org.python.python 0x0000000101e270dc PyEval_EvalFrameEx + 22922 1 org.python.python 0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 2 org.python.python 0x0000000101e27e6c 0x101d9d000 + 568940 3 org.python.python 0x0000000101e24e0a PyEval_EvalFrameEx + 14008 4 org.python.python 0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 5 org.python.python 0x0000000101e27e6c 0x101d9d000 + 568940 6 org.python.python 0x0000000101e24e0a PyEval_EvalFrameEx + 14008 7 org.python.python 0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 8 org.python.python 0x0000000101dc5abf 0x101d9d000 + 166591 9 org.python.python 0x0000000101da4d32 PyObject_Call + 97 10 org.python.python 0x0000000101db36e9 0x101d9d000 + 91881 11 org.python.python 0x0000000101da4d32 PyObject_Call + 97 12 org.python.python 0x0000000101e20c40 PyEval_CallObjectWithKeywords + 180 13 org.python.python 0x0000000101e5240d 0x101d9d000 + 742413 14 libsystem_c.dylib 0x00007fff8dfcb8bf _pthread_start + 335 15 libsystem_c.dylib 0x00007fff8dfceb75 thread_start + 13 Thread 2: 0 libsystem_kernel.dylib 0x00007fff91c40df2 __select + 10 1 time.so 0x00000001021ae030 0x1021ad000 + 4144 2 org.python.python 0x0000000101e24d77 PyEval_EvalFrameEx + 13861 3 org.python.python 0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 4 org.python.python 0x0000000101e27e6c 0x101d9d000 + 568940 5 org.python.python 0x0000000101e24e0a PyEval_EvalFrameEx + 14008 6 org.python.python 0x0000000101e27df7 0x101d9d000 + 568823 7 org.python.python 0x0000000101e24e0a PyEval_EvalFrameEx + 14008 8 org.python.python 0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 9 org.python.python 0x0000000101dc5abf 0x101d9d000 + 166591 10 org.python.python 0x0000000101da4d32 PyObject_Call + 97 11 org.python.python 0x0000000101db36e9 0x101d9d000 + 91881 12 org.python.python 0x0000000101da4d32 PyObject_Call + 97 13 org.python.python 0x0000000101e20c40 PyEval_CallObjectWithKeywords + 180 14 org.python.python 0x0000000101e5240d 0x101d9d000 + 742413 15 libsystem_c.dylib 0x00007fff8dfcb8bf _pthread_start + 335 16 libsystem_c.dylib 0x00007fff8dfceb75 thread_start + 13 Thread 1 crashed with X86 Thread State (64-bit): rax: 0x00007fab51368e10 rbx: 0x0000000000000000 rcx: 0x00007fab5146dc90 rdx: 0x0000000101ecd670 rdi: 0x00007fab5146de28 rsi: 0x0000000000000009 rbp: 0x0000000102dae630 rsp: 0x0000000102dae4c0 r8: 0x00007fff784a50b0 r9: 0x0000000102dae458 r10: 0x0000000000000081 r11: 0x0000000102c23064 r12: 0x00007fab51368e10 r13: 0x0000000103023f90 r14: 0x000000000000007c r15: 0x00000001023c4ddb rip: 0x0000000101e270dc rfl: 0x0000000000010246 cr2: 0x0000000000000058 Logical CPU: 2 Binary Images: 0x101d94000 - 0x101d94fff org.python.python (2.7.1 - 2.7.1) /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 0x101d9d000 - 0x101eb8ff7 org.python.python (2.7.1 - 2.7.1) /System/Library/Frameworks/Python.framework/Versions/2.7/Python 0x1020ea000 - 0x1020edfff strop.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so 0x1020f2000 - 0x1020f5fff operator.so (??? - ???) <59A152D0-52ED-354C-9C2D-D7390E3EC216> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so 0x10213b000 - 0x10213cfff _functools.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so 0x102140000 - 0x102141fff _locale.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so 0x102145000 - 0x102149fff _struct.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so 0x10218f000 - 0x102195ff7 _socket.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so 0x10219d000 - 0x1021a1fff _ssl.so (??? - ???) <50FC05D5-0434-3054-9C09-CA8923FED0C0> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so 0x1021a7000 - 0x1021a8fff cStringIO.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so 0x1021ad000 - 0x1021aefff time.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so 0x1021b5000 - 0x1021b8fff _collections.so (??? - ???) <62C1B5B7-654D-397A-8840-7EBB907DBCA1> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so 0x1021be000 - 0x1021c4fff itertools.so (??? - ???) <7C8350B9-8DD3-377A-A5C1-1103A6C955A6> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so 0x1021cd000 - 0x1021cdfff _bisect.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so 0x1021d1000 - 0x1021d2fff _heapq.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so 0x1021d7000 - 0x1021d9ff7 binascii.so (??? - ???) <9B353DAC-B0E8-3B4B-91A1-50F6F86AA928> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so 0x10221d000 - 0x10221dfff _scproxy.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_scproxy.so 0x102221000 - 0x10222cff7 datetime.so (??? - ???) <9EC1E3BD-3BD3-3B39-AE19-448CCEEA747A> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so 0x102322000 - 0x102327fff math.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so 0x1023ad000 - 0x1023aefff _hashlib.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_hashlib.so 0x1023b2000 - 0x1023b3ff7 _random.so (??? - ???) <3C7A7C17-1698-32D0-BF09-F50A19F75E4B> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_random.so 0x102437000 - 0x102443fff cPickle.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so 0x102449000 - 0x10244bfff select.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so 0x1024d1000 - 0x1024d2fff fcntl.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so 0x102596000 - 0x10259bfff array.so (??? - ???) <177F1D09-ACEE-3E39-8F1E-3EE8BA8A7AC6> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so 0x102661000 - 0x102661fff grp.so (??? - ???) <563EC9A6-F38F-3518-9BBB-912E9F01FDA1> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/grp.so 0x1026a5000 - 0x1026a6fff termios.so (??? - ???) <578DA44F-17E3-3343-982F-BB543CBB49F1> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/termios.so 0x10276b000 - 0x10276dfff zlib.so (??? - ???) <81E54FCE-EEAC-3E97-BB05-1143EB6AECA6> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/zlib.so 0x1027b2000 - 0x1027b8fff pyexpat.so (??? - ???) <0E02E7DD-AC97-38B5-BB3B-856249DEBFF9> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/pyexpat.so 0x1027ff000 - 0x102804fff +_mysql.so (??? - ???) <8B1F4F4C-09C5-33DC-9DA4-D611FF9E2AF4> /Users/USER/*/_mysql.so 0x102810000 - 0x102aa0ff7 libmysqlclient.18.dylib (18.0.0 - compatibility 18.0.0) <6A688A2F-6420-D89A-A3BD-5F9605F6C4C2> /usr/lib/libmysqlclient.18.dylib 0x102e31000 - 0x102e42fff _io.so (??? - ???) <5451CA4B-98A0-3F70-9322-DBE6B7D93CF1> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 0x102e51000 - 0x102e5dff7 +parser.so (??? - ???) <9384AA00-C2F8-3407-94F6-210FA55AFD70> /Library/Python/2.7/site-packages/http_parser/parser.so 0x102f2d000 - 0x102f3efff _ctypes.so (??? - ???) <2D2AE6AF-704A-3CBB-954B-33BA49B78254> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so 0x102f8a000 - 0x102f8efff _json.so (??? - ???) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_json.so 0x7fff61994000 - 0x7fff619c8ac7 dyld (195.5 - ???) <4A6E2B28-C7A2-3528-ADB7-4076B9836041> /usr/lib/dyld 0x7fff876a6000 - 0x7fff876d3fe7 libSystem.B.dylib (159.0.0 - compatibility 1.0.0) <7B4D685D-939C-3ABE-8780-77A1889E0DE9> /usr/lib/libSystem.B.dylib 0x7fff88a3b000 - 0x7fff88a3cfff libDiagnosticMessagesClient.dylib (??? - ???) <3DCF577B-F126-302B-BCE2-4DB9A95B8598> /usr/lib/libDiagnosticMessagesClient.dylib 0x7fff89578000 - 0x7fff89593fff libexpat.1.dylib (7.2.0 - compatibility 7.0.0) /usr/lib/libexpat.1.dylib 0x7fff899ec000 - 0x7fff89a25fe7 libssl.0.9.8.dylib (0.9.8 - compatibility 0.9.8) /usr/lib/libssl.0.9.8.dylib 0x7fff8a000000 - 0x7fff8a001fff libdnsinfo.dylib (395.6.0 - compatibility 1.0.0) <718A135F-6349-354A-85D5-430B128EFD57> /usr/lib/system/libdnsinfo.dylib 0x7fff8a163000 - 0x7fff8a169fff libmacho.dylib (800.0.0 - compatibility 1.0.0) /usr/lib/system/libmacho.dylib 0x7fff8a1cf000 - 0x7fff8a1d1fff libquarantine.dylib (36.0.0 - compatibility 1.0.0) <4C3BFBC7-E592-3939-B376-1C2E2D7C5389> /usr/lib/system/libquarantine.dylib 0x7fff8a223000 - 0x7fff8a224fff libsystem_sandbox.dylib (??? - ???) <8D14139B-B671-35F4-9E5A-023B4C523C38> /usr/lib/system/libsystem_sandbox.dylib 0x7fff8a225000 - 0x7fff8a22dfff libsystem_dnssd.dylib (??? - ???) <7749128E-D0C5-3832-861C-BC9913F774FA> /usr/lib/system/libsystem_dnssd.dylib 0x7fff8a28f000 - 0x7fff8a29dfff libdispatch.dylib (187.5.0 - compatibility 1.0.0) <698F8EFB-7075-3111-94E3-891156C88172> /usr/lib/system/libdispatch.dylib 0x7fff8ae52000 - 0x7fff8ae9dfff com.apple.SystemConfiguration (1.11 - 1.11) <0B02FEC4-C36E-32CB-8004-2214B6793AE8> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 0x7fff8afbd000 - 0x7fff8b1bffff libicucore.A.dylib (46.1.0 - compatibility 1.0.0) <82DCB94B-3819-3CC3-BC16-2AACA7F64F8A> /usr/lib/libicucore.A.dylib 0x7fff8b4bb000 - 0x7fff8b4fdff7 libcommonCrypto.dylib (55010.0.0 - compatibility 1.0.0) /usr/lib/system/libcommonCrypto.dylib 0x7fff8c12f000 - 0x7fff8c213def libobjc.A.dylib (228.0.0 - compatibility 1.0.0) /usr/lib/libobjc.A.dylib 0x7fff8c32b000 - 0x7fff8c39efff libstdc++.6.dylib (52.0.0 - compatibility 7.0.0) <6BDD43E4-A4B1-379E-9ED5-8C713653DFF2> /usr/lib/libstdc++.6.dylib 0x7fff8c711000 - 0x7fff8c713fff com.apple.TrustEvaluationAgent (2.0 - 1) <80AFB5D8-5CC4-3A38-83B9-A7DF5820031A> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent 0x7fff8c74b000 - 0x7fff8c74cfff libunc.dylib (24.0.0 - compatibility 1.0.0) /usr/lib/system/libunc.dylib 0x7fff8c7b5000 - 0x7fff8c8c1fef libcrypto.0.9.8.dylib (0.9.8 - compatibility 0.9.8) <3AD29F8D-E3BC-3F49-A438-2C8AAB71DC99> /usr/lib/libcrypto.0.9.8.dylib 0x7fff8cc05000 - 0x7fff8cdd8ff7 com.apple.CoreFoundation (6.7 - 635) <57446B22-0778-3E07-9690-96AC705D57E8> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff8ce15000 - 0x7fff8ce1afff libcompiler_rt.dylib (6.0.0 - compatibility 1.0.0) <98ECD5F6-E85C-32A5-98CD-8911230CB66A> /usr/lib/system/libcompiler_rt.dylib 0x7fff8d07f000 - 0x7fff8d083fff libdyld.dylib (195.5.0 - compatibility 1.0.0) /usr/lib/system/libdyld.dylib 0x7fff8d6e4000 - 0x7fff8d759ff7 libc++.1.dylib (19.0.0 - compatibility 1.0.0) /usr/lib/libc++.1.dylib 0x7fff8df5d000 - 0x7fff8df5eff7 libsystem_blocks.dylib (53.0.0 - compatibility 1.0.0) <8BCA214A-8992-34B2-A8B9-B74DEACA1869> /usr/lib/system/libsystem_blocks.dylib 0x7fff8df5f000 - 0x7fff8df7cff7 libxpc.dylib (77.16.0 - compatibility 1.0.0) <0A4B4775-29A9-30D6-956B-3BE1DBF98090> /usr/lib/system/libxpc.dylib 0x7fff8df7d000 - 0x7fff8e05afef libsystem_c.dylib (763.11.0 - compatibility 1.0.0) <1D61CA57-3C6D-30F7-89CB-CC6F0787B1DC> /usr/lib/system/libsystem_c.dylib 0x7fff8e3d9000 - 0x7fff8e3deff7 libsystem_network.dylib (??? - ???) <4ABCEEF3-A3F9-3E06-9682-CE00F17138B7> /usr/lib/system/libsystem_network.dylib 0x7fff8e6dd000 - 0x7fff8e6deff7 libremovefile.dylib (21.0.0 - compatibility 1.0.0) /usr/lib/system/libremovefile.dylib 0x7fff8f409000 - 0x7fff8f414ff7 libc++abi.dylib (14.0.0 - compatibility 1.0.0) <8FF3D766-D678-36F6-84AC-423C878E6D14> /usr/lib/libc++abi.dylib 0x7fff8f7f7000 - 0x7fff8f7fcfff libcache.dylib (47.0.0 - compatibility 1.0.0) /usr/lib/system/libcache.dylib 0x7fff8fb23000 - 0x7fff8fb23fff libkeymgr.dylib (23.0.0 - compatibility 1.0.0) <61EFED6A-A407-301E-B454-CD18314F0075> /usr/lib/system/libkeymgr.dylib 0x7fff8fee2000 - 0x7fff8ff30ff7 libauto.dylib (??? - ???) /usr/lib/libauto.dylib 0x7fff8ff31000 - 0x7fff8ff37ff7 libunwind.dylib (30.0.0 - compatibility 1.0.0) <1E9C6C8C-CBE8-3F4B-A5B5-E03E3AB53231> /usr/lib/system/libunwind.dylib 0x7fff907bd000 - 0x7fff907c1fff libmathCommon.A.dylib (2026.0.0 - compatibility 1.0.0) /usr/lib/system/libmathCommon.A.dylib 0x7fff91aae000 - 0x7fff91ab8ff7 liblaunch.dylib (392.18.0 - compatibility 1.0.0) <39EF04F2-7F0C-3435-B785-BF283727FFBD> /usr/lib/system/liblaunch.dylib 0x7fff91ae3000 - 0x7fff91aecfff libnotify.dylib (80.0.0 - compatibility 1.0.0) /usr/lib/system/libnotify.dylib 0x7fff91b74000 - 0x7fff91b7bfff libcopyfile.dylib (85.1.0 - compatibility 1.0.0) <172B1985-F24A-34E9-8D8B-A2403C9A0399> /usr/lib/system/libcopyfile.dylib 0x7fff91c2a000 - 0x7fff91c4afff libsystem_kernel.dylib (1699.22.73 - compatibility 1.0.0) <69F2F501-72D8-3B3B-8357-F4418B3E1348> /usr/lib/system/libsystem_kernel.dylib 0x7fff9288c000 - 0x7fff928c8fff libsystem_info.dylib (??? - ???) /usr/lib/system/libsystem_info.dylib 0x7fff93506000 - 0x7fff93518ff7 libz.1.dylib (1.2.5 - compatibility 1.0.0) <30CBEF15-4978-3DED-8629-7109880A19D4> /usr/lib/libz.1.dylib 0x7fff939e7000 - 0x7fff939e8fff libffi.dylib (??? - ???) /usr/lib/libffi.dylib External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 206162 thread_create: 1 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=62.8M resident=27.3M(43%) swapped_out_or_unallocated=35.5M(57%) Writable regions: Total=62.7M written=16.7M(27%) resident=22.3M(35%) swapped_out=0K(0%) unallocated=40.5M(65%) REGION TYPE VIRTUAL =========== ======= MALLOC 53.2M MALLOC guard page 32K STACK GUARD 56.0M Stack 9232K VM_ALLOCATE 8K __DATA 2320K __LINKEDIT 48.2M __TEXT 14.6M __UNICODE 544K shared memory 12K =========== ======= TOTAL 183.8M Model: MacBookPro8,1, BootROM MBP81.0047.B0E, 2 processors, Intel Core i7, 2.7 GHz, 8 GB, SMC 1.68f96 Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020 Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.100.98.75.10) Bluetooth: Version 2.5.0f17, 2 service, 19 devices, 1 incoming serial ports Network Service: AirPort, AirPort, en1 Serial ATA Device: APPLE SSD TS128C, 121.33 GB Serial ATA Device: OPTIARC DVD RW AD-5970H USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfa100000 / 3 USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0xfa110000 / 5 USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x821a, 0xfa113000 / 8 USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0245, 0xfa120000 / 4 USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509, 0xfa200000 / 2 USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2 USB Device: My Passport 0730, 0x1058 (Western Digital Technologies, Inc.), 0x0730, 0xfd120000 / 4 USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd110000 / 3
What are the advantages of using syslog over other logging facilites?
31,257,970
4
6
3,342
0
python,logging,syslog
The advantages of using syslog where available (all modern *nix systems, including Linux, FreeBSD, OS-X etc.) are numerous: Performance is better: syslog is compiled C and most importantly it works as a separate process so all your logging operations become non-blocking to the applications, processes, and threads that make them You can log from multiple processes/threads concurrently without worrying about locking. All logging is safely serialized for you so you don't lose data You get standard sortable time-stamps on all logged lines for free You get log rotation for free You get severity level support for free (see man syslog) You can call logging from any language with a C binding, which is virtually any language You can trivially log from shell scripts or command line (via logger) You don't need to reinvent the (how to log) wheel The only disadvantage I can think of is that syslog is non portable (to non *nix systems), but if you're on any modern *nix, any alternative is more complicated and likely less reliable. The concern of losing packets because syslog is using UDP may be valid, but in practice on a LAN, I've never found it to be an issue.
0
1
0
1
2011-10-13T07:07:00.000
3
0.26052
false
7,750,560
0
0
0
1
We are using a basic python log server based on BaseHTTPServer to aggregate our python logs on an ubunutu server. This solution has fulfilled our needs... until now. The number of programs dumping to this log server has grown and now the logger is crippling the system. Now that we are back to the drawing board, we are considering using syslog. Would it be advantageous to use syslog over other logging facilites. Thanks for the help
account(s) management over multiple tenants
7,757,039
2
2
126
0
python,google-app-engine,namespaces,user-accounts
If 'user identity' can span tenants (your apps), then keep user entities in a common namespace (the default namespace works fine for that, and that's the default when a request begins). Anything specific to a tenant (e.g., what authorization a user identity has for a specific tenant) can be stored where it is most convenient. I find that putting it in the tenant's namespace simplifies queries that would otherwise have to specify that or filter it out.
0
1
0
0
2011-10-13T14:58:00.000
1
1.2
true
7,756,132
0
0
1
1
i have an app with multiple tenants on GAE. over the 'master' (which is a tenant on its own) i let people register and create a subapp/tenant where the creator is the owner of the app. what is the best way to manage the user accounts? lets say USER_A creates APP_A and USER_B creates APP_B. so there are 2 users and 2 apps where each user is owner to the app it created and does not have access to the other users app. now USER_B wants to give access to the other user on his app. what is the best way to model this situation. should i store members in a completely separate namespace and validate the users session by switching constantly between namespaces? i think the best place to keep what permissions a specific user has on an app is on the actual app tenant rather than the USER object. any tips or best practices? thank you
PyDev project for Google App Engine not finding webapp2
17,769,623
0
6
5,907
0
python,eclipse,google-app-engine,pydev
adding ${GOOGLE_APP_ENGINE}/lib/webapp2-2.5.2 to the "External Libraries" worked for me. App Engine SDK ver:1.8.2 Python version: 2.7
0
1
0
0
2011-10-13T16:00:00.000
5
0
false
7,756,981
0
0
1
3
I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness. I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening.
PyDev project for Google App Engine not finding webapp2
7,789,156
3
6
5,907
0
python,eclipse,google-app-engine,pydev
The current SDK does not support the Python 2.7 runtime on the dev_appserver, so it doesn't bundle new libraries like webapp2. If all you need is the libraries, you can download them and include them in your app yourself, but if you need extra runtime features like multithreading and PIL, you will need to do your development in the production environment for now.
0
1
0
0
2011-10-13T16:00:00.000
5
0.119427
false
7,756,981
0
0
1
3
I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness. I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening.
PyDev project for Google App Engine not finding webapp2
8,238,441
3
6
5,907
0
python,eclipse,google-app-engine,pydev
I encounter this problem, too. And I follow TorelTwiddler's instruction -> he's right, there's no webapp2. You have to add ${GOOGLE_APP_ENGINE}/lib/webapp2 to the "External Libraries". This occurs because(I guess) you only change the interpreter of the project, not create a whole new GAE project with PyDev. This action didn't re-scan the libs it should include. If you are Create a new GAE project w/ Pydev, you'll see webapp2 is in the external libs' list.
0
1
0
0
2011-10-13T16:00:00.000
5
0.119427
false
7,756,981
0
0
1
3
I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness. I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening.
open (and maintain) remote connection with python
7,757,147
0
1
696
0
python,sockets,ssh,scp
This is not really python specific, but it probably depends on what libraries you can use. What you need is a way to send files through a single connection. (This is probably better suited to superuser or severfault.com though.) Create tarfile locally, upload it and unpack at target? Maybe you could even run 'tar xz' remotely and upload the file on stdin over SSH? (As MichaelDillon says in the comment, Python can create the tarfile on the fly...) Is SFTP an option? Rsync over SSH? Twisted is an async library that can handle many sockets/connections at once. Is probably overkill for your solution though, Hope it helps.
0
1
1
1
2011-10-13T16:07:00.000
3
0
false
7,757,059
0
0
0
1
I'm using Python to transfer (via scp) and database a large number of files. One of the servers I transfer files to has odd ssh config rules to stop too many ssh requests from a single location. The upshot of this is that my python script, currently looping through files and copying via os.system, hangs after a few files have been transferred. Is there a way in which Python could open up an ssh or other connection to the server, so that each file being transferred does not require an instance of ssh login? Thanks,
Python - apache - windows 7 - wamp
7,762,202
0
0
255
0
python,windows,apache
Common problems with Apache/mod_wsgi installation, if that is what you are trying to install are: Installing a mix of 32 and 64 bit binaries for Apache, Python and mod_wsgi. Not installing Python for all users on the system. Do either of those and Apache will not startup properly. Since you don't say what exactly failed, it is hard to guess. Provide more information.
0
1
0
0
2011-10-13T17:43:00.000
2
0
false
7,758,160
0
0
0
1
I tried millions of times to install python with apache on my windows 7 32 bit. But failed. Can anybody tell me the simplest way to get it work???
How do I separate my executable files from my library files?
7,786,309
0
1
629
0
php,python,project-management
For my PHP projects, I follow a very Java-esque naming convention (my background): index.php /classes/{organization type: net, org, com}/{organization name}/{component} /includes/ <- general configuration, etc; all non-executable; /lib/ <- third party libraries that are tied to specific releases; not modified, patched/upgraded as needed; /modules/ <- place for extensions written within the score of the project
0
1
0
1
2011-10-14T14:11:00.000
2
0
false
7,768,881
0
0
0
1
I still haven't gotten an answer that I'm happy with. Please do submit some answers if you have a nice system for your Python or PHP projects. I'm having a management issue with my PHP and Python projects. They both have two kinds of code files: files that should be run in the console or web browser, and files that should be included from other files to extend functionality. After my projects grow into large namespace or module trees, it starts getting disorienting that "executable" files and library files lay side by side with the same file extensions in all my folders. If PHP and Python were pre-compile languages, this would be the files with the main function. For example, picture I have the namespace com.mycompany.map.address which contained multiple .py or .php files depending on the project. It would contain models for different kinds of addresses and tons of functions for working with addresses. But in addition, it would contain some executable files that runs from the terminal, providing a user tools for searching for addresses, and perhaps adding and removing addresses from a database or such. I want a way of distinguish such executable files from the tons and tons of code files in my namespace trees If the files had separate file extensions this wouldn't be a problem. But since they don't, I'm thinking I should separate folders or something, but I don't know what to name them. In PHP I could perform the hack solution of configuring PHP to parse different file extensions, so my project could contain phps or phpx files, for instance. If anyone has some language-independent advice on how to handle this issue, I'd appreciate it. This could also apply to languages such as C, where one project might compile into many executable files. How should one separate the source files containing main functions from the rest of them?
in Python and linux how to get given user's id
7,770,065
-5
34
48,007
0
python,linux
You could just parse /etc/passwd, it's stored there.
0
1
0
0
2011-10-14T15:37:00.000
4
-1
false
7,770,034
0
0
0
1
There is os.getuid() which "Returns the current process’s user id.". But how do I find out any given user's id?
reliable way to deploy new code into a production celery cluster without pausing service
13,168,517
4
9
1,747
0
python,django,celery
The challenging part here seems to be identifying which celery tasks are new versus old. I would suggest creating another vhost in rabbitmq and performing the following steps: Update django web servers with new code and reconfigure to point to the new vhost. While tasks are queuing up in the new vhost, wait for celery works to finish up with the tasks from the old vhost. When workers have completed, update the code and configuration to the new vhost I haven't actually tried this but I don't see why this wouldn't work. One annoying aspect is having to alternate between the vhosts with each deploy.
0
1
0
0
2011-10-14T19:05:00.000
2
1.2
true
7,772,378
0
0
1
2
I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when the next time they are run, but what about registering new tasks? I know that restarting the daemon won't kill running workers, but instead will let them die on their own, but it still seems dangerous. Is there an elegant solution to this problem?
reliable way to deploy new code into a production celery cluster without pausing service
7,780,065
0
9
1,747
0
python,django,celery
a kind of work around for you can be to set the config variable MAX_TASK_PER_CHILD. This variable specify the number of task that a Pool Worker execute before kill himself. Off course when a new Pool Worker is executed this will load the new code. On my system normally I use to restart celery leaving other task running on background, normally everything goes fine, sometimes happen that one of this task is never killed and you can still kill it with a script.
0
1
0
0
2011-10-14T19:05:00.000
2
0
false
7,772,378
0
0
1
2
I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when the next time they are run, but what about registering new tasks? I know that restarting the daemon won't kill running workers, but instead will let them die on their own, but it still seems dangerous. Is there an elegant solution to this problem?
Eclipse/PyDev: Open Interactive console when program starts
7,791,891
0
0
375
0
python,eclipse,pydev
Currently not... please enter a feature request for that (it should be relatively straightforward adding a preference where you can choose an interpreter which would be used to open an interactive console when you open Eclipse).
0
1
0
0
2011-10-14T21:01:00.000
1
1.2
true
7,773,513
0
0
0
1
I find myself opening the interactive shell nearly every time I launch Eclipse. To save my lazy self a few extra clicks every day, I started wonder: is there is a way to get an interactive console to open automatically on start-up of Eclipse/PyDev? Thanks!
How do I open a .py file in IDLE for editing without starting a fresh interpreter session?
8,020,235
2
2
8,877
0
python,linux,python-idle
In IDLE's menu, go to Options -> Configure IDLE... -> General. Under "At Startup" select "Open Edit Window" instead of "Open Shell Window", then hit Apply or Ok. IDLE will save this setting and from now on will open just an editor window when you open a file.
0
1
0
0
2011-10-15T01:56:00.000
2
1.2
true
7,775,254
1
0
0
2
Python for Windows has built in support for right clicking a .py file, and selecting, "edit with IDLE", instead of the usual action, which is running the file. How can I accomplish this same setup on Linux? I am running Mint Julia, a Debian-type distribution. Selecting my default program from the shortcut menu will only allow me to select idle3, which will open both an interpreter with a chevron, and the file I want to edit. Can I set up my "open with idle" selection to forgo the interpreter, until I decide to run the file? Thanks.
How do I open a .py file in IDLE for editing without starting a fresh interpreter session?
8,353,380
0
2
8,877
0
python,linux,python-idle
You'll need to change the command to start IDLE itself to include a "-e". Choose "use a custom command" and type idle -e
0
1
0
0
2011-10-15T01:56:00.000
2
0
false
7,775,254
1
0
0
2
Python for Windows has built in support for right clicking a .py file, and selecting, "edit with IDLE", instead of the usual action, which is running the file. How can I accomplish this same setup on Linux? I am running Mint Julia, a Debian-type distribution. Selecting my default program from the shortcut menu will only allow me to select idle3, which will open both an interpreter with a chevron, and the file I want to edit. Can I set up my "open with idle" selection to forgo the interpreter, until I decide to run the file? Thanks.
Way to disable "System" service or process for a short period of time? Python
7,788,671
1
0
160
0
python,windows,service,process
As a general rule, if Windows says that it needs a file, you will be very hard pressed to get it to completely relinquish control. While that process is running, it will have exclusive rights (read, write, and execute) to the file (or files) in question, so I will highly doubt that there will be an effective hack while running Windows. My personal suggestion would be to get a live boot disk so that you can run Linux off of either a USB or an optical drive. Boot into the alternate OS, copy the file, and then be on your merry way.
0
1
0
0
2011-10-17T01:35:00.000
1
1.2
true
7,788,632
1
0
0
1
I'm not sure if it is a service or process, but is there a way to disable it or stop it? A file which I'm trying to copy is being run by the system but the system does not require this .sys file. If there is way in python I would be even more ecstatic to read the response.
What data structure/db should I use for storing the file tree structure?
7,789,286
0
0
257
0
python,database,database-design,data-structures
I think you should declare a class which has a list of its own type. Basically a simple tree structure. For ls: Just dispay all the child recursively. For any new addition: Add it to the parent directory node's child list as a child.
0
1
0
0
2011-10-17T04:01:00.000
1
0
false
7,789,253
0
0
0
1
I am trying to write an application(I am using python) to have a copy of a remote machines directory structure in my local machine (not the actual content of the files in the remote machine). Once I store it in my local machine, I want to be be able to perform the following operations on my local copy of the tree structure "ls" "ls /etc" "ls /etc/bin/yahoo" and see the listing. Also if I change/add a dir/file name in the remote machine, I want to have the ability to easily update it in my local data structure. UPDATE: Some people suggested using Nested Set Model. I think updating it is an expensive process.
Can Native Client (NaCl) programs be written in languages other than C or C++?
7,844,298
8
20
4,357
0
python,google-chrome,google-chrome-extension,go,google-nativeclient
Go used to compile to NaCl, but NaCl's been such a moving target that the support was removed from Go. It'll probably be resurrected at some point if/when NaCl settles down.
0
1
0
0
2011-10-17T23:12:00.000
4
1
false
7,800,693
0
0
0
1
Would it be possible to write a native client application in Python or Go that could then run in the browser?
Does Berkeley DB only support one processor operation
8,835,081
1
1
237
1
python,nginx,berkeley-db
it supports A Single Process With One Thread A Single Process With Multiple Threads Groups of Cooperating Processes Groups of Unrelated Processes
0
1
0
0
2011-10-19T06:52:00.000
1
1.2
true
7,817,567
0
0
0
1
I use Berkeley DB(BDB) in nginx. When a request arrives, nginx passes the URI as a key to BDB and checks if that key has a value in BDB file. I actually did in an example. I add some data in BDB, and run nginx, it's OK. I can access it. But when I add some data in running BDB with nginx (using Python), I can't get the new data. Even I use the another python interpreter access the BDB file, it was actually has the new data. Steps of the request in nginx: start up nginx, and it will init my plugin (BDB env and init) a request comes in control in plugin, check if key(uri) has a value. If true, return it, or pass ...rest of process
What happens if two python scripts want to write in the same file?
7,820,272
3
15
6,557
0
python,file,io
A better solution is to implement a resource manager (writer) to avoid opening the same file twice. This manager could use threading synchronization mechanisms (threading.Lock) to avoid simultaneous access on some platforms.
0
1
0
0
2011-10-19T10:41:00.000
5
0.119427
false
7,820,021
1
0
0
4
I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file. Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied?
What happens if two python scripts want to write in the same file?
7,821,856
2
15
6,557
0
python,file,io
How about having all of the different processes write their output into a queue, and have a single process that reads that queue, and writes to the file?
0
1
0
0
2011-10-19T10:41:00.000
5
0.07983
false
7,820,021
1
0
0
4
I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file. Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied?
What happens if two python scripts want to write in the same file?
50,034,098
0
15
6,557
0
python,file,io
Use multiprocessing.Lock() instead of threading.Lock(). Just a word of caution! might slow down your concurrent processing ability because one process just waits for the lock to be released
0
1
0
0
2011-10-19T10:41:00.000
5
0
false
7,820,021
1
0
0
4
I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file. Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied?
What happens if two python scripts want to write in the same file?
7,820,062
8
15
6,557
0
python,file,io
In general, this is not a good idea and will take a lot of care to get right. Since the writes will have to be serialized, it might also adversely affect scalability. I'd recommend writing to separate files and merging (or just leaving them as separate files).
0
1
0
0
2011-10-19T10:41:00.000
5
1.2
true
7,820,021
1
0
0
4
I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file. Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied?
Can I deploy a django app which uses sqlite3 as backend on google app engine?
7,838,935
5
3
582
1
python,django,google-app-engine,web-applications,sqlite
Unfortunately, no you can't. Google App Engine does not allow you to write files, and that is needed by SQLite. Until recently, it had no support of SQL at all, preferring a home-grown solution (see the "CAP theorem" as for why). This motivated the creation of projects like "Django-nonrel" which is a version of Django that does not require a relational database. Recently, they opened a beta service that proposes a MySQL database. But beware that it is fundamentally less reliable, and that it is probably going to be expensive. EDIT: As Nick Johnson observed, this new service (Google Cloud SQL) is fundamentally less scalable, but not fundamentally less reliable.
0
1
0
0
2011-10-20T15:52:00.000
1
0.761594
false
7,838,667
0
0
1
1
I created a simple bookmarking app using django which uses sqlite3 as the database backend. Can I upload it to appengine and use it? What is "Django-nonrel"?
How do I block all network access for a script?
7,843,516
2
4
291
0
python,c,sandbox
Unless you're using a sandboxed version of Python (using PyPy for example), there is no reliable way to switch-off network access from within the script itself. Of course, you could run under a VM with the network access shut off.
0
1
0
1
2011-10-20T22:55:00.000
3
0.132549
false
7,843,238
0
0
0
3
Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities?
How do I block all network access for a script?
7,843,275
5
4
291
0
python,c,sandbox
You more or less gave a generic answer yourself by tagging it with "sandbox" because that's what you need, some kind of sandbox. Things that come to mind are: using JPython or JRuby that run on the JVM. Within the JVM you can create a sandbox using a policy file so no code in the JVM can do thing you don't allow. For C code, it's more difficult. The brute force answer could be to run your C code in a virtual machine with no networking capabilities. I really don't have a more elegant answer right now for that one. :)
0
1
0
1
2011-10-20T22:55:00.000
3
1.2
true
7,843,238
0
0
0
3
Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities?
How do I block all network access for a script?
7,843,519
0
4
291
0
python,c,sandbox
Firewalls can block specific applications or processes from accessing the network. ZoneAlarms is a good one that I have used to do exactly what you want in the past. So it can be done programatically, but I don't know near enough about OS programming to offer any advice on how to go about doing it.
0
1
0
1
2011-10-20T22:55:00.000
3
0
false
7,843,238
0
0
0
3
Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities?
Subsuming the Linux packet processing stack
7,851,867
1
2
197
0
python,linux,networking
Are you receiving and processing the packet and only need to suppress the ICMP port-unreachable? If so, maybe just add an entry to the iptables OUTPUT chain to drop it?
0
1
1
0
2011-10-21T15:37:00.000
1
1.2
true
7,851,817
0
0
0
1
We occasionally have to debug glitchy Cisco routers that don't handle the TCP Selective Acknowledgment (SACK) options correctly. This causes our TCP sessions to die when routed through an IPTABLES port redirection rule. To help with the diagnosis, I've been constructing a python-based utility to construct a sequence of packets that can reproduce this error at will, the implementation uses raw sockets to perform this trick. I've got an ICMP ping working nicely but I've run into a snag on the UDP implementation, I can construct, send and receive the packet without problem, the issue that I'm seeing is that Linux doesn't like the UDP packets being sent back from the remote system and always sends an ICMP Destination unreachable packet, even though my python script is able to receive and process the packet without any apparent problems. My question: Is it possible to subsume the Linux UDP stack to bypass these ICMP error messages when working with RAW sockets?. Thanks
gnu-binutils-strings utf-8 instead of utf-16 or ascii
7,864,249
4
3
573
0
python,unix,utf-8,utf-16,binutils
I'm not experienced with strings, but the version I have (2.21.51.20110605) has an 8-bit encoding option (-eS) that would work with utf-8 text. It must have to cast a wide net looking for 'text' delimited by non-printable characters (value < 32). I'd expect a lot of noise. A test on a random executable showed the -eS (8-bit) result was 5 times bigger than -es (7-bit).
0
1
0
0
2011-10-23T02:35:00.000
1
1.2
true
7,863,986
0
0
0
1
I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible for the program to print out utf-8 strings? if so, which arguments are appropriate? i'm working in a python environment using subprocess and would like to work with the output from gnu-binutils-strings that a subprocess.Popen call would generate through a pipe.
Python - SCP vs SSH for multiple computers and multiple files
7,869,588
0
0
1,890
0
python,ssh,scp
scp lets you: Copy entire directories using the -r flag: scp -r g0:labgroup/ . Specify a glob pattern: scp 'g0:labgroup/assignment*.hs' . Specify multiple source files: scp 'g0:labgroup/assignment1*' 'g0:labgroup/assignment2*' . Not sure what sort of globbing is supported, odds are it just uses the shell for this. I'm also not sure if it's smart enough to merge copies from the same server into one connection.
0
1
0
1
2011-10-23T22:00:00.000
4
0
false
7,869,552
0
0
0
1
Python 2.4.x (cannot install any non-stock modules). Question for you all. (assuming use of subprocess.popen) Say you had 20 - 30 machines - each with 6 - 10 files on them that you needed to read into a variable. Would you prefer to scp into each machine, once for each file (120 - 300 SCP commands total), reading each file after it's SCP'd down into a variable - then discarding the file. Or - SSH into each machine, once for each file - reading the file into memory. (120 - 300 ssh commands total). ? Unless there's some other way to grab all desired files in one shot per machine (files are named YYYYMMDD.HH.blah - range would be given 20111023.00 - 20111023.23). - reading them into memory that I cannot think of?
How to make python modules compatible with different OS?
7,873,222
1
1
133
0
python
You're asking a very general question. Perhaps overly general. Generally, unless your application is relatively simple, it's impossible to guarantee that it is going to work on Linux and Mac OS X by only having Windows available. You will have to at least test it on Linux. Mac OS X is rather similar to Linux in many aspects, so you may get off the hook there, although for more complex cases it won't suffice. Python is not much different from other languages in this respect - it makes writing cross platform code easier, but it won't solve all your problems. Luckily, installing Linux on a VM is quick and free. Personally I use VirtualBox with a Ubuntu installation on top. It takes less than an hour to set up such a system from scratch (download Vbox, download an Ubuntu image and install it).
0
1
0
0
2011-10-24T08:50:00.000
2
0.099668
false
7,873,170
0
0
0
2
I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source code and modify it, and i have to make it compatible on these OS using my xp :D well my brother's pc is windows 7, but I don't have mac OS or linux (unless i can use VM) EDIT my application is not simple
How to make python modules compatible with different OS?
7,873,269
0
1
133
0
python
Your question is quite broad: 1) Development and testing: Use VMs, absolutely, they are great for testing on OS you don't natively use, and to have a clean environment for testing (eg. test even windows stuff on a clean windows VM if you can, you might find out you're missing some dependencies that you took for granted on your dev machine). 2) Actual library porting: Depending on the library this may or may not be difficult. Why is this library only working on windows? does it use specific DLLs, via ctypes or swig or some other bindings. If the library is python code (not a C library), is it tied to windows python APIs? There are many things to take into account, if using system specific APIs/libs, can they be faked on other OSs (write small abstraction over them), or does it require a lot more code. You get the gist.
0
1
0
0
2011-10-24T08:50:00.000
2
1.2
true
7,873,170
0
0
0
2
I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source code and modify it, and i have to make it compatible on these OS using my xp :D well my brother's pc is windows 7, but I don't have mac OS or linux (unless i can use VM) EDIT my application is not simple
Copy data from the clipboard on Linux, Mac and Windows with a single Python script
7,889,078
2
4
5,923
0
python,windows,linux,macos,clipboard
Polling is NOT robust/reliable. You cannot determine if data has changed (on windows anyway) without pasting it into a buffer for inspection. This requires opening the clipboard. If you do this in a loop, you're going to collide with other apps. i.e. the app where the user is copying another item onto the clipboard. This will explode with an "cannot open clipboard" or "out of memory" error. This approach will not work reliably/robustly. You need to use proper clipboard monitoring APIs in the various platforms.
0
1
0
0
2011-10-24T19:59:00.000
5
0.07983
false
7,881,230
0
0
0
1
I am trying to create a script in Python that will collect data put in the clipboard by the user and preferably save it as a list or in a text file or string/array/variable to work with later on. This should work on Linux all versions (I would assume Ubuntu), Mac OS all versions and Windows all versions. I am not sure if 32bit and 64bit systems have different ways of accessing the data at the clipboard, if they do I guess it would be safe to make this work for the 32bit versions only so people running the 64bit versions can fall back onto the 32bit version of the OS. The tricky part, apart from this having to work on the mentioned OS, is that I would like the script to run as long as the user does not stop it and while it runs all the data copied into the clipboard by the user is being copied to a list or in a text file or string/array/variable. Of course there is a time limit at which the user can input data into the clipboard so I was thinking of having a loop scanning the clipboard every second or every 500 milliseconds, check if the content has changed, and if it has, copy it, otherwise don't copy it. Is there a unified way or module that does this on all different OS or would it be better to write separate scripts for this task for the various OS? The thing is, this is part of a bigger project that I would like to make work on Linux, Mac and Windows, so having those three options covered and then use Python code that can be used across the mentioned OS for the rest of the script/project would be ideal. Am I asking too much in general from this script concerning it having to work on Linux, Mac and Windows?
Which executable does a core file belong to?
7,881,936
5
1
522
0
python,debugging,core
The "file" program can tell you; type "file core".
0
1
0
0
2011-10-24T20:58:00.000
1
1.2
true
7,881,926
1
0
0
1
I have a python program that spawns a number of processes, one of which segfaults and dumps core. Is there a way to find out which executable produced the resulting core file?
Which is the best IDE for Python For Windows
7,899,770
4
43
401,989
0
python,ide
U can use eclipse. but u need to download pydev addon for that.
0
1
0
0
2011-10-26T07:18:00.000
4
0.197375
false
7,899,732
1
0
0
1
I am new to python and I am using simple gedit application on linux machine to write python code, however its very difficult to manage the indentations of my code. I am looking for any Python IDEs that provides some functionality and should not slow down my P4 machine.
Modify `PATH` environment variable globally and permanently using Python
7,930,947
0
0
2,054
0
python,cross-platform,environment-variables,distutils
Distutils doesn’t set environment variables. On Windows, this would imply mucking with the registry; on UNIX, it would require to find out the right shell configuration file (which is not trivial) and edit it, which is just not done in this culture: people are told to edit their $PATH or to use full paths to the programs.
0
1
0
0
2011-10-27T10:14:00.000
2
0
false
7,914,505
1
0
0
1
Is that possible to modify PATH environment variable, globally and permanently, in a platform-independent way using Python (distutils)? Background I have some application (a plugin for Serna XML Editor), and now I'm going to make an installer for it, probably using python distutils (setup.py). After the installation setup.py needs to modify the PATH environment variable to add the installation directory to its value. A possible solution to achieve what I want would be to copy the executables to /usr/local/bin or somewhere else, but for MS Windows it is not obvious where to copy execs. Any ideas?
python calling a subprocess that runs in parallel
7,918,418
1
0
245
0
python,subprocess,parallel-processing
If the subprocess is really capable of multicore operation, it shouldn't matter how you spawn it. You don't (and generally, can't) "request" more cores for it -- the OS will automatically give it whatever resources are available. I suspect the answer lies with the commercial program in question rather than with the parent process, Python or the subprocess package.
0
1
0
0
2011-10-27T15:32:00.000
1
0.197375
false
7,918,395
1
0
0
1
I have code that calls a commercial program to run as a subprocess using the subprocess module. The commercial program is capable of running in parallel, but I have noticed that only 1 processor is being used when the subprocess is running. Is there a simple way to run a serial python program that requests more resources, for example 4 processors, for the subprocess?
get amount of used resources in app engine
7,934,948
0
0
34
0
python,google-app-engine
Unfortunately this is not possible, there is no API that you can use for this. Looking at the App Engine roadmap there is no such feature coming along any time soon. The only thing i can recommend is you sign up for billing and recieve the 50$ free quota, it's here till 31 october. You can enable billing and disable it and keep the free 50$! Hope this helped.
0
1
0
0
2011-10-28T16:15:00.000
1
1.2
true
7,931,936
0
0
1
1
I am thinking about implementing resource throttling in my application in google app engine. My idea is checking whether I am running out of resources (for example, bandwidth) and disabling part of the website, using the final part of the available daily traffic to inform the user that the site is running in a "resources saving" mode. I read the GAE documentation, but I just found that if I run out of traffic, it directly returns HTTP 403. Is there a way to make my python application aware of the used resources and to try not to be so rude with my users?
Send commands to an interactive shell from Python
7,954,357
0
1
3,763
0
python,shell,interactive
It will not be easy at all. You will have to know if meterpreter has any means for other programs to communicate with it. If it doesn't, you might want to go through hacking through it, e.g using OS pipes, etc to be able to get it to work. In any case, the code needed for such communication might be beyond Python's power.
0
1
0
1
2011-10-31T12:54:00.000
2
0
false
7,953,996
0
0
0
1
Is there a way to send command to another interactive shell ? Let's take the example of the meterpreter shell used in metasploit. Could it be a way to say command to this shell from python code, as soon as I get control of a computer and have a meterpreter shell to play with ? I mean All this from python code.
Distributing python-written executable with veusz
7,996,527
1
0
272
0
python,py2exe,veusz
Veusz runs its user interface in a separate python process so that it does not block python. If you look at veusz/embed.py, it tries to start up python or a veusz executable. You'd need to modify embed.py to start your .exe (sys.executable) if frozen instead of veusz and pass some special parameter which your program would interpret to start running veusz.embed_remote.runremote. The python multiprocessing module has to do something similar - you need to call a multiprocess function which checks whether the program was starting by multiprocessing - to get around the fact that Windows doesn't have a working fork.
0
1
0
0
2011-11-01T00:54:00.000
1
0.197375
false
7,961,431
1
0
0
1
I would like to distribute an application written in python as a .exe file. I have already been able to do this using py2exe, but now I have incorporated the veusz library into my code. Ideally my program should open up a veusz plot (as it does on my computer, which has python, numpy, etc. all installed). However, I want to distribute an executable that does this without having to install python. When I try running my setup.py with py2exe, everything goes fine and the exe is built. However, once the application runs and gets to the point where it is to display the graph, it sends up: Runtime error: Unable to find veusz executable on system path. Can I fix this without having to install a bunch of stuff on my clients' computers? Is this possible? And if I must install something, what is the minimum amount of software I need to install?
How do I make python processes run with correct process name?
7,977,112
9
4
654
0
python,linux
Add a shebang to the Python file in question, make the Python file executable (e.g. by chmod a+x ./logserver.py) and start it directly by ./logserver.py. A shebang is a line telling the kernel which interpreter to use. It's simply a line like #!/usr/bin/env python at the very beginning of the file.
0
1
0
0
2011-11-02T07:20:00.000
2
1.2
true
7,976,926
1
0
0
1
I have a few long term processes and temporary processes in Python. While shell and C programs run under their own names, all Python processes run as 'python filename.py', which makes it tough to identify processes. How can I make python processes show up as 'logserver.py' or such in Linux? I use Python 2.7 in Ubuntu 11.10.
Create 32-bit exe's from python code on 64-bit machine
7,988,865
8
12
15,094
0
python
To produce 32 bit executables you need to install 32-bit versions of Python and cx_freeze.
0
1
0
0
2011-11-02T23:50:00.000
3
1.2
true
7,988,772
1
0
0
3
I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit. Thanks!
Create 32-bit exe's from python code on 64-bit machine
7,989,276
0
12
15,094
0
python
All the "produce an executable from Python code" methods I know of basically create a file that bundles up the Python interpreter with the Python code you want to execute inside a single file. It is nothing at all like compiling C code to an executable; Python is just about impossible to compile to machine code in any significantly more useful way than just gluing the Python bytecode to the machine code for a Python interpreter. So that's almost certainly why you can't produce a 32 bit exe from a 64 bit installation of Python; there isn't a 32 bit interpreter to embed in the output file.
0
1
0
0
2011-11-02T23:50:00.000
3
0
false
7,988,772
1
0
0
3
I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit. Thanks!
Create 32-bit exe's from python code on 64-bit machine
18,043,350
4
12
15,094
0
python
In addition to the answers already given: To compile/freeze python code for different architectures (x86/x64), install both, x86 and x64 versions of python, to your system and corresponding variations of all required modules and libraries to your python installations so both installations have the same (required) set of packages installed. The next step is to check that your global OS environment is configuredcorrectly. The following Windows environment variables need to point to the appropriate installation of Python you want to freeze to, You should know which locations they need to point to: %PATH% %PYTHONHOME% %PYTHONPATH% Once you've set them up properly, re-open any terminals to make sure you've got the new environment loaded (re-login to your Windows session if necessary to properly refresh your environment) and you are ready to run your cx_freeze and any other python-related build ops to get your final builds for that architecture. Once done with those builds, re-run the process from step 2. to change your Windows environment to the next python installation and build. To speed up the environment-change process I either script those steps or use a VM. Hope this helps.
0
1
0
0
2011-11-02T23:50:00.000
3
0.26052
false
7,988,772
1
0
0
3
I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit. Thanks!
How can I stop the debugger server from pydev?
7,993,203
0
1
525
0
python,eclipse,pydev
This was a bug -- and it was fixed in the latest version (PyDev 2.2.4), so, please upgrade to the latest version and that should be working already.
0
1
0
0
2011-11-03T00:02:00.000
1
0
false
7,988,856
0
0
1
1
I am using the pydev remote debugger feature for my application. When I try to stop the debugger server via the stop button it shows on the console that the server is successfully terminated but it isn't because it is still accepting new connections on its default port (5678). Do you know how can I stop the server in a reliable way? Thanks in advance.
Connect to putty and type few command
7,991,590
3
6
59,795
0
python,putty
you can use code similar to: command = "plink.exe -ssh username@" + hostname + " -pw password -batch \"export DISPLAY='" + hostname + "/unix:0.0' ; " which will open an ssh to the desired hostname using username and password shutdown: command += "sudo /sbin/halt\"" reboot: command += "sudo /sbin/reboot\"" add your other commands using the same method as above, run the command with: pid = subprocess.Popen(command).pid As pointed out by Tadeck, this will only work on a windows machine attempting to connect to a linux machine.
0
1
0
1
2011-11-03T07:36:00.000
4
0.148885
false
7,991,529
0
0
0
1
I want to connect to putty and want to do few step: login to Putty type few command to bring down the server Traverse to the particular path Remove the file from the directory Again start the server I need to write the code in windows. But my server is in linux. How shall I proceed? Thanks in advance
How to become productive using Vim/Emacs
8,001,512
3
6
1,355
0
python,ruby,linux,vim,emacs
I am an Emacs guy (using vi only to edit configuration files under /etc). I think that with Emacs, you should start it at most daily (and it is very different with vim), and you should configure it in your .emacs file. For example, I compile using the F12 key, with (global-set-key [f12] 'recompile) in my .emacs.
0
1
0
1
2011-11-03T20:24:00.000
5
0.119427
false
8,001,384
0
0
1
3
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow: Subclipse (or alternatively I use command line) m2clipse (Maven Eclipse plugin) Data Source Explorer (dealing with SQL) The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code): Refactor (rename method throughout the whole "open project") Jump to class implementation Search for all usage of a particular class or method Updating dependencies (3rd party JARs) via maven pom.xml Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation). Write and run unit-test All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH. I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor. There are 2 major goals: Mobility (as in, travelling and coding) VM as development environment Tools I'd like to use are as follow: Linux Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET) Any RDBMS Any build/dependency system Unit-testing framework What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc. Help me build my dream environment: lightweight, productive, easily replicable :) Thanks!
How to become productive using Vim/Emacs
8,001,471
5
6
1,355
0
python,ruby,linux,vim,emacs
If you ask a question which involves "vim OR emacs" you will never get an useful answer. It's a religious question, which does not have a correct answer! That said, you should clearly use Vim! ;-) But seriously: Vim is much more lightweight, so it might better suite the scenario you are describing. Vim can be scripted in different languages and you can find many useful scripts at www.vim.org. Emacs is "heavier", but Lisp is a very powerful scripting languages. So Emacs is much more of a general tool than just a text editor. IDE functionality (like project management) is something I'm missing from time to time in Vim. There are some scripts to do that, but I don't like them. If you need that, I would go for Emacs.
0
1
0
1
2011-11-03T20:24:00.000
5
0.197375
false
8,001,384
0
0
1
3
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow: Subclipse (or alternatively I use command line) m2clipse (Maven Eclipse plugin) Data Source Explorer (dealing with SQL) The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code): Refactor (rename method throughout the whole "open project") Jump to class implementation Search for all usage of a particular class or method Updating dependencies (3rd party JARs) via maven pom.xml Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation). Write and run unit-test All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH. I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor. There are 2 major goals: Mobility (as in, travelling and coding) VM as development environment Tools I'd like to use are as follow: Linux Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET) Any RDBMS Any build/dependency system Unit-testing framework What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc. Help me build my dream environment: lightweight, productive, easily replicable :) Thanks!
How to become productive using Vim/Emacs
8,001,983
1
6
1,355
0
python,ruby,linux,vim,emacs
Either of those text editors will have a learning curve. That being said I have successfully used emacs to do the following tasks that are in line w/ what you've asked: Write PL/SQL and execute it on an oracle DB all from the editor. Write, Compile, Run java. Edit pom files. Keep a pretty good TODO list in org mode. You can launch a shell in emacs, and that feature alone does MOST of what you've asked for (SVN, make/ant/mvn/etc). If you're jumping into one of these editors and hoping for pretty eclipse and vis studio features such as the green junit bar, i'm not sure that they exist. Eclipse' refactor tool works pretty well too and I don't know what is possible in emacs. Though with emacs, I've found that someone has typically written some extension to do what i want, you just need to be able to find it and learn how to use it. I'm an emacs neophyte at best but in scaled down projects I've found it to be pretty efficient and I don't have to take my hands off the keyboard very much. Disclaimer(java/ee/spring eclipse developer by day that messes around with lua and the love framework using emacs at night)
0
1
0
1
2011-11-03T20:24:00.000
5
0.039979
false
8,001,384
0
0
1
3
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow: Subclipse (or alternatively I use command line) m2clipse (Maven Eclipse plugin) Data Source Explorer (dealing with SQL) The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code): Refactor (rename method throughout the whole "open project") Jump to class implementation Search for all usage of a particular class or method Updating dependencies (3rd party JARs) via maven pom.xml Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation). Write and run unit-test All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH. I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor. There are 2 major goals: Mobility (as in, travelling and coding) VM as development environment Tools I'd like to use are as follow: Linux Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET) Any RDBMS Any build/dependency system Unit-testing framework What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc. Help me build my dream environment: lightweight, productive, easily replicable :) Thanks!
Errors trying to run a python script from a batch file
8,002,349
2
2
579
0
python,batch-file
Absolutely. If there's a space in the path, you need to put the whole path in double quotes.
0
1
0
0
2011-11-03T21:43:00.000
1
0.379949
false
8,002,282
0
0
0
1
I have this line in my bat file: C:\Python26\python.exe C:\myPythonDirectory.py But it fails giving the error: can't open file [Errno2] no such file or directory. Could it be giving an error because there is a space in one of the folder names in my python directory?
Install error easy_install python
8,020,986
2
4
7,877
0
python,windows,easy-install
easy_install is an executable program, not a Python script. Run it from the Windows command line, not from Python.
0
1
0
0
2011-11-05T14:09:00.000
3
0.132549
false
8,020,673
1
0
0
1
I use Windows 7 and Python IDLE. I'm trying to use easy_install but gut this error: Traceback (most recent call last): File "", line 1, in easy_install NameError: name 'easy_install' is not defined In included in my 'Path' the directory where it has been installed (C:\Python27\Scripts). Any thoughts on what could be wrong? Maybe... In Python IDLE > File > Path browser, I cannot see C:\Python27\Scripts. How to add it ?
nohup not logging in nohup.out
10,672,167
3
0
1,610
0
python,logging,web2py,nohup
Nothing to worry. Actually the python process along with nohup was logging the file in batch mode and i could see the output only after quite some time and not instantaneously.
0
1
0
0
2011-11-05T16:50:00.000
4
1.2
true
8,021,674
0
0
1
3
I am running a python script of web2py and want to log its output. I am using following command nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 & The process is running but it is not logging into the file. I have tried without nohup also but it is still same. The default logging of nohup in nohup.out is also not working. Any suggestion what might be going wrong?
nohup not logging in nohup.out
12,594,155
0
0
1,610
0
python,logging,web2py,nohup
If you've got commas in your print statements there's a good chance it's due to buffering. You can put a sys command (forget which) in your code or when you run the nohup, just add the option -u and you'll disable std(in|out|err) buffering
0
1
0
0
2011-11-05T16:50:00.000
4
0
false
8,021,674
0
0
1
3
I am running a python script of web2py and want to log its output. I am using following command nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 & The process is running but it is not logging into the file. I have tried without nohup also but it is still same. The default logging of nohup in nohup.out is also not working. Any suggestion what might be going wrong?
nohup not logging in nohup.out
8,022,039
0
0
1,610
0
python,logging,web2py,nohup
nohup will try to create the file in the local directory. Can you create a file in the folder you are running it from ?
0
1
0
0
2011-11-05T16:50:00.000
4
0
false
8,021,674
0
0
1
3
I am running a python script of web2py and want to log its output. I am using following command nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 & The process is running but it is not logging into the file. I have tried without nohup also but it is still same. The default logging of nohup in nohup.out is also not working. Any suggestion what might be going wrong?
How to write to log in python with nginx + uwsgi
8,022,616
4
8
11,471
0
python,logging,nginx,uwsgi
use logging.StreamHandler as logging handler
0
1
0
1
2011-11-05T18:58:00.000
2
1.2
true
8,022,495
0
0
0
2
I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors. I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem to affect the log in any situation. How do I point the python logging libraries to use the UWSGI log?
How to write to log in python with nginx + uwsgi
8,022,729
5
8
11,471
0
python,logging,nginx,uwsgi
uWSGI is a wsgi server, and as such passes a stream in the environ dict passed to the application callable it hosts, using the key wsgi.errors. If you are writing a bare wsgi app, then writing to that stream should do the job. If you are using a framework that abstracts the wsgi interface out (and by the sound of it, you are, print would ordinarily write to sys.stdout, which gets closed on a daemonized process and would never make it to any log file), you will probably need to look into how that framework handles error logging.
0
1
0
1
2011-11-05T18:58:00.000
2
0.462117
false
8,022,495
0
0
0
2
I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors. I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem to affect the log in any situation. How do I point the python logging libraries to use the UWSGI log?
Datastore 'Response too large error' since migrated to Python27
8,034,730
3
4
190
0
python,google-app-engine
This is a known bug in the Python 2.7 runtime - if the result of a datastore query is >1MB then you will get this response. It will be fixed in 1.6.1.
0
1
0
0
2011-11-06T01:24:00.000
1
1.2
true
8,024,609
0
0
1
1
I just migrated my GAE/python app from M/S to HRD and then activated the new python27 runtime. Now most of my datastore queries are failing with this error: ResponseTooLargeError: The response from API call datastore_v3.RunQuery() was too large. The same code is still running on older GAE app (M/S and python25) with no problems at all. What is going on? Is this because of the new runtime or because of the HRD? Should I change my models/app to make request smaller? Thanks!
Resource usage of google Go vs Python and Java on Appengine
8,038,951
23
53
12,094
0
java,python,google-app-engine,go
The cost of instances is only part of the cost of your app. I only use the Java runtime right now, so I don't know how much more or less efficient things would be with Python or Go, but I don't imagine it will be orders of magnitude different. I do know that instances are not the only cost you need to consider. Depending on what your app does, you may find API or storage costs are more significant than any minor differences between runtimes. All of the API costs will be the same with whatever runtime you use. Language "might" affect these costs: On-demand Frontend Instances Reserved Frontend Instances Backed Instances Language Independent Costs: High Replication Datastore (per gig stored) Outgoing Bandwidth (per gig) Datastore API (per ops) Blobstore API storge (per gig) Email API (per email) XMPP API (per stanza) Channel API (per channel)
0
1
0
0
2011-11-07T14:26:00.000
5
1
false
8,037,783
0
0
1
4
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times? Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup? In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
Resource usage of google Go vs Python and Java on Appengine
10,370,469
17
53
12,094
0
java,python,google-app-engine,go
The question is mostly irrelevant. The minimum memory footprint for a Go app is less than a Python app which is less than a Java app. They all cost the same per-instance, so unless your application performs better with extra heap space, this issue is irrelevant. Go startup time is less than Python startup time which is less than Java startup time. Unless your application has a particular reason to churn through lots of instance startup/shutdown cycles, this is irrelevant from a cost perspective. On the other hand, if you have an app that is exceptionally bursty in very short time periods, the startup time may be an advantage. As mentioned by other answers, many costs are identical among all platforms - in particular, datastore operations. To the extent that Go vs Python vs Java will have an effect on the instance-hours bill, it is related to: Does your app generate a lot of garbage? For many applications, the biggest computational cost is the garbage collector. Java has by far the most mature GC and basic operations like serialization are dramatically faster than with Python. Go's garbage collector seems to be an ongoing subject of development, but from cursory web searches, doesn't seem to be a matter of pride (yet). Is your app computationally intensive? Java (JIT-compiled) and Go are probably better than Python for mathematical operations. All three languages have their virtues and curses. For the most part, you're better off letting other issues dominate - which language do you enjoy working with most?
0
1
0
0
2011-11-07T14:26:00.000
5
1
false
8,037,783
0
0
1
4
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times? Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup? In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
Resource usage of google Go vs Python and Java on Appengine
10,283,180
47
53
12,094
0
java,python,google-app-engine,go
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times? Yes, Go instances have a lower memory than Python and Java (< 10 MB). Yes, Go instances start faster than Java and Python equivalent because the runtime only needs to read a single executable file for starting an application. Also even if being atm single threaded, Go instances handle incoming request concurrently using goroutines, meaning that if 1 goroutine is waiting for I/O another one can process an incoming request. Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup? Go program is uploaded as source code and compiled (once) to a binary when deploying a new version of your application using the SDK. In other words: Will I benefit from using Go in app engine from a cost perspective? The Go runtime has definitely an edge when it comes to performance / price ratio, however it doesn't affect the pricing of other API quotas as described by Peter answer.
0
1
0
0
2011-11-07T14:26:00.000
5
1
false
8,037,783
0
0
1
4
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times? Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup? In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
Resource usage of google Go vs Python and Java on Appengine
8,044,755
0
53
12,094
0
java,python,google-app-engine,go
I haven't used Go, but I would strongly suspect it would load and execute instances much faster, and use less memory purely because it is compiled. Anecdotally from the group, I believe that Python is more responsive than Java, at least in instance startup time. Instance load/startup times are important because when your instance is hit by more requests than it can handle, it spins up another instance. This makes that request take much longer, possibly giving the impression that the site is generally slow. Both Java and Python have to startup their virtual machine/interpreter, so I would expect Go to be an order of magnitude faster here. There is one other issue - now Python2.7 is available, Go is the only option that is single-threaded (ironically, given that Go is designed as a modern multi-process language). So although Go requests should be handled faster, an instance can only handle requests serially. I'd be very surprised if this limitation last long, though.
0
1
0
0
2011-11-07T14:26:00.000
5
0
false
8,037,783
0
0
1
4
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times? Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup? In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
How do I stop wxFileDialog running on OSX from treating .itlp packages as files?
8,066,742
1
0
106
0
wxpython
It sounds like you're trying to open a file with a file dialog. wxPython wraps the native widgets where ever possible, so I'm guessing it's behaving the same way that the normal file dialog does. Try opening the file with a different program that loads that dialog and it'll probably behave the same way. On Windows when I need to open a zip file, I use a zip program or use the one built into Windows. File dialogs don't open them.
0
1
0
0
2011-11-09T13:58:00.000
1
1.2
true
8,066,075
0
0
0
1
I'm working on a program for which I need to be able to open a zip file containing an itlp (iTunes LP) and then do stuff to it. I'm using wxFileDialog in wxPython for this purpose using the appropriate wildcard to only show zip files. The problem is that because itlp's are folders not files they are still shown in the file dialog, but if you try to open them they're treated as files and the FileDialog returns the path as it would if it were a file instead of navigating into them like it would for a folder. This may only happen on OSX, I've not tried it on any other platform, I've got vague recollections that Unix based OSs take file extensions more seriously than windows. So my question here is what can I do to either hide the itlps in the file dialog, or get it to treat them like normal folders, not files?
Kill a python process
20,572,635
0
17
59,787
0
python,macos
Open Activity monitor, go to the Processes tab, and highlight python.exe and quit it by clicking Quit.
0
1
0
0
2011-11-09T14:08:00.000
4
0
false
8,066,221
1
0
0
3
I wrote a python script but accidentally put an infinite while loop in my script. How do I kill the process? I've tried ctrl+c but with no success. Are there any other option to try? I'm on Mac Os X 10.7.2 with python 2.7
Kill a python process
8,066,307
25
17
59,787
0
python,macos
ps a to get the PID of your process. kill -9 <pid> to send it the unblockable SIGKILL signal. Note that I only have a Linux box in front of me to test, so the OS X commands may be slightly different.
0
1
0
0
2011-11-09T14:08:00.000
4
1.2
true
8,066,221
1
0
0
3
I wrote a python script but accidentally put an infinite while loop in my script. How do I kill the process? I've tried ctrl+c but with no success. Are there any other option to try? I'm on Mac Os X 10.7.2 with python 2.7
Kill a python process
8,066,240
29
17
59,787
0
python,macos
Try Ctrl+\ to send a SIGQUIT.
0
1
0
0
2011-11-09T14:08:00.000
4
1
false
8,066,221
1
0
0
3
I wrote a python script but accidentally put an infinite while loop in my script. How do I kill the process? I've tried ctrl+c but with no success. Are there any other option to try? I'm on Mac Os X 10.7.2 with python 2.7
Connect appengine with cakephp
8,070,747
0
0
378
1
php,python,google-app-engine,cakephp
You can not run PHP on GAE. If you run PHP somewhere, it is a bad architecture to go over the internet for your data. It will be slooooow and a nightmare to develop in. You should store your data where you run your php, unless you must have a distributed, globally scaling architecture, which afaiu not the case.
0
1
0
0
2011-11-09T18:21:00.000
5
0
false
8,069,649
0
0
1
1
I'm thinking in create a webapplication with cakephp but consuming python's appengine webservice. But, to install cakephp etc, I need to configure the database. Appengine uses another kind of datastorage, with is different from mysql, etc. I was thinking in store the data in appengine, and using the python webservices, and with the cakephp application comunicating with the webservice, for insert and retrieve data. Is there any good resource for this, or is it unpossible. Obs: also opened for a possibility for developing the webapplicaiton completely in python running in appengine. If anyone has a good resource. Thanks.
How to compile .py into an executable for Debian
8,072,665
0
1
2,610
0
python,compilation,debian
Why do you think you need to compile it? Debian, like most other Linux distributions, comes with Python installed as standard, as many of the system tools depend on it. A Python script will just run.
0
1
0
0
2011-11-09T22:10:00.000
3
0
false
8,072,461
0
0
0
1
I'm having a hard time finding a conclusive answer for how to compile a Python 2.7 .py file into a executable program for Debian. Most tutorials say "we assume you've already written the manifest, etc.", but I cannot find how to do those first steps. So, I need a step-by-step. How do I take JUST a .py file (using Python 2.7 and PyGTK) and a few .pdf and .png files that go with it, and compile all of that into a working Debian binary? (Note: If the tutorial starts out with a tar.gz, or requires a setup.py or similar already written, I need instructions on how to get those files too.)
Screen recorder in python
8,074,644
1
5
14,740
0
python,video
I know of no mechanism to perform screen recording in Python. However, you may be able to use Python to control one of the many existing screen recording programs: recorditnow recordmydesktop byzanz istanbul vnc2swf pyvnc2swf
0
1
0
0
2011-11-10T03:16:00.000
3
0.066568
false
8,074,595
0
0
0
1
Is there a library for making a screen recorder application in python? i think it would be fun to make somthing like that. but a library that will work on linux im using ubuntu Thanks !
Cygwin paths for Windows python
8,082,314
2
3
3,843
0
python,cygwin
No, Windows python has no suport for Cygwin paths, but Cygwin does have its own Python. If you can't add that to the existing Cygwin install, you might want to consider doing a user-specific Cygwin install into a directory that you're allowed to write to. There is a way to obtain limited Cygwin path support for Windows programs, although I suspect this isn't an option for you either: install Cygwin into C:\, so that a Cygwin /path is equivalent to C:\path. This relies on the fact that the Windows API (albeit not all Windows programs) accepts both backslashes and slashes as path separators, and that it considers absolute paths without drive letter as referring to the system drive (i.e. C:). Obviously this won't work for Cygwin paths that point to other drives (via the Cygwin mount table). It also won't work for any programs that use / (rather than -) to introduce options, which includes most built-in Windows command-line tools. But it does usually work for cross-platform tools such as Python. Yet another option is to use MSYS instead of Cygwin, which is a fork of an old Cygwin version, whereby its most distinctive feature is that it automatically translates POSIX paths to Windows paths when invoking Windows programs. Note however, that this approach has its pitfalls too, because it isn't always clear whether an argument is a path or not. Hence, sometimes it will fail to translate a path or wrongly change an argument that isn't a path.
0
1
0
0
2011-11-10T11:43:00.000
2
0.197375
false
8,078,967
1
0
0
1
I have access to a machine with a minimal cygwin installation, and the Windows version of python. I need to run some python scripts there, however python requires Windows paths. I can use cygpath -w, on the arguments that I provide, however further unix/cygwin paths are included in numerous other scripts which are subsequently invoked. Is there a way to tell Windows python to accept unix/cygwin paths?
Best way to fork multiple shell commands/processes in Python?
8,090,108
3
3
4,562
0
python,shell
All calls to subprocess.Popen return immediately to the caller. It's the calls to wait and communicate which block. So all you need to do is spin up a number of processes using subprocess.Popen (set stdin to /dev/null for safety), and then one by one call communicate until they're all complete. Naturally I'm assuming you're just trying to start a bunch of unrelated (i.e. not piped together) commands.
0
1
0
0
2011-11-11T05:34:00.000
5
0.119427
false
8,090,084
1
0
0
1
Most of the examples I've seen with os.fork and the subprocess/multiprocessing modules show how to fork a new instance of the calling python script or a chunk of python code. What would be the best way to spawn a set of arbitrary shell command concurrently? I suppose, I could just use subprocess.call or one of the Popen commands and pipe the output to a file, which I believe will return immediately, at least to the caller. I know this is not that hard to do, I'm just trying to figure out the simplest, most Pythonic way to do it. Thanks in advance
chmod - file permission on executable
8,104,835
2
0
1,884
0
python,permissions,executable,chmod
The permissions you can set on a file with chmod affect who can read from/write to/execute that file, not what privileges the process created by running that file has. On Unix you could get some form of protection by playing with the file owner and the sticky bit, and having appropriate permissions on your filesystem, but that's not easy to get right and doesn't work on Windows (no sticky bit there).
0
1
0
0
2011-11-12T13:45:00.000
3
1.2
true
8,104,811
0
0
0
2
I have to change file permissions on an executable file, using os.chmod. I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing. How can I do that? Thanks, rubik
chmod - file permission on executable
8,104,833
1
0
1,884
0
python,permissions,executable,chmod
I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing That's not how chmod works - it sets permissions on the file itself, it can't restrict what an executable can write to.
0
1
0
0
2011-11-12T13:45:00.000
3
0.066568
false
8,104,811
0
0
0
2
I have to change file permissions on an executable file, using os.chmod. I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing. How can I do that? Thanks, rubik
ipython: %paste over ssh connection
8,175,931
53
33
5,474
0
ipython
I think this is exactly what %cpaste is for (I am always forgetting about all the things IPython does). %cpaste enters a state allowing you to paste already formatted or indented code, and it will strip leading indentation and prompts, so you can copy/paste indented code from files, or even from an interactive Python session including leading >>> or In [1] which will be stripped.
0
1
0
0
2011-11-12T20:16:00.000
2
1.2
true
8,107,261
0
0
0
1
In ipython >=0.11, the %paste command is required to paste indented commands. However, if I run an ipython shell in a remote terminal, the buffer %paste refers to is on the remote machine rather than the local machine. Is there any way around this?
different types of line terminations(unix, windows, etc)
8,115,701
1
0
136
0
python,termination,linefeed
You mostly don't need to worry about it. If you come to a point when something doesn't work, come back and ask about that. Note however that what determines the line-ending convention is not which programming language you use, but the platform it runs on (*nix/Windows/Mac, all are different).
0
1
0
0
2011-11-13T19:04:00.000
1
1.2
true
8,113,895
0
0
0
1
I'm note sure about conventions for different types of line termination in different programming languages. I know that there are 2 types, 1: line feed, 2: carriage-return, line feed. My question is: how does readline in different programming languages, like python: a = fd.readline();, c/c++: file.getline (buffer,100);, java: line = buf.readLine(); deal with line termination? If they are sensitive to these 2 different types of terminations, how do I treat them separately?
Cross platform build script that can call MSBuild or Xbuild depending on environment?
8,114,513
0
0
391
0
c#,python,scripting,msbuild,mono
Far easier would be to write a small shell script for Linux or OSX that ran xbuild but was called msbuild. The arguments are the same I think.
0
1
0
0
2011-11-13T19:31:00.000
1
0
false
8,114,067
1
0
0
1
I have a simple .Net console app which has only framework dependencies. It can compile fine with either MSBuild on windows or Mono/XBuild on linux. It is part of a larger project, which has a python build script. Is there any simple way to determine the most suitable build engine (msbuild/xbuild) and use that? In other words, I have a 'build.py' and I want that to call xbuild or msbuild as needed.
does Tornado uses WSGI to deal with python files?
8,129,321
3
1
444
0
python,wsgi,tornado
Tornado shouldn't use WSGI, because WSGI is not async friendly. It has WSGI support, but it won't support async. Tornado has its own HTTP server (written in C and Python), and can be used standalone or placed behind another async HTTP server (usually Nginx).
0
1
0
0
2011-11-14T21:56:00.000
1
1.2
true
8,128,736
0
0
1
1
am sorry for that question, am beginning in Tornado, and because i come from two other frameworks: Flask and Django, Flask uses Werkzeug which is a WSGI webserver, Django uses WSGI too, but, when making an application programmed with Tornado, how it will deal with HTTP? there is a protocol to deal with python files when it comes to internet? or do i mess something about WSGI? NB: i know also that Tornado has a WSGI support, for example it can serve Django application, but i mean with a native Tornado application, which protocol it uses?
Python: How do I redirect output of os.system to python shell?
8,142,466
2
3
6,088
0
python
(Reposting as an answer as requested): os.system() will work when run in a terminal - that's where stdout is going, and any processes you start will inherit that stdout unless you redirect it. If you need to redirect into IDLE, use @root45's answer above (upvoted). That will work for most programs, but at least on Unixy systems, processes can also directly access the terminal they're run in (e.g. to request a password) - Windows may have something similar.
0
1
0
0
2011-11-15T17:45:00.000
2
1.2
true
8,140,750
0
0
0
1
I want to make a simple batch script using python using os.system. I am able to run the commands just fine, but the output for those commands dont print to the python shell. Is there some way to redirect the output to the python shell?
Redirecting traffic to other webserver
8,166,815
2
1
388
0
python,linux,redirect,webserver,transmission
I found my answer: a reverse proxy. It will take care of the routing to the correct port based on the URL. I now just have to select the right one there are so many (NginX, pound, lighttd etc...) Thanks anyway.
0
1
1
0
2011-11-16T09:57:00.000
2
0.197375
false
8,149,701
0
0
0
1
Here is my setup: I have a Python webserver (written myself) that listens on port 80 and also have the Transmission-daemon (bittorrent client) that provides a webUI on port 9101. (running on Linux) I can access both webservers locally without problems, but now would like to access them externally also. My issue is that I would prefer not to have to open extra ports on my firewall to access the Transmission webUI. Is it possible to within the python webserver to redirect some traffic to the appropriate port. So for example: http: //mywebserver/index.html -> served by the Python webserver http: //mywebserver/transmission.html -> redirected to transmission (which is currently http: //localhost:9101) Thanks
Ignore case in glob() on Linux
42,831,010
1
48
34,246
0
python,linux
Depending on your case, you might use .lower() on both file pattern and results from folder listing and only then compare the pattern with the filename
0
1
0
0
2011-11-16T11:59:00.000
8
0.024995
false
8,151,300
0
0
0
1
I'm writing a script which will have to work on directories which are modified by hand by Windows and Linux users alike. The Windows users tend to not care at all about case in assigning filenames. Is there a way to handle this on the Linux side in Python, i.e. can I get a case-insensitive, glob-like behaviour?
Looking for algorithm to help determine shortest path from one terminal screen to another
8,154,303
0
0
137
0
python,graph-algorithm
If you have created a topology of the screens, the A* algorithm should work fine.
0
1
0
0
2011-11-16T14:46:00.000
2
0
false
8,153,525
0
0
0
1
I am using a terminal client to interact with a mainframe computer. The entire interface is based on the concept of screens. An example workflow might look like: Login Screen: enter login credentials, press enter Menu Screen: enter the number of the menu item you want (lets say "6" for memos), press enter Memo Screen: enter account number, press enter Add Memo Screen: enter memo details, etc, press enter to save, F3 to go back I have written a python application to automate the processing of records through this terminal interface. One of the difficulties I am having is that there are a lot of different screens and my application right now is pretty dumb about how to get from one screen to another. It can go from the login screen, to adding memos. But, if it finds itself on the memo screen and needs to de-activate an account, it has to logout and login again because it only knows how to get to the deactivation screen from the login screen, not from the add memos screen. So, I would like to create a "map" in my application that links each screen to the screens that are "next" to it. Then, I need an algorithm that could tell how to get from any screen A to any screen B in the shortest manner possible. I already have some screen objects setup and have "related" them to the screens next to them. So, I am looking for some kind of algorithm that I can implement or python library that I can use that will do the work of calculating the route from one screen to another. Edit: I realize that I am looking for some kind of shortest-path graph algorithm. What is currently throwing me is that I don't really have a "distance", I just have nodes. So, I really don't want shortest-distance, I want least-nodes.
Alternative to TCP/IP for local program-to-program data streaming?
8,157,428
8
2
856
0
c++,python,linux,networking,gcc
If you already have a TCP or UDP server, the easiest way will probably be to switch to UNIX domain sockets. They come in "stream" and "datagram" modes, just like TCP/UDP sockets, and they're always local, as they use the filesystem namespace (instead of port numbers like TCP/UDP).
0
1
0
0
2011-11-16T19:16:00.000
4
1.2
true
8,157,348
0
0
0
2
I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have? Keep in mind that I cannot turn my C++ program into a SO and integrate it into my python script using ctypes, my C++ program must be compiled in 32bit, and my python script must be 64bit.
Alternative to TCP/IP for local program-to-program data streaming?
8,157,381
0
2
856
0
c++,python,linux,networking,gcc
Maybe you can use named pipes?
0
1
0
0
2011-11-16T19:16:00.000
4
0
false
8,157,348
0
0
0
2
I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have? Keep in mind that I cannot turn my C++ program into a SO and integrate it into my python script using ctypes, my C++ program must be compiled in 32bit, and my python script must be 64bit.
Separated web server and application server?
8,163,446
3
2
265
0
python,apache,wsgi
WSGI is not a network protocol, so you will have to run a web server in front of your application even if it only acts as a WSGI container. Proxy connections from your main web server to the WSGI container with mod_proxy.
0
1
0
0
2011-11-17T07:19:00.000
2
0.291313
false
8,163,418
0
0
1
2
I am developing web service. My system is like this: Client request --> Web Server(Apache) --> Application Server(Python) I used WSGI for communicating between Apache and Python. My question how can I separated the web server and app server. At the moment, I have to run them on the same server.
Separated web server and application server?
8,163,634
1
2
265
0
python,apache,wsgi
+1 for Ignacio's answer. Also note that separating a WSGI app from a server will lose one of the main benefits of WSGI (the server calls the wsgi app directly). Additionally, WSGI apps have a response callback that was intended to communicate directly with the server. Instead of decoupling the server from the app, have you considered keeping them paired together and replicating them over multiple servers/app pairs using nginx and/or haproxy to split and load balance requests? I believe this is the usual solution to loading issues.
0
1
0
0
2011-11-17T07:19:00.000
2
0.099668
false
8,163,418
0
0
1
2
I am developing web service. My system is like this: Client request --> Web Server(Apache) --> Application Server(Python) I used WSGI for communicating between Apache and Python. My question how can I separated the web server and app server. At the moment, I have to run them on the same server.
Run the some code whenever I upload the project on to the app engine server
8,163,809
0
2
64
0
python,google-app-engine,appserver
There isn't an official way to discover if your application has been modified altought each time you upload your application it gets a unique version number {app version.(some unique number)} but since there isn't a document API on how to get it I wound't take a risk and use it. What you need todo is to have a script that will upload your application and when the script is done you can call a handler in your application that set a value in the datastore that marks the application as new. Once you have that, you can look for it in the datastore in your handlers and run the code if you find it.
0
1
0
0
2011-11-17T07:47:00.000
1
0
false
8,163,669
0
0
1
1
I've built an appeninge project so, how can I run some piece of code on the appserver only once, i.e when ever I upload the whole project on to the server. How should I achieve this task???
How to speed up debugging of python programs in PyDev in Eclipse (esspecially Google App Engine)
8,169,698
0
0
291
0
python,debugging,google-app-engine,optimization,pydev
How often do you need to reload the application?, the dev server will update all your code and configuration changes without need to reload.
0
1
0
1
2011-11-17T15:18:00.000
1
0
false
8,169,561
0
0
1
1
How it possible to speed up debugging in PyDev in Eclipse for Google App Engine programs? How to speed up code execution? How to speed up application reloading? Please share your experience or suggestions.
How to run invisible subprocess in Python?
8,176,549
5
1
1,893
0
python,process,subprocess
Not without getting into subversive process hiding tasks. If as a user that wants to look at the running processes, let me see the running processes. Don't hide it from me. Techniques to hide running processes may also be picked up by some anti virus as potential threats. Don't do it. Actually, why do you want to? I can't think of a single reason to hide a process for a legit program.
0
1
0
0
2011-11-18T00:45:00.000
2
0.462117
false
8,176,421
1
0
0
2
I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager?
How to run invisible subprocess in Python?
8,176,846
0
1
1,893
0
python,process,subprocess
Are you sure this "subprocess" needs to actually be a process? Maybe you could do the work inside of a thread instead of forking a new process. I'm not sure if that would accomplish your goals though, since you're not specific about what you need multiple processes for.
0
1
0
0
2011-11-18T00:45:00.000
2
0
false
8,176,421
1
0
0
2
I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager?
How can I delete the automatic Indexes in App Engine?
8,186,860
3
2
185
0
python,google-app-engine,google-cloud-datastore
vacuum_indexes is only for indexes defined in index.yaml, for automatic index its enough to set indexed = False and uploaded a new version. You can see the impact of setting indexed to False in the development server datastore page in the write counts column.
0
1
0
0
2011-11-18T16:45:00.000
2
1.2
true
8,185,834
0
0
1
2
So I have a live Python application on App Engine that has far too many automatic indexes. I noticed a high amount of datastore writes for my low entity count and I believe this is the cause. Each entity has many StringProperties and some even have StringListProperties. I added the indexed = False to all my object's properties (I don't every use a query where this would matter): someproperty = db.StringProperty(indexed = False) Is there anything else I need to do for new entities to be unindexed? Do I need to increment the app's version id? Do I need to run appcfg.py vacuum_indexes . ?
How can I delete the automatic Indexes in App Engine?
8,189,761
1
2
185
0
python,google-app-engine,google-cloud-datastore
To get rid of the existing automatic indices you will have to retrieve every single entity and re-put it with the indexed = False properties. If you don't do this, then the automatic indices will stick around. However, the new entities you create will not be added to those indices.
0
1
0
0
2011-11-18T16:45:00.000
2
0.099668
false
8,185,834
0
0
1
2
So I have a live Python application on App Engine that has far too many automatic indexes. I noticed a high amount of datastore writes for my low entity count and I believe this is the cause. Each entity has many StringProperties and some even have StringListProperties. I added the indexed = False to all my object's properties (I don't every use a query where this would matter): someproperty = db.StringProperty(indexed = False) Is there anything else I need to do for new entities to be unindexed? Do I need to increment the app's version id? Do I need to run appcfg.py vacuum_indexes . ?
How to execute a series of Python scripts in batch?
8,187,496
6
2
2,093
0
python,batch-file
Refactor them into modules, then make a new script that imports the relevant functions from each module and runs those. The easiest way to do this is to write a main function per module and run all the main function serially.
0
1
0
0
2011-11-18T18:43:00.000
2
1.2
true
8,187,461
1
0
0
1
I frequently find that I need to run a series of python scripts sequentially. The order and number of these scripts may vary, but instead of executing each script individually and sequentially, is there a preferred way of batch automating a series of Python scripts? My programs require multiple and complex file path and other argument combinations.