Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
15,765,699
2013-04-02T13:41:00.000
2
0
1
0
1
linux,python-2.7,segmentation-fault,hashlib
0
15,769,594
0
1
0
true
0
0
hashlib uses libcrypto for hash algorithms if it can find libcrypto while building python. I suspect somehow it's ending up using a different libcrypto at runtime vs. build time.
1
1
0
0
Whenever I try to import hashlib in Python 2.7 I get a segmentation fault. I've installed openssl version 1.0.0, pyOpenssl version .10, and recompiled python with the ssl lines uncommented in Modules/Setup, pointing to the correct path for the libraries and include files for openssl. I've run ldd on all the libraries I can find that might use libssl or libcrypto, and they're all pointing to the same versions of the files. gdb returns: 0x0000003d1d0f670 in EVP_PKEY_CTX_dup () from /usr/lib64/libcrypto.so.1.0.0 Any ideas what might be going on, and how to repair it?
Python 2.7 "import hashlib" segmentation fault
1
1.2
1
0
0
1,235
15,774,899
2013-04-02T21:38:00.000
3
0
0
0
0
python,postgresql,sqlalchemy,ddl,flask-sqlalchemy
0
15,775,816
0
1
0
true
0
0
(Copy from comment) Assuming sess is the session, you can do sess.execute(CreateTable(tenantX_tableY)) instead. EDIT: CreateTable is only one of the things being done when calling table.create(). Use table.create(sess.connection()) instead.
1
0
0
0
I'm using Sqlalchemy in a multitenant Flask application and need to create tables on the fly when a new tenant is added. I've been using Table.create to create individual tables within a new Postgres schema (along with search_path modifications) and this works quite well. The limitation I've found is that the Table.create method blocks if there is anything pending in the current transaction. I have to commit the transaction right before the .create call or it will block. It doesn't appear to be blocked in Sqlalchemy because you can't Ctrl-C it. You have to kill the process. So, I'm assuming it's something further down in Postgres. I've read in other answers that CREATE TABLE is transactional and can be rolled back, so I'm presuming this should be working. I've tried starting a new transaction with the current engine and using that for the table create (vs. the current Flask one) but that hasn't helped either. Does anybody know how to get this to work without an early commit (and risking partial dangling data)? This is Python 2.7, Postgres 9.1 and Sqlalchemy 0.8.0b2.
How do you create a table with Sqlalchemy within a transaction in Postgres?
0
1.2
1
1
0
1,872
15,775,295
2013-04-02T22:07:00.000
2
0
1
0
1
python,performance,cython
0
15,905,349
0
2
1
true
0
0
I believe you can benefit by using math functions from libc as you are calling np.sqrt and np.floor on scalars. This has not only the Python call overhead but there are different code paths in the numpy ufuncs for scalars and arrays. So that involves at least a type switch.
1
3
0
0
I am doing my first steps with Cython, and I am wondering how to improve performance even more. Until now I got to half the usual (python only) execution time, but I think there must be more! I know cython -a and I already typed my variables. But there is still a lot in yellow in my function. Is this because cython does not recognise numpy or is there something else I am missing?
How to improve Cython performance?
0
1.2
1
0
0
553
15,788,591
2013-04-03T13:23:00.000
1
0
1
0
1
python,installation,automatic-updates
0
15,850,839
0
2
0
false
0
0
Have the "import X" call run a code in a wrapper library. The code the time of import would check the database for a new version of the library and download if it has changed. Then it can in turn import the downloaded library or import the existing library. There may be issues with this on frozen code so you might have to explicitly eval the new module. Edit: This does not necessarily need to be done in another module. It could just be a function call.
1
6
0
0
I maintain an in-house Python package which is used by some not-really-technical people in the company. Being that their needs (or rather, their wants) change on an almost-daily basis, I have to update the library pretty often, and I create new installers for them too often for their liking. The lib provides a high-level access to a custom in-house database. At this point, I know that I could send the lib version along with the query request, and show the user a message with the result that they need to install an update. However, being that these people seem to think that taking a few seconds to click on an .exe file and clicking through the "next" buttons on the installer takes too long, I'm being asked to see if there's a way to automatically update the library when they do the "import X" call. I have never come across this kind of request, and I'm thinking that if this was possible that most popular libraries would offer this option. But I've been wrong before, and often. Has anyone successfully done this before?
Is it possible to upgrade a Python package on the fly?
1
0.099668
1
0
0
566
15,794,368
2013-04-03T17:45:00.000
2
0
1
0
0
python,datetime,object
0
15,794,489
0
3
0
false
0
0
Convert to seconds, divide by 300 and use the integer portion as your grouping.
1
0
0
0
Can i borrow someone's brain for this issue. I have got data and their relevant timestamps. I am interested in grouping them by 5min frequency however i can only start the grouping on 00:00 format. I mean 13:23:27 (hours) would need to be group with 13:25:00 data and then it will be 13:30:00, 13:35:00 etc Do you know how i can distinguish this rounding? At the moment i am able to group by 5min but it starts from the first timestamp which could be 13:18:47 so the next one is giving me is 13:24:00 which is wrong as per my definition i would like to see 13:20:00 Hope that make sense...
Date grouping python
0
0.132549
1
0
0
116
15,795,038
2013-04-03T18:23:00.000
2
0
0
0
0
python,python-2.7,perforce
0
15,806,216
0
1
0
true
0
0
Several options come to mind. The simplest approach would be to always let your program use the same client and let it sync the file. You could let your program call p4 sync and see if you get a new version or not. Let it continue if you get a new version. This approach has the advantage that you don't need to remember any states/version from the previous run of your program. If you don't like using a fixed client you could let your program always check the current head revision of the file in question: p4 fstat //depot/path/yourfile |grep headRev | sed 's/.*headRev \(.*\)/\1/' You could store that version for the next run of your program in some temp file and compare versions each time. If you run your program at fixed times (e.g. via cron) you could check the last modification time (either with p4 filelog or with p4 fstat) and if the time is between the time of the last run and the current time then you need to process the file. This option is a bit intricate since you need to parse those different time formats.
1
0
0
0
I'm writing a python app that connects to perforce on a daily basis. The app gets the contents of an excel file on perfoce, parses it, and copies some data to a database. The file is rather big, so I would like to keep track of which revision of the file the app last read on the database, this way i can check to see if the revision number is higher and avoid reading the file if it has not changed. I could make do with getting the revision number, or the changelist number when the file was last checked in / changed. Or if you have any other suggestion on how to accomplish my goal of avoiding doing an unnecessary read of the file. I'm using python 2.7 and the perforce-python API
How to get head revision number of a file, or the changelist number when it was checked in / changed
0
1.2
1
1
0
1,797
15,817,272
2013-04-04T16:59:00.000
0
0
0
0
0
wxpython,wxwidgets
0
16,090,332
0
2
0
true
0
1
So i found the solution of the problem. It is because when I was plugging the different monitor - for some reason the DPI was changing. Adjusting the settings in the windows display control panel did the thing.
2
0
0
0
I have been developing a wx.python application. at some point i need to create a fullscreen, no taskbar, etc. wx.Frame which has exactly the size of the screen and display in it a bimap which has exactly the dimensions of the screen, so one pixel of the bitmap equals exactly one pixel of the screen. everything has been working fine (on dvi/vga/hdmi monitors) up to the time when i pluged in displayport monitor. the monitor is detected by wxwidgets to be lower resolution than it actually is, so the bitmap goes off the screen. EDID still detects valid resolution so it is for sure wxwidgets related issue. when i use wx.DisplaySize - it returns lower resolution than is actually set. i also tried to create the bitmap according to the wx.DisplaySize() output but then, as expected, when i try to light up one pixel, its neighbours are changed too. (some sort of scalling occurs). similar issue occurs when i plug a projector. have any of you had simmilar symptomes? how to deal with it?
weird scalling on displayport monitors in wx.python
0
1.2
1
0
0
110
15,817,272
2013-04-04T16:59:00.000
1
0
0
0
0
wxpython,wxwidgets
0
15,822,502
0
2
0
false
0
1
Correct EDID values does not necessarily mean that the system is running it in that display mode. Have you checked the system's display properties or screen resolution properties to ensure that the system is driving the display at its full resolution? Your symptoms sound to me like it is running at a lower resolution and the display is stretching it to fill the full screen.
2
0
0
0
I have been developing a wx.python application. at some point i need to create a fullscreen, no taskbar, etc. wx.Frame which has exactly the size of the screen and display in it a bimap which has exactly the dimensions of the screen, so one pixel of the bitmap equals exactly one pixel of the screen. everything has been working fine (on dvi/vga/hdmi monitors) up to the time when i pluged in displayport monitor. the monitor is detected by wxwidgets to be lower resolution than it actually is, so the bitmap goes off the screen. EDID still detects valid resolution so it is for sure wxwidgets related issue. when i use wx.DisplaySize - it returns lower resolution than is actually set. i also tried to create the bitmap according to the wx.DisplaySize() output but then, as expected, when i try to light up one pixel, its neighbours are changed too. (some sort of scalling occurs). similar issue occurs when i plug a projector. have any of you had simmilar symptomes? how to deal with it?
weird scalling on displayport monitors in wx.python
0
0.099668
1
0
0
110
15,819,339
2013-04-04T18:50:00.000
0
0
1
0
0
python,nltk,stemming,porter-stemmer
0
15,819,519
0
2
0
false
0
0
The idea of stemming is to reduce different forms of the same word to a single "base" form. That is not what you are asking for, so probably no existing stemmer is (at least not by purpose) fullfilling your needs. So the obvious solution for your problem is: If you have your own custom rules, you have to implement them. You don't tell much about your requirement. Depending on your needs, you have to start from scratch. If porter stemmter comes close to your needs, but not in some special cases, you could hand code some overrides and use an existing stemmer for the other cases.
1
2
0
0
Given a list of words like this ['add', 'adds', 'adding', 'added', 'addition'], I want to stem all of them to the same word 'add'. That means stemming all different verb and noun forms of a word (but not its adjective and adverb forms) into one. I couldn't find any stemmer that does that. The closest one I found is PorterStemmer, but it stems the above list to ['add', 'add', 'ad', 'ad', 'addit'] I'm not very experienced with stemming techniques. So, I want to ask if there's any available stemmer that does what I explains above? If not, do you have any suggestion on how to achieve that? Many thanks,
What other alternative are there to stemming?
0
0
1
0
0
1,664
15,821,121
2013-04-04T20:30:00.000
0
0
0
1
1
python,python-idle
0
69,122,871
0
5
0
false
0
0
Old question I know but maybe the OP's question was not answered? If you want Idle's File Open/Save/Save As menu items to interact with a particular folder, you need to set the CWD before starting Idle. So, assuming you have a folder on Windows "C:\Users<username>\Documents\python\my_project", then at a cmd prompt type cd C:\Users\<username>\Documents\python\my_project and then start Idle
2
33
0
0
So, I'm learning Python and would like to create a simple script to download a file from the internet and then write it to a file. However, I am using IDLE and have no idea what the working directory is in IDLE or how to change it. How can I do file system stuff in IDLE if I don't know the working directory or how to change it?
What's the working directory when using IDLE?
0
0
1
0
0
63,312
15,821,121
2013-04-04T20:30:00.000
5
0
0
1
1
python,python-idle
0
15,821,197
0
5
0
false
0
0
This will depend on OS and how IDLE is executed. To change the (default) CWD in Windows, right click on the Short-cut Icon, go to "Properties" and change "Start In".
2
33
0
0
So, I'm learning Python and would like to create a simple script to download a file from the internet and then write it to a file. However, I am using IDLE and have no idea what the working directory is in IDLE or how to change it. How can I do file system stuff in IDLE if I don't know the working directory or how to change it?
What's the working directory when using IDLE?
0
0.197375
1
0
0
63,312
15,855,468
2013-04-06T20:06:00.000
-1
0
0
0
0
python,django,e-commerce,django-oscar
0
22,601,474
0
4
0
false
1
0
You have to add atleast one product class /admin/catalogue/productclass/
1
5
0
0
I'm a beginner in Python and Django. I have installed django-oscar. Then I Configured it and started the server, it works. Now, I don't understand how to add a product? At the dashboard there is a button Create new product. But in order to add new product it asks to select product class and I can not find any product class in the given dropdown options. Provide me a demo example of how to add product in django-oscar.
Django Oscar. How to add product?
0
-0.049958
1
0
0
6,316
15,860,676
2013-04-07T09:04:00.000
0
0
1
0
0
python,html,django
0
15,902,133
0
1
0
false
1
0
You can send variables to the server using methods POST or GET. Perhaps you can get the right answer if you elaborate more or showing us some of your code.
1
0
0
0
Hey guys how do I get a variable name from HTML back into my python. So I have this variable {{file}} in my html which I need to pass back into the python file in order the function to work.
How do I get a variable name from HTML back into my python
0
0
1
0
0
87
15,864,762
2013-04-07T16:30:00.000
0
0
0
0
0
python,pyqt,pyqt4,resource-files
1
47,707,774
0
5
0
false
0
1
you could try with pyside as well like: --- pyside-rcc -o input.qrc output.py
2
15
0
0
I'm having trouble importing a resource file. I'm using pyqt4 with monkey studio and I am trying to import a png image. When I run the program I get an import error like ImportError: No module named icon_rc I know that I have to compile it using pyrcc4 but I don't understand how to do this can anybody help please. It would be very helpful to have an answer that fully explains how to compile the resource file so I can import it.
PYQT4 - How do I compile and import a qrc file into my program?
0
0
1
0
0
49,757
15,864,762
2013-04-07T16:30:00.000
5
0
0
0
0
python,pyqt,pyqt4,resource-files
1
44,592,514
0
5
0
false
0
1
In Pyqt5 this command can be used Pyrcc5 input_file.qrc -o Out_file.py We need to convert that qrc file into python file and then it can be imported to your code
2
15
0
0
I'm having trouble importing a resource file. I'm using pyqt4 with monkey studio and I am trying to import a png image. When I run the program I get an import error like ImportError: No module named icon_rc I know that I have to compile it using pyrcc4 but I don't understand how to do this can anybody help please. It would be very helpful to have an answer that fully explains how to compile the resource file so I can import it.
PYQT4 - How do I compile and import a qrc file into my program?
0
0.197375
1
0
0
49,757
15,870,130
2013-04-08T01:58:00.000
1
0
0
1
0
python,django,heroku,celery,django-celery
0
15,870,589
0
2
1
true
1
0
It depends on how much accuracy you need. Do you want users to select the time down to the minute? second? or will allowing them to select the hour they wish to be emailed be enough. If on the hour is accurate enough, then use a task that polls for users to mail every hour. If your users need the mail to go out accurate to the second, then set a task for each user timed to complete on that second. Everything in between comes down to personal choice. What are you more comfortable doing, and even more importantly: what produces the simplest code with the fewest failure modes?
1
0
0
0
I am trying to set up some scheduled tasks for a Django app with celery, hosted on heroku. Aside from not know how everything should be configured, what is the best way to approach this? Let's say users can opt to receive a daily email at a time of their choosing. Should I have a scheduled job that run every, say 5 minutes. Looks up every user who wants to be emailed at that time and then fire off the emails? OR Schedule a task for each user, when they set their preference. (Not sure how I would actually implement this yet)
How to queue up scheduled actions
0
1.2
1
0
0
169
15,873,307
2013-04-08T07:14:00.000
1
0
0
0
0
python,wxpython
0
15,888,610
0
2
0
false
0
1
I personally think that SetItems(listOfItems) is the quickest way of doing it and it works for several other widget types as well, such as ComboBox. The answer that Thomas mentions forces the developer to clear the widget and then Append individual items OR use AppendItems to add a list of items. Either way, that's a 2-step process compared with just using SetItems()
1
0
0
0
I was wondering how I fill a wxChoice with content at runtime. When creating the GUI I do not have the information of the content since it depends on the users what directory to choose. What am I doing? The user will have to select a directory from a wx.DirDialog. The event handler refers to a function that will search for files of certain type and the results will be returned as a list of strings. The list of strings should be used to fill/update the wx.Choice widget but I do not how to do this at runtime. Does anybody has a solution for this problem? Cheers Thomas
Fill wx.Choice at runtime
0
0.099668
1
0
0
477
15,879,911
2013-04-08T13:08:00.000
1
0
0
0
0
python,django,templates
0
15,879,987
0
1
0
true
1
0
You save the output of Person.objects.count() in a variable and pass it on to your template from the corresponding view.
1
2
0
0
Let's say I have a "Person" model. How can I display the number of persons in my system in a template? In standard code, I would do: Person.objects.count(). But how to do this in a template?
Access Model.objects methods from Django templates
0
1.2
1
0
0
1,519
15,883,110
2013-04-08T15:28:00.000
0
0
1
0
0
python,arguments
0
15,883,448
0
4
0
false
0
0
No, there is not more or less a "standard" approach to this.
1
0
0
0
This has probably been asked before, but I don't know how to look up the answer, because I'm not sure what's a good way to phrase the question. The topic is function arguments that can semantically be expressed in many different ways. For example, to give a file to a function, you could either give the file directly, or you could give a string, which is the path to the file. To specify a number, you might allow an integer as an argument, or maybe you might allow a string (the numeral), or you might even allow a string such as "one". Another example might be a function that takes a list (of numbers, say), but as a convenience, it will convert a number into a list containing one element: that number. Is there a more or less standard approach in Python to allowing this sort of flexibility? It certainly complicates the code for a program if you're not certain what types the arguments are, so my guess would be to try factor out the convenience functions into just one place, instead of scattered everywhere, but I don't really know how best to do that kind of factoring.
Flexible Arguments in Python
0
0
1
0
0
1,455
15,888,186
2013-04-08T20:19:00.000
1
0
0
1
1
python-2.7,python-3.x,python-idle
1
17,015,420
1
11
0
false
0
0
I had exactly the same issue :"IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I found the answer from this stackoverflow site. I created a file named string.py and that classhed with the normal python files. I removed the string.py and everything works now. Thanks folks.
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.01818
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
3
0
0
1
1
python-2.7,python-3.x,python-idle
1
17,843,247
1
11
0
false
0
0
Adding to existing answers - it is actually possible to have firewall block IDLE when not running with -n flag. I haven't used IDLE for a few months and decided to try if it works properly with newly installed python3.3 (on Linux Mint 13 x86). In between I made iptables setup much more aggressive and apparently it blocked idle-python3.3 from connecting to the Python RPC server. Sometimes it is just what the message says.
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.054491
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
1
0
0
1
1
python-2.7,python-3.x,python-idle
1
20,869,245
1
11
0
false
0
0
I had the same error message. Error not seen after I added all the *.exe filea to be found in the Python install directory to the Windows firewall exception list.
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.01818
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
5
0
0
1
1
python-2.7,python-3.x,python-idle
1
21,956,824
1
11
0
false
0
0
Look for files on your main python folder that you may create in names like "threading.py", "tkinter.py" and other names that overlapps with your Lib folder and move/delete them
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.090659
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
1
0
0
1
1
python-2.7,python-3.x,python-idle
1
22,885,631
1
11
0
false
0
0
I finally got it to work when I disabled ALL firewalls and antivirus, because some antivirus ALSO have firewall control. Ex. avast
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.01818
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
1
0
0
1
1
python-2.7,python-3.x,python-idle
1
31,248,725
1
11
0
false
0
0
Using Windows 7 64 installation of Python 2.7.10 Shell I solved the above problem by opening the program as an administrator.
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.01818
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
0
0
0
1
1
python-2.7,python-3.x,python-idle
1
37,479,563
1
11
0
false
0
0
i have the Same issue on os win7 64Bit and Python 3.1 and find a workaround because i have a Project with many .py files and just one gave this error. - Workaround is to copy a working file and copy the contents from not working file to working file. (i used Another editor as idle. The Problem with that workaround is... of you rename the file it doenst work. attention just rename the not working file doesnt work for me. just that copy paste. – john
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
0
0
0
1
1
python-2.7,python-3.x,python-idle
1
42,023,097
1
11
0
false
0
0
I came across this problem too. There are two things you can do You may already have a process running call pythonw.exe which prevents IDLE from being starting. End that task and try running IDLE again Use pythonwin or python command line
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
1
0
0
1
1
python-2.7,python-3.x,python-idle
1
27,731,044
1
11
0
false
0
0
Remove copy.py in your folder if you happen to have one
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
0.01818
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
14
0
0
1
1
python-2.7,python-3.x,python-idle
1
16,003,884
1
11
0
false
0
0
I had this same problem today. I found another stack overflow post where someone had a tkinter.py file in the same directory as python, and they fixed it by removing that tkinter.py file. When I looked in my python directory, I realized I had created a script called random.py and put it there. I suspect that it conflicted with the normal random module in python. When I removed this file, python started working again. So I would suggest you look in your main python directory and see if there are any .py files that you could move to different places.
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
1
1
0
0
72,468
15,888,186
2013-04-08T20:19:00.000
10
0
0
1
1
python-2.7,python-3.x,python-idle
1
24,211,913
1
11
0
false
0
0
I'm running Windows 7 64-bit. I saw the same errors today. I tracked down the cause for me, hopefully it'll help you. I had IDLE open in the background for days. Today I tried to run a script in IDLE, and got the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." errors. So I closed all IDLE windows, and tried to restart IDLE. That then caused the same errors to pop up, and now IDLE wouldn't open successfully. The cause was an extra pythonw.exe process running in the background. If I open up an instance of IDLE, then open a second, the second has issues connecting, and closes. But it does not close the instances of pythonw.exe that it opened, one is left running in the background. That extra instance then prevents future attempts to open IDLE. Opening up Task Manager and killing all pythonw.exe processes fixed IDLE, and now it functions properly on my machine (1 instance open at a time though!).
11
10
0
0
Resolved April 15, 2013. In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly. Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times. And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect. Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained. Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't. Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection
1
1
1
0
0
72,468
15,898,775
2013-04-09T09:51:00.000
0
1
0
0
0
google-app-engine,python-2.7,google-talk
0
15,903,171
0
2
0
false
0
0
I think you are confused. Python runs ON appengine. Also theres a working java xmpp example provided.
2
0
0
0
I searched a lot for built web service like Google Talk, using Google Application Engine and Python. For that first step is to check the status of online user on the Gmail. I found many code of it on python using XMPP library but it work only on python not using Google Application Engine. There is also suggestion of using XMPP python API but for sending message we have to provide JID like [email protected] and message send.We can not send message from one email Id to another Email Id directly. Now I want to perform Oauth authentication in python for gtalk at domain level can anyone tell me how to do this?
Gtalk Service On Google App Engine Using Python
0
0
1
0
1
323
15,898,775
2013-04-09T09:51:00.000
0
1
0
0
0
google-app-engine,python-2.7,google-talk
0
15,904,726
0
2
0
false
0
0
You can only send messages from your app. There are two options: [email protected] or anything@your_app_id.appspotchat.com. If you wanted to behave like an arbitrary xmpp client, you'll have to use a third party xmpp library running over HTTP and handle the authentication with the user's XMPP server.
2
0
0
0
I searched a lot for built web service like Google Talk, using Google Application Engine and Python. For that first step is to check the status of online user on the Gmail. I found many code of it on python using XMPP library but it work only on python not using Google Application Engine. There is also suggestion of using XMPP python API but for sending message we have to provide JID like [email protected] and message send.We can not send message from one email Id to another Email Id directly. Now I want to perform Oauth authentication in python for gtalk at domain level can anyone tell me how to do this?
Gtalk Service On Google App Engine Using Python
0
0
1
0
1
323
15,900,399
2013-04-09T11:16:00.000
0
0
1
0
0
python
0
15,900,584
1
2
0
true
0
0
At least on Arch Linux, and presumably on other distros, there are two separate packages for pip, which if both installed give you two different commands: pip and pip3. Running pip ... will always install to the Python 2 site-packages, and pip3 ... to the Python 3 site-packages. This works both for system-wide packages (running as root) or for installing them into your home directory.
1
1
0
0
I understand that we can install different version of Python on a same box - but there are packages that are not supported common to both. So if I have two version of Python(2.x and 3.x) installed how can I automatically have packages deployed correctly for each version of Python using pip?
Python site packages: How can I maintain for both 2.x and 3.x version
0
1.2
1
0
0
65
15,904,042
2013-04-09T14:02:00.000
135
0
1
0
0
python,graph,matplotlib,border
0
15,904,277
0
2
0
true
0
0
Set the edgecolor to "none": bar(..., edgecolor = "none")
1
75
1
0
I'm using pyplot.bar but I'm plotting so many points that the color of the bars is always black. This is because the borders of the bars are black and there are so many of them that they are all squished together so that all you see is the borders (black). Is there a way to remove the bar borders so that I can see the intended color?
matplotlib bar graph black - how do I remove bar borders
0
1.2
1
0
0
72,444
15,904,973
2013-04-09T14:40:00.000
2
0
1
0
0
python,security,memory-management
0
15,905,534
0
2
0
true
0
0
Unless you use custom coded input methods to get the password, it will be in many more places then just your immutable string. So don't worry too much. The OS should take care that any data from your process is cleared before the memory is allocated to another process. This may of course fail if the page is copied to disk (swapped out or hibernated). Secure password entry is not easy. Maybe you can find a special library or module that handles this.
2
5
0
0
Say i store a password in plain text in a variable called passWd as a string. How does python release this variable once i discard of it (for instance, with del passWd or passWd= 'new random data')? Is the string stored as a byte-array meaning it can be overwritten in the memoryplace that it originally existed or is it a fixed set in a memory area which can't be modified and there for when assining a new value a new memory area is created and the old area is discareded but not overwritten by null? I'm questioning how Python implements the safety of memory areas and would like to know more about it, mainly because i'm curious :) From what i've gathered so far, using del (or __del__) causes the interpreter to not release memory areas of that variable automaticly which can cause issues, and also i'm not sure that del is so thurrow on deleting the values. But that's just from what i've gathered and not something in black or white :) The main reason for me asking, is I'm intending to write a hand-over application that gets a string, does some I/O, passes it along to another subsystem (bootloader for raspberry pi for instance) and the interface is written in Python (how odd that must sound in some peoples ears..) and i'm not worried that the data is compromised during the I/O calculations but that a memory dump might be occuring in between the two subsystem handovers. or if the system is frozen (say a hiberation) say 20min after the system is booted and i removed the variable as fast as i could, but somehow it's still in the memory despite me doing a del passWd :) (Ps. I've asked on Superuser, they refered me here aand i'm sorry for poor grammar!)
Python - Releasing/replacing a string variable, how does it get handled?
0
1.2
1
0
0
553
15,904,973
2013-04-09T14:40:00.000
0
0
1
0
0
python,security,memory-management
0
16,334,037
0
2
0
false
0
0
I finally whent with two solutions. ld_preload to replace the functionality of the string handling of Python on a lower level. One other option which is a bit easier was to develop my own C library that has more functionality then what Python offers through the standard string handling. Mainly the C code has a shread() function that writes over the memory area where the string "was" stored and some other error checks. However, @Ber gave me a good enough answer to start developing my own solution since (as he pointed out) there is no secure method in Python and python stores strings in way to many places and relies on the OS (which, on it's own isn't a bad thing except when you don't trust the OS you are installing your realtively secure application on).
2
5
0
0
Say i store a password in plain text in a variable called passWd as a string. How does python release this variable once i discard of it (for instance, with del passWd or passWd= 'new random data')? Is the string stored as a byte-array meaning it can be overwritten in the memoryplace that it originally existed or is it a fixed set in a memory area which can't be modified and there for when assining a new value a new memory area is created and the old area is discareded but not overwritten by null? I'm questioning how Python implements the safety of memory areas and would like to know more about it, mainly because i'm curious :) From what i've gathered so far, using del (or __del__) causes the interpreter to not release memory areas of that variable automaticly which can cause issues, and also i'm not sure that del is so thurrow on deleting the values. But that's just from what i've gathered and not something in black or white :) The main reason for me asking, is I'm intending to write a hand-over application that gets a string, does some I/O, passes it along to another subsystem (bootloader for raspberry pi for instance) and the interface is written in Python (how odd that must sound in some peoples ears..) and i'm not worried that the data is compromised during the I/O calculations but that a memory dump might be occuring in between the two subsystem handovers. or if the system is frozen (say a hiberation) say 20min after the system is booted and i removed the variable as fast as i could, but somehow it's still in the memory despite me doing a del passWd :) (Ps. I've asked on Superuser, they refered me here aand i'm sorry for poor grammar!)
Python - Releasing/replacing a string variable, how does it get handled?
0
0
1
0
0
553
15,958,980
2013-04-11T21:14:00.000
0
1
0
0
0
python,twitter
0
30,488,072
0
4
0
false
0
0
Twitter is set such that you can't retweet the same thing more than once. So if your bot gets such a tweet, it will be redirected to an Error 403 page by the API. You can test this policy by reducing the time between each run by the script to about a minute; this will generate the Error 403 link as the current feed of tweets remains unchanged.
2
0
0
0
I'm writing a simple Twitter bot in Python and was wondering if anybody could answer and explain the question for me. I'm able to make Tweets, but I haven't had the bot retweet anyone yet. I'm afraid of tweeting a user's tweet multiple times. I plan to have my bot just run based on Windows Scheduled Tasks, so when the script is run (for example) the 3rd time, how do I get it so the script/bot doesn't retweet a tweet again? To clarify my question: Say that someone tweeted at 5:59pm "#computer". Now my twitter bot is supposed to retweet anything containing #computer. Say that when the bot runs at 6:03pm it finds that tweet and retweets it. But then when the bot runs again at 6:09pm it retweets that same tweet again. How do I make sure that it doesn't retweet duplicates? Should I create a separate text file and add in the IDs of the tweets and read through them every time the bot runs? I haven't been able to find any answers regarding this and don't know an efficient way of checking.
How do I make sure a twitter bot doesn't retweet the same tweet multiple times?
0
0
1
0
1
2,022
15,958,980
2013-04-11T21:14:00.000
0
1
0
0
0
python,twitter
0
15,959,518
0
4
0
false
0
0
You should store somewhere the timestamp of the latest tweet processed, that way you won't go throught the same tweets twice, hence not retweeting a tweet twice. This should also make tweet processing faster (because you only process each tweet once).
2
0
0
0
I'm writing a simple Twitter bot in Python and was wondering if anybody could answer and explain the question for me. I'm able to make Tweets, but I haven't had the bot retweet anyone yet. I'm afraid of tweeting a user's tweet multiple times. I plan to have my bot just run based on Windows Scheduled Tasks, so when the script is run (for example) the 3rd time, how do I get it so the script/bot doesn't retweet a tweet again? To clarify my question: Say that someone tweeted at 5:59pm "#computer". Now my twitter bot is supposed to retweet anything containing #computer. Say that when the bot runs at 6:03pm it finds that tweet and retweets it. But then when the bot runs again at 6:09pm it retweets that same tweet again. How do I make sure that it doesn't retweet duplicates? Should I create a separate text file and add in the IDs of the tweets and read through them every time the bot runs? I haven't been able to find any answers regarding this and don't know an efficient way of checking.
How do I make sure a twitter bot doesn't retweet the same tweet multiple times?
0
0
1
0
1
2,022
15,969,213
2013-04-12T10:38:00.000
2
0
1
1
0
python,asynchronous,flask,gevent
0
15,970,840
0
2
1
false
0
0
How about simply using ThreadPool and Queue? You can then process your stuff in a seperate thread in a synchronous manner and you won't have to worry about blocking at all. Well, Python is not suited for CPU bound tasks in the first place, so you should also think of spawning subprocesses.
1
16
0
0
I have recently been working on a pet project in python using flask. It is a simple pastebin with server-side syntax highlighting support with pygments. Because this is a costly task, I delegated the syntax highlighting to a celery task queue and in the request handler I'm waiting for it to finish. Needless to say this does no more than alleviate CPU usage to another worker, because waiting for a result still locks the connection to the webserver. Despite my instincts telling me to avoid premature optimization like the plague, I still couldn't help myself from looking into async. Async If have been following python web development lately, you surely have seen that async is everywhere. What async does is bringing back cooperative-multitasking, meaning each "thread" decides when and where to yield to another. This non-preemptive process is more efficient than OS-threads, but still has it's drawbacks. At the moment there seem to be 2 major approaches: event/callback style multitasking coroutines The first one provides concurrency through loosely-coupled components executed in an event loop. Although this is safer with respect to race conditions and provides for more consistency, it is considerably less intuitive and harder to code than preemptive multitasking. The other one is a more traditional solution, closer to threaded programming style, the programmer only having to manually switch context. Although more prone to race-conditions and deadlocks, it provides an easy drop-in solution. Most async work at the moment is done on what is known as IO-bound tasks, tasks that block to wait for input or output. This is usually accomplished through the use of polling and timeout based functions that can be called and if they return negatively, context can be switched. Despite the name, this could be applied to CPU-bound tasks too, which can be delegated to another worker(thread, process, etc) and then non-blockingly waited for to yield. Ideally, these tasks would be written in an async-friendly manner, but realistically this would imply separating code into small enough chunks not to block, preferably without scattering context switches after every line of code. This is especially inconvenient for existing synchronous libraries. Due to the convenience, I settled on using gevent for async work and was wondering how is to be dealt with CPU-bound tasks in an async environment(using futures, celery, etc?). How to use async execution models(gevent in this case) with traditional web frameworks such as flask? What are some commonly agreed-upon solutions to these problems in python(futures, task queues)? EDIT: To be more specific - How to use gevent with flask and how to deal with CPU-bound tasks in this context? EDIT2: Considering how Python has the GIL which prevents optimal execution of threaded code, this leaves only the multiprocessing option, in my case at least. This means either using concurrent.futures or some other external service dealing with processing(can open the doors for even something language agnostic). What would, in this case, be some popular or often-used solutions with gevent(i.e. celery)? - best practices
Python async and CPU-bound tasks?
1
0.197375
1
0
0
6,728
15,972,941
2013-04-12T13:42:00.000
0
1
1
0
0
jpeg,python-imaging-library,uninstallation,raspberry-pi
1
16,268,144
0
1
0
true
0
0
You can do this to re-install PIL pip install -I PIL
1
0
0
0
Hi i am getting an error "IOError: decoder jpeg not available" when trying to implement some functions from the PIL. What i would like to do is remove PIL, install the jpeg decoder then re-install the PIL, but im lost as to how to uninstall the PIL? Any help would be greatly appreciated
Remove PIL from raspberry Pi
0
1.2
1
0
0
429
15,982,612
2013-04-12T23:50:00.000
0
0
1
0
0
python,path,enthought
0
15,995,409
0
4
0
false
0
0
The problem described also occurs in a Win 7 Canopy installation. I tried to place files to be imported in several of the locations provided in sys.path(). ['', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\User\Scripts\python27.zip', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\DLLs', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\plat-win', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\lib-tk', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\User', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\User\lib\site-packages', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System\lib\site-packages', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System\lib\site-packages\PIL', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System\lib\site-packages\win32', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System\lib\site-packages\win32\lib', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\System\lib\site-packages\Pythonwin', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\site-packages', 'C:\Users\Owner\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\site-packages\IPython\extensions'] The only solution I found was to use: sys.path.append()
2
3
0
0
Running Enthought Canopy appears to de-activate the normal .profile PATH information (OS X) for python programs run within the Canopy environment. I need to make locations searchable for user files. How to do this is not explained in the user manual. There are several possible places to enter such information (eg the two 'activate' files) but adding extra PATH information in them has no effect. So how is it done? DN
Enthought Canopy: how do I add to the PATH?
0
0
1
0
0
6,880
15,982,612
2013-04-12T23:50:00.000
1
0
1
0
0
python,path,enthought
0
16,281,145
0
4
0
false
0
0
On Mac OSX 10.6.8 this worked % launchctl setenv PYTHONPATH /my/directory:/my/other/directory then launch Canopy and you should see /my/directory and /my/other/directory on sys.path
2
3
0
0
Running Enthought Canopy appears to de-activate the normal .profile PATH information (OS X) for python programs run within the Canopy environment. I need to make locations searchable for user files. How to do this is not explained in the user manual. There are several possible places to enter such information (eg the two 'activate' files) but adding extra PATH information in them has no effect. So how is it done? DN
Enthought Canopy: how do I add to the PATH?
0
0.049958
1
0
0
6,880
15,990,889
2013-04-13T17:43:00.000
0
0
0
1
0
python,google-app-engine,google-chrome,pycharm,webapp2
0
30,849,574
0
1
0
true
1
0
It turns out that this wasn't a refresh or caching issue but a timing issue. Under some circumstances, GAE uses an update algorithm that incurs a delay before transactions are applied. In Run mode, the new page was being requested before the update was completed; in Debug mode, enough time passed for the update to be completed. One solution would have been to change the datastore architecture to eliminate reading an obsolete version of the data, but that caused other, more serious problems. Another solution was to include a split-second delay, after an update but before displaying the updated record. Not ideal, since it's impossible to know how long that delay has to be, but for now this has been satisfactory.
1
1
0
0
I'm writing a GAE webapp using Python 2.7, webapp2, and Jinja. In development, I run the app under PyCharm 2.7.1 on a Max OSX 10.7.5 (Lion). I'm currently using Chrome 26.0.1410.43 as my browser. I don't know for sure that this is a PyCharm issue, but that's my best guess. Here's a description: When I use the "Debug" control to start the app, webpages refresh automatically as I navigate from one page to another. That is, if I start at page A, navigate to page B, take some action that changes what A should look like, and navigate back to A, the change appears. However, when I use the "Run" control to start the app, with no other changes, webpages do not automatically refresh. In that same scenario, when I navigate back to A, the old version of that webpage appears. I need to click my browser's Refresh control to see the updated page. Please tell me how to stop the browser from displaying cached pages in Run mode. I haven't tried publishing this to our GAE website yet, and hopefully it won't happen there, but I need Run mode for performance on the video tutorial I'm creating. Thanks for any suggestions!
In PyCharm, webpages refresh in debug mode, not in run mode
0
1.2
1
0
0
550
16,001,064
2013-04-14T15:58:00.000
0
0
0
0
0
c#,python,buffer
0
16,002,014
0
1
0
false
0
0
I'd create a log file on the HDD and put in the last recorded data and time. Then just read it out when needed again.
1
0
0
0
I've a client (currently in C#, a python version in progress) which gets computer data such as CPU %, disk space etc. and sends it to a server. I don't know how to manage if my client looses connection with the server. I have to continue collecting information but where to stock them? Just a buffer? Is using a log file a better solution? Any ideas?
How to store datas while connection is lost?
0
0
1
0
1
57
16,009,440
2013-04-15T07:03:00.000
0
0
1
0
0
python,c
0
16,009,488
0
1
0
false
0
0
A simple implementation is to use a preallocated buffer and a counter for the number of elements. When the buffer is filled up and you want to append element, then you allocate a bigger buffer (e.g. twice as big) and copy the old one's data into the new one. Thus the append operation is not strictly O(1), but it's amortized O(1), namely on average it's O(1).
1
0
0
0
How are the lists implemented in python? I mean how is it possible to append an element in constant time and also get an item in constant time? Can anyone please tell how to do it in C?
Python list implementation
0
0
1
0
0
937
16,013,843
2013-04-15T11:19:00.000
7
0
1
0
0
python,python-import
0
16,013,905
0
1
0
true
0
0
Since it is a mapping, there can be no identically named modules in sys.modules. That is the point. If use the statement import foo and sys.modules['foo'] exists, that module is returned. No file access is needed, no top-level code for that module needs to be run. If foo is not present, then the sys.path determines where foo is going to be found first. That value is a list, so it has order, and the search for the foo module is conducted according to that ordering.
1
1
0
0
When Python wants to import a module it is first going to look in sys.modules. But since the key-value pairs of dictionaries are not in a fixed order, how can you ever know for certain which of two identically named modules in sys.modules will be imported first?
Why was sys.modules chosen to be a dictionary?
0
1.2
1
0
0
92
16,016,645
2013-04-15T13:38:00.000
1
1
0
0
0
php,python-2.7
0
16,016,728
0
1
0
false
0
0
If you have access to exec, you can run the python interpreter. However, that's: Overkill Not necessarily wise A major waste of resources If your logic is simple, why don't you write it in PHP? Furthermore, if your logic is not simple...why don't you make an API of some sort to access it and favour communication rather than code deduplication?
1
0
0
0
I want to implement one logic which is written in python, this code will do some searching stuffs, and I have a website done in PHP. can any one tell me whether I can include python script in PHP? if yes , how can I do that ? Criteria : Input to the python script will come from php or html [either text or file]. and output of python is directly displayed to the page or through php or store it in mysql and show it through PHP.[Please suggest me the best one in this].
Can Python Script be included in PHP?
0
0.197375
1
0
0
69
16,018,995
2013-04-15T15:25:00.000
1
0
0
0
0
python,postgresql,openerp,erp
0
16,029,533
0
1
0
false
1
0
Install hr_payroll module. Flow is as below: Employee --> Contracts --> Salary Structure --> Salary Rules In Contract, You can set Working Schedule for that employee with Wage. You need to configure Salary Structure with Salary Rules as per your need. Salary rules for Bonus, expenses, etc. In that Salary structure, You need to add that rules. Now, go to the Employee Payslip menu, select that employee, Related information will be automatically come over there. Click on Compute sheet button. You will get Salary details in Salary Computation tab as per your Salary rules that you added in your Salary Structure. For now, there is no link between attendance and payroll in OpenERP that you need to customize. It depends on requirements that how much time it will take for that! Hope this will help you.
1
1
0
0
In our company we decided to use openERP We now working to customize openERP with our work ... we can use it successfully in warehouse dept. and sallies dept. My question is how to make openERP calculate monthly Net Salary with deduct if the Employee absence or leave the work or if we decided to add bonus and if we can programming new model and add it How this difficult to work and what about expected time required to do OR how we can access to fields related with attendance and building our own program to calculate Net Salary ?
Can we calculate Net Salary with openERp
0
0.197375
1
0
0
1,340
16,026,129
2013-04-15T23:09:00.000
1
0
1
1
0
ipython,qtconsole
0
16,066,204
0
1
0
true
0
0
No, it's not really in sight. The Qt console has some support for control characters, so it can do things like coloured text, but it's definitely not enough to support curses, and we're not really interested in going down that route. The code is all in the open if you want to try to make it into a full terminal emulator. But I rather hope there are better starting points for terminal emulators in Windows.
1
0
0
0
I have been trying all sorts of sourceforge projects that try to port GNU functionality to Windows, with the goal to create a very GNU aware Ipython profile providing the best terminal environment I know how (on Windows that is). How close is QtConsole to having the ability of running something like Curses through the IpyQt frontend? (The key here, is that I want the DPI aware rich text of QtConsole. Would knock the socks off most of the Windows terminal alternatives.) Is that possibility even in sight, or is that a match that will likely not happen? I have never emulated a VT100 in my spare time, how much does QtConsole look like one?
Ipython and Curses on Windows
0
1.2
1
0
0
125
16,026,776
2013-04-16T00:21:00.000
3
0
0
0
0
python,web2py
1
16,026,857
0
1
0
true
1
0
web2py keeps the structure it thinks the table has in a separate file. If someone has manually dropped the table, web2py will still think it exists, but of course you get an error when you try to actually use the table Look for the *.mytable.table file in the databases directory
1
2
0
0
I have an error no such table: mytable, even though it is defined in models/tables.py. I use sqlite. Interesting enough, if I go to admin panel -> my app -> database administration then I see a link mytable, however when I click on it then I get no such table: mytable. I don't know how to debug such error? Any ideas?
web2py. no such table error
0
1.2
1
1
0
1,115
16,034,823
2013-04-16T10:34:00.000
0
0
0
1
0
python,qt4,pyqt,qprocess
0
69,134,278
0
3
0
false
0
0
pid() function is provided to keep old source code working. Use processId() instead. Returns the native process identifier for the running process, if available. If no process is currently running, 0 is returned. Note: Unlike processId(), pid() returns an integer on Unix and a pointer on Windows.
1
3
0
0
Is there some way to read the PID of a process started with QProcess.start(...)? QProcess::pid() returns sip.voidptr and there's not much I can do with it (or I don't know how). I want to have the PID to have the possibility to make the window active later on.
get PID of QProcess with python on windows
0
0
1
0
0
859
16,055,489
2013-04-17T08:44:00.000
0
0
0
0
0
python,django,ironmq
0
16,065,078
0
3
0
false
1
0
There are few interesting options. As example, you can add additional reupload workers step for deploy process. It'll guarantee consistence between deployed application and workers. Using own (rest) api is great idea, i like it even more than sharing models between different beings
2
0
0
0
My question is about web application architecture. I have a website, my users can upload files and from this files I need to create some kind of reports for users. When user upload file it stored on my server where website hosted. File path stored in Django model field. Worker is on another server and i need to get access to my database and procces that file. I know how to use django ORM itself without URLs and other parts of django. My question: If I need to create workers on another server, which use different django models from my website i need to copy all of the models into every worker? For example, one worker proccess file and it need models "Report" and "User". Other worker do other actions and need "User" and "Link" models. Everytime i change model in my main website i need to change same models in my workers, also different workers can have same duplicate models. I think it's not good from architecture point. Any suggestions on how to organize my website and workers?
File upload and store, then proccessing with remote worker
0
0
1
0
0
229
16,055,489
2013-04-17T08:44:00.000
0
0
0
0
0
python,django,ironmq
0
16,055,809
0
3
0
false
1
0
Why do you really need the exact same models in your workers? You can design the worker to have a different model to perform it's own actions on your data. Just design API's for your data and access it separately from your main site. If it really necessary, Django app can be shared across multiple projects. So you can just put some generic code in a separate app (like your shared models) and put them in sourcecontrol. After an update in your main website, you can easily update the workers also.
2
0
0
0
My question is about web application architecture. I have a website, my users can upload files and from this files I need to create some kind of reports for users. When user upload file it stored on my server where website hosted. File path stored in Django model field. Worker is on another server and i need to get access to my database and procces that file. I know how to use django ORM itself without URLs and other parts of django. My question: If I need to create workers on another server, which use different django models from my website i need to copy all of the models into every worker? For example, one worker proccess file and it need models "Report" and "User". Other worker do other actions and need "User" and "Link" models. Everytime i change model in my main website i need to change same models in my workers, also different workers can have same duplicate models. I think it's not good from architecture point. Any suggestions on how to organize my website and workers?
File upload and store, then proccessing with remote worker
0
0
1
0
0
229
16,059,476
2013-04-17T12:02:00.000
4
0
1
0
0
python,pyc
0
16,059,584
0
3
0
false
0
0
They are cross platform, but not cross-version and not cross-implementation. In other words, different CPython versions could have trouble with one and the same .pyc file. And if you look at other implementations such as PyPy, IronPython, Jython etc., you won't have any luck with .pyc files at all. Besides, .pyc files correspond to one .py file. What you (probably) have in mind are libraries which include a part written in C. They must be compiled to platform-dependent files (.pyd, .dll, .so, etc.) in order to work. As not many developers have all supported platforms available, they provide it as source and leave it to the user's system to compile it.
2
6
0
0
If I am right in understanding, Python compile files are cross platform. So why are most libraries released requiring a build and install? Is it laziness on the part of the distributer, or am I wrong in saying they could simply distribute the pyc files? If this isn't the case, how do I distribute a python script file that has libraries as prerequist without requiring the user to build and install the libraries?
Why are python libraries not supplied as pyc?
0
0.26052
1
0
0
1,400
16,059,476
2013-04-17T12:02:00.000
0
0
1
0
0
python,pyc
0
16,059,746
0
3
0
false
0
0
The process of creating a .pyc file from a .py file is done transparently by the interpreter. The reason some installers generate them at install time is purely to avoid them having to be generated the first time the script is run - usually for speed reasons, but also so that the .pyc can end up in a system-wide (non-user-writable) directory. Unlike compiled languages, or even Python modules written in C, it is not a technical requirement that these files exist in the first place - if it was, you wouldn't be able to put your own scripts directly into python and have them run without a compile step. Any library that strictly requires a build step before it is installed certainly has a component that compiles to native code - which certainly isn't cross-platform. For any pure-python library, it is always sufficient to put the module's source directory tree somewhere in your PYTHONPATH, having copied it directly from the archive you downloaded it in.
2
6
0
0
If I am right in understanding, Python compile files are cross platform. So why are most libraries released requiring a build and install? Is it laziness on the part of the distributer, or am I wrong in saying they could simply distribute the pyc files? If this isn't the case, how do I distribute a python script file that has libraries as prerequist without requiring the user to build and install the libraries?
Why are python libraries not supplied as pyc?
0
0
1
0
0
1,400
16,068,644
2013-04-17T19:33:00.000
1
0
0
0
0
python,redis,persistence,reload
0
16,069,631
0
1
0
false
0
0
You can stop redis and replace dump.rdb in /var/lib/redis (or whatever file is in the dbfilename variable in your redis.conf). Then start redis again.
1
2
0
0
I understand how to save a redis database using bgsave. However, once my database server restarts, how do I tell if a saved database is present and how do I load it into my application. I can tolerate a few minutes of lost data, so I don't need to worry about an AOF, but I cannot tolerate the loss of, say, an hour's worth of data. So doing a bgsave once an hour would work for me. I just don't see how to reload the data back into the database. If it makes a difference, I am working in Python.
How to load a redis database after
0
0.197375
1
1
0
1,375
16,089,089
2013-04-18T17:04:00.000
91
0
1
0
0
python,markdown,ipython,mathjax
0
53,228,544
0
7
0
false
0
0
Put two backslashes in front of dollar signs. For example: Some prices: \\$3.10, \\$4.25, \\$8.50. (running Jupyter notebook server 5.7.0)
4
52
0
0
I have a markdown cell in iPython that contains four dollar signs. iPython interprets anything between dollar signs as a MathJax expression, which is not what I want. How do I escape the dollar signs? Escaping them with a backslash prevents MathJax from kicking in, but the backslash shows in the compiled Markdown. ANy ideas on how to get just the dollar sign? Thanks
Escaping dollar sign in ipython notebook
0
1
1
0
0
38,570
16,089,089
2013-04-18T17:04:00.000
7
0
1
0
0
python,markdown,ipython,mathjax
0
16,095,493
0
7
0
false
0
0
If you use <span>$</span>, MathJax won't process it as a delimiter. You should be able to enter that in Markdown. For example, I've used that here: $ This is not math $.
4
52
0
0
I have a markdown cell in iPython that contains four dollar signs. iPython interprets anything between dollar signs as a MathJax expression, which is not what I want. How do I escape the dollar signs? Escaping them with a backslash prevents MathJax from kicking in, but the backslash shows in the compiled Markdown. ANy ideas on how to get just the dollar sign? Thanks
Escaping dollar sign in ipython notebook
0
1
1
0
0
38,570
16,089,089
2013-04-18T17:04:00.000
11
0
1
0
0
python,markdown,ipython,mathjax
0
29,808,632
0
7
0
false
0
0
You can escape $ with math mode by using a backslash. Try $\$$
4
52
0
0
I have a markdown cell in iPython that contains four dollar signs. iPython interprets anything between dollar signs as a MathJax expression, which is not what I want. How do I escape the dollar signs? Escaping them with a backslash prevents MathJax from kicking in, but the backslash shows in the compiled Markdown. ANy ideas on how to get just the dollar sign? Thanks
Escaping dollar sign in ipython notebook
0
1
1
0
0
38,570
16,089,089
2013-04-18T17:04:00.000
3
0
1
0
0
python,markdown,ipython,mathjax
0
38,617,452
0
7
0
false
0
0
I'm aware that this topic is old, but it's still somehow the first google result and its answers are incomplete. You can also surround the $ with `backticks`, the same way that you would display code in Jupyter. So $ becomes `$`, and should display without error
4
52
0
0
I have a markdown cell in iPython that contains four dollar signs. iPython interprets anything between dollar signs as a MathJax expression, which is not what I want. How do I escape the dollar signs? Escaping them with a backslash prevents MathJax from kicking in, but the backslash shows in the compiled Markdown. ANy ideas on how to get just the dollar sign? Thanks
Escaping dollar sign in ipython notebook
0
0.085505
1
0
0
38,570
16,092,153
2013-04-18T20:09:00.000
1
0
1
0
0
python
0
16,092,297
0
5
0
false
0
0
There is a simple solution to this problem, however there are also much faster solutions which you may want to look at after you've implemented the simple version. What you want to be doing is checking each position in the string you're search over and seeing if the string you're searching for starts there. This is inefficient but works well enough for most purposes, if you're feeling comfortable with that then you may want to look at Boyer-Moore string searching, which is a much more complex solution but more efficient. It exploits the fact that you can determine that if a string doesn't start at a certain point you may not need to check some of the other positions.
1
3
0
0
I wish to create a 'find' procedure myself, which is capable of finding a sub-string in a string and it also should be able to read a string backward and give position of match- just like the original find function in python. I am unable to figure out what logic should I use- also I don't know how the original find functions? I just started to use python and am fairly new to programming as well. Any guidance shall be highly appreciated!
How does find procedure work in python
0
0.039979
1
0
0
1,649
16,120,717
2013-04-20T13:06:00.000
1
0
0
0
0
python,html,web-applications,cgi
0
16,121,984
0
2
0
false
1
0
First you will need to understand HTTP. It is a text based protocol. I assume by "web site" you mean User-Agent, like FireFox. Now, your talking about an input box, well this will mean that you've already handled an HTTP request for your content. In most web applications this would have been several requests (one for the dynamically generated application HTML, and more for the static css and js files). CGI is the most basic way to programmatically inspect already parsed HTTP requests and create HTTP responses from objects you've set. Now your application is simple enough where you can probably do all the HTTP parsing yourself to gain a basic understanding of what's going on, but you will still need to understand how to develop a server that can listen on a socket. To avoid all that just find a Python application server that has already implemented all of the above and much more. There are many python application servers to choose from. Use one with a small learning curve for something as simple as above. Some are labeled as "micro-frameworks" in this genre.
1
0
0
0
I have zero experience with website development but am working on a group project and am wondering whether it would be possible to create an interaction between a simple html/css website and my python function. Required functionality: I have to take in a simple string input from a text box in the website, pass it into my python function which gives me a single list of strings as output. This list of strings is then passed back to the website. I would just like a basic tutorial website to achieve this. Please do not give me a link to the CGI python website as I have already read it and would like a more basic and descriptive view as to how this is done. I would really appreciate your help.
How to Combine Html + CSS code with python function?
1
0.099668
1
0
0
3,480
16,122,228
2013-04-20T15:50:00.000
0
0
1
0
0
python,json,api
0
16,122,376
0
2
0
false
0
0
Suppose all transactions contain the same structure, it is perfectly fine to use a for item in json_tuple to deal with the transactions. It all really depends on what you want to do with the data set.
1
0
0
0
Hy, still a python beginner, I am looking for help pointing me in the right direction: I am trying to build sort of a database of api answers from bitstamp listing the transactions on bitstamp. The api-call gives all transactions in a time frame, output is json. After processing the api output with json.loads() output can be no transaction: [] one transaction: {'key':'value',....} many transactions: {'key':'value',....} {'key':'value',....} {'key':'value',....} As I understand this: ok: if x=='[]':return ok: for key in x: print(x[key]) seems to be a tuple. dont know how to deal with, I would like to make as many dictionarys out of the transactions-tuple as there are. So sort of for every tuple make dict[x] with tuple in it. I know some mysql, in the end I want to have a table with one transaction per line, sorted chronologically, so i can build a chart of the transaction prices or some sort of 2-dimensional array, that i can acces by array[x][y]. I dont aks for a complete solution, just a short idea how it could/should be done, so I can start my way through the tutorials :) p.s.: reason for json.load is, that the native output is like [{key:value, ..} {key:value,...}]
Json output with none, one or many dictionaries in a tubple - best way to manipulate? (Bitstamp transaction list)
0
0
1
0
0
144
16,125,352
2013-04-20T21:25:00.000
0
0
0
0
0
python,django
0
32,982,612
0
2
0
false
1
0
yeah, like Daniel said, so I add the next posted = [{k.replace('person__',''):v} for k, v in request.POST.items() if k.startswith('person__')] then I can use a model form with posted data
1
0
0
0
I have a form on my site that allows the user to add names to an object. The user can hit a plus button to add another name or a minus button to remove a name. I need to be able to easily pull all POST variables that start with a name. For example. A user adds two names so we have two text boxes names 'name0' and 'name1'. Is there a way that I can pull those two values without know how many I may have? One reason I want to do this without knowing is because they could do any number of add and remove functions on the list of names. So I could end up with this: 'name2', 'name10', 'name11' for the names that come in. I don't want to have to know the exact values. I just want to pull all POST variables that start with 'name'. Is this possible?
Getting POST values from a Django request when they start with the same string
1
0
1
0
0
1,678
16,131,781
2013-04-21T13:44:00.000
0
0
0
0
1
.net,com,interop,ironpython
1
16,272,641
0
1
0
true
0
1
This is just for anyone who ever runs into this question with a similar problem - the problem was that the parameters of the functions were of type out and ref in C#. The function could not be invoked because there was no corresponding function signature. I had to use clr.Reference[] to explicitly create references for the function parameters. I guess when using an external COM objects one should stop thinking python and start thinking .net or C#...
1
0
0
0
Im trying to write an IronPython app that uses a COM object interface. I manage to import it using clr.AddReference, and manage also to call some of the functions, create objects, etc. However at a certain point when trying to call a function I get : StandardError: Error while invoking GetK300RZ. (GetK300RZ being the function name.) Why is this happening to me? What does this error mean exactly? could this be related to the 'embed interop types' option? I would greatly appriciate any insight as to how to get around this problem... Thanks
IronPython - error while invoking
0
1.2
1
0
0
126
16,139,169
2013-04-22T03:54:00.000
0
0
0
0
0
python,django
0
16,141,722
0
1
0
true
1
0
There are several ways to determine user activity: 1) Use javascript to send periodic requests to server. +: You will be able to determine user activity despite he actively working on site or just keep open window. -: Too many requests. 2) Use django middleware -: Can`t determine user activity if he keeps only open window 3) Use asynchronous framework to keep long-lived connection. For example tornado. It is cleanest way but the most labor-intensive.
1
0
0
0
Is there a way to see if a user is currently logged in and active on a site? For example, I know you can check the authentication token of the user and see if he is still 'actively logged in', but this doesn't tell me much, since the user could technically be logged in for two weeks, though only actively on the site for one minute of that duration. last_login would be equally unhelpful. What would be a good method in django to check to see if the user is currently active? I have done this in Google Analytics, but was wondering how I could do an entirely-django approach.
How to determine if user is currently active on site in Django
0
1.2
1
0
0
799
16,142,113
2013-04-22T08:00:00.000
2
0
1
0
0
python,encryption,tkinter
0
16,146,593
0
5
0
false
0
1
You don't need, or even want, complex encryption for passwords--and what you are describing is a password, not a key (it just grants access, it doesn't encrypt the data). Current best practice is to store passwords salted and hashed. That is, when the user creates a new account and enters a password, you build a string from the password plus user name plus a "salt" (which is just a small string that's the same for everyone on your site--this is to thwart rainbow table attacks). Then you run that string through a good hash algorithm--something like SHA1 is fine (even MD5 is more than adequate, despite reports to the contrary). You certainly don't need anything like AES. Anyway, now that you have a hash, you store the hash in the database, and not the password. Even a strong cipher like AES is useless if don't do the rest right. Next time the user logs in, you do the same: add his password to user name and salt, hash that, and compare the hash to what's stored. There's no way, even in principle, for you to know what his password was, so no way for an attacker to find it even if they get your database and know your algorithm and salt.
1
1
0
0
issue I am writing an application in python. It takes care of contacts and other information about a person. I want to prompt the user for a master key every time that he/she wants to perform a major operation. I have everything figured out. The whole application is ready and works well. But I store the master key in a file. This file is easily readable in the plain text form. And my friends who tried using this said that the software is useless if I don't apply a strong encryption algorithm as users would simply trust the application with the details that can be easily stolen. goal To store the master key in a form that can be deciphered (or read) only by my program. other things there is an option for the user to change the master key. The master key will be read and deciphered only once. At the start of the program. It will be stored in a variable then and and used from this variable. It is a GUI application. And I am using python Tkinter. details Please note that the data is stored using another encryption that is not un breakable but enough for this kind of information. I have not used any database to store the information. The only data to be encrypted is a master key. It is an alphanumeric string of length anywhere from 7 to 80 characters. specs 1. Python 2.7 2. Tkinter 8.5 3. Linux Mint 14
Encryption -- how to do it
0
0.07983
1
0
0
859
16,145,516
2013-04-22T07:12:00.000
11
0
1
0
0
python,windows
0
16,145,517
0
2
0
false
0
0
This is the wrong way to go about performing action at system shutdown time. The job of the shutdown process is to stop running processes and then switch off power; if you try to detect this happening from within your program and react by getting some last action in, it's a race between the OS and your program who gets to go first. More likely than not your program will have been stopped before it managed to perform the necessary action. Instead, you should hook into the normal protocol for doing things at shutdown. This will tell the shutdown utility to send an explicit signal to your program and wait for it to be acknowledged, which gives you enough time (within reason) to do what you have to do. How exactly to register to be notified varies with the OS, so this is more of an OS-specific question rather than a Python question.
1
6
0
0
I have a Python script that runs in a loop regularly making adjustments to my lighting system. When I shut down my computer, I'd like my script to detect that, and turn off the lights altogether. How do I detect my computer beginning to shut down in Python? Or, assuming Windows sends Python a "time to shut down" notice, how do I intercept that to kill my lights and exit the loop?
Detecting computer/program shutdown in Python?
0
1
1
0
0
7,003
16,148,872
2013-04-22T13:51:00.000
6
0
1
1
0
python,powershell,python-2.7
0
16,150,017
0
2
0
true
0
0
I just solved this issue after nearly pulling my hair out. Thought I would share. In windows system > advanced system settings > environment variables there are two places to change the PATH, user variables and system variables. I added ";c:\python27" as the value for PATH in both. It now works
2
0
0
0
I am trying to get python.exe to run in interactive mode in windows powershell. I have added c:\python27 to my PATH and when I type "python" in into the shell a new command prompt window opens running python, rather than running within powershell. This is a problem as when I run things like "python --version" it launches the new command prompt window and then closes before I can read it. Does anyone know how to get python to run in powershell? Note: this used to work before I started to install pip, easy_install and virtualenv this morning. Thanks
Python will not run in windows powershell
0
1.2
1
0
0
7,079
16,148,872
2013-04-22T13:51:00.000
0
0
1
1
0
python,powershell,python-2.7
0
16,149,638
0
2
0
false
0
0
I'm not expert in PS, but when I need to use python in interactive mode in windows powershell, I use something like this (version of python is 2.7.3, I didn't change env variables): PS C:\Python27> ./python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
2
0
0
0
I am trying to get python.exe to run in interactive mode in windows powershell. I have added c:\python27 to my PATH and when I type "python" in into the shell a new command prompt window opens running python, rather than running within powershell. This is a problem as when I run things like "python --version" it launches the new command prompt window and then closes before I can read it. Does anyone know how to get python to run in powershell? Note: this used to work before I started to install pip, easy_install and virtualenv this morning. Thanks
Python will not run in windows powershell
0
0
1
0
0
7,079
16,151,665
2013-04-22T16:08:00.000
1
0
0
0
0
python,flash,bots
0
16,154,217
0
1
0
false
0
0
I'd try saving the button you have to click as a pic, then scan your entire screen and use PIL to match the pic you saved to the button you have to press; from there you should be able to retrieve the coordinates.
1
0
0
0
I got a bot in Python that I've made to simulate a player playing a flash web game. The thing is, I've used an approach that requires specific screen coordinates to work, and there is a pop-up I need to click to advance to the next state that seems to appear in random positions every time it shows up. Do you know how to "detect" where the popup is?. Thanks.
How to make this bot work?
0
0.197375
1
0
0
253
16,152,515
2013-04-22T16:53:00.000
0
0
1
0
0
python-3.x,symbian3,s60-3rd-edition
0
22,061,960
0
1
0
false
0
0
With Symbian there is something called platform security, and from it there is something called data caging which is preventing access to the executable folders and some other ones as well, thus there are not really possibilities on 3rd party supplying such an application, and therefor I would suppose there would not be application with this kind of functionality available.
1
0
0
0
in Symbian 2nd Version, there's a software called Sisboom which works with python, with Sisboom it was possible to get the installer file of already installed software, now i've Symbian 3rd Version, and i got the same software, and i'm unbale to do the same, please help...
how to pack already installed software in symbain 3rd version?
1
0
1
0
0
90
16,163,085
2013-04-23T07:09:00.000
1
0
1
0
0
python,virtualenv,pip
0
16,164,433
0
1
0
false
0
0
In reality, there is a more severe danger: pip downloads packages via plain HTTP, end even if you force it to use HTTPS, it can not check id the certificate is valid (since Python stdlib does not have the functionality either). That is someone in the middle can mask the expected package with something that you will readily install (sometimes with sudo). That's why in production environment it is anyway a good idea to install only separately downloaded and already checked packages.
1
3
0
0
We heavily use virtualenv and pip in our build system to isolate our Python deliveries. Everything is fully automated and was working fine until now. A couple of days ago, an issue appeared: an indirect dependency was moved to a private bitbucket repository, and pip started to prompt for a login/password. Which was dramatic for continuous integration tools... And at some point, the very same dependency was removed from pypi, so we could no longer install our environment. In a couple of words, pip started to prompt for a user/password, which was quickly a pain (all automated tools were hanging forever...). And since today, it simply fails. I was wondering how to have something more reliable. As I guess anyone can remove a package from pypi, it is not safe to fully rely on it, right ? I was using a cache and thought that would be enough, but apparently it always try to connect to the internet to check the package existence. What is recommanded here ? Should I download everything manually, and only refer to local path via the variable "dependency_links" in my setup.py ? Or is there something smarter ? Thanks ! Emmanuel
How to protect yourself from package disappearance on pip?
0
0.197375
1
0
0
92
16,171,519
2013-04-23T14:07:00.000
1
1
0
0
0
python,python-2.7
0
16,401,807
0
1
0
false
0
0
first, use the latest version of minepy. Second, you can use a smaller value of "alpha" parameter, say 0.5 or 0.45. In this way, you will reduce the computational time in despite of characteristic matrix accuracy. Davide
1
0
1
0
I have a numerical matrix of 2500*2500. To calculate the MIC (maximal information coefficient) for each pair of vectors, I am using minepy.MINE, but this is taking forever, can I make it faster?
how to make minepy.MINE run faster?
0
0.197375
1
0
0
425
16,180,946
2013-04-23T23:35:00.000
2
0
0
0
0
python,matplotlib,axis
0
16,180,974
0
3
0
false
0
0
I would look at the largest value in your data set (i.e. the histogram bin values) multiply that value by a number greater than 1 (say 1.5) and use that to define the y axis value. This way it will appear above your histogram regardless of the values within the histogram.
1
90
1
0
I am drawing a histogram using matplotlib in python, and would like to draw a line representing the average of the dataset, overlaid on the histogram as a dotted line (or maybe some other color would do too). Any ideas on how to draw a line overlaid on the histogram? I am using the plot() command, but not sure how to draw a vertical line (i.e. what value should I give for the y-axis? thanks!
Drawing average line in histogram (matplotlib)
0
0.132549
1
0
0
127,120
16,191,318
2013-04-24T11:53:00.000
1
0
0
1
0
python,google-app-engine,google-cloud-datastore
0
16,191,993
0
1
1
true
1
0
Why is what you describe not possible? The object representing the logged-in user is an instance of google.appengine.api.users.User. That object has a user_id property. You can use that ID as a field in your own user model, to which you can add a field determining whether or not they are an admin.
1
0
0
0
I am developing an app in GAE. Application provides different view depending upon whether logged-in user is admin or normal user. I want to use 'Google Apps domain' as Authentication Type. So that all user of my domain can login into the application and use it. Here, application can't differentiate a logged-in as admin or normal user. Somehow I should make an user as admin and as soon as that user logs in, application should use admin view for that user. Is there any way to tell application that a particular user is admin? If we have our own USER table, we can mark any user as admin. Whenever a user logs into the app, app can consult USER table to check if user is admin or not? But in my scenario, it is not possible.
Differentiating logged-in users as admin and normal user in Google App Engine?
1
1.2
1
0
0
145
16,198,789
2013-04-24T17:45:00.000
2
0
1
0
0
python,macos,pip,macports
0
16,550,756
0
2
0
true
0
0
If you are using macports for python then you should install pip and easy_install via macports as well. You seem to have a non macports pipon your path. installing py27-pip will give you a pip-2.7 executable script on your path, similarly for easy_install. The macports version have the python version in their name so as to allow multiple versions of python to be installed. If you want just pip then create a bash alias or link the pip-2.7 script to pip in a directory on yourpath.
1
0
0
0
I've got a mac on which I installed python using macports. I like it this way because I could manually install numpy, scipy etc. without needing to mess with pre-built packages like enthought. I now wanted to install web.py, but after trying to install it through both easy_install and pip, I can't import it on the interactive python command line. When installing it, it also says: Installed /Library/Python/2.6/site-packages/web.py-0.37-py2.6.egg while it says the following when I type 'python': Python 2.7.3 (default, Oct 22 2012, 06:12:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin When I type 'which python' I get: /opt/local/bin/python So my question is: how to make easy_install and/or pip install modules in the python installation which I enter when I simply type 'python' on the command line?
How to make pip install python modules in my current python2.7 installation on mac (instead of 2.6)?
0
1.2
1
0
0
3,596
16,222,064
2013-04-25T18:28:00.000
0
0
0
0
0
java,python,design-patterns,error-handling,software-design
1
16,224,608
0
2
0
false
0
0
For every exception your app throws you insert it into a db, your error code is the id for that record, that's what the user sees. Obviously same exception gets the same id. The plugin information you need is stored in the DB
1
1
0
0
UPDATE: The error codes here is not such a return value of a function. Actually I am not discussing using exception or error codes for error handling. I am trying to figure out, using what pattern to organize errors. What I am really doing is like error codes showing on Windows blue screen. Back to the very old time, when your Windows crash you can get an error code on blue screen, using that code you can figure out what's going on by looking up MS's document. In my system, there are many plugins contributed by different people that may not know each other. If I allow them to define their error codes. It's mostly like error code of two plugins may conflict. ================================================================================================ I want to design an extendable error codes system that allows plugins to define their own error codes. The basic idea is: system has a range of reserved error codes plugin can select a range that not used by system, then creates its error codes in that range. However, the problem is plugins don't know each other(because plugins may be written by different people and installed into system by user's preference). so their error codes range may conflict. Is there any good practice for this requirement? I google a lot but to my surprise, there are very few articles talking about designing error codes in production software. Most posts are focus on exception vs error code. And, is there any good pattern for showing error in product that user could figure out what's going on? My basic idea is to show user an error which has error code, descriptions, details. And user could click the error code then I would show him the proper solution
How to design extendable error codes?
1
0
1
0
0
838
16,223,006
2013-04-25T19:18:00.000
4
0
1
0
0
python,module,field,openerp
0
16,229,121
0
1
0
true
1
0
What you want currently not possible in openerp. But you can use one trick, you should use two fields one is integer for giving interval and other in char fields for giving months, days etc. You can get this example on Scheduler , ir.cron object of opener.
1
0
0
0
I need a field that can contain a number and text on it, like for example "6 months", i've used the datetime field, but it only takes a formatted date on it, and if use integer or float it takes a number, and char takes only a character, so how can i have an integer and a char on the same field?
DateTime field OpenErp
0
1.2
1
0
0
422
16,230,984
2013-04-26T07:29:00.000
0
0
0
0
0
python,machine-learning,nlp,classification,nltk
0
16,231,323
0
2
0
false
0
0
I see two questions How to train the system? Can the system consist of "sci-fi" and "others"? The answer to 2 is yes. Having a 80% confidence threshold idea also makes sense, as long as you see with your data, features and algorithm that 80% is a good threshold. (If not, you may want to consider lowering it if not all sci-fi movies are being classified as sci-fi, or lowering it, if too many non-sci-fi movies are being categorized as sci-fi.) The answer to 1 depends on the data you have, the features you can extract, etc. Jared's approach seems reasonable. Like Jared, I'd also to emphasize the importance of enough and representative data.
2
0
1
0
I am just starting out with nltk, and I am following the book. Chapter six is about text classification, and i am a bit confused about something. In the examples (the names, and movie reviews) the classifier is trained to select between two well-defined labels (male-female, and pos-neg). But how to train if you have only one label. Say I have a bunch of movie plot outlines, and I am only interested in fishing out movies from the sci-fi genre. Can I train a classifier to only recognize sci-fi plots, en say f.i. if classification confidence is > 80%, then put it in the sci-fi group, otherwise, just ignore it. Hope somebody can clarify, thank you,
train nltk classifier for just one label
0
0
1
0
0
441
16,230,984
2013-04-26T07:29:00.000
0
0
0
0
0
python,machine-learning,nlp,classification,nltk
0
16,231,216
0
2
0
true
0
0
You can simply train a binary classifier to distinguish between sci-fi and not sci-fi So train on the movie plots that are labeled as sci-fi and also on a selection of all other genres. It might be a good idea to have a representative sample of the same size for the other genres such that not all are of the romantic comedy genre, for instance.
2
0
1
0
I am just starting out with nltk, and I am following the book. Chapter six is about text classification, and i am a bit confused about something. In the examples (the names, and movie reviews) the classifier is trained to select between two well-defined labels (male-female, and pos-neg). But how to train if you have only one label. Say I have a bunch of movie plot outlines, and I am only interested in fishing out movies from the sci-fi genre. Can I train a classifier to only recognize sci-fi plots, en say f.i. if classification confidence is > 80%, then put it in the sci-fi group, otherwise, just ignore it. Hope somebody can clarify, thank you,
train nltk classifier for just one label
0
1.2
1
0
0
441
16,241,755
2013-04-26T17:09:00.000
2
0
0
0
0
python,tkinter
0
16,241,833
0
1
0
false
0
1
Every created image is assigned a unique name (unless you specify the name of the image when creating). This unique name is generated by using a counter, which increases monotonically.
1
1
0
0
I have a program that displays many tkinter PhotoImages at once (relevant: I'm not using PIL). It currently has several screens, and when the play gets to the edge it loads a new tilemap, creating a bunch more photoimages in the currentTiles array after clearing the old contents. I'm fairly certain there are no other references to these photoimages in the rest of the program. The weird thing is that when I print the contents of the last item in the array after the loadLevel function is called, it says things such as "pyimage3761", and it increments each time I load a new screen. Is this due to tkinter keeping track of how many have been created so far, or is it because the old tiles are still in memory? I can't for the life of me figure out where there could be another reference, so I'm just wondering if there are any other possibilities before I spend hours looking for errors. Thanks!!
Tkinter PhotoImage: References in Memory?
0
0.379949
1
0
0
238
16,244,924
2013-04-26T20:44:00.000
3
0
0
0
0
python,heroku
0
16,245,012
0
1
0
false
1
0
Heroku is for developing Web (HTTP, HTTPS) applications. You can't deploy code that uses socket to Heroku. If you want to run your app on Heroku, the easier way is to use a web framework (Flask, CherryPy, Django...). They usually also come with useful libraries and abstractions for you to talk to your database.
1
0
0
0
I am quite new to heroku and I reached a bump in my dev... I am trying to write a server/client kind of application...on the server side I will have a DB(I installed postgresql for python) and I was hoping I could reach the server, for now, via a python client(for test purposes) and send data/queries and perform basic tasks on the DB. I am using python with Heroku, I manage to install the DB and it seems to be working(i.e i can query, insert, delete, etc...) now all i want is to write a server(in python) that would be my app and would listen on a port and receive messages and then perform whatever tasks it is asked to do...I tought about using sockets for this and have managed to write a basic server/client locally...however when I deploy the app on heroku i cannot connect to the server and my code is basically worthless can somebody plz advise on the basic framework for this sort of requirements...surely I am not the first guy to want to write a client/server app...if you could point to a tutorial/doc i would be much obliged. Thx
how to write a client/server app in heroku
0
0.53705
1
1
0
569
16,252,538
2013-04-27T13:11:00.000
0
0
1
0
1
python,django,web,infinite-loop
1
16,252,661
0
3
0
false
1
0
Yes, your analysis is correct. The worker thread/process will keep running. Moreover, if there is no wait/sleep in the loop, it will hog the CPU. Other threads/process will get very little cpu, resulting your entire site on slow response. Also, I don't think server will send any timeout error to client explicitly. If the TCP timeout is set, TCP connection will be closed. Client may also have some timeout setting to get response, which may come into picture. Avoiding such code is best way to avoid such code. You can also have some monitoring tool on server to look for CPU/memory usage and notify for abnormal activity so that you can take action.
1
7
0
0
Something that I just thought about: Say I'm writing view code for my Django site, and I make a mistake and create an infinite loop. Whenever someone would try to access the view, the worker assigned to the request (be it a Gevent worker or a Python thread) would stay in a loop indefinitely. If I understand correctly, the server would send a timeout error to the client after 30 seconds. But what will happen with the Python worker? Will it keep on working indefinitely? That sounds dangerous! Imagine I've got a server in which I've allocated 10 workers. I let it run and at some point, a client tries to access the view with the infinite loop. A worker will be assigned to it, and will be effectively dead until the next server restart. The dangerous thing is that at first I wouldn't notice it, because the site would just be imperceptibly slower, having 9 workers instead of 10. But then it might happen again and again throughout a long span of time, maybe months. The site would just get progressively slower, until eventually it would be really slow with just one worker. A server restart would solve the problem, but I'd hate to have my site's functionality depend on server restarts. Is this a real problem that happens? Is there a way to avoid it? Update: I'd also really appreciate a way to take a stacktrace of the thread/worker that's stuck in an infinite loop, so I could have that emailed to me so I'll be aware of the problem. (I don't know how to do this because there is no exception being raised.) Update to people saying things to the effect of "Avoid writing code that has infinite loops": In case it wasn't obvious, I do not spend my free time intentionally putting infinite loops into my code. When these things happen, they are mistakes, and mistakes can be minimized but never completely avoided. I want to know that even when I make a mistake, there'll be a safety net that will notify me and allow me to fix the problem.
What happens when you have an infinite loop in Django view code?
0
0
1
0
0
2,964
16,288,787
2013-04-29T21:45:00.000
0
1
0
0
1
python
0
21,212,477
0
1
0
true
0
0
The solution was to go into the code, and change the following lines to: Line 118: self.track = u'' Lines 149-152: self.track = int(self._fields.get(TRACK, u'')) + 1
1
0
0
0
I'm using the Python library HSAudioTag, and I'm trying to read the track number in my files, however, without fail, the file returns 0 as the track number, even if it's much higher. Does anybody have any idea how to fix this? Thanks.
Python HSAudioTag for WMA files always returns 0?
0
1.2
1
0
1
87
16,293,597
2013-04-30T06:29:00.000
0
0
0
1
0
python,python-2.7,network-programming,udp,sliding-window
0
16,399,916
0
2
0
false
0
0
You could have a message loop continuously listening and processing received packets and putting them on a queue then read them at your leisure... However you would need to implement you own ACKs taking into account the possibilities of lost and duplicates (if your application is concerned about them).. Which begs the question - why not use TCP?
1
0
0
0
Let's say a source A is sending me an unknown number of messages using UDP. How can I intercept all those messages? This is the complete scenario: Send 7 messages Wait for their ACKs Process ACKs Send another batch Repeat... Problems: (1) I don't know how many messages arrive, some may get lost and some are repeated, and (2) I might be be doing something else later, so I cannot wait forever.
Receive an unknown number of UDP messages
0
0
1
0
0
273
16,294,819
2013-04-30T07:48:00.000
20
0
1
0
0
python,pip,requirements.txt
0
16,294,888
0
8
0
false
0
0
You can run pip freeze to see what you have installed and compare it to your requirements.txt file. If you want to install missing modules you can run pip install -r requirements.txt and that will install any missing modules and tell you at the end which ones were missing and installed.
1
41
0
0
I have a requirements.txt file with a list of packages that are required for my virtual environment. Is it possible to find out whether all the packages mentioned in the file are present. If some packages are missing, how to find out which are the missing packages?
Check if my Python has all required packages
1
1
1
0
0
41,835
16,334,482
2013-05-02T09:23:00.000
-1
1
1
0
0
python,encryption,passwords
0
16,334,819
0
4
0
false
0
0
You could use htpasswd which is installed with apache or can be downloaded seperately. Use subprocess.check_output to run it and you can create Python functions to add users, remove them, verify they have given the correct password etc. Pass the -B option to enable salting and you will know that it's secure (unlike if you implement salts yourself).
1
6
0
0
I have a small python program which will be used locally by a small group of people (<15 people).But for accountability, i want to have a simple username+password check at the start of the program ( doesn't need to be super secure).For your information, I am just a beginner and this is my first time trying it.When i search around, i found that python has passlib for encryption. But even after looking though it i am still not sure how to implement my encryption.So, there are a few things that i want to know. How do i store the passwords of users locally? The only way i know at the moment is to create a text file and read/write from it but that will ruin the whole purpose of encryption as people can just open the text file and read it from there. What does hash & salt means in encryption and how does it work? (a brief and simple explanation will do.) What is the recommended way to implement username and password check? I am sorry for the stupid questions. But i will greatly appreciate if you could answers my question.
Password Protection Python
0
-0.049958
1
0
0
6,052
16,359,847
2013-05-03T13:17:00.000
0
0
0
0
0
python,django
0
16,360,039
0
2
0
false
1
0
You keep track of all users, and you show all users whose coordinates are of a similar value. Yes, that's a generic answer, but it is a very generic question. I would not be surprised if there are modules for Django doing this already.
1
0
0
0
I have the following situation. I keep track of a user's longitude and latitude using ios. I send the longitude and latitude coordinates to a django server. How can I use these longitude and latitude coordinates to determine what objects are near? Basically how can I use these coordinates to determine the list of other users near a user?
Getting near objects. Django + Badoo
0
0
1
0
0
259
16,375,251
2013-05-04T14:16:00.000
2
0
0
0
0
javascript,python,html,screen-scraping,eval
1
16,385,053
0
2
0
false
1
0
Well, in the end I came down to the following possible solutions: Run Chrome headless and collect the html output (thanks to koenp for the link!) Run PhantomJS, a headless browser with a javascript api Run HTMLUnit; same thing but for Java Use Ghost.py, a python-based headless browser (that I haven't seen suggested anyyyywhere for some reason!) Write a DOM-based javascript interpreter based on Pyv8 (Google v8 javascript engine) and add this to my current "half-solution" with mechanize. For now, I have decided to use either use Ghost.py or my own modification of the PySide/PyQT Webkit (how ghost works) to evaluate the javascript, as apparently they can run quite fast if you optimize them to not download images and disable the GUI. Hopefully others will find this list useful!
1
1
0
0
This is part of a project I am working on for work. I want to automate a Sharepoint site, specifically to pull data out of a database that I and my coworkers only have front-end access to. I FINALLY managed to get mechanize (in python) to accomplish this using Python-NTLM, and by patching part of it's source code to fix a reoccurring error. Now, I am at what I would hope is my final roadblock: Part of the form I need to submit seems to be output of a JavaScript function :| and lo and behold... Mechanize does not support javascript. I don't want to emulate the javascript functionality myself in python because I would ideally like a reusable solution... So, does anyone know how I could evaluate the javascript on the local html I download from sharepoint? I just want to run the javascript somehow (to complete the loading of the page), but without a browser. I have already looked into selenium, but it's pretty slow for the amount of work I need to get done... I am currently looking into PyV8 to try and evaluate the javascript myself... but surely there must be an app or library (or anything) that can do this??
Evaluate javascript on a local html file (without browser)
0
0.197375
1
0
1
1,441
16,375,396
2013-05-04T14:33:00.000
0
0
0
0
1
python,pygame
0
16,377,757
0
1
0
true
0
1
Setting gamma or screen brightness is not the best way to go. When your game gets more complicated, it's easier if you use the technique ecline6 suggested: changing your background image. But since it is a loaded image i suppose, you can use this trick: Let's say you have a background surface. Every 10s you will fire an event that will change the backround by blitting an low alpha-black surface on top of it. That way your background will get darker. You can do the same with white, to make it more brighter too.
1
0
0
0
I try to write a simple 2d game using python 3.x and pygame 1.9.2. I want to simulate changing of days/nights. I have got in-game time(like real, but faster) and I'd like to make my screen darker at exact time but have no ideas how to do it. Could you advice me how to reduce the brightness of my screen or other ways how to show changing of days and nights? Excuse for my language if I make mistakes. English isn't native for me)
Changing days and nights with pygame
0
1.2
1
0
0
755
16,379,321
2013-05-04T21:52:00.000
1
1
1
1
0
python,ubuntu,pydev,pymongo
0
16,379,374
0
1
0
true
0
0
You can install packages for a specific version of Python, all you need to do is specify the version of Python you want use from the command-line; e.g. Python2.7 or Python3. Examples Python3 pip your_package Python3 easy_install your_package.
1
0
0
0
I am currently trying to run Pydev with Pymongo on an Python3.3 Interpreter. My problem is, I am not able to get it working :-/ First of all I installed Eclipse with Pydev. Afterwards I tried installing pip to download my Pymongo-Module. Problem is: it always installs pip for the default 2.7 Version. I read that you shouldn't change the default system Interpreter (running on Lubuntu 13.04 32-Bit) so I tried to install a second Python3.3 and run it in an virtual environement, but I can't find any detailed Information on how to use everything on my specific problem. Maybe there is someone out there, that uses a similar configuration and can help me out to get everything running (in a simple way) ? Thanks in advance, Eric
Using Python3 with Pymongo in Eclipse Pydev on Ubuntu
0
1.2
1
0
0
1,303
16,396,903
2013-05-06T10:35:00.000
5
0
0
0
0
python,pandas
0
61,941,548
0
8
0
false
0
0
inp0= pd.read_csv("bank_marketing_updated_v1.csv",skiprows=2) or if you want to do in existing dataframe simply do following command
2
249
1
0
I need to delete the first three rows of a dataframe in pandas. I know df.ix[:-1] would remove the last row, but I can't figure out how to remove first n rows.
Delete the first three rows of a dataframe in pandas
0
0.124353
1
0
0
412,922
16,396,903
2013-05-06T10:35:00.000
9
0
0
0
0
python,pandas
0
52,984,033
0
8
0
false
0
0
A simple way is to use tail(-n) to remove the first n rows df=df.tail(-3)
2
249
1
0
I need to delete the first three rows of a dataframe in pandas. I know df.ix[:-1] would remove the last row, but I can't figure out how to remove first n rows.
Delete the first three rows of a dataframe in pandas
0
1
1
0
0
412,922
16,397,384
2013-05-06T11:03:00.000
0
0
0
1
1
python,plugins,autocomplete,installation,gedit
0
45,171,475
0
1
0
false
0
0
If you have gedit3, have you checked that this is a plugin for gedit3, not gedit2? Take a look at *.plugin file. It should say IAge=3.
1
2
0
0
Of course I tried to copy the files in the .gnome2/gedit/plugins and in the .local/share/gedit/plugins directories. But it doesn't work at all. How do I install the plugin? I'm on Fedora 18. Lxde desktop manager.
Gedit plugin for python autocomplete: how to install?
0
0
1
0
0
1,116
16,406,080
2013-05-06T19:46:00.000
1
0
0
1
0
python,google-app-engine,loops
0
16,406,284
0
2
0
false
1
0
Take a look at the GAE cron functionality.
1
0
0
0
Can I make a loop in Google App Engine that fetches information from a site? I have made a small code that already gets the information I want from the site, but I don't know how to make this code run every lets say, 20 minutes. Is there a way to do this? P.S.: I have looked at TaskQueue, but I'm not sure if it is meant for things like this.
Google App Engine urlfetch loop
0
0.099668
1
0
0
81
16,411,136
2013-05-07T04:19:00.000
2
0
0
0
1
python,html,google-app-engine
1
16,411,935
0
1
0
false
1
0
You're getting '405 method not allowed' because the POST is going to the same url that served up the page, but the handler for that path (MainPage) does not have a post method. That's the same diagnosis that you were given when you asked this question two hours earlier under a different user id. Stepping back further to address the "what have I done wrong" question: It seems to me that you've gotten quite far along before discovering that what you have doesn't work. So far along that the example is cluttered with irrelevant code that's unrelated to the failure. That makes it harder for you for figure this out for yourself, and it makes it more difficult for people here to help you. In this situation, you help yourself (and help others help you) by seeing how much code you can eliminate while still demonstrating the failure.
1
0
0
1
I've been trying to get my python code to post. I have tried using the Postman Plugin to test the post method and I would get a 405 method error. I am planning to have the user post the information and have it displayed. Currently if I press submit I would get a error loading page, changing the form to get results in the submit button working and returning to the previous page. If I change the handler to post the screen would instantly display '405 Method Not Allowed'. I've looked through the Google App Engine logs and there are no errors. Can someone help me with what I done wrong and advise me on how to the post method functioning? Thanks for the time.
Unable to get Python to POST on html
0
0.379949
1
0
0
299
16,426,150
2013-05-07T18:34:00.000
1
0
1
0
0
python,encryption,python-3.x,cryptography
0
16,426,218
0
3
0
false
0
0
You cannot get the password the user used to log in to the computer. And, if you could, you would not want to store it. In fact, the OS doesn't even have the user's password. The OS has a hash of it, and when the user logs in, it hashes what the user types and checks that it matches. Also, if you ask the user to log in with their system password, any savvy user is going to immediately mistrust your app and refuse to use it. Make them create a password, and then login with that, not their system password. And don't save the password, save a hash, just like the OS does. If you want to verify that they've been authenticated by the OS… well, you already know that, or they couldn't have logged in to run your app. (If you're building a network server that allows remote login based on local accounts, that's a different story, but it's not relevant to your use case, and complicated, so I won't get into it here.) If you want to allow someone to "stay logged in", you don't do that by saving their password. Instead, you create some kind of hard-to-fake "session key" when they log in, and store that somewhere. They don't have to log in again until you destroy the session key (which you do when they log out). The one exception to "never store passwords" is when you need to act as a "proxy" for the user to some other application that needs their password. A well-designed application will provide a way for you to proxy the login properly, but many applications are not well-designed. Web browsers have to do this all the time, which is why most web browsers have a "remember my password at this site" checkbox. In this case, you do want to store passwords, ideally encrypted by the OS on your behalf (e.g., using OS X's Keychain APIs), or, if not, encrypted by you code using some key that's generated from the user's "master password" (which you don't store). Unfortunately, there is no real shortcut to learning how to design for security—or, rather, there are all kinds of shortcuts, and taking any one of them means your entire system ends up insecure and all the work you put into trying to secure it ends up useless. The easy solution is to use complete off-the-shelf solutions. If you want to design things yourself, you need at least a basic grounding in all of the issues. Start with one of Bruce Scheneier's "pop" books, Secrets and Lies or Beyond Fear. Then read his Practical Cryptography on designing cryptosystems, and Applied Cryptography on evaluating crypto algorithms. Then, once you realize how much you don't know and how important it is, learn everything you need for your problem, and then you can think about solving it.
2
1
0
0
basically, I want to have a login box, and the option to remember the password next time you log in. I know there are encryption modules out there, but they require a password to work in the first place. is there a way to get the password the user used to log into the computer, and use that to encrypt the password for my application? so in a nutshell, how do I store a password securely for later use. I'm using python 3, and my program needs to be crossplatform.
remember password functionality in python
1
0.066568
1
0
0
1,629
16,426,150
2013-05-07T18:34:00.000
1
0
1
0
0
python,encryption,python-3.x,cryptography
0
16,426,284
0
3
0
false
0
0
There is no way out. If the application does not ask the user for a password, then it is not securely storing passwords, it's only doing... "things". In that case, don't give the user a false sense of security, use cleartext. A notable exception is the GNOME login keyring (and equivalent on other platforms) not asking for a password, but it uses a trick: it encrypts data with your login password and decrypts them with the same when you enter it at startup. If you are developing a web application with a local client, consider using OAuth instead of passwords.
2
1
0
0
basically, I want to have a login box, and the option to remember the password next time you log in. I know there are encryption modules out there, but they require a password to work in the first place. is there a way to get the password the user used to log into the computer, and use that to encrypt the password for my application? so in a nutshell, how do I store a password securely for later use. I'm using python 3, and my program needs to be crossplatform.
remember password functionality in python
1
0.066568
1
0
0
1,629
16,432,969
2013-05-08T04:58:00.000
3
0
0
0
0
python,lucene,pylucene
0
16,469,866
0
1
0
false
0
0
Got it working eventually by creating a new tokenzier which considered every char other than an underscore as part of the token generated (basically underscore becomes the separator) class UnderscoreSeparatorTokenizer(PythonCharTokenizer): def __init__(self, input): PythonCharTokenizer.__init__(self, input) def isTokenChar(self, c): return c != "_" class UnderscoreSeparatorAnalyzer(PythonAnalyzer): def __init__(self, version): PythonAnalyzer.__init__(self, version) def tokenStream(self, fieldName, reader): tokenizer = UnderscoreSeparatorTokenizer(reader) tokenStream = LowerCaseFilter(tokenizer) return tokenStream
1
1
0
0
I am new to pylucene and I am trying to build a custom analyzer which tokenizes text on the basis of underscores only, i.e. it should retain the whitespaces. Example: "Hi_this is_awesome" should be tokenized into ["hi", "this is", "awesome"] tokens. From various code examples I understood that I need to override the incrementToken method for a CustomTokenizer and write a CustomAnalyzer for which the TokenStream needs to use the CustomTokenizer followed by a LowerCaseFilter to achieve the same. I am facing problems in implementing the incrementToken method and connecting the dots (how the tokenizer maybe used as usually the Analyzers depend on TokenFilter which depend on TokenStreams) as there is very little documentation available on pylucene.
Custom Tokenizer for pylucene which tokenizes text based only on underscores (retains spaces)
0
0.53705
1
0
0
682