Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16,016,645 | 2013-04-15T13:38:00.000 | 1 | 1 | 0 | 0 | php,python-2.7 | 16,016,728 | 1 | 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 rath... | 1 | 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]. an... | Can Python Script be included in PHP? | 0.197375 | 0 | 0 | 69 |
16,017,830 | 2013-04-15T14:32:00.000 | 0 | 0 | 0 | 0 | python,django,django-models,internationalization | 16,126,895 | 1 | true | 1 | 0 | Finally I've solved the problem by introducing a new layer, like follows:
There exist the models Area and Resource, both are now translatable and are created by admin staff, current users aren't allowed to create or modify them. These models will be more abstract to allow doing the matchings.
But, to allow more "precis... | 1 | 1 | 0 | I'm working on a Django (v. 1.5.1) website and I have several models, such as RegisteredUser and Startup. Each of these two models has a Many2ManyField to an Area model. Area contains two fields: name and slug (which is built from name).
This design works well to find users and startups within the same areas, but there... | How to translate a shared Model in Django without breaking uniqueness? | 1.2 | 0 | 0 | 47 |
16,018,995 | 2013-04-15T15:25:00.000 | 1 | 0 | 0 | 0 | python,postgresql,openerp,erp | 16,029,533 | 1 | 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... | 1 | 1 | 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... | Can we calculate Net Salary with openERp | 0.197375 | 0 | 0 | 1,340 |
16,019,155 | 2013-04-15T15:33:00.000 | 1 | 0 | 0 | 0 | python,mp3 | 21,548,733 | 1 | false | 1 | 0 | I assume you want to split the channels losslessly, without decoding MP3 and re-encoding it - otherwise you would not have mentioned MP3 at all and would have easily found many tools like Audacity to do that.
There are 4 channel modes of MP3 frames - this means 4 types of MP3 files: simple stereo, joint-stereo, dual-ch... | 1 | 0 | 0 | I'd like to seperate the channels of a mp3 file in Python and save it in two other files.
Does anybody know a library for this.
Thanks in advance. | Python split mp3 channel | 0.197375 | 0 | 0 | 1,282 |
16,022,915 | 2013-04-15T19:05:00.000 | 3 | 1 | 0 | 0 | python,pytest | 58,883,629 | 5 | false | 0 | 0 | This is what I use
py.test tests/ --pdbcls=IPython.core.debugger:Pdb -s | 1 | 115 | 0 | I'm using pytest for my test suite. While catching bugs in complex inter-components test, I would like to place import ipdb; ipdb.set_trace() in the middle of my code to allow me to debug it.
However, since pytest traps sys.stdin/sys.stdout ipdb fails. How can I use ipdb while testing with pytest.
I'm not interested in... | How to execute ipdb.set_trace() at will while running pytest tests | 0.119427 | 0 | 0 | 36,627 |
16,025,662 | 2013-04-15T22:22:00.000 | 14 | 0 | 1 | 1 | python,windows,eyed3 | 16,025,847 | 2 | true | 0 | 0 | try import eyed3 (without capital D) | 2 | 3 | 0 | On Windows, I have installed Python 2.7 and added python.exe's directory to PATH. Then I installed pip und used pip install eyeD3 to install the eyeD3 module successfully. However, using import eyeD3 doesn't work, but throws an ImportError.
I had the idea to adjust the PYTHONPATH-environment-variable in my command line... | Making the eyeD3-module available for import in python | 1.2 | 0 | 0 | 3,498 |
16,025,662 | 2013-04-15T22:22:00.000 | 3 | 0 | 1 | 1 | python,windows,eyed3 | 16,128,387 | 2 | false | 0 | 0 | The namespace changed to eyed3 in 0.7, as did the API. On all platforms. | 2 | 3 | 0 | On Windows, I have installed Python 2.7 and added python.exe's directory to PATH. Then I installed pip und used pip install eyeD3 to install the eyeD3 module successfully. However, using import eyeD3 doesn't work, but throws an ImportError.
I had the idea to adjust the PYTHONPATH-environment-variable in my command line... | Making the eyeD3-module available for import in python | 0.291313 | 0 | 0 | 3,498 |
16,026,129 | 2013-04-15T23:09:00.000 | 1 | 0 | 1 | 1 | ipython,qtconsole | 16,066,204 | 1 | 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 emulato... | 1 | 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 ... | Ipython and Curses on Windows | 1.2 | 0 | 0 | 125 |
16,026,776 | 2013-04-16T00:21:00.000 | 3 | 0 | 0 | 0 | python,web2py | 16,026,857 | 1 | 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 | 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 | 1.2 | 1 | 0 | 1,115 |
16,027,450 | 2013-04-16T01:46:00.000 | 2 | 1 | 1 | 0 | python | 16,027,565 | 3 | false | 0 | 0 | You can use this regex [\u2E80-\u9FFF] to match CJK characters. | 1 | 6 | 0 | I have a Unicode string in Python. I am looking for a way to determine if there is any Chinese/Japanese character in the string. If possible it'll be better to be able to locate those characters.
It seems this is a bit different from a language detection problem. My string can be a mixture of English and Chinese texts.... | Is there a way to know whether a Unicode string contains any Chinese/Japanese character in Python? | 0.132549 | 0 | 0 | 4,416 |
16,027,516 | 2013-04-16T01:53:00.000 | 4 | 0 | 0 | 0 | python,django,datetime,django-models | 54,221,361 | 6 | false | 1 | 0 | datetime.time(16, 00) does not work.
Use datetime.time(datetime.now()) instead if you are trying to get the current time or datetime.time(your_date_time)
Where your_date_time = datetime.datetime object | 2 | 30 | 0 | I have a model for events which almost always start at 10:00pm, but may on occasion start earlier/later. To make things easy in the admin, I'd like for the time to default to 10pm, but be changeable if needed; the date will need to be set regardless, so it doesn't need a default, but ideally it would default to the cur... | Can I set a specific default time for a Django datetime field? | 0.132549 | 0 | 0 | 26,326 |
16,027,516 | 2013-04-16T01:53:00.000 | 0 | 0 | 0 | 0 | python,django,datetime,django-models | 71,781,104 | 6 | false | 1 | 0 | What if the form.TimeField it contains a widget?
start_time = forms.TimeField(widget=TimeInput)
i've used the answers above but I cant setup the default value for it and also bear in mind I'm using django-bootstrap tags so I don't have a HTML form inputs code. | 2 | 30 | 0 | I have a model for events which almost always start at 10:00pm, but may on occasion start earlier/later. To make things easy in the admin, I'd like for the time to default to 10pm, but be changeable if needed; the date will need to be set regardless, so it doesn't need a default, but ideally it would default to the cur... | Can I set a specific default time for a Django datetime field? | 0 | 0 | 0 | 26,326 |
16,027,942 | 2013-04-16T02:46:00.000 | 0 | 1 | 0 | 0 | python,c | 16,451,937 | 4 | false | 0 | 0 | You can use Cython for setting the necessary c types and compile your python syntax code. | 2 | 2 | 0 | I've written a high level motor controller in Python, and have got to a point where I want to go a little lower level to get some speed, so I'm interested in coding those bits in C.
I don't have much experience with C, but the math I'm working on is pretty straightforward, so I'm sure I can implement with a minimal amo... | Best way to call C-functions from python? | 0 | 0 | 0 | 1,391 |
16,027,942 | 2013-04-16T02:46:00.000 | 0 | 1 | 0 | 0 | python,c | 16,028,391 | 4 | false | 0 | 0 | you can use SWIG, it is very simple to use | 2 | 2 | 0 | I've written a high level motor controller in Python, and have got to a point where I want to go a little lower level to get some speed, so I'm interested in coding those bits in C.
I don't have much experience with C, but the math I'm working on is pretty straightforward, so I'm sure I can implement with a minimal amo... | Best way to call C-functions from python? | 0 | 0 | 0 | 1,391 |
16,034,698 | 2013-04-16T10:27:00.000 | -1 | 0 | 0 | 1 | python,linux,kernel,conntrack | 50,619,225 | 2 | false | 0 | 0 | The file ip_conntrack contains only ipv4 specific conntrack entries whereas nf_conntrack includes both ipv4 and ipv6 protocol conntrack entries.
nf_conntrack file is registered with proc file system using code in
net/netfilter/nf_conntrack_standalone.c
whereas ip_conntrack file is registered with proc file system throu... | 1 | 22 | 0 | I'm looking for a detailed documentation about content of files /proc/net/nf_conntrack and/or /proc/net/ip_contrack on Linux systems.
Yes, I know, there are many utilities which can show me the content of these files in human readable format, but... I'd like to do it on a SOHO router, with Tomato USB firmware (by Shibb... | Details of /proc/net/ip_conntrack and /proc/net/nf_conntrack | -0.099668 | 0 | 0 | 26,249 |
16,034,823 | 2013-04-16T10:34:00.000 | 0 | 0 | 0 | 1 | python,qt4,pyqt,qprocess | 69,134,278 | 3 | 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 | 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 | 0 | 859 |
16,037,623 | 2013-04-16T12:53:00.000 | 1 | 1 | 0 | 0 | python,git | 16,037,728 | 3 | false | 0 | 0 | git status shows how many commits you are ahead/behind the remote tracking branch. You need to perform git fetch first though, because otherwise git cannot know if anything new went into remote. | 1 | 7 | 0 | I'm working with custom a build system that manages a large number of git repositories and written primarily in python.
It would save me a lot of time if I could write a command that would report the current branch of all repositories, then report if the head of "branch" is the same as the head of "remotes/origin/branc... | simplest possible way git can output the number of commits between "branch" and "remotes/origin/branch" | 0.066568 | 0 | 0 | 2,039 |
16,044,608 | 2013-04-16T18:38:00.000 | 4 | 0 | 1 | 0 | python,pygame | 16,044,733 | 1 | true | 0 | 1 | None that I'm aware of. Running a Pygame application in the browser would require some way of displaying graphics and playing sound from a remote Python interpreter. This would be pretty complicated to do, and would likely not perform very well anyway.
If you want to write games which run in a web browser, learn Javasc... | 1 | 5 | 0 | I was wondering if there is an online python interpreter with Pygame. It would be great if there is one, because when I share a game, I don't have to compile it first, I just send the code, and possibly upload the textures to a storage server and change the URL for the image location.
Is there an online Python interpre... | Is there an online Python interpreter with the Pygame module? | 1.2 | 0 | 0 | 10,085 |
16,048,056 | 2013-04-16T22:12:00.000 | 3 | 0 | 0 | 0 | python,qt,pyqt,qml,pyside | 16,048,799 | 1 | true | 0 | 1 | The latest version of PyQt (4.10?) works with Qt5. It does not support Qt Quick 2, AFAIK. I don't believe PySide supports either. | 1 | 3 | 0 | Did Qt 5 and Qt Quick supported by last Version Pyside or PyQt ? | Pyside or PyQt support Qt 5.0 and Qt Quick 2 | 1.2 | 0 | 0 | 2,837 |
16,048,269 | 2013-04-16T22:27:00.000 | 1 | 0 | 1 | 0 | python,py2exe | 16,048,795 | 2 | true | 0 | 0 | use absolute path to point to python interpreter executable.
c:\python27\python.exe setup.py py2exe
Or install cx_Freeze, which seems much better than py2exe except the lack of onefile capability. | 1 | 1 | 0 | I have both python 3.2 and python 2.7 installed. I am trying to compile a file, but since the default program for opening .py files is 3.2, it gives me an error for not having py2exe installed when I run the program. I tried setting the default program to python 2.7, but it won't work because the two versions have th... | Running py2exe with multiple versions of python installed | 1.2 | 0 | 0 | 650 |
16,049,395 | 2013-04-17T00:19:00.000 | 0 | 0 | 0 | 0 | python,qt,pyside | 16,050,068 | 2 | false | 0 | 1 | If you want an infinite progress bar or spinning wheel, just have it play, then when you finish the process, stop and/or delete the bar/icon from the screen. | 1 | 2 | 0 | I have a GUI developed using PySide. I have a long operation to perform from the interface, but there is no way to predict how long the operation will be. I'd like to display something to the user to tell him: the operation is in progress, please wait. Something like an infinite progress bar, or a spinning wheel. Is th... | Progress bar for event with unknown duration (PySide) | 0 | 0 | 0 | 3,339 |
16,051,345 | 2013-04-17T04:13:00.000 | 0 | 0 | 1 | 1 | python,python-2.7,pypy,pyscripter | 26,822,586 | 2 | false | 0 | 0 | PyCharm Community edition IDE by JetBrains supports pypy, or any other interpreter
Just go to File > Settings > Project INterpreter and set interpreter location | 1 | 1 | 0 | Maybe I am missing something, but I just downloaded pypy 2.0 beta2 windows binary (32 bit), and it seems I can run the interpreter by executing pypy.exe. However, I would like pypy to work with pyscripter and for all my old libraries to be available. Is this possible? Or is it as if I just installed a new version of py... | Making pypy available to pyscripter (or any other ide for that matter) on Windows? | 0 | 0 | 0 | 1,140 |
16,051,571 | 2013-04-17T04:34:00.000 | 1 | 1 | 0 | 1 | python,aptana,pydev | 16,058,892 | 1 | true | 0 | 0 | The only way to really know what's going on would be connecting jvisualvm (or some profiler or debugger) to your process to see what's going on (and then report an issue). On jvisualvm you can get a dump with the current processes, which may be enough already if you can say which is the thread that's running.
Note that... | 1 | 0 | 0 | I am using pydev through Aptana Studio 3 on a mac. Shortly after opening up Aptana, my computer heats way up, the fans go full power, and Aptana uses over 100% cpu even when it's not doing anything. I also have pydev on eclipse, but this spike doesn't occur. Has anyone else seen this? Is there any way to stop it? | pydev massive cpu usage | 1.2 | 0 | 0 | 284 |
16,052,969 | 2013-04-17T06:22:00.000 | 0 | 0 | 0 | 0 | python,user-interface,tkinter,download,tabular | 16,053,496 | 2 | false | 0 | 0 | Your question is a bit confusing - you're talking about data structure and persistence then about list box (GUI stuff...)
wrt/ the data structure and persistence part a "table like" structure with "rows and columns" is easily modeled as a list of ducts or list of tuples. For the perstitance part you can serialize your... | 1 | 0 | 0 | I am making a download manager in python..
I want to create a table like structure with multiple columns and rows to show:
Download name, download status (paused/downloading), download size and other information interactively.
Can anyone give me ideas on how to create a table-like structure where I can easily add the d... | Creating a table like structure in python | 0 | 0 | 0 | 3,399 |
16,055,254 | 2013-04-17T08:32:00.000 | 1 | 0 | 0 | 0 | python,django,svn,version-control,pycharm | 16,057,411 | 2 | false | 1 | 0 | You can open trunk/branches with multiple pycharm window. The project root should be trunk/branch root.
Normally, you don't need to switch among branches frequently. | 1 | 0 | 0 | I have a PyCharm Django project, versioned with SVN. Project itself been created via "Checkout from version control" function, and root of a project is a root of repository, so it includes trunk and branches.
My questions is:
- How to easily switch between feature-branches?
- Maybe Im missing something - what in that ... | How to easily switch to another SVN branch in PyCharm Django Project | 0.099668 | 0 | 0 | 2,174 |
16,055,489 | 2013-04-17T08:44:00.000 | 0 | 0 | 0 | 0 | python,django,ironmq | 16,065,078 | 3 | 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 | 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 acc... | File upload and store, then proccessing with remote worker | 0 | 0 | 0 | 229 |
16,055,489 | 2013-04-17T08:44:00.000 | 0 | 0 | 0 | 0 | python,django,ironmq | 16,055,809 | 3 | 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 ... | 2 | 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 acc... | File upload and store, then proccessing with remote worker | 0 | 0 | 0 | 229 |
16,057,689 | 2013-04-17T10:29:00.000 | 2 | 0 | 1 | 0 | python,variables,loops | 16,057,890 | 4 | false | 0 | 0 | Relying on variables's names and changing them is not the best way to go.
As people already pointed out in comments, it would be better to use a dict or a list instead. | 1 | 4 | 0 | I want to run a program in Python which loops several times, creating a NEW array each time - i.e. no data is overwritten - with the array named with a reference to the loop number, so that I can call it in subsequent loops. For instance, I might want to create arrays x0, x1, x2, ..., xi in a loop running from 0 to i, ... | How to rename variables in a loop in Python | 0.099668 | 0 | 0 | 30,400 |
16,059,476 | 2013-04-17T12:02:00.000 | 4 | 0 | 1 | 0 | python,pyc | 16,059,584 | 3 | 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 ... | 2 | 6 | 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 t... | Why are python libraries not supplied as pyc? | 0.26052 | 0 | 0 | 1,400 |
16,059,476 | 2013-04-17T12:02:00.000 | 0 | 0 | 1 | 0 | python,pyc | 16,059,746 | 3 | 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-u... | 2 | 6 | 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 t... | Why are python libraries not supplied as pyc? | 0 | 0 | 0 | 1,400 |
16,062,092 | 2013-04-17T13:57:00.000 | 0 | 0 | 0 | 0 | python,django | 16,064,152 | 2 | false | 1 | 0 | 'objs=Modelname.objects.filter(student__in=malerep).order_by('-Votes','-student__Percentage')'
then using objs[0] i was able to access the object of the student with max votes and max percentage in case of a tie. | 2 | 0 | 0 | Modelname.objects.filter(student__in=malerep).order_by('-Votes','-student__Percentage')
Here i want to specifically get the student who has the maximum number of votes.
What i am trying to do is, to get the list of students who stood for an election and got some votes and then sort them based on the number of votes the... | django, get an object from a list of filtered objects which has the maximum value for a field | 0 | 0 | 0 | 131 |
16,062,092 | 2013-04-17T13:57:00.000 | 1 | 0 | 0 | 0 | python,django | 16,063,068 | 2 | true | 1 | 0 | At this point, you have two choice:
First, use "max" to get the max value of certain field and use that max value to retrieve the particular student instance.
Good side, this is easy to implement; bad side, you need to hit database twice to achieve your goal.
Second, use raw(). You can perform all the complicate query ... | 2 | 0 | 0 | Modelname.objects.filter(student__in=malerep).order_by('-Votes','-student__Percentage')
Here i want to specifically get the student who has the maximum number of votes.
What i am trying to do is, to get the list of students who stood for an election and got some votes and then sort them based on the number of votes the... | django, get an object from a list of filtered objects which has the maximum value for a field | 1.2 | 0 | 0 | 131 |
16,063,191 | 2013-04-17T14:46:00.000 | 3 | 0 | 1 | 0 | python,numpy,multiprocessing,python-import | 16,063,388 | 1 | false | 0 | 0 | I was wondering if every process would import the package.
Assuming the import occurs after you've forked the process, then, yes. You could avoid this by doing the import before the fork, though.
There would be a major performance hit due to multiple imports of a library.
Well, there would a performance hit if you d... | 1 | 0 | 0 | I am using multiprocessing package to spawn multiple processes that execute a function, say func (with different arguments). func imports numpy package and I was wondering if every process would import the package. In fact, the main thread, or rather main process also imports numpy and that can be easily shared between... | Sharing imports between Python processes | 0.53705 | 0 | 0 | 801 |
16,063,698 | 2013-04-17T15:07:00.000 | 0 | 0 | 0 | 0 | python,scipy | 16,064,603 | 1 | false | 0 | 0 | After looking through the source for the SciPy function, I will just subclass it and override init where the individual inputs are combined into an array anyway. | 1 | 0 | 1 | I am trying to generate a radial basis function where the input variables are defined at runtime. The SciPy.interpolate.Rbf function seems to request discrete lists for each input and output variable, eg: rbf(x,y,z). This restricts you to defining fixed variables before hand.
I have tried unsuccessfully to pass a list... | Alternative inputs to SciPy Radial Basis Functions | 0 | 0 | 0 | 512 |
16,063,928 | 2013-04-17T15:18:00.000 | 0 | 0 | 0 | 1 | python,svn,conflict,pysvn | 16,092,530 | 1 | false | 0 | 0 | I solved this by adding the prop of mime-type application/octet-stream.
This way svn would bypass the contextual merge feature. | 1 | 0 | 0 | I'm using SVN as a backend for a collaborative framework. That said, I want to handle ALL the updates by hand, ie: no automerge, no auto-update.
so if updating brings the following changeset:
A file1
D file2
U file3
G file4
I want to process the update and the automerge by hand.
I know that this is possible in subversi... | Handling PySVN merges by manually | 0 | 0 | 0 | 175 |
16,068,644 | 2013-04-17T19:33:00.000 | 1 | 0 | 0 | 0 | python,redis,persistence,reload | 16,069,631 | 1 | 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 | 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 ... | How to load a redis database after | 0.197375 | 1 | 0 | 1,375 |
16,071,286 | 2013-04-17T22:23:00.000 | 0 | 1 | 1 | 0 | python,search,binary | 16,071,379 | 2 | false | 0 | 0 | You would be better working off another language. Python could do it (if you use for example,
file = open("file", "wb")
(appending the b opens it in binary), and then using a simple search, but to be honest, it is much easier and faster to do it in a lower-level language such as C. | 1 | 0 | 0 | Is there an easy way to work in binary with Python?
I have a file of data I am receiving (in 1's and 0's) and would like to scan through it and look for certain patterns in binary. It has to be in binary because due to my system, I might be off by 1 bit or so which would throw everything off when converting to hex or ... | Workin with binary in python | 0 | 0 | 0 | 105 |
16,072,837 | 2013-04-18T01:07:00.000 | 0 | 0 | 1 | 0 | python,scripting | 16,073,010 | 4 | false | 0 | 0 | If you are on a Windows OS with IDLE installed, right-clicking a .py file should offer you the option to edit in IDLE. | 1 | 3 | 0 | I'm trying to open a .py script on my computer but it unfortunately keeps opening in Notepad. I've tried changing the associations on my computer but even when I browse to python.exe and click it, it won't show up as a usable program (interestingly, pythonw.exe can be associated with it but nothing opens when I click o... | Python is not opening .py files | 0 | 0 | 0 | 58,573 |
16,077,481 | 2013-04-18T07:58:00.000 | 3 | 0 | 1 | 1 | python,python-2.7,distutils,enthought | 16,088,553 | 2 | false | 0 | 0 | Compiler options are taken from CPython’s Makefile. IOW they are the same as the ones used to compile Python. You can override most of them on the command line as Evert described.
The global distutils.cfg is something that a sysadmin can create to set default options, not a file that is installed with Python. | 1 | 7 | 0 | Maybe a stupid question, but I was wondering where Python's distutils get the compiler options from? It gets some linked directories wrong and I want to correct that once and for all.
I know there should be a prefix/lib/pythonver/distutils/distutils.cfg but I can't find any distutils.cfg anywhere on the computer. Obvi... | Distutils compiler options configuration | 0.291313 | 0 | 0 | 4,646 |
16,078,856 | 2013-04-18T09:11:00.000 | 2 | 0 | 1 | 0 | python | 16,079,138 | 1 | true | 0 | 0 | Are you assigning a unique incrementing ID to each record? If you are, you can create a separate table that holds just the ID of the last record fetched, that way you can only retrieve records with IDs greater than this ID. Each time you fetch, you could update this table with the new latest ID.
Let me know if I misu... | 1 | 0 | 0 | I have a python script that retrieves the newest 5 records from a mysql database and sends email notification to a user containing this information.
I would like the user to receive only new records and not old ones.
I can retrieve data from mysql without problems...
I've tried to store it in text files and compare the... | How to check if data has already been previously used | 1.2 | 1 | 0 | 85 |
16,085,288 | 2013-04-18T14:08:00.000 | 3 | 1 | 1 | 0 | python,pyramid | 16,088,122 | 1 | true | 0 | 0 | It's not a "project name". It's the name of a python package. Yes, you'll have to search/replace and rename that package everywhere in your code. You're probably better off just starting from a new project with the right name if you are only at the tutorial stage. | 1 | 3 | 0 | I am just starting out with pyramid and I am doing the tutorial. I would like to use some of the tutorial code as a starting point for the project that I am going to start, but I don't want to keep the project name as tutorial. It seems like once you give a project a name that name is used in many places. Is there a wa... | How do you change the name of a pyramid project? | 1.2 | 0 | 0 | 468 |
16,087,386 | 2013-04-18T15:42:00.000 | 0 | 0 | 1 | 0 | python | 16,087,778 | 4 | false | 0 | 0 | You can multiply by 1.0 in order to get the value as float
amount= 125
tip1 = 15
tip2 = 20
print "tip1=" , (amount * (1.0 * tip1/100))
print "tip2=" , (amount * (1.0 * tip2/100)) | 1 | 0 | 0 | i am VERY new to programming and i am currently learning python from a book i purchased.
At the end of each chapter it has challenges for you to write programs based on what you have learnt in the previous chapter.It is asking to create a program for a user to enter an amount for a restaurant bill and tells them two am... | How do i create a tipping program for python? | 0 | 0 | 0 | 9,038 |
16,088,764 | 2013-04-18T16:48:00.000 | 1 | 0 | 0 | 0 | android,python,kivy | 16,287,866 | 1 | false | 1 | 1 | I'm looking for the same thing. I too am looking at Kivy. The possible solutions I can see to audio is hooking in a 3rd party application as a "recipe" in Kivy.
There is aubio, which apparently can be compiled for iOS/Android (see stackoverflow question regarding this), but I believe you have to get your own audio sour... | 1 | 1 | 0 | I am trying to write a metronome application in Python, and I intend to publish the application for Android and iOS. I have found a few cross-platform frameworks like Kivy, but their audio support is lacking. More specifically, I need very precise audio timing and I can't rely on thread timing or events. I want to writ... | Android Audio API in Python | 0.197375 | 0 | 0 | 1,422 |
16,089,089 | 2013-04-18T17:04:00.000 | 91 | 0 | 1 | 0 | python,markdown,ipython,mathjax | 53,228,544 | 7 | 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 | 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 ... | Escaping dollar sign in ipython notebook | 1 | 0 | 0 | 38,570 |
16,089,089 | 2013-04-18T17:04:00.000 | 7 | 0 | 1 | 0 | python,markdown,ipython,mathjax | 16,095,493 | 7 | 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 | 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 ... | Escaping dollar sign in ipython notebook | 1 | 0 | 0 | 38,570 |
16,089,089 | 2013-04-18T17:04:00.000 | 11 | 0 | 1 | 0 | python,markdown,ipython,mathjax | 29,808,632 | 7 | false | 0 | 0 | You can escape $ with math mode by using a backslash. Try $\$$ | 4 | 52 | 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 ... | Escaping dollar sign in ipython notebook | 1 | 0 | 0 | 38,570 |
16,089,089 | 2013-04-18T17:04:00.000 | 3 | 0 | 1 | 0 | python,markdown,ipython,mathjax | 38,617,452 | 7 | 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 | 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 ... | Escaping dollar sign in ipython notebook | 0.085505 | 0 | 0 | 38,570 |
16,092,153 | 2013-04-18T20:09:00.000 | 1 | 0 | 1 | 0 | python | 16,092,297 | 5 | 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 ine... | 1 | 3 | 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 fu... | How does find procedure work in python | 0.039979 | 0 | 0 | 1,649 |
16,094,676 | 2013-04-18T23:17:00.000 | 1 | 0 | 1 | 0 | python,hash,cryptography,sha512 | 16,094,803 | 2 | false | 0 | 0 | It's equally as likely as any other hash value, or should be. | 1 | 0 | 0 | I was just thinking about numbers repeating in hashes and I was wondering if it was possible for half of a sha512 hash to consist of 64 consecutive zeros. | Is it possible for a sha512 hash to start with 64 zeros? | 0.099668 | 0 | 0 | 682 |
16,095,220 | 2013-04-19T00:19:00.000 | -1 | 0 | 1 | 0 | python,counter | 16,095,280 | 4 | false | 0 | 0 | You could change the __str__ method of the counter class by going into the source code for the collections module, but I wouldn't suggest that as that permanently modifies it. Maybe just changing what you print would be more beneficial? | 1 | 2 | 0 | So when I print the Counter (from collections import Counter) to a file I always get this the literal Counter ({'Foo': 12})
Is there anyway to make the counter not write out so literally? So it would instead write {'Foo' : 12} instead of Counter({'Foo' : 12}).
Yeah it's picky, but I am sick of grep'n the thing out of m... | Can you make Counter not write-out "Counter"? | -0.049958 | 0 | 0 | 831 |
16,098,570 | 2013-04-19T06:29:00.000 | 0 | 0 | 0 | 1 | python,mysql,google-app-engine,google-cloud-datastore,web-scraping | 16,131,039 | 1 | false | 1 | 0 | Based on what I know about your app it would make sense to use memcache. It will be faster, and will automatically take care of things like expiring stale cache entries. | 1 | 0 | 0 | I need to scrap about 40 random webpages at the same time.These pages vary on each request.
I have used rpcs in python to fetch the urls and scraped the data using BeautifulSoup. It takes about 25 seconds to scrap all the data and display on the screen.
To increase the speed i stored the data in appengine datastore so... | What is the fastest way to get scraped data from so many web pages? | 0 | 1 | 0 | 402 |
16,102,005 | 2013-04-19T09:58:00.000 | 0 | 0 | 1 | 0 | python,file,io | 16,102,297 | 2 | false | 0 | 0 | Just rewrite the file. Read it into some data format (string or list of strings with readlines()) change the char you want and then write the data to the file again. Actually it would be a more sane thing to do than performing a high-precision operation within the file. | 1 | 1 | 0 | I know the position of file pointer,and I want to delete the preceding char.
Of course I can create another file,writing in the left content,which is not the way I want.
In other word,I want to do this "inplace".Thank you. | Python, How to do deleting work in a file? | 0 | 0 | 0 | 52 |
16,107,658 | 2013-04-19T15:02:00.000 | 1 | 0 | 0 | 1 | python,windows,powershell,path,exe | 16,108,206 | 1 | false | 0 | 0 | Making the comments an answer for future reference:
Have a ; at the end of the PATH and logout and log back in. | 1 | 1 | 0 | I've had my python program removed from windows a while ago, and recently downloaded python2.7.4 from the main site, but when I type "python" in the Windows PowerShell(x86) prompt from C:, I get the message "'python' is not recognized as an internal or external command, operable program or batch file.", and I'd like to... | Can't open python.exe in Windows Powershell | 0.197375 | 1 | 0 | 1,533 |
16,108,560 | 2013-04-19T15:49:00.000 | 0 | 0 | 0 | 1 | python,django,rabbitmq,celery | 16,154,276 | 1 | false | 1 | 0 | Replace this names: coordinator with rabbitmq (or some other broker kombu supports) and users with celery workers.
I am pretty sure you can do all you need (and much more) just by configuring celery / kombu and rabbitmq and without writing too many (if any) lines of code.
small note: Celery features scheduled tasks. | 1 | 2 | 0 | I have a service that needs a sort of coordinator component. The coordinator will manage entities that need to be assigned to users, taken away from users if the users do not respond on a timely manner, and also handle user responses if they do response. The coordinator will also need to contact messaging services to n... | Embed a celery worker in my own code | 0 | 0 | 0 | 515 |
16,112,209 | 2013-04-19T19:32:00.000 | 5 | 0 | 1 | 0 | python,pandas | 16,225,932 | 2 | true | 0 | 0 | As Wouter said, the recommended method is to convert the dict to a pandas.Series and multiple the two objects together:
result = df * pd.Series(myDict) | 1 | 4 | 1 | Suppose I have a pandas DataFrame with two columns named 'A' and 'B'.
Now suppose I also have a dictionary with keys 'A' and 'B', and the dictionary points to a scalar. That is, dict['A'] = 1.2 and similarly for 'B'.
Is there a simple way to multiply each column of the DataFrame by these scalars?
Cheers! | Multiplying Columns by Scalars in Pandas | 1.2 | 0 | 0 | 9,702 |
16,114,358 | 2013-04-19T22:23:00.000 | 0 | 1 | 0 | 0 | php,python,html,networking | 16,115,090 | 4 | false | 1 | 0 | Chrome provides a built-in tool for seeing the network connections. Press Ctrl+Shift+J to open the JavaScript Console. Then open the Network tab to see all of the GET/POST calls. | 1 | 0 | 0 | is there a way to trace all the calls made by a web page when loading it? Say for example I went in a video watching site, I would like to trace all the GET calls recursively until I find an mp4/flv file. I know a way to do that would be to follow the URLs recursively, but this solution is not always suitable and quite... | Tracing GET/POST calls | 0 | 0 | 1 | 98 |
16,114,939 | 2013-04-19T23:35:00.000 | 0 | 0 | 0 | 0 | python,sqlalchemy | 17,140,662 | 2 | true | 0 | 0 | In the end I decided that working with the tuple returned by the query wasn't a problem. | 1 | 0 | 0 | My little website has a table of comments and a table of votes. Each user of the website gets to vote once on each comment.
When displaying comments to the user, I will select from the comments table and outerjoin a vote if one exists for the current user.
Is there a way to make a query where the vote will be attached ... | SqlAlchemy: Join onto another object | 1.2 | 1 | 0 | 149 |
16,116,446 | 2013-04-20T04:05:00.000 | 6 | 0 | 1 | 0 | python,variables,definition,literals | 16,116,484 | 2 | false | 0 | 0 | In any programming language a Literal is a constant value, where as identifiers can change their values. Identifiers can store literals and process them further. Identifiers are name given to variables.
1, 1.5, 'a', "abc", etc. are examples for literals. But in the statement x=123, x is a variable and 123 is a Literal. | 1 | 12 | 0 | I'm a beginner user for Python, but I get confused between literal and variables.
This is what I know about a literal: "a"+"b"
And variables: sentence="a"+"b" | What is the difference between literal and variables in Python? | 1 | 0 | 0 | 23,504 |
16,117,044 | 2013-04-20T05:37:00.000 | 0 | 1 | 0 | 1 | python,shell,python-2.7,putty | 16,117,169 | 2 | false | 0 | 0 | On the server, you can install tmux or screen. These programs run the program in the background and enable you to open a 'window', If I use tmux:
Open tmux: tmux
Detach (run in background): press Ctrl-b d
reattach (open a 'window'): tmux attach | 1 | 0 | 0 | I had putty on one server and run a python script available on that server. That script keep on throwing output on terminal. Later on, my internet connection went off but even then i was expecting my script to complete it job as script is on running on that server. But when internet connection resumed, I found that scr... | to keep the script running even after internet connection goes off | 0 | 0 | 1 | 289 |
16,120,373 | 2013-04-20T12:30:00.000 | 0 | 1 | 0 | 1 | python,c,ipc | 16,121,274 | 3 | false | 0 | 0 | How about writing the weight-lifting code as a library in C and then providing a Python module as wrapper around it? That is actually a pretty usual approach, in particular it allows prototyping and profiling in Python and then moving the performance-critical parts to C.
If you really have a reason to need two processe... | 1 | 9 | 0 | I have a an application with two processes, one in C and one in Python. The C process is where all the heavy lifting is done, while the Python process handles the user interface.
The C program writes to a large-ish buffer 4 times per second, and the Python process reads this data. To this point the communication to the... | How can I handle IPC between C and Python? | 0 | 0 | 0 | 12,308 |
16,120,717 | 2013-04-20T13:06:00.000 | 1 | 0 | 0 | 0 | python,html,web-applications,cgi | 16,121,984 | 2 | 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... | 1 | 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... | How to Combine Html + CSS code with python function? | 0.099668 | 0 | 0 | 3,480 |
16,122,228 | 2013-04-20T15:50:00.000 | 0 | 0 | 1 | 0 | python,json,api | 16,122,376 | 2 | 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 | 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 ... | Json output with none, one or many dictionaries in a tubple - best way to manipulate? (Bitstamp transaction list) | 0 | 0 | 0 | 144 |
16,125,352 | 2013-04-20T21:25:00.000 | 0 | 0 | 0 | 0 | python,django | 32,982,612 | 2 | 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 | 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 'name... | Getting POST values from a Django request when they start with the same string | 0 | 0 | 0 | 1,678 |
16,125,684 | 2013-04-20T22:06:00.000 | 0 | 0 | 1 | 0 | python,biopython | 16,467,481 | 1 | true | 0 | 0 | BetweenPosition is basically obsolete and can be ignored. | 1 | 0 | 0 | What is the difference between "BetweenPosition" and "WithinPosition" in Biopython.
It seems like one of them is inclusive of the endpoints, and the other is not -- but the description in the Biopython documentation didn't seem to describe that explicitly. | BetweenPosition and WithinPosition in Biopython | 1.2 | 0 | 0 | 48 |
16,126,734 | 2013-04-21T00:27:00.000 | 0 | 0 | 1 | 0 | python,init | 16,126,755 | 3 | false | 0 | 0 | Yes - when inheriting class invokes __init__() of the parent class. AFAIK, this is the only valid case of calling __init__() explicitly. | 1 | 9 | 0 | I am having a hard time figuring out the purpose some code that I've come across.
The code has a class Foo, which has an __init__ method that takes multiple arguments. From what I've learned of Python so far, by calling Foo('bar'), it will pass this string as a parameter to __init__ (which I think is supposed to be th... | What is the purpose of calling __init__ directly? | 0 | 0 | 0 | 26,811 |
16,128,593 | 2013-04-21T06:33:00.000 | 1 | 0 | 1 | 0 | python,algorithm,full-text-search | 16,128,660 | 4 | true | 0 | 0 | Maybe build a hashtable with the counts for as many n-tuples as you can afford storage for? You can prune the trees that don't appear anymore. I wouldn't call it "approximation", but could be "upper bounds", with assurance to detect strings that don't appear.
So, say you can build all 4-tuples.
Then to count occurrence... | 2 | 4 | 0 | I have a large static binary (10GB) that doesn't change.
I want to be able to take as input small strings (15 bytes or lower each) and then to determine which string is the least frequent.
I understand that without actually searching the whole binary I wont be able to determine this exactly, so I know it will be an app... | How many times string appears in another string | 1.2 | 0 | 0 | 199 |
16,128,593 | 2013-04-21T06:33:00.000 | 0 | 0 | 1 | 0 | python,algorithm,full-text-search | 16,130,707 | 4 | false | 0 | 0 | Because you have a large static string that does not change you could distinguish one-time work preprocessing this string which never has to be repeated from the work of answering queries. It might be convenient to do the one-time work on a more powerful machine.
If you can find a machine with an order of magnitude or ... | 2 | 4 | 0 | I have a large static binary (10GB) that doesn't change.
I want to be able to take as input small strings (15 bytes or lower each) and then to determine which string is the least frequent.
I understand that without actually searching the whole binary I wont be able to determine this exactly, so I know it will be an app... | How many times string appears in another string | 0 | 0 | 0 | 199 |
16,128,864 | 2013-04-21T07:20:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,google-cloud-storage | 16,135,479 | 2 | false | 1 | 0 | The data file doesnt "need to be in memory" and if you try that you will run oom.
If you can process it sequentially open it as a filestream. Ive done that with blobstore, should be similar | 1 | 3 | 0 | I'm required to process large files, up to 2GB, in GAE (I'm using Python).
of course I'll be running the code on a backend, however since a local storage isn't available the data will need to be in memory.
is there a file descriptor like wrapper for boto or other cloud storage supported protocol?
or other recommended t... | processing large cloud storage files in app engine | 0 | 0 | 0 | 281 |
16,131,781 | 2013-04-21T13:44:00.000 | 0 | 0 | 0 | 0 | .net,com,interop,ironpython | 16,272,641 | 1 | 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... | 1 | 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... | IronPython - error while invoking | 1.2 | 0 | 0 | 126 |
16,133,206 | 2013-04-21T16:07:00.000 | 1 | 0 | 0 | 0 | python,matplotlib,plot | 16,133,372 | 2 | false | 0 | 0 | I found out that subplot() should be called before the plot(), issue resolved. | 1 | 1 | 1 | I am plotting some data using pylab and everything works perfect as I expect. I have 6 different graphs to plot and I can individually plot them in separate figures. But when I try to subplot() these graphs, the last one (subplot(3,2,6)) doesn't show anything.
What confuses me is that this 6th graph is drawn perfectly ... | Python Pylab subplot bug? | 0.099668 | 0 | 0 | 375 |
16,133,352 | 2013-04-21T16:19:00.000 | 1 | 0 | 1 | 0 | python-3.x,pygame | 16,134,693 | 1 | true | 0 | 1 | The installation packages for pygame are incompatible with python 3.x However, the vast majority of the pygame modules have been ported to python 3.x, so really it's simply a matter of moving the Pygame modules to your python 3.x dist-packages.
The scrap, _movie, surfarray for Numeric, and threads modules are the one... | 1 | 0 | 0 | I have downloaded and installed pygame and I know where it is (/usr/lib/python2.7/dist-packages). I am trying to get the program consisting of the line 'import pygame' to recognize its existence but I keep getting 'ImportError: No module named pygame'. How would I get it to work? | Why can't the program recognize pygame? | 1.2 | 0 | 0 | 691 |
16,134,927 | 2013-04-21T18:51:00.000 | 7 | 0 | 0 | 1 | python,security,google-app-engine,nosql,google-cloud-datastore | 16,140,194 | 1 | true | 1 | 0 | Standard SQL injection techniques rely on the fact that SQL has various statements to either query or modify data. The datastore has no such feature. The GQL (the query language for the datastore) can only be used to query, not modify. Inserts, updates, and deletes are done using a separate method that does not use a t... | 1 | 2 | 0 | Is there any SQL injection equivalents, or other vulnerabilities I should be aware of when using NoSQL?
I'm using Google App Engine DB in Python2.7, and noticed there is not much documentation from Google about security of Datastore.
Any help would be appreciated! | NDB/DB NoSQL Injection Google Datastore | 1.2 | 1 | 0 | 973 |
16,139,169 | 2013-04-22T03:54:00.000 | 0 | 0 | 0 | 0 | python,django | 16,141,722 | 1 | 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 wi... | 1 | 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 fo... | How to determine if user is currently active on site in Django | 1.2 | 0 | 0 | 799 |
16,139,929 | 2013-04-22T05:22:00.000 | 0 | 1 | 1 | 0 | python,gevent,monkeypatching | 16,140,423 | 1 | false | 0 | 0 | Normally there's just one entry in sys.modules for each module. ie, the same module object is shares, so it affects the module as long as it's imported the same way.
It's possible to have the same module in sys.modules under two or more entries if it is imported differently. | 1 | 2 | 0 | In a file a.py, I have the lines:
import gevent
gevent.monkey.patch_all()
import b
# etc, etc
In file b.py is it necessary to monkey patch again? Is there anything wrong with monkey patching multiple times? | Is Python's monkey patching local to the current module? | 0 | 0 | 0 | 1,320 |
16,142,113 | 2013-04-22T08:00:00.000 | 2 | 0 | 1 | 0 | python,encryption,tkinter | 16,146,593 | 5 | 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 strin... | 1 | 1 | 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... | Encryption -- how to do it | 0.07983 | 0 | 0 | 859 |
16,143,460 | 2013-04-22T09:19:00.000 | 6 | 0 | 0 | 0 | python,python-3.x,drag-and-drop,tkinter | 16,145,812 | 2 | true | 0 | 1 | Tkinter has no built-in support for dragging and dropping between applications. Tkdnd is, AFAIK, the only way to accomplish it without writing the low level code yourself. | 1 | 9 | 0 | What is the correct/official/proper/recommended way of accomplishing drag/drop in tkinter? My documentation section 24.1.1 includes:
Tkdnd Drag-and-drop support for Tkinter. This is experimental and
should become deprecated when it is replaced with the Tk DND.
but I can find no other official documentation. Does Tk... | Drag and Drop in Tkinter? | 1.2 | 0 | 0 | 11,082 |
16,144,431 | 2013-04-22T10:06:00.000 | 1 | 0 | 0 | 0 | python,django,security,django-models,django-forms | 16,148,219 | 1 | true | 1 | 0 | Yes. If these cases were NOT secure they would be security issues and be patched quickly if discovered. | 1 | 2 | 0 | Sometimes I have a form that is a bit complicated in logic, and needs validation beyond just type checking or regex, so I end up handling data directly from request.POST['item'], like:
datetime.strptime(request.POST['item'], FORMAT)
MyModel.objects.filter(name=request.POST['item2']
As far as I know, the first exampl... | Django: Risks in handling data directly from request.POST["item"] | 1.2 | 0 | 0 | 159 |
16,145,317 | 2013-04-22T10:52:00.000 | 0 | 0 | 1 | 0 | python,class,pickle,typechecking,isinstance | 16,145,318 | 1 | false | 0 | 0 | AFAIK, it's not possible in any simple way; type-checking is incompatible with data pickled in a different session. I'm not a zealot when it comes to type-checking, but I like what works. | 1 | 0 | 0 | I have a really annoying bug, and I've finally tracked it down.
I use (or more accurately, already have used) a stand-alone script to create a store of objects, after which I pickle this data structure. I can then initialize my main program with the deserialized data each time my program runs.
This becomes a problem, ... | Is it possible to get isinstance or similar type-checking to work with my pickled classes? | 0 | 0 | 0 | 618 |
16,145,516 | 2013-04-22T07:12:00.000 | 11 | 0 | 1 | 0 | python,windows | 16,145,517 | 2 | 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... | 1 | 6 | 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" notic... | Detecting computer/program shutdown in Python? | 1 | 0 | 0 | 7,003 |
16,148,615 | 2013-04-22T13:41:00.000 | 0 | 1 | 1 | 0 | python,encoding,installation,xlrd | 16,168,365 | 1 | false | 0 | 0 | Upgraded to Python 3.3 and the library got installed ok. Not sure if that's a problem with Python 3.2 or the instance I had. | 1 | 0 | 0 | I'm trying to install a xlrd 0.9.2 package on Python3.2 on windows 7. When I launch the setup.py install I receive encoding error: 'utf8' codec can't decode...
The module (licenses.py) where the installer stops has an encoding declaration:
# -*- coding: cp1252 -*-
but it seems the python is ignoring it.
I was using ... | python encoding error at xlrd installation | 0 | 0 | 0 | 315 |
16,148,872 | 2013-04-22T13:51:00.000 | 6 | 0 | 1 | 1 | python,powershell,python-2.7 | 16,150,017 | 2 | 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 | 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 launch... | Python will not run in windows powershell | 1.2 | 0 | 0 | 7,079 |
16,148,872 | 2013-04-22T13:51:00.000 | 0 | 0 | 1 | 1 | python,powershell,python-2.7 | 16,149,638 | 2 | 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", "cre... | 2 | 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 launch... | Python will not run in windows powershell | 0 | 0 | 0 | 7,079 |
16,148,893 | 2013-04-22T13:52:00.000 | 1 | 0 | 0 | 1 | python,unix,centos,version | 16,148,913 | 2 | false | 0 | 0 | When you run anything on the command-line, it will search through the folders in the PATH variable, in order, until it finds an executable file with that name. | 1 | 1 | 0 | I have python in both /usr/bin and /usr/local/bin. Now I have this question that which one will execute if I call python?
I know that I can check with which python command to see which one is which one. But I'm asking which one would work by default? | which version of program will execute? the one in the /usr/bin or the one in /usr/local/bin? | 0.099668 | 0 | 0 | 58 |
16,149,187 | 2013-04-22T14:06:00.000 | 0 | 0 | 1 | 0 | python,file,numpy | 16,149,290 | 4 | false | 0 | 0 | I had this problem long ago so i dont have the code near to show you, but i used a binary write in a tmp file to get that done.
EDIT: Thats is, pickle is what i used. Thanks SpankMe and RoboInventor | 2 | 0 | 1 | I need to save multiple numpy arrays along with the user input that was used to compute the data these arrays contain in a single file. I'm having a hard time finding a good procedure to use to achieve this or even what file type to use. The only thing i can think of is too put the computed arrays along with the user ... | Saving python data for an application | 0 | 0 | 0 | 106 |
16,149,187 | 2013-04-22T14:06:00.000 | 2 | 0 | 1 | 0 | python,file,numpy | 16,149,283 | 4 | false | 0 | 0 | How about using pickle and then storing pickled array objects in a storage of your choice, like database or files? | 2 | 0 | 1 | I need to save multiple numpy arrays along with the user input that was used to compute the data these arrays contain in a single file. I'm having a hard time finding a good procedure to use to achieve this or even what file type to use. The only thing i can think of is too put the computed arrays along with the user ... | Saving python data for an application | 0.099668 | 0 | 0 | 106 |
16,149,613 | 2013-04-22T14:26:00.000 | 8 | 0 | 1 | 1 | python,django,gcc,lxml | 24,547,445 | 7 | false | 0 | 0 | I met the similar question(error: command 'gcc' failed with exit status 4) this morning. It seems you need check your machine's memory. If the memory is lower than 512M,that may be the cause.Try to close some services temporarily,like apache server,and try "pip install lxml" again.It maybe work! | 1 | 35 | 0 | I'm having the following error when trying to run "pip install lxml" into a virtualenv in Ubuntu 12.10 x64. I have Python 2.7.
I have seen other related questions here about the same problem and tried installing python-dev, libxml2-dev and libxslt1-dev.
Please take a look of the traceback from the moment I tip the comm... | Installing lxml with pip in virtualenv Ubuntu 12.10 error: command 'gcc' failed with exit status 4 | 1 | 0 | 0 | 37,060 |
16,151,665 | 2013-04-22T16:08:00.000 | 1 | 0 | 0 | 0 | python,flash,bots | 16,154,217 | 1 | 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 | 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 t... | How to make this bot work? | 0.197375 | 0 | 0 | 253 |
16,151,727 | 2013-04-22T16:12:00.000 | 0 | 0 | 0 | 0 | python,python-3.x,pyqt,pyqt4,python-3.3 | 16,198,711 | 1 | true | 0 | 1 | I found out a solution. I was trying to do everything in my GUI thread. Im new to python but I am sure with some research I can teach myself threads. | 1 | 1 | 0 | What I am trying to achieve seems like it should be simple, but I can not find anything online to help.
I would like to take my pyqt program and, instead of using the command prompt, export all my print() commands to a qtextbrowser.
There are 2 parts to my question.
How do I disable the command prompt from showing up ... | Real time command prompt export in text field using pyqt4 | 1.2 | 0 | 0 | 403 |
16,152,515 | 2013-04-22T16:53:00.000 | 0 | 0 | 1 | 0 | python-3.x,symbian3,s60-3rd-edition | 22,061,960 | 1 | 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 b... | 1 | 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? | 0 | 0 | 0 | 90 |
16,152,851 | 2013-04-22T17:15:00.000 | 1 | 0 | 1 | 0 | python,logging,stack-trace | 16,152,852 | 2 | false | 0 | 0 | Looking around I found the following solution / workaround:
sys.tracebacklimit = 0 | 1 | 5 | 0 | I would like to disable the stack trace that is printed when there is an exception raised. | How to disable stack trace in python | 0.099668 | 0 | 0 | 6,658 |
16,152,965 | 2013-04-22T17:20:00.000 | 1 | 0 | 0 | 0 | java,python,pdf,text | 16,153,090 | 3 | true | 1 | 0 | For java: have a look at iText
For python I would use PDFMiner | 1 | 0 | 0 | I have about 10,000 of pdf files(conf papers) and I need to extract text from certain section (like the experimental section) of these papers and save in a file.
Does anyone know a java tool or some python tool which can help me do this?
Thanks in advance
Ayush | automatically extract text from pdf for many files | 1.2 | 0 | 0 | 901 |
16,153,501 | 2013-04-22T17:50:00.000 | 0 | 0 | 1 | 0 | python,built-in,python-internals | 16,153,558 | 2 | false | 0 | 0 | An object isn't aware of its own name (it can have many), let alone of any unique ID it has associated with it. So - in short - no. The reasons that __len__ and co. work is that they are bound to the object already - an object is not bound to its ID. | 1 | 6 | 0 | In Python:
len(a) can be replaced by a.__len__()
str(a) or repr(a) can be replaced by a.__str__() or a.__repr__()
== is __eq__, + is __add__, etc.
Is there similar method to get the id(a) ? If not, is there any workaround to get an unique id of a python object without using id() ?
edit: additional question: if not ?... | Python, what is the object method of built-in id()? | 0 | 0 | 0 | 3,035 |
16,153,597 | 2013-04-22T17:55:00.000 | 0 | 1 | 1 | 0 | python,windows,mingw,msys | 16,485,372 | 2 | false | 0 | 0 | The best possibility is to change your build script to point to -lboost_python-mgw46-mt-1_53.dll
If you rename libboost_python-mgw46-mt-1_53.dll you have to rename libboost_python-mgw46-mt-1_53.dll.a to.
Often have dll's a reciprocal reference, if you now, only renames, the original names are not found.
So do not rena... | 1 | 0 | 0 | I am trying to compiling an autodiff python library, pyadolc, on Windows with Mingw. It requires boost python to call the underlying c++ library, adol-c.
I first compiled boost_python library (dll) with mingw. The dll generated are namead as libboost_python-mgw46-mt-1_53.dll and libboost_python-mgw46-mt-1_53.dll.a, sit... | How should I handle an "incorrectly" named dll? | 0 | 0 | 0 | 118 |
16,154,500 | 2013-04-22T18:52:00.000 | 5 | 0 | 1 | 0 | python | 16,154,528 | 1 | true | 0 | 0 | Perhaps you want rLu[int(lineList[0])-1].update(umDict)? It's a little difficult to understand your data structure from your description. If I understand you right, you do not have a "key-value pair", you have a one-key dictionary. | 1 | 0 | 0 | I need a little assistance with inserting a key:value pair from a dictionary (called umDict) into an already existing dictionary in a list at a specific spot in that list.
What I have already is a list (called rLu) that's filled with 943 empty dictionaries. I also have a list called lineList that has parsed a string an... | Insert dictionary key:value into existing dictionary at a specific index in a list | 1.2 | 0 | 0 | 635 |
16,155,776 | 2013-04-22T20:07:00.000 | 0 | 0 | 0 | 0 | python,twisted | 16,171,818 | 1 | true | 0 | 0 | As you use XML-RPC, you will have to write simple Twisted web application that handles XML-RPC calls. There are many possibilities for cache: expiring, storing on disk, invalidating, etc etc. You may start from simple dict for storing queries and find its limitations. | 1 | 1 | 0 | I am totally fresh and noob as you can be on Twisted. I chose a database proxy as my final project. The idea is, have a mysql as a database. A twisted proxy runs in between client and the database.The proxy makes the methods like UPDATE,SELECT,INSERT through its XMLRPC to the client. And, the methods itself in the prox... | Database Proxy using Twisted | 1.2 | 1 | 0 | 166 |
16,157,144 | 2013-04-22T21:36:00.000 | 2 | 0 | 0 | 0 | python,database,pyramid | 16,159,421 | 1 | true | 1 | 0 | initialize_db is not a migration script. It is for bootstrapping your model and that's that. If you want to tie in migrations with upgrade/rollback support, look at alembic for SQL schema migrations. | 1 | 0 | 0 | I am a rails developer that is learning python and I am doing a project using the pyramid framework. I am used to having some sort of way of rolling back the database changes If I change the models in some sort of way. Is there some sort of database rollback that works similar to the initialize_project_db command? | Is there some sort of way to roll back the initialize_project_db script in pyramid? | 1.2 | 1 | 0 | 139 |
16,157,258 | 2013-04-22T21:43:00.000 | 5 | 0 | 1 | 0 | python,integer,character,comparison-operators | 16,157,300 | 1 | true | 0 | 0 | There's no "char" type in python, chr returns a string of length one, and with strong typing it doesn't make sense for any string to be equal to any integer. | 1 | 1 | 0 | I ran into this interesting little 'gotcha' this evening, consider the following code snippet:
( chr(1) == 1 )
This comparison evaluates to False on Python 2.7.4, is this a feature or a bug?, If a feature, can anyone explain the reasoning behind this design decision? | Python evaluates comparison of integer and character with the same value as False | 1.2 | 0 | 0 | 386 |
16,157,636 | 2013-04-22T22:13:00.000 | 0 | 1 | 1 | 0 | c#,special-characters,ironpython | 16,273,312 | 1 | false | 1 | 0 | Probably you are doing something wrong. There is no issues with encoding and IronPython. Check encoding for script you load before.. | 1 | 0 | 0 | I am facing an encoding issue while trying to pass a string from two C# modules using Ironpython code as a bridge.
Special characters like € , © gets distorted when the string is received by the recipient module.
Can anyone please advise if its a IronPython issue ? and how to fix this type of issue
Thanks,
Amit | special character encoding C# and Ironpython | 0 | 0 | 0 | 387 |
16,158,308 | 2013-04-22T23:17:00.000 | 1 | 0 | 0 | 0 | python,django,django-1.5 | 16,158,406 | 1 | true | 1 | 0 | If you are sure that there are not any dependencies from some other files in your project or in your apps you can safely remove them.
First comment out one by one and every time check the project in your browser if it is running correctly. Also check the logs for warnings and errors. | 1 | 0 | 0 | I'd like to know if I can just ditch the Sites default app (comment it out from INSTALLED_APPS and so on) without breaking anything?
It's written in the doc that some other parts of django use it (redirects framework, comments, flatpages, syndic, auth, shortcut and view on site), but it's not explicitly said if it's go... | Remove django sites app | 1.2 | 0 | 0 | 182 |
16,159,985 | 2013-04-23T02:39:00.000 | 0 | 0 | 0 | 0 | java,python,graph,jython,networkx | 16,269,881 | 1 | false | 0 | 0 | Jython is python language spec inside of the JVM much like JRuby.
NetworkX source code is C or fortran (don't remember which).
Numpy/Scipy are C based (great packages for scientific computing).
Matplotlib is c (for display of the graphs).
NetworkX will help create graphs, matplotlib will help display them but both may ... | 1 | 1 | 0 | I need to use python with Java in a project in which graphs (the kind with nodes and edges) plays a large role. I want to visualize those graphs in a simple GUI and update its node labels/edge weights/whatever every second or so. I also want to load graphs from files in graphml form.
Networkx is advised by many people,... | Jython graph library | 0 | 0 | 1 | 1,298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.