Q_CreationDate
stringlengths
23
23
Title
stringlengths
11
149
Question
stringlengths
25
6.53k
Answer
stringlengths
15
5.1k
Score
float64
-1
1.2
Is_accepted
bool
2 classes
N_answers
int64
1
17
Q_Id
int64
0
6.76k
2011-09-20 23:07:52.450
Getting an embedded Python runtime to use the current active virtualenv
I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex...
Seems to be not an answer, but still might be useful in other contexts. Have you tried running bin/activate_this.py from your Python virtualenv? The comment in this file of my virtualenv reads: By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used whe...
0.135221
false
2
1,456
2011-09-20 23:07:52.450
Getting an embedded Python runtime to use the current active virtualenv
I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex...
You can the check the environment variable VIRTUAL_ENV to get the current envs location.
0
false
2
1,456
2011-09-21 16:18:30.483
Getting error: AttributeError: class has no attribute ''
Here is the code: 1 #!/usr/bin/env python 2 3 import re, os, sys, jira, subprocess 4 5 class Check_jira: 6 7 def verify_commit_text(self, tags): 8 for line in tags: 9 if re.match('^NO-TIK',line): 10 return True 11 elif re.match('^NO-REVIEW', lin...
class Check_jira ends on line 25 and has only one method. Then you have an if block, and CheckForJiraIssueRecord is just a function defined in this block (that is, the function is defined if __name__ == '__main__'. Just put the if block outside after the whole class definition.
1.2
true
1
1,457
2011-09-23 11:36:48.647
Embed python/dsl for scripting in an PHP web application
I'm developing an web based application written in PHP5, which basically is an UI on top of a database. To give users a more flexible tool I want to embed a scripting language, so they can do more complex things like fire SQL queries, do loops and store data in variables and so on. In my business domain Python is widel...
How about doing the scripting on the client. That will ensure maximum security and also save server resources. In other words Javascript would be your scripting platform. What you do is expose the functionality of your backend as javascript functions. Depending on how your app is currently written that might require ba...
0.201295
false
2
1,458
2011-09-23 11:36:48.647
Embed python/dsl for scripting in an PHP web application
I'm developing an web based application written in PHP5, which basically is an UI on top of a database. To give users a more flexible tool I want to embed a scripting language, so they can do more complex things like fire SQL queries, do loops and store data in variables and so on. In my business domain Python is widel...
You could do it without Python, by ie. parsing the user input for pre-defined "tags" and returning the result.
0
false
2
1,458
2011-09-24 03:08:57.527
A script im robot with xmpppy of python, how to detect network failure?
I am using xmpppy libary to write a XMPP IM robot. I want to act on disconnects, but I don't know how to detect disconnects. This could happen if your Jabber server crashes or if you have lost your internet connection. I found the callback, RegisterDisconnectHandler(self, DisconnectHandler), but it didn't work for the ...
Did you try waiting 30 minutes after the network failure? Depending on your network stack's settings, it could take this long to detect. However, if you're not periodically sending on the socket, you may never detect the outage. This is why many XMPP stacks periodically send a single space character, using an algori...
0
false
1
1,459
2011-09-24 12:25:59.787
zeromq: how to prevent infinite wait?
I just got started with ZMQ. I am designing an app whose workflow is: one of many clients (who have random PULL addresses) PUSH a request to a server at 5555 the server is forever waiting for client PUSHes. When one comes, a worker process is spawned for that particular request. Yes, worker processes can exist concurr...
The send wont block if you use ZMQ_NOBLOCK, but if you try closing the socket and context, this step would block the program from exiting.. The reason is that the socket waits for any peer so that the outgoing messages are ensured to get queued.. To close the socket immediately and flush the outgoing messages from the ...
0.986614
false
1
1,460
2011-09-24 19:36:40.807
Which strategy to use with multiprocessing in python
I am completely new to multiprocessing. I have been reading documentation about multiprocessing module. I read about Pool, Threads, Queues etc. but I am completely lost. What I want to do with multiprocessing is that, convert my humble http downloader, to work with multiple workers. What I am doing at the moment is, do...
What you're describing is essentially graph traversal; Most graph traversal algorithms (That are more sophisticated than depth first), keep track of two sets of nodes, in your case, the nodes are url's. The first set is called the "closed set", and represents all of the nodes that have already been visited and process...
0.386912
false
1
1,461
2011-09-26 06:53:54.313
Getting friendly device names in python
I have an 2-port signal relay connected to my computer via a USB serial interface. Using the pyserial module I can control these relays with ease. However, this is based on the assumption that I know beforehand which COM-port (or /dev-node) the device is assigned to. For the project I'm doing that's not enough since I...
Regarding Linux, if all you need is to enumerate devices, you can even skip pyudev dependency for your project, and simply parse the output of /sbin/udevadm info --export-db command (does not require root privileges). It will dump all information about present devices and classes, including USB product IDs for USB devi...
1.2
true
2
1,462
2011-09-26 06:53:54.313
Getting friendly device names in python
I have an 2-port signal relay connected to my computer via a USB serial interface. Using the pyserial module I can control these relays with ease. However, this is based on the assumption that I know beforehand which COM-port (or /dev-node) the device is assigned to. For the project I'm doing that's not enough since I...
It will be great if this is possible, but in my experience with commercial equipments using COM ports this is not the case. Most of the times you need to set manually in the software the COM port. This is a mess, specially in windows (at least XP) that tends to change the number of the com ports in certain cases. In so...
0
false
2
1,462
2011-09-28 10:42:10.123
read() stops after NUL character
I'm downloading files over HTTPS, I request the files through urllib2.Request and they come back as a socket._fileobject. I'd ideally like to stream this to file to avoid loading it into memory but I'm not sure how to do this. My problem is if I call .read() on the object it only returns all the data up to the first NU...
I found out the problem was that I was running the code inside PyScripter and the in-built python interpreter terminates NUL bytes in the output. So there was no problem with my code, if I run it outside PyScripter everything works fine. Now running Wing IDE and never looking back :)
1.2
true
1
1,463
2011-09-29 03:02:06.243
pythonw.exe processes not quitting after running script
Every time I restart the shell or run a script and instance of pythonw.exe*32 is created. When I close out of IDLE these processes don't go away in the task manager. Any ideas on how to fix this? Thanks!
Have you tried using python.exe instead of pythonw.exe? Im pretty sure this is the intended default behavior for the window python interperter (pythonw.exe). If its a .pyw file, just right click "Open With..." and use python.exe
1.2
true
1
1,464
2011-09-29 21:36:46.367
How do I override the default session timeout with pyramid + pyramid-beaker + beaker
I am using pyramid to create a web application. I am then using pyramid-beaker to interface beaker into pyramid's session management system. Two values affect the duration of a user's session. The session cookie timeout The actual session's life time on either disk/memcache/rdbms/etc I currently have to cookie defau...
Changing the timeout isn't supported by beaker. If you are trying to make a session stick around that long, you should probably just put it into a separate cookie. A common use-case is the "remember me" checkbox on login. This helps you track who the user is, but generally the actual session shouldn't be sticking aroun...
1.2
true
1
1,465
2011-09-29 21:50:26.500
How to use simple sqlalchemy calls while using thread/multiprocessing
Problem I am writing a program that reads a set of documents from a corpus (each line is a document). Each document is processed using a function processdocument, assigned a unique ID, and then written to a database. Ideally, we want to do this using several processes. The logic is as follows: The main routine creates...
The MetaData and its collection of Table objects should be considered a fixed, immutable structure of your application, not unlike your function and class definitions. As you know with forking a child process, all of the module-level structures of your application remain present across process boundaries, and table de...
0.999909
false
1
1,466
2011-09-30 16:47:11.020
How can I run a program in msys through Python?
I've got a short python script that will eventually edit an input file, run an executable on that input file and read the output from the executable. The problem is, I've compiled the executable through msys, and can only seem to run it from the msys window. I'm wondering if the easiest way to do this is to somehow use...
Find where in the msys path libgcc_s_dw2-1.dll is. Find the environmental variable in MSYS that has that path in it. Add that environmental variable to Windows.
1.2
true
1
1,467
2011-10-01 23:25:55.543
Sync local file with HTTP server location (in Python)
I have an HTTP server which host some large file and have python clients (GUI apps) which download it. I want the clients to download the file only when needed, but have an up-to-date file on each run. I thought each client will download the file on each run using the If-Modified-Since HTTP header with the file time of...
You can add a header called ETag, (hash of your file, md5sum or sha256 etc ), to compare if two files are different instead of last-modified date
0.135221
false
2
1,468
2011-10-01 23:25:55.543
Sync local file with HTTP server location (in Python)
I have an HTTP server which host some large file and have python clients (GUI apps) which download it. I want the clients to download the file only when needed, but have an up-to-date file on each run. I thought each client will download the file on each run using the If-Modified-Since HTTP header with the file time of...
I'm assuming some things right now, BUT.. One solution would be to have a separate HTTP file on the server (check.php) which creates a hash/checksum of each files you're hosting. If the files differ from the local files, then the client will download the file. This means that if the content of the file on the server ch...
0
false
2
1,468
2011-10-02 00:12:39.143
Removing indent in PYDEV
I am using pydev for python development. I am facing issue while removing indentation for a block of statement. If I have to add indentation I used to press SHIFT + down arrow key until I reach the end of block of statements which I want to indent and then press the TAB key.This is how i used to add indent for a block...
I don't know Pydev, but in most editors Shift+Tab will do the trick.
0.998178
false
2
1,469
2011-10-02 00:12:39.143
Removing indent in PYDEV
I am using pydev for python development. I am facing issue while removing indentation for a block of statement. If I have to add indentation I used to press SHIFT + down arrow key until I reach the end of block of statements which I want to indent and then press the TAB key.This is how i used to add indent for a block...
From pydev.org, their page: Block indent (and dedent) Tab / Shift-Tab Smart indent (and dedent) Enter / Backspace
0.386912
false
2
1,469
2011-10-03 08:27:03.037
Control rs232 windows terminal program from python
I am testing a piece of hardware which hosts an ftp server. I connect to the server in order to configure the hardware in question. My test environment is written in Python 3. To start the ftp server, I need to launch a special proprietary terminal application on my pc. I must use this software as far as I know and I h...
I was also able to solve this using WScript, but pySerial was the preferred solution.
0
false
1
1,470
2011-10-03 17:59:27.687
How to detect the right font to use depending on the langage
For a program of mine I have a database full of street name (using GIS stuff) in unicode. The user selects any part of the world he wants to see (using openstreetmap, google maps or whatever) and my program displays every streets selected using a nice font to show their names. As you may know not every font can display...
Use utf-8 text and a font that has glyphs for every possible character defined, like Arial/Verdana in Windows. That bypasses the entire detection problem. One font will handle everything.
0
false
2
1,471
2011-10-03 17:59:27.687
How to detect the right font to use depending on the langage
For a program of mine I have a database full of street name (using GIS stuff) in unicode. The user selects any part of the world he wants to see (using openstreetmap, google maps or whatever) and my program displays every streets selected using a nice font to show their names. As you may know not every font can display...
You need information about the language of the text. And when you decide what fonts you want, you do a mapping from language to font. If you try to do it automatically, it does not work. The fonts for Japanese, Chinese Traditional, and Chinese Simplified look differently even for the same character. They might be intel...
1.2
true
2
1,471
2011-10-05 10:42:23.333
What are the different options for social authentication on Appengine - how do they compare?
[This question is intended as a means to both capture my findings and sanity check them - I'll put up my answer toute suite and see what other answers and comments appear.] I spent a little time trying to get my head around the different social authentication options for (python) Appengine. I was particularly confused ...
In my research on this question I found that there are essentially three options: Use Google's authentication mechanisms (including their federated login via OpenID) Pros: You can easily check who is logged in via the Users service provided with Appengine Google handles the security so you can be quite sure it's wel...
1.2
true
1
1,472
2011-10-06 07:30:13.363
Where should I place a Python package's demo script?
I am coding a new python package to be used by others. To demonstrate how it should be used, I am writing a demo script that executes the main parts of the new package. What is the convention for doing this, so that other will find the script easily? Should it be a separate module (by what name)? Should it be located ...
Should it be a separate module (by what name)? demo/some_useful_name.py A demo directory contains demo scripts. Similarly, a test directory contains all your unit tests. Should it be located in the package's root directory? No. It's not part of the package. It's a demo. Out of the package? Yes. In init.py? ...
0.673066
false
2
1,473
2011-10-06 07:30:13.363
Where should I place a Python package's demo script?
I am coding a new python package to be used by others. To demonstrate how it should be used, I am writing a demo script that executes the main parts of the new package. What is the convention for doing this, so that other will find the script easily? Should it be a separate module (by what name)? Should it be located ...
I've never seen any real convention for this, but I personally put it in a main sentinel within __init__.py so that it can be invoked via python -m somepackage.
0.545705
false
2
1,473
2011-10-07 16:47:02.303
Using wx.MDIChildFrame Widgets
I want to put a bunch of widgets into an MDIChildFrame , using wxpython, but i cant find much documentation on how to do so. has anyone created a child frame with alot going on it in so i can take a look at the source code? would be really Helpful Cheers Kemill
The wxPython demo has a fairly complicated window in their MDI with SashWindows demo. However, I keep seeing on the wxPython mailing list that MDI in general isn't usually recommended anyway. If I were you, I'd look at wx.lib.agw.aui. It's a pure python implementation of AUI and fixes a lot of the bugs in wx.aui. I kno...
0
false
1
1,474
2011-10-08 16:32:31.593
How to get the control over the selection in a gtk.IconView?
I want to change the opacity or color of a gtk.IconView select box (I want actually to make the selection more visible). I noticed that the gtk.IconView widget had style properties selection-box-alpha & selection-box-color but only accessible for reading. The set_select_function() method of the gtk.TreeSelection class ...
You might be able to set the pixmap opacity by implementing a custom gtk.CellRenderer that draws the pixmap according to the selection state, and replacing the gtk.IconView's default cell renderer with your own.
0.201295
false
1
1,475
2011-10-10 12:12:36.523
Best way to earmark messages in an IMAP folder?
I am working on an application that is supposed to connect to IMAP account, read through emails and pick out emails sent by lets say "Mark", then it is supposed to respond to mark with an automatic response such as "Got it mate" and then do the same tomorrow, with the only difference that tomorrow it should not respond...
The UID is guaranteed to be unique. Store each one locally.
1.2
true
1
1,476
2011-10-10 17:22:03.820
usr/bin/env: bad interpreter Permission Denied --> how to change the fstab
I'm using cygwin on windows 7 to run a bash script that activates a python script, and I am getting the following error: myscript.script: /cydrive/c/users/mydrive/folder/myscript.py: usr/bin/env: bad interpreter: Permission Denied. I'm a total newbie to programming, so I've looked around a bit, and I think this means P...
You should write your command as 'python ./example.py ',then fix it in your script.
0
false
2
1,477
2011-10-10 17:22:03.820
usr/bin/env: bad interpreter Permission Denied --> how to change the fstab
I'm using cygwin on windows 7 to run a bash script that activates a python script, and I am getting the following error: myscript.script: /cydrive/c/users/mydrive/folder/myscript.py: usr/bin/env: bad interpreter: Permission Denied. I'm a total newbie to programming, so I've looked around a bit, and I think this means P...
This seems to be a late answer, but may be useful for others. I got the same kinda error, when I was trying to run a shell script which used python. Please check \usr\bin for existence of python. If not found, install that to solve the issue. I come to such a conclusion, as the error shows "bad interpreter".
0.050976
false
2
1,477
2011-10-11 02:55:05.540
Python Audio over Network Problems
Hello I am having problems with audio being sent over the network. On my local system with no distance there is no problems but whenever I test on a remote system there is audio but its not the voice input i want its choppy/laggy etc. I believe its in how I am handling the sending of the audio but I have tried now for ...
Did you run ping or ttcp to test network performance between the 2 hosts? If you have latency spikes or if some packets are dropped your approach to sending voice stream will suffer badly. TCP will wait for missing packet, report it being lost, wait for retransmit, etc. You should be using UDP over lossy links and audi...
0
false
1
1,478
2011-10-11 08:43:17.490
Writing a telnet server in Python and embedding IPython as shell
I am trying to write a simple telned server that will expose a IPython shell to the connected client. Does someone know how to do that ? The question is really about embedding the IPython shell into the Telnet server (I can probably use Twisted for the Telnet server part ) Thx
I think it is not possible provide full functionality of IPython, such as auto complete,.. Twisted has python shell that works well with telnet.
0
false
1
1,479
2011-10-11 13:42:10.653
Running IPython after changing the filename of python.exe
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)...
I do not know if there is a config file where you can change, but you may have to recompile Ipython and change the interpreter variables. But why do you need to rename it to python27.exe when it already is in a python27 folder?
0
false
4
1,480
2011-10-11 13:42:10.653
Running IPython after changing the filename of python.exe
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)...
instead of renaming python.exe, make sure the path to the python you want to run is before the path to other pythons
0
false
4
1,480
2011-10-11 13:42:10.653
Running IPython after changing the filename of python.exe
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)...
Try to find Python in windows registry and changes path to python. After that try to reinstall ipython.
0.101688
false
4
1,480
2011-10-11 13:42:10.653
Running IPython after changing the filename of python.exe
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)...
Found a solution: python27.exe c:\Python27\Scripts\ipython-script.py
1.2
true
4
1,480
2011-10-11 19:20:42.370
pydev: find all references to a function
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.
Ctrl+Shift+G will find all the references to a function in PyDev (F3 will go to the definition of a function).
1.2
true
1
1,481
2011-10-11 22:36:35.727
Python PIL: Create indexed color image with transparent background
I wonder how I could create a image with a transparent background and only 2 indexed colours (red and blue) to minimise the file size? More specifically I have two black and white images that I want to convert, one to transparent and blue and the other to transparent and red. Then I want to merge those 2 images. I coul...
Once you merge the two images, you won't have two colors any more - the colors will combine based on the transparency of each one at every pixel location. Worst case, you will have 256*256=65536 colors, which can't be indexed and wouldn't compress well if you did. I would suggest saving as a PNG and let the lossless co...
0.201295
false
1
1,482
2011-10-12 00:15:03.877
Uniformly distributed data in d dimensions
How can I generate a uniformly distributed [-1,1]^d data in Python? E.g. d is a dimension like 10. I know how to generate uniformly distributed data like np.random.randn(N) but dimension thing is confused me a lot.
You can import the random module and call random.random to get a random sample from [0, 1). You can double that and subtract 1 to get a sample from [-1, 1). Draw d values this way and the tuple will be a uniform draw from the cube [-1, 1)^d.
0.201295
false
1
1,483
2011-10-12 23:43:00.387
Running command with browser
I want to have a "control panel" on a website, and when a button is pressed, I want it to run a command on the server (my computer). The panel is to run different python scripts I wrote (one script for each button), and I want to run the panel on my Mac, my iPod touch, and my wii. The best way I see for this is a web...
Here are three options: Have each button submit a form with the name of the script in a hidden field. The server will receive the form parameters and can then branch off to run the appropriate script. Have each button hooked to it's own unique URL and use javascript on the button click to just set window.location to ...
1.2
true
2
1,484
2011-10-12 23:43:00.387
Running command with browser
I want to have a "control panel" on a website, and when a button is pressed, I want it to run a command on the server (my computer). The panel is to run different python scripts I wrote (one script for each button), and I want to run the panel on my Mac, my iPod touch, and my wii. The best way I see for this is a web...
On the client side (the browser), you can do it with the simplest approach. Just an html form. javascript would make it nicer for validation and to do ajax calls so the page doesnt have to refresh. But your main focus is handling it on the server. You could receive the form request in the language of your choice. If yo...
0
false
2
1,484
2011-10-13 10:09:29.107
how can i run a script containing shell escape from ipython?
It's so convenient to use shell escape from interactive environment in ipython, but is it possible to call python script containing shell escape from ipython?
If you give the script a .ipy extension, ipython's special syntax (like !ls) should work when you do ipython myscript.ipy.
1.2
true
1
1,485
2011-10-14 15:37:19.360
in Python and linux how to get given user's id
There is os.getuid() which "Returns the current process’s user id.". But how do I find out any given user's id?
You could just parse /etc/passwd, it's stored there.
-0.470104
false
1
1,486
2011-10-16 14:40:16.167
Listening to network event and keyboard input at the same time in Python
I want to write an (GUI) application that listens both to keyboard events (client side generated events) and to a network port (server side generated events). I could use some high level advice on how to do this. Some additional info: - I am using the wxPython module for the GUI - I could set the socket in non-blocking...
I am not a wx expert. Could you use wx's native event driven mechanisms? The keypress would certainly have an event. Wx has a socket class wxSocketClient() that could translate the low level socket events (data ready, closed, etc) into a wx event.
0
false
1
1,487
2011-10-17 09:48:30.130
Integrating python and c#
I've decided to try and create a game before I finish studies. Searching around the net, I decided to create the basic game logic in python (for simplicity and quicker development time), and the actual I/O engine in c# (for better performance. specifically, I'm using Mono with the SFML library). After coming to grips ...
Have you considered IronPython? It's trivial to integrate and since it's working directly with .net the integration works very well.
0.386912
false
2
1,488
2011-10-17 09:48:30.130
Integrating python and c#
I've decided to try and create a game before I finish studies. Searching around the net, I decided to create the basic game logic in python (for simplicity and quicker development time), and the actual I/O engine in c# (for better performance. specifically, I'm using Mono with the SFML library). After coming to grips ...
Sincerely, I would say C# is today gives you a lot of goods from Python. To quote Jon Skeet: Do you know what I really like about dynamic languages such as Python, Ruby, and Groovy? They suck away fluff from your code, leaving just the essence of it—the bits that really do something. Tedious formality gives way ...
1.2
true
2
1,488
2011-10-19 13:24:13.720
KML to string in Python?
I'd like to download a KML file and print a particular element of it as a string in Python. Could anyone give me an example of how to do this? Thanks.
You can download the KML file in python using urllib. For reading KML, you can use a parser (search for "kml python parser").
0
false
1
1,489
2011-10-19 20:42:47.977
How to store recipe information with Python
I'm very new to Python and I'm trying to write a sort of recipe organizer to get acquainted with the language. Basically, I am unsure how how I should be storing the recipes. For now, the information I want to store is: Recipe name Ingredient names Ingredient quantities Preparation I've been thinking about how to d...
Just a general data modeling concept: you never want to name anything "...NumberOne", "...NumberTwo". Data models designed in this way are very difficult to query. You'll ultimately need to visit each of N tables for 1 to N ingredients. Also, each table in the model would ultimately have the same fields making main...
0.201295
false
1
1,490
2011-10-21 00:24:05.100
How to intepret the shape of the array in Python?
I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','. I am wondering how to interpret this. Thanks.
It sounds like you're using Numpy. If so, the shape (38845,) means you have a 1-dimensional array, of size 38845.
0.296905
false
3
1,491
2011-10-21 00:24:05.100
How to intepret the shape of the array in Python?
I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','. I am wondering how to interpret this. Thanks.
Just wondering why this ','. Because (38845) is the same thing as 38845, but a tuple is expected here, not an int (since in general, your array could have multiple dimensions). (38845,) is a 1-tuple.
0
false
3
1,491
2011-10-21 00:24:05.100
How to intepret the shape of the array in Python?
I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','. I am wondering how to interpret this. Thanks.
Python has tuples, which are like lists but of fixed size. A two-element tuple is (a, b); a three-element one is (a, b, c). However, (a) is just a in parentheses. To represent a one-element tuple, Python uses a slightly odd syntax of (a,). So there is only one dimension, and you have a bunch of elements in that one dim...
1.2
true
3
1,491
2011-10-21 07:36:05.983
How can I query the nearest record in a given coordinates(latitude and longitude of string type)?
I am using GeoDjango with PostGIS. Then I am into trouble on how to get the nearest record from the given coordinates from my postgres db table.
I have no experience with GeoDjango, but on PostgreSQL/PostGIS you have the st_distance(..) function. So, you can order your results by st_distance(geom_column, your_coordinates) asc and see what are the nearest rows. If you have plain coordinates (no postgis geometry), you can convert your coordinates to a point with ...
0.135221
false
1
1,492
2011-10-24 08:50:56.283
How to make python modules compatible with different OS?
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 co...
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 as...
0.201295
false
2
1,493
2011-10-24 08:50:56.283
How to make python modules compatible with different OS?
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 co...
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...
1.2
true
2
1,493
2011-10-24 13:20:58.557
Generating constructor documentation for class defined in C++
When developing a Python plug-in (in C++), how does one go about setting the documentation for __new__? In particular, given a new type defined by a PyTypeObject structure in the C++, how does one document the arguments which can be passed to the constructor.
Constructor arguments are usually documented in the type docstring, i.e. via the tp_doc slot, so you can do help(type) (or type? in IPython) instead of help(type.__new__) or help(type.__init__).
0
false
1
1,494
2011-10-25 02:11:36.443
Where to use yield in Python best?
I know how yield works. I know permutation, think it just as a math simplicity. But what's yield's true force? When should I use it? A simple and good example is better.
Another use is in a network client. Use 'yield' in a generator function to round-robin through multiple sockets without the complexity of threads. For example, I had a hardware test client that needed to send a R,G,B planes of an image to firmware. The data needed to be sent in lockstep: red, green, blue, red, green, b...
0.296905
false
1
1,495
2011-10-28 12:06:36.593
Pre-fill a form with attached file taken from some URL in Django
I have a form with "subject", "body" and "file" fields on some page on my Django site. If "subject" and/or "body" parameters exist in GET, I pre-fill them in the form from server side. I want to do the same with "file" field - more exactly, I want if there is an "URL" parameter in request.GET, take the file from this U...
You can't pre-fill a file field. But I don't think you need to use one at all, since you're getting the file from a URL, not from the user's local machine. Just use a normal text field for the URL, and get the file server-side (eg using urllib) after the form is submitted.
1.2
true
2
1,496
2011-10-28 12:06:36.593
Pre-fill a form with attached file taken from some URL in Django
I have a form with "subject", "body" and "file" fields on some page on my Django site. If "subject" and/or "body" parameters exist in GET, I pre-fill them in the form from server side. I want to do the same with "file" field - more exactly, I want if there is an "URL" parameter in request.GET, take the file from this U...
Most sites that do something like this implement it with a second form where you attach the file. Doing the upload via ajax means you do need to store the file on your server for some amount of time, and then your original form just needs a reference to that file so you know when you're done with it. Then you just need...
0.201295
false
2
1,496
2011-10-29 09:04:34.300
How do I create a multicast stream socket over IPv6 in Python?
I need some help in implementing Multicast Streaming server over IPv6 preferably in Python. I am able to do so with Datagram servers but since I need to send large amounts of data (images and videos) over the connection, I get an error stating , data too large to send. Can any one tell me how do I implement a Streamin...
You DO want to use datagrams, as with multicast there are multiple receivers and a stream socket will not work. You need to send your data in small chunks (datagrams) and state in each which part of the stream it is so receivers can detect lost (and reordered) datagrams. Instead of inventing a new mechanism for identif...
0.995055
false
1
1,497
2011-10-29 20:52:59.773
how do i create a database in psycopg2 and do i need to?
I'm create a blog using django. I'm getting an 'operational error: FATAL: role "[database user]" does not exist. But i have not created any database yet, all i have done is filled in the database details in setting.py. Do i have to create a database using psycopg2? If so, how do i do it? Is it: python import psycop...
before connecting to database, you need to create database, add user, setup access for user you selected. Reffer to installation/configuration guides for Postgres.
0
false
2
1,498
2011-10-29 20:52:59.773
how do i create a database in psycopg2 and do i need to?
I'm create a blog using django. I'm getting an 'operational error: FATAL: role "[database user]" does not exist. But i have not created any database yet, all i have done is filled in the database details in setting.py. Do i have to create a database using psycopg2? If so, how do i do it? Is it: python import psycop...
Generally, you would create the database externally before trying to hook it up with Django. Is this your private server? If so, there are command-line tools you can use to set up a PostgreSQL user and create a database. If it is a shared hosting situation, you would use CPanel or whatever utility your host provides t...
0
false
2
1,498
2011-10-30 15:06:02.940
Retrieving raw XML for items with feedparser
I'm trying to use feedparser to retrieve some specific information from feeds, but also retrieve the raw XML of each entry (ie. elements for RSS and for Atom), and I can't see how to do that. Obviously I could parse the XML by hand, but that's not very elegant, would require separate support for RSS and Atom, and I i...
I'm the current developer of feedparser. Currently, one of the ways you can get that information is to monkeypatch feedparser._FeedParserMixin (or edit a local copy of feedparser.py). The methods you'll want to modify are: feedparser._FeedParserMixin.unknown_starttag feedparser._FeedParserMixin.unknown_endtag At the ...
1.2
true
1
1,499
2011-10-31 22:33:16.290
Boto: how to keep EMR job flow running after completion/failure?
How can I add steps to a waiting Amazon EMR job flow using boto without the job flow terminating once complete? I've created an interactive job flow on Amazon's Elastic Map Reduce and loaded some tables. When I pass in new steps to the job flow using Boto's emr_conn.add_jobflow_steps(...), the job flow terminates after...
If it finishes correctly, it should not terminate with keep_alive=True. That said, it would normally exit on failure, so you want to add terminate_on_failure="CONTINUE" to your add_job_steps arguments.
1.2
true
1
1,500
2011-11-01 09:59:10.747
Qt Designer: how to add custom slot and code to a button
I use Qt4 Designer and I want that when I click on the "yes" button, some code will execute. And when I click on the "no", some other code will be execute. How can I do it?
Right-click on your widget Select "Go to slot..." Select a signal and click OK Your custom slot declaration and definition for that signal will be added to *.cpp and *.h files. Its name will be generated automatically. upd: Sorry, I didn't notice that the question is about Python & QtDesigner itself, I was thinking of...
0.998178
false
2
1,501
2011-11-01 09:59:10.747
Qt Designer: how to add custom slot and code to a button
I use Qt4 Designer and I want that when I click on the "yes" button, some code will execute. And when I click on the "no", some other code will be execute. How can I do it?
Click on the Edit Signal/Slots tool. Create a connection for your button. For this, select your button in the designer by pressing on it with the left button of the mouse. Move the mouse to some place in the main window to create a connection with the main window (it is like a red line with a earth connection). When yo...
1
false
2
1,501
2011-11-02 05:40:45.253
How can I get generators/iterators to evaluate as False when exhausted?
Other empty objects in Python evaluate as False -- how can I get iterators/generators to do so as well?
Guido doesn't want generators and iterators to behave that way. Objects are true by default. They can be false only if they define __len__ that returns zero or __nonzero__ that returns False (the latter is called __bool__ in Py3.x). You can add one of those methods to a custom iterator, but it doesn't match Guido's in...
0.995055
false
1
1,502
2011-11-02 20:27:13.560
Preserving only domain-specific keywords?
I am trying to determine the most popular keywords for certain class of documents in my collection. Assuming that the domain is "computer science" (which of course, includes networking, computer architecture, etc.) what is the best way to preserve these domain-specific keywords from text? I tried using Wordnet but I am...
You need a huge training set of documents. Small subset of this collection (but still large set of documents) should represent given domain. Using nltk calculate words statistics taking into account morphology, filter out stopwords. The good statistics is TF*IDF which is roughly a number of occurenses of a word in the ...
1.2
true
1
1,503
2011-11-03 00:02:20.887
How can I stop the debugger server from pydev?
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...
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
false
1
1,504
2011-11-03 18:47:13.350
How to access commit message from Mercurial Input or Changeset hook
I would like to write a hook for Mercurial to do the following, an am struggling to get going.: Run on central repo, and execute when changeset(s) are pushed (I think I should use the "input" or "changegroup" hook) Search each commit message for a string with the format "issue:[0-9]*" IF string found, call a webservic...
changegroup hook is called once per push. If you want to analyse each changeset, then you want incoming hook (there's no input hook AFAIK) — it'll be called for each changeset, with ID in HG_NODE environment variable. You can get the commit message with e.g. hg log -r $HG_NODE --template '{desc}' or via the API.
0.386912
false
1
1,505
2011-11-05 01:28:50.570
TDD practice: Distinguishing between genuine failures and unimplemented features
If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ...
Most projects would have a hierarchy (e.g. project->package->module->class) and if you can selectively run tests for any item on any of the levels or if your report covers these parts in detail you can see the statuses quite clearly. Most of the time, when an entire package or class fails, it's because it hasn't been i...
0.101688
false
3
1,506
2011-11-05 01:28:50.570
TDD practice: Distinguishing between genuine failures and unimplemented features
If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ...
I use a piece of paper to create a test list (scratchpad to keep track of tests so that I don't miss out on them). I hope you're not writing all the failing tests at one go (because that can cause some amount of thrashing as new knowledge comes in with each Red-Green-Refactor cycle). To mark a test as TO-DO or Not impl...
0.201295
false
3
1,506
2011-11-05 01:28:50.570
TDD practice: Distinguishing between genuine failures and unimplemented features
If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ...
I also now realize that the unittest.expectedFailure decorator accomplishes functionality congruent with my needs. I had always thought that this decorator was more for tests that require certain environmental conditions that might not exist in the production environment where the test is being run, but it actually ma...
0
false
3
1,506
2011-11-07 09:37:55.587
On what side is 'HTTP Error 403: request disallowed by robots.txt' generated?
I am trying out Mechanize to make some routine simpler. I have managed to bypass that error by using br.set_handle_robots(False). There are talks about how ethical it's to use it. What I wonder about is where this error is generated, on my side, or on server side? I mean does Mechanize throw the exception when it sees ...
The server blocks your activity with such response. Is it your site? If not, follow the rules: Obey robots.txt file Put a delay between request, even if robots.txt doesn't require it. Provide some contact information (e-mail or page URL) in the User-Agent header. Otherwise be ready site owner blocking you based on Us...
0
false
1
1,507
2011-11-07 16:37:12.977
Redis: find all objects older than
I store several properties of objects in hashsets. Among other things, something like "creation date". There are several hashsets in the db. So, my question is, how can I find all objects older than a week for example? Can you suggest an algorithm what faster than O(n) (naive implementation)? Thanks, Oles
My initial thought would be to store the data elsewhere, like relational database, or possibly using a zset. If you had continuous data (meaning it was consistently set at N interval time periods), then you could store the hash key as the member and the date (as a int timestamp) as the value. Then you could do a zrank...
1.2
true
1
1,508
2011-11-07 19:30:17.213
How to develop a simple web application with server-side Python
I am wondering how to go about implementing a web application with Python. For example, the html pages would link to python code that would give it increased functionality and allow it to write to a database. Kind of like how Reddit does it.
Plain CGI is a good starting point to learn about server side scripting, but it is an outdated technology and gets difficult to maintain after certain level of complexity. I would think it is no longer used in industrial-grade web server anymore. Plus you have to setup a web server and then install some module to inter...
0
false
1
1,509
2011-11-07 19:59:48.230
Forwarded Email parsing in Python/Any other language?
I have some mails in txt format, that have been forwarded multiple times. I want to extract the content/the main body of the mail. This should be at the last position in the hierarchy..right? (Someone point this out if I'm wrong). The email module doesn't give me a way to extract the content. if I make a message obje...
The email module doesn't give me a way to extract the content. if I make a message object, the object doesn't have a field for the content of the body. Of course it does. Have a look at the Python documentation and examples. In particular, look at the walk and payload methods.
1.2
true
1
1,510
2011-11-08 07:17:28.193
Is there a way to comment out python code in a django html file?
I'm curious, i have the following code {% code_goes_here %}, how do I comment it out in the html file?
Django templates has {# ... #} as comments. NOTE: These comments are not multi-line.
0.673066
false
1
1,511
2011-11-08 17:57:22.310
how to clear ipython buffer in emacs?
I am running and interactive ipython shell in an emacs buffer using ipython.el. I wonder if there is a way to clear the screen? Since it is not running on a terminal, the import os; os.system('CLS') trick will not work. Thanks.
C-c M-o runs the command comint-clear-buffer (found in inferior-python-mode-map), which is an interactive compiled Lisp function. It is bound to C-c M-o. (comint-clear-buffer) Clear the comint buffer.
0.673066
false
1
1,512
2011-11-09 03:00:25.077
Programming a GUI Like Steam?
So I've been tinkering with a few different GUI's but I haven't been able to even find a point to begin researching this question: How do I make a GUI like Steam (Digital distribution app) has? More specifically, I'm interested in how they manage to make their SHIFT+TAB menu pop up in-game, without disrupting/pausing/e...
Hmm, that looks very much like they are using Adobe AIR or maybe Flash.
-0.386912
false
1
1,513
2011-11-09 22:10:05.920
How to compile .py into an executable for Debian
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 Pytho...
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
false
1
1,514
2011-11-10 05:17:19.250
How to maximize a browser window using the Python bindings for Selenium 2-WebDriver?
I wanted to know how to maximize a browser window using the Python bindings for Selenium 2-WebDriver.
You can use browser.maximize_window() for that
0.999329
false
1
1,515
2011-11-10 15:48:45.170
item or member, is there a rule how to refer to a container's contents?
Let's take a random container in Python (list, dict...), do you say a container has items or do you refer to it as members? Documentation seems to suggest that only sets have members.
"Items" in Python usually are the things that can be retrieved or modified using the __getitem__() and __setitem__() functions, so lists and dictionaries have items. Sets in contrast don't implement __getitem__() and __setitem__(), so the documentation uses one of the usual terms to refer to the members of a set ("ele...
0.265586
false
2
1,516
2011-11-10 15:48:45.170
item or member, is there a rule how to refer to a container's contents?
Let's take a random container in Python (list, dict...), do you say a container has items or do you refer to it as members? Documentation seems to suggest that only sets have members.
Python documentation extensively refers to dictionaries and lists as containing 'items'
0
false
2
1,516
2011-11-11 09:52:36.803
Customizing the Django User admin
I have a Django application where users have additional data. That data is collected in a Profile model with a OneToOneField pointing to User. This is fine and works perfectly for most purposes, but I have trouble customizing the admin for User. In particular: I would like to be able to show a Profile field inside lis...
Turns out, one can put the methods in the UserAdmin itself instead than in the User model. This way I can access all the information I need about the user.
1.2
true
1
1,517
2011-11-11 14:04:37.737
pyqt designer and layout for central widget
I started new clear Main Window project, There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar. I need to set default layout inside the window, so probably for centralWidget. But I didnt found way how to do it. I can get LayoutWidget with some particular size into centralWidget. But I want to set layou...
Right click anywhere within your centralWidget go to the Lay Out sub menu and select the Layout you want. This will be applied automatically to all contents of your centralWidget. In order to see how it works place inside it 2 or 3 push buttons and try changing the layouts.
1.2
true
2
1,518
2011-11-11 14:04:37.737
pyqt designer and layout for central widget
I started new clear Main Window project, There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar. I need to set default layout inside the window, so probably for centralWidget. But I didnt found way how to do it. I can get LayoutWidget with some particular size into centralWidget. But I want to set layou...
Add some widgets to the central widget first. Then select the central widget and use the "Layout in a Grid", "Layout Vertically", etc buttons on the toolbar to add a main layout. The layouts in the "Widget Box" side-bar are used for adding child layouts to a main layout.
0.201295
false
2
1,518
2011-11-11 17:23:13.507
How do I confirm a form has been submitted with django?
I'm submitting a form and instead of redirecting to a success url I would like to just show "Form has been submitted" in text on the page when the form has been submitted. Does anyone know how I can do so?
Honestly, this isn't a Django-specific issue. The problem is whether you are doing a normal form submission or using AJAX. The basic idea is to POST to your form submission endpoint using AJAX and the form data, and in the Django view, merely update your models and return either an empty 200 response or some data (in X...
0
false
1
1,519
2011-11-11 18:02:47.620
Sending data through the web to a remote program using python
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
I would suggest taking a look at setting up a simple site in google app engine. It's free and you can use python to do the site. Than it would just be a matter of creating a simple restful service that you could send a POST to with your pickled data and store it in a database. Than just create a simple web front end on...
0.201295
false
4
1,520
2011-11-11 18:02:47.620
Sending data through the web to a remote program using python
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
I suggest you to use a good middle-ware like: Zero-C ICE, Pyro4, Twisted. Pyro4 using pickle to serialize data.
0
false
4
1,520
2011-11-11 18:02:47.620
Sending data through the web to a remote program using python
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Adding this as an answer so that OP will be more likely to see it... Make sure you consider security! If you just blindly accept pickled data, it can open you up to arbitrary code execution.
0
false
4
1,520
2011-11-11 18:02:47.620
Sending data through the web to a remote program using python
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Another option in addition to what Casey already provided: Set up a remote MySQL database somewhere that has user access levels allowing remote connections. Your Python program could then simply access the database and INSERT the data you're trying to store centrally (e.g. through MySQLDb package or pyodbc package). ...
0.101688
false
4
1,520
2011-11-12 23:54:26.693
Downloading PDF files with Scrapy
I'm scraping pdf files from a site using Scrapy, a Python web-scraping framework. The site requires to follow the same session in order to allow you to download the pdf. It works great with Scrapy's because it's all automated but when I run the script after a couple of seconds it starts to give me fake pdf files like ...
I think the site tracks your session. If it's a PHP site, pass PHPSESSID cookie to the request which downloads the PDF file.
0
false
1
1,521
2011-11-13 19:04:58.117
different types of line terminations(unix, windows, etc)
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);...
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).
1.2
true
1
1,522
2011-11-13 21:23:24.920
How to make an exe file out of Python Scrapy script?
I have a Scrapy script, and it's working fine. To distribute it to my friends, I need it to be executable because they don't know much about Scrapy. Would someone tell me how to turn a Scrapy script into an exe file? Is py2exe applicable in this regard?
Yes, use py2exe Ask questions about any specific problems you have.
0.386912
false
1
1,523
2011-11-15 13:17:09.603
Software metric tool for Python
I want a tool which can compute source code metrics such as lines of code, number of packages, classes, functions, cyclomatic complexity number, depth of inheritance tree etc. for my Python Code. I have tried pylint, but it didn't offer much metrics. pynocle seemed interesting but I dont know how to use it. Can anyone ...
try radon, It calculate Cyclomatic Complexity, Maintainability Index and Raw metrics like LOC, SLOC and...
0
false
1
1,524
2011-11-15 16:39:15.327
How to load training data in PyBrain?
I am trying to use PyBrain for some simple NN training. What I don't know how to do is to load the training data from a file. It is not explained in their website anywhere. I don't care about the format because I can build it now, but I need to do it in a file instead of adding row by row manually, because I will have ...
Here is how I did it: ds = SupervisedDataSet(6,3) tf = open('mycsvfile.csv','r') for line in tf.readlines(): data = [float(x) for x in line.strip().split(',') if x != ''] indata = tuple(data[:6]) outdata = tuple(data[6:]) ds.addSample(indata,outdata) n = buildNetwork(ds.indim,8,8,ds.outdim,recurren...
1.2
true
1
1,525
2011-11-15 21:14:31.730
How to use a report from a view inside another view in Django?
I have a form where I upload a file, and I generate a report out of it. The thing is, I would also like to make the report available for download, as an archive. I would like to somehow include the CSS and the JS ( that I inherit from my layout ) inside the report, but I don't really know how to go about this. So far, ...
you could always keep the files, and have a cron job that deletes files whose session has expired
0
false
1
1,526
2011-11-15 21:34:39.707
How do get matplotlib pyplot to generate a chart for viewing / output to .png at a specific resolution?
I'm fed up with manually creating graphs in excel and consequently, I'm trying to automate the process using Python to massage the .csv data into a workable form and matplotlib to plot the result. Using matplotlib and generating them is no problem but I can't work out is how to set the aspect ration / resolution of the...
For resolution, you can use the dpi (dots per inch) argument when creating a figure, or in the savefig() function. For high quality prints of graphics dpi=600 or more is recommended.
0
false
1
1,527
2011-11-16 14:46:54.977
Looking for algorithm to help determine shortest path from one terminal screen to another
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 Scree...
If you have created a topology of the screens, the A* algorithm should work fine.
0
false
1
1,528
2011-11-18 21:54:38.260
Running Python Program via sshfs-mounted Share
I have a share (on Machine-A) mounted via sshfs on Machine-B. From Machine-C, I have this share mounted also via sshfs (double sshfs) like so: On Machine-C: /mnt/Machine-B/target_share On Machine-B: /mnt/Machine-A/target_share On Machine-A: /media/target_share Now I have a Python program that runs fine in all places t...
I found that there may be a bug in sshfs, such that if a user on a Linux system has the same user ID as another, i.e., 1002, but different usernames, this causes problems. The way I worked around this was to actually avoid sshfs for this case all together and mount the drives directly to a local system. I wanted to av...
1.2
true
1
1,529