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
23,900,813
2014-05-27T23:55:00.000
0
0
0
0
python,django,django-views,django-sites
23,903,821
2
false
1
0
add SITE_ID = 1 to your settings.py, and run python manage.py syncdb to create corresponding tables if not exist, this will work and then, you could login into your admin site: click Site to modify defalut example.com to yours, this used when you edit an object, It will provide a View on site button if you defined a g...
1
0
0
I have an issue with the Sites system in Django. My problem is when running Site.objects.get_current() on some pages on initial load of the development server I get an exception saying Site matching query does not exist. however if I load the main page of the site it loads just fine then I can go back to any other page...
Issue with Sites system in Django
0
0
0
58
23,904,066
2014-05-28T06:15:00.000
0
1
0
0
python,scala,unit-testing
24,052,936
2
true
0
0
Short answer: Maybe, but don't. Eventually common sense prevailed. I now aim to either use pyspark or port the unit tests across to Scala along with the rest of the library. Exposing Scala to Python was achievable by generating Scala code that prints specifically what I wanted. Then from Python calling SBT to compile ...
1
0
0
I have a library written in Python complete with unit tests. I'm about to start porting of the functionality to Scala to run on Spark and as part of an Android application. But I'm loath to reproduce the unit tests in scala. Is there a method for exposing the to-be-written Scala library to external interrogation from ...
Scala Testing with Python unittests
1.2
0
0
520
23,908,547
2014-05-28T10:02:00.000
1
1
1
0
python,performance,jit,numba
23,944,220
2
false
0
0
Numba is mapping math.sqrt calls to sqrt/sqrtf in libc already. The slowdown probably comes from the overhead of Numba. This overhead comes from (un)boxing PyObjects and detecting if errors occurred in the compiled code. It affects calling small functions from Python but less when calling from another Numba compiled...
2
1
1
I have a complex function that performs math operations that cannot be vectorized. I have found that using NUMBA jit compiler actually slows performance. It it probably because I use within this function calls to python math.sqrt. How can I force NUMBA to replace calls to python math.sqrt to faster C calls to sqrt? -- ...
how improve speed of math.sqrt() with numba jit compiler in python 2.7
0.099668
0
0
1,612
23,908,547
2014-05-28T10:02:00.000
4
1
1
0
python,performance,jit,numba
23,943,709
2
false
0
0
Numba already does replace calls to math.sqrt to calls to a machine-code library for sqrt. So, if you are getting slower performance it might be something else. Can you post the code you are trying to speed up. Also, which version of Numba are you using. In the latest version of Numba, you can call the inspect_ty...
2
1
1
I have a complex function that performs math operations that cannot be vectorized. I have found that using NUMBA jit compiler actually slows performance. It it probably because I use within this function calls to python math.sqrt. How can I force NUMBA to replace calls to python math.sqrt to faster C calls to sqrt? -- ...
how improve speed of math.sqrt() with numba jit compiler in python 2.7
0.379949
0
0
1,612
23,909,692
2014-05-28T10:54:00.000
25
1
1
0
python,unit-testing
23,909,751
1
true
0
0
You can't. Local variables are local to the function and they cannot be accessed from the outside. But the bigger point is that you shouldn't actually be trying to test the value of a local variable. Functions should be treated as black boxes from the outside. The are given some parameters and they return some values a...
1
15
0
I need to write a test that will check a local variable value inside a static function. I went through all the unittest docs but found nothing yet.
How to unittest local variable in Python
1.2
0
0
9,780
23,913,689
2014-05-28T13:56:00.000
1
0
0
1
python,linux,mod-wsgi,wsgi
23,920,537
1
false
1
0
OSError [Errno 10] no child processes can mean the program ran, but took too much memory and died. Starting jobs within Apache is fine. Running as root is a bit sketchy, but isn't that big of a deal. Note that the 'root' account setup, like PATH, might be different from your account. This would explain why it runs fr...
1
0
0
I have a python wsgi script that is attempting to make a call to generate an openssl script. Using subprocess.check_call(args), the process throws an OSError [Errno 10] no child processes. The owner of the opensll bin is root:root. Could this be the problem? Or does apache not allow for child processes? Using just th...
Python wsgi OSError: [Errno 10] No child process
0.197375
0
0
1,426
23,914,274
2014-05-28T14:20:00.000
1
0
1
0
python
23,915,208
1
true
0
0
The use of strings or integers depends on the size of your DNA sequence. I know that some sequences might be over millions of elements. It is better to use typed integers if you are dealing with a lot of information. Otherwise, you can use strings if it is more suitable for you.
1
3
0
I am trying to represent the sequence of a biological virus as ATGCs, but I have seen code where it is represented as 1234s instead. Are there any differences in memory usage or code speed if we store it as the integers [1,2,3,4] instead of the letters [A,T,G,C]? For those who might need a bit more context, I will not...
Should I store categorical variables as integers or letters in Python?
1.2
0
0
86
23,916,186
2014-05-28T15:42:00.000
7
0
1
0
python,shared-libraries,python-wheel,python-cffi
30,941,390
2
false
0
0
Wheels are the standard way of distributing Python packages, but there is a problem when you have extension modules that depend on other so's. This is because the normal Linux dynamic linker is used, and that only looks in /usr/lib or /usr/local/lib. This is a problem when installing a wheel in a virtualenv. As far as ...
1
30
0
I want to create package for python that embeds and uses an external library (.so) on Linux using the cffi module. Is there standard way to include .so file into python package? The package will be used only internally and won't be published to pypi. I think Wheel packages are the best option - they would create platfo...
How to include external library with python wheel package
1
0
0
12,753
23,917,036
2014-05-28T16:23:00.000
4
0
1
0
metadata,ipython-notebook
24,728,131
2
false
0
0
If I understand what you are looking for: from the Cell Toolbar (top right of the ipython notebook toolbar), select Edit Metadata from the drop-down list.
1
10
0
I want to store the values of my IPython.html.widgets in my ipython notebook somehow. Is there a way to modify the metadata of the current cell from the code within the cell itself?
Modify cell's metadata
0.379949
0
0
4,821
23,917,776
2014-05-28T17:04:00.000
-1
0
1
0
python,function,return,exec
65,267,489
10
false
0
0
if we need a function that is in a file in another directory, eg we need the function1 in file my_py_file.py located in /home/.../another_directory we can use the following code: def cl_import_function(a_func,py_file,in_Dir): ... import sys ... sys.path.insert(0, in_Dir) ... ax='from %s import %s'%(py_file,a_func)...
2
41
0
For testing purposes I want to directly execute a function defined inside of another function. I can get to the code object of the child function, through the code (func_code) of the parent function, but when I exec it, i get no return value. Is there a way to get the return value from the exec'ed code?
How do I get the return value when using Python exec on the code object of a function?
-0.019997
0
0
42,376
23,917,776
2014-05-28T17:04:00.000
0
0
1
0
python,function,return,exec
70,064,689
10
false
0
0
use eval() instead of exec(), it returns result
2
41
0
For testing purposes I want to directly execute a function defined inside of another function. I can get to the code object of the child function, through the code (func_code) of the parent function, but when I exec it, i get no return value. Is there a way to get the return value from the exec'ed code?
How do I get the return value when using Python exec on the code object of a function?
0
0
0
42,376
23,920,481
2014-05-28T19:41:00.000
-1
0
0
0
python,mysql,django,postgresql
23,920,627
3
false
1
0
Usually when the settings that are controlling the application are changed then the server has to be restarted.
3
0
0
I was wondering in which cases do I need to restart the database server in Django on production. Whether it is Postgres/MySQL, I was just thinking do we need to restart the database server at all. If we need to restart it, when and why do we need to restart the server? Any explanation would be really helpful, Cheers!
When do I need to restart database server in Django?
-0.066568
1
0
237
23,920,481
2014-05-28T19:41:00.000
2
0
0
0
python,mysql,django,postgresql
23,920,963
3
false
1
0
You will not NEED to restart your database in production due to anything you've done in Django. You may need to restart it to change your database security or configuration settings, but that has nothing to do with Django and in a lot of cases doesn't even need a restart.
3
0
0
I was wondering in which cases do I need to restart the database server in Django on production. Whether it is Postgres/MySQL, I was just thinking do we need to restart the database server at all. If we need to restart it, when and why do we need to restart the server? Any explanation would be really helpful, Cheers!
When do I need to restart database server in Django?
0.132549
1
0
237
23,920,481
2014-05-28T19:41:00.000
1
0
0
0
python,mysql,django,postgresql
23,920,777
3
true
1
0
You shouldn't really ever need to restart the database server. You probably do need to restart - or at least reload - the web server whenever any of the code changes. But the db is a separate process, and shouldn't need to be restarted.
3
0
0
I was wondering in which cases do I need to restart the database server in Django on production. Whether it is Postgres/MySQL, I was just thinking do we need to restart the database server at all. If we need to restart it, when and why do we need to restart the server? Any explanation would be really helpful, Cheers!
When do I need to restart database server in Django?
1.2
1
0
237
23,921,986
2014-05-28T21:13:00.000
2
0
0
0
python,web-scraping,beautifulsoup,web-crawler
23,922,228
2
false
1
0
You're basically asking "how do I write a search engine." This is... not trivial. The right way to do this is to just use Google's (or Bing's, or Yahoo!'s, or...) search API and show the top n results. But if you're just working on a personal project to teach yourself some concepts (not sure which ones those would be...
1
8
0
I'm trying to teach myself a concept by writing a script. Basically, I'm trying to write a Python script that, given a few keywords, will crawl web pages until it finds the data I need. For example, say I want to find a list of venemous snakes that live in the US. I might run my script with the keywords list,venemou...
Web scraping without knowledge of page structure
0.197375
0
1
3,298
23,924,714
2014-05-29T02:14:00.000
1
0
0
0
python,scikit-learn,outliers
23,930,543
1
false
0
0
There's no support for masking in scikit-learn; outlier detection is done ad hoc by some estimators (e.g. DBSCAN, or RANSAC, which will appear in the next release). If you want to remove outliers yourself, just use NumPy indexing.
1
2
1
I have a pipeline where I transform some data and fit a curve to it. Is there a preferred/standard way for masking the outliers in the data?
Is it possible to mask outliers within a scikit learn pipeline?
0.197375
0
0
906
23,925,726
2014-05-29T04:31:00.000
11
0
0
0
python,django
25,240,502
12
false
1
0
You may be calling a site object before creating site model(before syncdb or migrate) ex: site = Site.objects.get(id=settings.SITE_ID)
5
35
0
I am running a test django server on aws and I just installed django-userena and when I try to signup a user upon clicking submit, I get the following message: relation "django_site" does not exist LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si... I am not really sure what went wrong here. ...
Django: relation "django_site" does not exist
1
0
0
30,101
23,925,726
2014-05-29T04:31:00.000
1
0
0
0
python,django
62,523,888
12
false
1
0
if you are getting this error when deploying you django app to Heroku, make sure you have run: heroku run python manage.py migrate This worked for me
5
35
0
I am running a test django server on aws and I just installed django-userena and when I try to signup a user upon clicking submit, I get the following message: relation "django_site" does not exist LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si... I am not really sure what went wrong here. ...
Django: relation "django_site" does not exist
0.016665
0
0
30,101
23,925,726
2014-05-29T04:31:00.000
-1
0
0
0
python,django
70,516,679
12
false
1
0
I just restarted my computer and problem disappeared :) (restarting docker-compose is not enough).
5
35
0
I am running a test django server on aws and I just installed django-userena and when I try to signup a user upon clicking submit, I get the following message: relation "django_site" does not exist LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si... I am not really sure what went wrong here. ...
Django: relation "django_site" does not exist
-0.016665
0
0
30,101
23,925,726
2014-05-29T04:31:00.000
1
0
0
0
python,django
34,530,826
12
false
1
0
A horrible code lead to this error for me. I had a global variable to get the current site SITE = Site.objects.get(pk=1) this was evaluated during migration and lead to the error.
5
35
0
I am running a test django server on aws and I just installed django-userena and when I try to signup a user upon clicking submit, I get the following message: relation "django_site" does not exist LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si... I am not really sure what went wrong here. ...
Django: relation "django_site" does not exist
0.016665
0
0
30,101
23,925,726
2014-05-29T04:31:00.000
1
0
0
0
python,django
60,034,840
12
false
1
0
Going to leave this here for future me: python manage.py makemigrations allauth This worked for me, I forgot why, took me too long to figure out how I fixed this the first time Edit: makemigrations sometimes doesnt make 3rd party things like allauth which some of my projects use, so I have to specify those ones
5
35
0
I am running a test django server on aws and I just installed django-userena and when I try to signup a user upon clicking submit, I get the following message: relation "django_site" does not exist LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si... I am not really sure what went wrong here. ...
Django: relation "django_site" does not exist
0.016665
0
0
30,101
23,930,672
2014-05-29T10:00:00.000
0
0
1
0
python,vim,pyflakes
23,931,250
2
false
0
0
You are supposed to install plugins and colorschemes in $HOME/.vim/. If that directory doesn't exist already, create it. Same deal with $HOME/.vim/ftplugin/ and so on…
1
0
0
I am having difficulty in having pyflakes in vim for statin analysis of python code. When I find folders on my system with name "ftplugin" I see following results: /usr/share/vim/vimfiles/after/ftplugin /usr/share/vim/vimfiles/after/ftplugin/ftplugin /usr/share/vim/vimfiles/ftplugin /usr/share/vim/vim72/ftplugin Where ...
Where to add pyflakes folder for static analysis in vim for python?
0
0
0
159
23,932,002
2014-05-29T11:12:00.000
0
0
0
0
python,jython
23,934,381
2
false
1
0
The first thing to do is to read the exception. About seven lines in, your exception says "Caused by: java.lang.NullPointerException". I would focus on that. Where is the null coming from? Also note that your stack trace is missing some lines at the end, where it says "... 7 more". This makes it hard to read the exc...
1
0
0
I am a java person not well versed in jython or python. So pardon my ignorance if this is a basic question. I am using jython 2.5, python 2.5 and jre 1.7. Intermittently, the jython interpreter fails to start, and is throwing an error like: Exception in thread "main" java.lang.ExceptionInInitializerError - ...
Jython throws java.lang.ExceptionInInitializerError intermittently
0
0
0
913
23,936,409
2014-05-29T14:59:00.000
14
0
1
0
ipython,ipython-notebook
23,940,905
1
true
0
0
You can launch your iPython notebook in the folder that you want the server to have access to, and the user won't be able to go to the parent directory, but you should realize that when the user launches a kernel, they will be able to chdir to any folder in the file system. So if you want to limit access to users of t...
1
13
0
I'm running ipython notebook server on the cloud and i want to expose this as a service so that users can play around with the notebook, i noticed that using notebook i can access the filesystem and inspect files on the filesystem, i want to limit this access.I want only special folders to be accessible from ipython no...
How to limit ipython notebook directory access
1.2
0
0
6,374
23,943,024
2014-05-29T21:07:00.000
0
0
1
0
java,python,json,dictionary,map
23,943,045
2
false
1
0
You could pass it as JSON, and parse the info out of the JSON in Java. If the data is more simple, you could make every other String in Java's String[] args parameter represent a key or value, and then have your code loop through those and add them to a map.
1
0
0
I am calling a Java file within Python code. Currently, I am passing it several parameters which Java sees in its String[] args array. I would prefer to pass just one parameter that is a Python dictionary (dict) which Java can understand and make into a map. I know I will probably have to pass the python dictionary as ...
Pass a Python dict to a Java map possibly with JSON?
0
0
0
1,082
23,944,242
2014-05-29T22:46:00.000
7
1
1
0
python,c,numpy,gmp,gmpy
23,946,348
1
true
0
0
numpy and GMPY2 have different purposes. numpy has fast numerical libraries but to achieve high performance, numpy is effectively restricted to working with vectors or arrays of low-level types - 16, 32, or 64 bit integers, or 32 or 64 bit floating point values. For example, numpy access highly optimized routines writt...
1
2
1
I understand that GMPY2 supports the GMP library and numpy has fast numerical libraries. I want to know how the speed compares to actually writing C (or C++) code with GMP. Since Python is a scripting language, I don't think it will ever be as fast as a compiled language, however I have been wrong about these generaliz...
How do numpy and GMPY2 compare with GMP in terms of speed?
1.2
0
0
2,014
23,948,317
2014-05-30T06:21:00.000
1
0
1
0
python,virtualenv
23,948,495
5
false
0
0
A Virtual Environment, put simply, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects. For example, you can work on a project which requires Django 1.3 while also maintaining a project which requires Django 1.0.
2
15
0
I am a beginner in Python. I read virtualenv is preferred during Python project development. I couldn't understand this point at all. Why is virtualenv preferred?
Why is virtualenv necessary?
0.039979
0
0
8,475
23,948,317
2014-05-30T06:21:00.000
1
0
1
0
python,virtualenv
57,047,780
5
false
0
0
Suppose you are working on multiple projects, one project requires certain version of python and other project requires some other version. In case you are not working on virtual environment both projects will access the same version installed in your machine locally which in case can give error for one. While in case ...
2
15
0
I am a beginner in Python. I read virtualenv is preferred during Python project development. I couldn't understand this point at all. Why is virtualenv preferred?
Why is virtualenv necessary?
0.039979
0
0
8,475
23,954,173
2014-05-30T12:03:00.000
0
0
1
0
python,emacs,python-mode,ido
23,982,213
1
false
0
0
M-x imenu RET provides that functionality already. Should work with python-mode.el as with shipped python.el Checked with GNU Emacs 24.3.90.1 (i686-pc-linux-gnu, GTK+ Version 3.6.5) of 2014-04-21 In case of trouble start from emacs -Q
1
1
0
The function ido-goto-symbol when run in emacs python mode, shows the message No items suitable for an index found in this buffer. How can I get the ido-goto-symbol to work in python-mode so that it lists functions and classes present in the python file?
Ido-goto-symbol command support for emacs python mode
0
0
0
198
23,957,232
2014-05-30T14:40:00.000
1
0
0
0
python,django,email
23,959,164
3
false
1
0
As J. C. Leitão pointed out, the django error debug page has javascript and css(most css doesn't work in email). But all these css and js code are inline. The debug page is a single html file that has no external resources. In my company, we include the html as a attachment in the report email. When we feel the plain t...
1
7
0
Django has an awesome debug page that shows up whenever there's an exception in the code. That page shows all levels in the stack compactly, and you can expand any level you're interested in. It shows only in debug mode. Django also has an awesome feature for sending email reports when errors are encountered on the pro...
Making the stack levels in Django HTML email reports collapsable
0.066568
0
0
123
23,963,825
2014-05-30T21:44:00.000
0
0
0
0
python,user-input
23,963,904
1
false
0
0
No, python cannot accept this kind of input through raw_input. This is because you're thinking about sequences like: Ctrl-C, Ctrl-Z, etc. These are not keyboard inputs, these are signals that are processed by the terminal (not the program). You can try to set up signal handlers that will do this for you, but that is ...
1
0
0
I am writing a command line interface in python that accepts a lot of user input. For the values that I am querying the user about, there is a significant amount of "additional information" that I could display, but would rather only display if the user needed help with how to provide a value. So I thought I would prov...
Can Python Accept Ctrl+[char] using raw_input?
0
0
0
158
23,964,506
2014-05-30T22:55:00.000
3
0
1
0
python,string,escaping
23,964,541
2
false
0
0
The r prefix for a string literal doesn't disable escaping, it changes escaping so that the sequence \x (where x is any character) is "converted" to itself. So then, \' emits \' and your string is unterminated because there's no ' at the end of it.
1
0
0
I'm trying to understand why python has this unheard of behavior. If I'm writing rawdata string, it is much more likely that I won't want escaping quotes. This behavior forces us to write this weird code: s = r'something' + '\\' instead of just 's = r'something\' any ideas why python developers found this more sensible...
Why does python allow escaping quotes in rawdata string?
0.291313
0
0
78
23,965,028
2014-05-31T00:00:00.000
7
0
1
0
python,for-loop,generator,cython,coroutine
23,983,403
1
false
0
0
Some recommendations: Cython supports generators out of the box, so you should try passing your Python code with generators to cython and see what kind of speedup you get. Next step is to add as much static typing information to your loops to speed up the work the generators are doing. Python generators are cool, but ...
1
4
0
I have Python code that has lots of loops that consume data from Python generators. Some also re yield the processed data. This is a bottleneck and I want to speed this part up and was thinking of using Cython. What is the recommended way to deal with generators and yield. I would like to Convert Python generators int...
Cythonizing for loops that iterate over generators
1
0
0
2,859
23,965,691
2014-05-31T01:57:00.000
0
0
1
0
python,git,virtualenv
23,965,791
1
true
0
0
When using env, that essentially means the first python instance in your PATH will be used. What is the output when you do which python? Which version is virtualenv using instead? It may be that you're using the system python instead of the virtualenv without that change. How are you actually invoking the scripts? If y...
1
0
0
files from the Grinberg flask tutorial on git won't work for me locally unless I add #!/usr/bin/env python to the first line - but I thought the default python for my xubuntu apt-get installation of virtualenv was supposed to be python 2.7 ? Can I invoke virtualenv in a way that ensures the right python gets used so I ...
virtualenv gets wrong python?
1.2
0
0
2,213
23,965,870
2014-05-31T02:37:00.000
6
0
1
0
python,json,string,dictionary,ordereddictionary
23,965,905
2
true
0
0
When you convert an OrderedDict to a normal dict, you can't guarantee the ordering will be the preserved, because dicts are unordered. Which is why OrderedDict exists in the first place. It seems like you're trying to have your cake and eat it too, here. If you want the order of the JSON string preserved, use the answe...
1
1
0
How do I convert an OrderedDict to a normal dictionary while preserving the same order? The reason I am asking this is because is when I fetch my data from an API, I get a JSON string, in which I use json.loads(str) to return a dictionary. This dictionary that is returned from json.loads(...) is just out of order and ...
Convert OrderedDict to normal dict preserving order?
1.2
0
0
3,780
23,967,242
2014-05-31T06:44:00.000
1
1
0
1
python,apache,web-deployment
23,967,560
1
true
0
0
It depends on how the GUI is written, what abc.exe does and how you want to use the web interface. In general, what you want is not possible. While for local applications there is only one user and it is clear, when the user terminates the program, for web applications there can be millions of users at the same time, a...
1
2
0
I wrote a program in C, and designed its GUI using Python. Now I want to convert it to a web app. I have GUI.py and abc.exe file. Can I directly execute GUI Python script (GUI.py) on 'Apache2' local server? If yes, then how?
How to run GUI Python script on Apache?
1.2
0
0
417
23,971,667
2014-05-31T15:24:00.000
3
0
0
0
python,sql,client,hive
23,984,349
1
false
0
0
Fixed! It was due to permission on remote server. Changed user in connect statement from 'root' to 'hdfs' solved the problem.
1
1
0
I am using pyhs2 as hive client. The sql statement with ‘where’ clause was not recognized. Got 'pyhs2.error.Pyhs2Exception: 'Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask' But it runs ok in hive shell.
python hive client pyhs2 does not recognize 'where' clause in sql statement
0.53705
1
0
945
23,979,911
2014-06-01T12:33:00.000
0
0
1
0
python,python-2.7
23,979,979
2
false
0
0
You can solve it with str.split but this should be solved with os.path.split
1
0
0
Say that I have this string "D:\Users\Zache\Downloads\example.obj" and I want to copy another file to the same directory as example.obj. How do I do this in a way that´s not hardcoded? "example" can also be something else (user input). I'm using filedialog2 to get the big string. This is for an exporter with a basic G...
Remove a string (filename) from a bigger string (the whole path)
0
0
0
34
23,980,268
2014-06-01T13:15:00.000
3
0
0
0
xml,python-2.7,ms-word,python-docx
24,001,416
1
true
0
0
The short answer is that you can't reliably determine soft page breaks from a .docx file. You can identify hard page breaks and you may be able to detect where Word broke pages the last time it "flowed" the document. A Word document is a "flowed" document, meaning that Word's layout engine "flows" the text of the docum...
1
1
0
How do I identify a new page, or some identifier that denotes a pages number using python-docx? I've looked through the docs to no avail so far and have also tried looking for the WD_BREAK.PAGE attribute but this feature is not yet support. All help is appreciated thanks.
Find a new page in a word document
1.2
0
0
666
23,983,822
2014-06-01T19:50:00.000
4
0
1
0
python,ipython,anaconda,qtconsole
23,998,898
2
true
0
0
The launcher always points to the root environment (Python 2). If you have activated the Python 3 environment, you can launch the notebook by just typing ipython notebook (and the same with the qtconsole with ipython qtconsole).
2
4
0
I have installed in Window 7 environment Anaconda 2.0. The default Python is 2.7 but also Python 3.4 is installed. I am able to activate Python 3.4 with the command "activate py3k". After this Spyder IDE does work right with Python 3.4 But 1) I'm not able to start Ipython Notebook and QT Console with Python 3.4 2) I'...
How to activate Ipython Notebook and QT Console with Python 3.4 in Anaconda 2.0
1.2
0
0
8,218
23,983,822
2014-06-01T19:50:00.000
5
0
1
0
python,ipython,anaconda,qtconsole
24,006,124
2
false
0
0
As asmeurer said, when in your py3k environment in the command prompt, you can launch a 3.4 kernel with the ipython notebook command. You can run both a 2.7 and a 3.4 at the same time if you specify a different port, for instance, ipython notebook --port 8080 The 2.7 will default to 8888. Note that, by default, IPython...
2
4
0
I have installed in Window 7 environment Anaconda 2.0. The default Python is 2.7 but also Python 3.4 is installed. I am able to activate Python 3.4 with the command "activate py3k". After this Spyder IDE does work right with Python 3.4 But 1) I'm not able to start Ipython Notebook and QT Console with Python 3.4 2) I'...
How to activate Ipython Notebook and QT Console with Python 3.4 in Anaconda 2.0
0.462117
0
0
8,218
23,985,795
2014-06-02T00:19:00.000
1
0
0
0
python,amazon-web-services,amazon-s3,flask
23,986,820
1
false
1
0
Make the request to your Flask application, which will authenticate the user and then issue a redirect to the S3 object. The trick is that the redirect should be to a signed temporary URL that expires in a minute or so, so it can't be saved and used later or by others. You can use boto.s3.key.generate_url function in y...
1
0
0
I am trying to serve files securely (images in this case) to my users. I would like to do this using flask and preferably amazon s3 however I would be open to another cloud storage solution if required. I have managed to get my flask static files like css and such on s3 however this is all non-secure. So everyone who ...
Secure access of webassets with Flask and AWS S3
0.197375
0
0
890
23,986,203
2014-06-02T01:27:00.000
0
0
1
0
python,list
23,986,267
4
false
0
0
A list of lists is similar to having a 2-D array. To reference an element of the inner list, just use mylist[i][j] where i refers to the index of the list and j to the element in that list. In the case of 2, this would be: mylist[0][0]
1
1
0
I have a list that contain lists: mylist=[[2],[9],[3],[5],[7]] Is there a way in python to get the value of the inner list (not just print it)? Therefore, we would get integer 2 from the list mylist[0]. Without iterating the whole mylist.
integer extraction from list of lists in python
0
0
0
60
23,987,050
2014-06-02T03:41:00.000
1
0
0
0
python,django,orm
23,987,194
2
false
1
0
I chose option 1 when I set up my environment, which does much of the same stuff. I have a JSON interface that's used to pass data back to the server. Since I'm on a well-protected VLAN, this works great. The biggest benefit, like you say, is the Django ORM. A simple address call with proper data is all that's neede...
1
2
0
So in my spare time, I've been developing a piece of network monitoring software that essentially can be installed on a bunch of clients, and the clients report data back to the server(RAM/CPU/Storage/Network usage, and the like). For the administrative console as well as reporting, I've decided to use Django, which ha...
How to access Django DB and ORM outside of Django
0.099668
1
0
849
23,987,917
2014-06-02T05:37:00.000
0
0
0
1
python,debugging,file-io,lsof
23,990,975
1
false
0
0
I never worked with Mac OS but I could imagine this: Maybe Python locks the file on open and the hex-editor is failing if you try to open it afterwards. The system hangs and get slow (even after killing all processes) -> I think thats some kind of caching which fill up your memory till your computer starts using the ...
1
0
0
I have a problem with understanding a strange file locking behavior in Python Debugger. I have a 2TB image file, which my script reads. Everything works perfect, until I want to read the same file with a different hex editor. If the file is opened in hex editor before I start my script, everything is fine. If I try to ...
File is locked by Python debugger
0
0
0
79
23,993,475
2014-06-02T11:29:00.000
0
0
0
0
python-2.7,openerp
23,993,609
2
false
1
0
yes it is possible you can create two views for same table with separate menu and action for each view.
1
3
0
I need Multiple form views of the same object in my module , I created multiple forms but OpenERP shows only one form related to the object other forms are hidden . i looked in the documentation but there is no answer . if anybody know , please help. Thanks in advance.
Is it possible to show multiple form views or tree views of the same object in Openerp?
0
0
0
3,944
23,993,638
2014-06-02T11:39:00.000
0
0
0
1
python,hadoop
25,421,497
3
false
0
0
As far as I know, the same task is run on many nodes. As soon as one node returnes the result, tasks on onther nodes are killed. That's why job SUCCEEDED but single tasks are in KILLED state.
1
13
0
I just finished setting up a small hadoop cluster (using 3 ubuntu machines and apache hadoop 2.2.0) and am now trying to run python streaming jobs. Running a test job I encounter the following problem: Almost all map tasks are marked as successful but with note saying Container killed. On the online interface the log ...
Hadoop streaming jobs SUCCEEDED but killed by ApplicationMaster
0
0
0
3,350
23,995,129
2014-06-02T12:58:00.000
1
0
1
1
python,windows,pip
23,996,033
1
true
0
0
python-dev installs the headers and libraries for linux, allowing you to write / compile extensions. In windows, the standard installer provides this by default. The header files are in the $installroot\include directory. The link libraries are found in $installroot\libs. For example I've installed python 2.7 into c:...
1
0
0
Actually, we can simply install python-dev on linux just use the following command: sudo apt-get install python-dev since python is integrated with Linux. But no such luck on windows. For input "pip install python-dev", there is no corresponding package on pypi.python.org. What packages should I install to match those ...
How can I manage to install packages within python-dev on windows systems just like that on Linux?
1.2
0
0
7,578
23,998,359
2014-06-02T15:42:00.000
0
0
0
0
python,angularjs,testing,selenium
24,002,478
1
false
0
0
As said by @Siking, this is clearly a timing issue. The fact is that Selenium is very fast and faster than loading of element. Sometimes, Selenium requires a pause or a sleep to ensure that an element is present. I also recommend -especially for asynchronous requests- using waitForElementPresent to wait until ajax meth...
1
4
0
I've created a test that click on an element X. This element is only revealed after you click on another button, and those elements are connected with ng-hide. When i try to run my code the click on X element doesn't work. However, in debug mode or after adding 1 second sleep, it does. I'm using selenium framework in...
Selenium click on elements works only in debug mode
0
0
1
2,065
23,998,471
2014-06-02T15:49:00.000
-2
0
1
0
python,python-3.x,global-variables
23,998,513
3
false
0
0
Should I declare this variable again and again as global in each function You should not have any global variables at all, and put these variables and functions into a class.
1
3
0
I am using some variable in multiple functions. This includes changing the variable values by each of those functions. I already declared the variable as 'global' in the first function. Should I declare this variable again and again as global in each function (and this will not overwrite the first global variable I dec...
Global variable changed by multiple functions - how to declare in Python
-0.132549
0
0
7,982
23,998,849
2014-06-02T16:10:00.000
0
0
0
1
python
23,999,339
1
false
0
0
I just solved the issue following these steps from Python26/Scripts/ I ran the following command easy_install pip Then I ran - pip install -U multi-mechanize and it works...
1
1
0
I just follow up the steps to install multimechanize on Windows, I didn't get errors during the installation, I'm tried with python 2.7 and 2.6... but I'm getting the following error when I tried to create a new project, C:\multi-mechanize-1.2.0>multimech-newproject msilesMultimech 'multimech-newproject' is not recogn...
multimech is not recognized on Windows
0
0
0
79
23,999,013
2014-06-02T16:19:00.000
3
0
1
1
python,corba,omniorb
24,046,108
1
true
0
0
With help from Duncan Grisby. The version of omniORBpy must match the Win32/Win64 status of your environment. Copy the distribution to a directory (I used python27/lib/site-packages/omniORB Add to or create a PYTHONPATH environment variable that points to ../omniORB/lib/python and ../omniORB/lib/x86_win32 Merge the...
1
2
0
I'd like to experiment with a Python (v2.7) app accessing a CORBA API, but I keep going around in circles about which OmniOrb pieces are necessary and where they should be placed. I've downloaded omniORBpy-4.2.0-win64-py27 which I thought should have contained the bits I needed. Is is as simple as adding the files in...
Python: Installing OmniOrbpy in Windows64(Windows 7) environment
1.2
0
0
801
24,000,654
2014-06-02T18:06:00.000
0
0
0
0
python,neural-network,backpropagation,pybrain
27,366,408
1
false
0
0
The assert statement checks if a condition is true. In this case, if the inner dimension (indim) of your network is the same as your dataset, ds. Check if im3.flatten() is igual 12288 assert ds.indim == network.indim # 12288 != im3.flatten(), error!
1
2
1
I initialized ds = SupervisedDataSet(12288,1) and add data ds.appendLinked(im3.flatten(),10) where im3 is an openCV picture. and this is my trainer -> trainer = BackpropTrainer(red, ds) When the running process reach BackpropTrainer, i get an AssertionError on backprop.py line 35 self.setData(dataset). It's a pybrain e...
I get a PyBrain BackpropTrainer AssertionError on Windows 7, which requirement is missin?
0
0
0
424
24,001,364
2014-06-02T18:55:00.000
1
0
0
0
python,amazon-web-services,elastic-map-reduce
29,903,784
1
false
0
0
You can use pip install mmh3 to install it.
1
0
1
I need to use mmh3 for hashing. However, when I run "python MultiwayJoin.py R.csv S.csv T.csv -r emr > output.txt" in terminal, it returned an error said that: File "MultiwayJoin.py", line 5, in import mmh3 ImportError: No module named mmh3
mmh3 not installed on Elastic MapReduce in AWS
0.197375
0
0
1,466
24,002,076
2014-06-02T19:44:00.000
3
0
1
0
python,plot,graphics,anaconda,spyder
59,919,089
2
false
0
0
If you are using the latest version of spyder, you just change "variable explore" to "plots", which shown above the console.
1
12
0
Setup: Anaconda 2.0.0 (Win 64), Spyder (2.3.0rc that came with Anaconda) I configure the graphics: Tools > Preferences > iPython console > Graphics > Graphics backend > Inline But no matter what I do the graphics always open in a separate window? Is there a way to force them to be inline in the console?
Spyder Plot Inline
0.291313
0
0
31,810
24,002,485
2014-06-02T20:13:00.000
0
0
0
0
python,machine-learning,scikit-learn,nltk
64,190,596
4
false
0
0
I think a better method would be to : Step-1: Create word/sentence embeddings for each text/sentence. Step-2: Calculate the POS-tags. Feed the POS-tags to a embedder as Step-1. Step-3: Elementwise multiply the two vectors. (This is to ensure that the word-embeddings in each sentence is weighted by the POS-tags associa...
1
13
1
I want to use part of speech (POS) returned from nltk.pos_tag for sklearn classifier, How can I convert them to vector and use it? e.g. sent = "This is POS example" tok=nltk.tokenize.word_tokenize(sent) pos=nltk.pos_tag(tok) print (pos) This returns following [('This', 'DT'), ('is', 'VBZ'), ('POS', 'NNP'), ('example', ...
python: How to use POS (part of speech) features in scikit learn classfiers (SVM) etc
0
0
0
11,721
24,006,376
2014-06-03T02:53:00.000
0
0
0
0
python,openpyxl
24,012,565
1
false
0
0
This is currently not directly possible in openpyxl because it would require the reassigning of all cells below the new row. You can do it yourself by iterating through the relevant rows (starting at the end) and writing a new row with the values of the previous row. Then you create a row of cells where you wan them.
1
1
0
I'm curious if there's a way to insert a new row (that would push all the existing rows down) in an existing openpyxl worksheet? (I'm looking to insert at the first row if it helps) I looked through all the docs and didn't see anything mentioned.
How to insert a row in openpyxl
0
1
0
5,098
24,009,656
2014-06-03T07:42:00.000
0
0
0
0
python,animation,matplotlib,ipython
24,048,037
1
false
0
0
As @tcaswell pointed out, the problem was caused by the callback that was indirectly calling plt.show().
1
0
1
I have a python a script that generates an animation using matplotlib's animation.FuncAnimation and animation.FFMpegWriter. It works well, but there's an issue when running the code in IPython: each frame of the animation is displayed on screen while being generated, which slows down the movie generation process. I've ...
Matplotlib animation + IPython: temporary disabling interactive mode?
0
0
0
285
24,015,758
2014-06-03T12:54:00.000
1
0
0
0
python,database,django,oracle,database-connection
24,016,200
1
false
0
0
It can depend on how your hosting is setup, but if it is allowed you will need the following. Static IP, or Dynamic DNS setup so your home server can be found regularly. Port forwarding on your router to allow traffic to reach the server. The willingness to expose your home systems to the dangers of the internet S...
1
0
0
I have a "local" Oracle database in my work network. I also have a website at a hosting service. Can I connect to the 'local' Oracle database from the hosting service? Or does the Oracle database need to be at the same server as my website? At my work computer I can connect to the Oracle database with a host name, user...
Connect to local Oracle database from online website
0.197375
1
0
490
24,019,331
2014-06-03T15:40:00.000
0
0
0
1
python,network-programming,zeromq,ethernet,pyzmq
24,155,570
2
false
0
0
Maybe you could periodically send datagram message containing peer's ip address (or some other useful information) to broadcast address, to allow other peers to discover it. And after peer's address is dicovered you can estabish connection via ZeroMQ or other kind... connection. :)
1
1
0
I need to transfer data via pyzmq through two computers connected by an ethernet cable. I have already set up a script that runs on the same computer correctly, but I need to find the tcp address of the other computer in order to communicate. They both run Ubuntu 14.04. One of them should be a server processing request...
How can I find the tcp address for another computer to transfer over ethernet?
0
0
1
223
24,022,754
2014-06-03T18:51:00.000
1
0
1
0
python,md5,checksum
24,025,573
2
false
0
0
The recent researches about MD5 collisions may have baffled you because in 2013 some people gave algorithms to generate MD5 collisions in 1 second on a normal computer however I assure you that this does not nullify the use of MD5 for checking file integrity and duplicacy. It is highly unlikely that you'll get two norm...
1
4
0
I've been tasked with consolidating about 15 years of records from a laboratory, most of which is either student work or raw data. We're talking 100,000+ human-generated files. My plan is to write a Python 2.7 script that will map the entire directory structure, create checksums for each, and then flag duplicates for ...
Is it safe to use MD5 checksums to search for duplicate files across multiple hard drives?
0.099668
0
0
4,101
24,023,131
2014-06-03T19:12:00.000
2
0
0
0
python,django,bower
24,024,759
5
false
1
0
There is no recommended way - it depends on your project. If you are using bower, node for more than the django project, it might make sense to place it in your project root (above django) so that it may be reused elsewhere. If it's purely for django's static files, then it might make sense to place it in a src/ outsi...
2
18
0
I'm new to Django framework and i have read that that the 'static' files like css and js must be inside the 'static' directory, but my question is: Given that bower package manager install its dependencies on a new directory called bower_components in the current directory, the bower.json must be created on the 'static...
How to use bower package manager in Django App?
0.07983
0
0
8,184
24,023,131
2014-06-03T19:12:00.000
2
0
0
0
python,django,bower
25,576,643
5
false
1
0
If you're afraid of the bower.json being included, the collectstatic command has an --ignore option that you can use to exclude whatever you want.
2
18
0
I'm new to Django framework and i have read that that the 'static' files like css and js must be inside the 'static' directory, but my question is: Given that bower package manager install its dependencies on a new directory called bower_components in the current directory, the bower.json must be created on the 'static...
How to use bower package manager in Django App?
0.07983
0
0
8,184
24,024,736
2014-06-03T20:54:00.000
0
0
1
0
python,random
24,024,883
2
false
0
0
Yes, there is. It is random.triangular(min, max, av). Your mean value will be close, but not equal to av. Edit: see comments below, this has drawbacks.
1
0
1
I need to generate 100 age values between 23 and 72 and the mean value must be 42 years. Do you think such a function already exists in standard python? If not, I think I know python just enough and should be able to code the algorithm but I am hoping something is already there for use. Any hints?
How to generate random int around specific mean?
0
0
0
110
24,025,334
2014-06-03T21:35:00.000
1
0
1
0
python
24,025,363
1
true
0
0
Pretty much. It's not necessarily creating a new instance of the class, since for numbers in a certain range, Python will store canonical instances of those integers and hand you an old one when you ask for a new one. You can do the same thing with your own classes if you want, by implementing __new__.
1
0
0
Does that mean when I call int("123"), it is actually creating an instance of int class?
Python print(int) gives me instead of
1.2
0
0
62
24,026,618
2014-06-03T23:25:00.000
0
0
0
0
python,bokeh
24,030,090
3
false
1
0
It seems that since bokeh uses html5 canvas as a backend, it will be writing things to static html pages. You could always export the html to pdf later.
1
29
1
Is it possible to output individual figures from Bokeh as pdf or svg images? I feel like I'm missing something obvious, but I've checked the online help pages and gone through the bokeh.objects api and haven't found anything...
Exporting figures from Bokeh as svg or pdf?
0
0
0
17,265
24,027,928
2014-06-04T02:12:00.000
0
0
0
0
python,selenium,web-scraping,mechanize
24,027,994
2
false
1
0
I would try to watch Chrome's network tab, and try to imitate the final request to get the image. If it turned out to be too difficult, then I would use selenium as you suggested.
1
1
0
My script logs in to my account, navigates the links it needs to, but I need to download an image. This seems to be easy enough to do using urlretrive. The problem is that the src attribute for the image contains a link which points it to the page which initiates a download prompt, and so my only foreseeable option is ...
Using Mechanize for python, need to be able to right click
0
0
1
194
24,028,075
2014-06-04T02:36:00.000
0
0
1
0
python,sublimetext3,ipython-notebook
59,419,565
2
false
0
0
I had the same concern when moving from Jupyter Notebook to Sublime Text, and tried Anaconda's autocomplete, which is far worse than Jupyter's. But after trying SublimeCodeIntel, all problems solved! It is almost same as VSCode's auto-complete and code tips.
1
0
0
Does anyone know of anything comparable? I am currently using Anaconda for linting and autocompletion, but it is nowhere near as good as the IPython Notebook autocompletion.
Python autocompletion comparable to IPython Notebook for Sublime Text 3
0
0
0
525
24,030,051
2014-06-04T05:57:00.000
0
0
0
0
python,linux,pygtk,browser-automation
24,030,111
1
false
0
0
Selinum with phantomjs should be a good replacement of splinter.
1
1
0
I have tried splinter for browser automation. Used firefox webdriver in splinter. But the problem is high CPU usage when the firefox loads and sometimes its hangs the gui. Please suggest me an option. I'm in a Linux box(Ubuntu) and building an app using pygtk.
Is there any inbuilt browser for web automation using python?
0
0
1
260
24,032,359
2014-06-04T08:20:00.000
0
0
0
0
python-2.7,selenium,selenium-webdriver,robotframework,automated-tests
24,085,441
3
false
1
0
I have seen this issue and found that there is a recovery period where Selenium does not work correctly for a short time after closing a window. Try using a fixed delay or poll with Wait Until Keyword Succeeds combined with a keyword from Selenium2Library.
1
0
0
I am having a problem on handling the pop up windows in robot framework. The process I want to automate is : When the button is clicked, the popup window appears. When the link from that popup window is clicked, the popup window is closed automatically and go back to the main page. While the popup window appears, the...
Going back to the main page after closing the pop up window
0
0
1
1,622
24,036,291
2014-06-04T11:33:00.000
11
0
0
1
c#,python,protocol-buffers,protobuf-net
24,038,019
1
true
0
0
DateTime is spoofed via a multi-field message that is not trivial, but not impossible to understand. In hindsight, I wish I had done it a different way, but it is what it is. The definition is available in bcl.proto in the protobuf-net project. However! If you are targering multiple platforms, I strongly recommend you ...
1
8
0
I'm working on a project consisting on Client/Server. Client is written in Python (will run on linux) and server in C#. I'm communicating through standard sockets and I'm using protobuf-net for protocol definition. However, I'm wondering how would protobuf-net handle DateTime serialization. Unix datetime differs from ....
How protobuf-net serialize DateTime?
1.2
0
0
3,765
24,036,896
2014-06-04T12:02:00.000
0
0
0
0
python-2.7,openstack
24,052,584
1
false
0
0
Use the size parameter on volume object. For example: for vol in cinder_instance.volume.list():print vol.id # Gives the cinder volume ID print vol.size # Gives cinder volume size
1
0
0
Can any one help me out to get the openstack cinder volume size through python bindings. I have list of cinder volumes that are extracted by calling cinder_client_instance.volumes.list() method. Now I want to know the size of the volume. How I can get the volume size?
Get the openstack cinder volume size through python bindings
0
0
0
220
24,039,160
2014-06-04T13:44:00.000
0
0
0
0
python,c++,swig
24,071,860
2
false
0
0
You can export your function with a different but compatible signature. In your case declare the export of your func to take int instead of bool. SWIG will generate the wrapper code for int, but the compiler will call your bool function at the c++ level (unless you have a book overload). There are no overloads in pytho...
2
1
0
I'm updating my bindings to support swig 3.0.1 , but I'm getting an error when trying to call a function that expects a boolean (it was not happening before with 2.0.9)... Specifically: TypeError: in method 'MClass_setStatus', argument 2 of type 'bool' Any hint on what actually changed ?
swig 3.0.1 , python 3 and bool data types
0
0
0
526
24,039,160
2014-06-04T13:44:00.000
1
0
0
0
python,c++,swig
24,077,769
2
true
0
0
I need backward compatibility so this isn't an acceptable option. I was able to override the behaviour to the legacy one using -DSWIG_PYTHON_LEGACY_BOOL on the swig command line
2
1
0
I'm updating my bindings to support swig 3.0.1 , but I'm getting an error when trying to call a function that expects a boolean (it was not happening before with 2.0.9)... Specifically: TypeError: in method 'MClass_setStatus', argument 2 of type 'bool' Any hint on what actually changed ?
swig 3.0.1 , python 3 and bool data types
1.2
0
0
526
24,048,350
2014-06-04T22:00:00.000
0
0
1
0
python,kivy,pyinstaller
39,481,035
4
false
0
1
I had a similar issue with garden modules. When I install like the following: start cmd /C "garden install --kivy roulettescroll" start cmd /C "garden install --kivy roulette" start cmd /C "garden install --kivy tickline" start cmd /C "garden install --kivy datetimepicker" I add PyInstaller ... --hidden-import=kivy.ga...
3
4
0
I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import: from kivy.garden.navigationdrawer import NavigationDrawer I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo...
Kivy Garden in PyInstaller - stuck trying to trace import
0
0
0
2,433
24,048,350
2014-06-04T22:00:00.000
2
0
1
0
python,kivy,pyinstaller
24,048,458
4
false
0
1
You could just copy the navigationdrawer code from C:\Users\me\.kivy\garden\garden.navigationdrawer to your app directory, call the folder 'navigationdrawer' and replace the import with from navigationdrawer import NavigationDrawer. It's not quite the 'right' way to do it (there's probably some way to make pyinstaller ...
3
4
0
I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import: from kivy.garden.navigationdrawer import NavigationDrawer I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo...
Kivy Garden in PyInstaller - stuck trying to trace import
0.099668
0
0
2,433
24,048,350
2014-06-04T22:00:00.000
-1
0
1
0
python,kivy,pyinstaller
35,244,089
4
false
0
1
Go to your python site packages there is a folder named garden, look in __init__.py. There is a explanation how to install navigationdrawer.
3
4
0
I have a Kivy-based Python project that I'm trying to build. It uses the NavigationDrawer component from Kivy Garden, through an import: from kivy.garden.navigationdrawer import NavigationDrawer I have a PyInstaller spec file for it which builds a distributable version. This version works well on my machine, but unfo...
Kivy Garden in PyInstaller - stuck trying to trace import
-0.049958
0
0
2,433
24,050,155
2014-06-05T01:20:00.000
1
0
0
1
python,google-app-engine,app-engine-ndb
32,898,743
4
false
1
0
I am answering this over a year since it was asked. The only way to test these sorts of things is by deploying an app on GAE. What I sometimes do when I run across these challenges is to just "whip up" a quick application that is tailor made to just test the scenario under consideration. And then, as you put it, you ju...
3
1
0
Setup: Python, NDB, the GAE datastore. I'm trying to make sure i understand some of the constraints around my data model and its tradeoffs for consistency and max-write-rate. Is there any way to test/benchmark this on staging or on my dev box, or should I just bite the bullet, push to prod on a shadow site of sorts, an...
How do you test the consistency models and race conditions on Google App Engine / NDB?
0.049958
0
0
261
24,050,155
2014-06-05T01:20:00.000
1
0
0
1
python,google-app-engine,app-engine-ndb
24,050,936
4
false
1
0
I am not sure it can be tested. The inconsistencies are inconsistent. I think you just have to know that datastore operations have inconsistencies, and code around them. You don't want to plan on observations from your tests being dependable in the future.
3
1
0
Setup: Python, NDB, the GAE datastore. I'm trying to make sure i understand some of the constraints around my data model and its tradeoffs for consistency and max-write-rate. Is there any way to test/benchmark this on staging or on my dev box, or should I just bite the bullet, push to prod on a shadow site of sorts, an...
How do you test the consistency models and race conditions on Google App Engine / NDB?
0.049958
0
0
261
24,050,155
2014-06-05T01:20:00.000
2
0
0
1
python,google-app-engine,app-engine-ndb
24,050,360
4
false
1
0
You really need to do testing in the real environment. At best the dev environment is an approximation of production. You certainly can't draw any conclusions at all about performance by just using the SDK. In many cases the SDK is faster (startup times) and slower (queries on large datasets. Eventual Consistency is ...
3
1
0
Setup: Python, NDB, the GAE datastore. I'm trying to make sure i understand some of the constraints around my data model and its tradeoffs for consistency and max-write-rate. Is there any way to test/benchmark this on staging or on my dev box, or should I just bite the bullet, push to prod on a shadow site of sorts, an...
How do you test the consistency models and race conditions on Google App Engine / NDB?
0.099668
0
0
261
24,052,693
2014-06-05T06:03:00.000
3
0
1
0
python
24,052,765
3
false
0
0
I like ','.join(str(i) for i in lst), but it's really not much different than map
1
2
0
What is the most convenient way to join a list of ints to form a str without spaces? For example [1, 2, 3] will turn '1,2,3'. (without spaces). I know that ','.join([1, 2, 3]) would raise a TypeError.
Easiest way to join list of ints in Python?
0.197375
0
0
1,522
24,054,363
2014-06-05T07:38:00.000
1
1
0
0
python,oauth-2.0,keyerror
24,058,208
1
true
0
0
You get this keyerror because there is no refresh_token in the response. If you didn't ask for offline access in your request, there will be no refresh token in the response, only an access token, bearer and token expiry.
1
0
0
Hy! I use google-mail-oauth2-tools but I have a problem: When I write the verification code the program dead. Traceback (most recent call last): File "oauth2.py", line 346, in <module> main(sys.argv) File "oauth2.py", line 315, in main print 'Refresh Token: %s' % response['refresh_token'] KeyError: 'refresh...
google-mail-oauth2-tools KeyError :-/
1.2
0
1
467
24,055,220
2014-06-05T08:27:00.000
3
0
1
0
python,printing,scripting,syntax-error,twill
24,055,670
4
false
0
0
I just found the answer. Thanks for viewing this question and probably for that downvote (SAD FACE).. So, the solution that I found was to use the 2to3 Script Tool found in Python Folder. Basically, it refactors Python 2 codes to Python 3 codes.
1
10
0
I've been trying to learn Twill Scripting on Python and I am using Python 3.4 and Twill 1.8.0. Been reading some posts here and I found it interesting to study. But, I do have a problem installing Twill. I just knew that PRINT in Python is now a function so meaning it needs parenthesis and that's where my problem start...
Is there a new/updated Twill?
0.148885
0
0
4,901
24,057,239
2014-06-05T10:05:00.000
1
0
0
0
python,django
24,057,408
1
false
1
0
You need to collectstatic in your live environment, have you setup your static folders and placed the appropriate declarations in your nginx? If yes then just run: ./manage.py collectstatic
1
0
0
i am using default django admin panel,I have just moved my django site on my live server, and found the admin panel has no styling with it,but in my local server,everything is fine.In mention i am using nginx.To fix this problem, i have just check the path /usr/local/lib/python2.7/site-packages/django/contrib/ and fou...
Django admin panel interface missing
0.197375
0
0
449
24,059,900
2014-06-05T12:11:00.000
0
0
1
0
python-3.x,module
24,060,037
1
true
0
0
Skip the .py. It's just import filename.
1
0
0
I have written a small program and saved it as a module using if __name__ == '__main__:' main() Now I want to use this program in another program that I'm writing. How do I do that without just copying and pasting the previous program's code? I have tried import filename.py but that doesn't work. Some context: The f...
How do I use a previous program that I've written in a new program that I am currently writing?
1.2
0
0
19
24,061,320
2014-06-05T13:18:00.000
2
0
0
0
python,xml,django,post
24,061,391
1
true
1
0
I'm not quite sure what you're asking. Do you just want to know how to access the POST data? You can get that via request.body, which will contain your XML as a string. You can then use your favourite Python XML parser on it.
1
0
0
There is XML data passed in POST request as a simple string and not inside some name=value pair, with HTTP header (optionally) set to 'Content-Type: text/xml'. How can I get this data in Python (by its own ways or by tools of Django)?
How can I get XML data in Python/Django passed in POST request?
1.2
0
1
2,986
24,062,830
2014-06-05T14:26:00.000
1
0
1
0
python,c,distutils
24,066,500
3
false
0
0
I'd consider building the python module as a subproject of a normal shared library build. So, use automake, autoconf or something like that to build the shared library, have a python_bindings directory with a setup.py and your python module.
1
16
0
I have written a library whose main functionality is implemented in C (speed is critical), with a thin Python layer around it to deal with the ctypes nastiness. I'm coming to package it and I'm wondering how I might best go about this. The code it must interface with is a shared library. I have a Makefile which builds ...
Best way to package a Python library that includes a C shared library?
0.066568
0
0
4,767
24,063,919
2014-06-05T15:13:00.000
1
0
1
0
python
24,064,458
1
true
0
0
Python module/package is for distributing a code, not data Building modules or packages is creating different types of distribution formats. Some of them being: python source code - for pure python apps, sort or ZIP archive, extension zip or tar.gz egg - zip archive with whatever can be compiled being compiled - exten...
1
0
0
The python documentation states that we can build and install a python module separately. What benefit does it provide? Does it mean that we can add more files to the build directory if we have not installed the module(thought the module has been built)?
Can we add more files into the build directory if we have not installed the python module yet?
1.2
0
0
19
24,064,222
2014-06-05T15:27:00.000
1
0
1
0
python,psychopy
24,072,167
2
false
0
0
In concrete terms, when you add a Sound component in Builder, you just need to add an expression in the "Start (time)" field that takes account of the duration of the first sound stimulus and the ISI for this trial. So if you have a column for the ISI in the conditions file as Jonas suggests (let's say it is called "IS...
1
1
0
I'm totally new to PsychoPy and I'm working with Builder. I'm not familiar with Python coding at all. I have audio stimuli that have variable durations. In each trial, I want the second stimulus to start 500ms or 1500ms after the end of the first stimulus. Is there a way to do this in Builder? If I have to do it on Cod...
variable stimuli duration but two kinds of fixed ISI in PsychoPy
0.099668
0
0
991
24,069,015
2014-06-05T19:48:00.000
3
0
1
0
python
24,069,166
1
true
0
0
You should split your code into multiple modules when it begins to be unwieldy to keep it all in one module. This is to some extent a matter of taste. Note that it may unwieldy for the code author (i.e., file is too big to navigate easily) or for the user of the library (e.g., too many unrelated functions/classes jam...
1
0
0
Im not positive on the terminology here, so that may explain why searching on my own yielded no results. I was just curious if there is a widely accepted, general method to writing a module in python. Obviosuly people prefer splitting things into segmented .py scripts, importing when needed, and packing it all into a f...
Python convention for separating files
1.2
0
0
50
24,069,488
2014-06-05T20:17:00.000
1
0
1
0
python
24,592,547
1
true
0
0
After a long time I got it. Python(x,y) is a Python 2.7 distribution. I was trying to install mlpy module for Python 3.5. That was the problem. Thanks for everyone who tried to help :)
1
1
0
I always used Phython(x,y) for college programming because it makes my life a lot easier. I never needed to worry about the headache of installing new modules because all modules I needed until then came along with Python(x,y). The problem is that right now I need "mlpy" module, but I can't find a way to integrate it w...
How do I install additional molules for Python(x,y)?
1.2
0
0
6,850
24,069,711
2014-06-05T20:31:00.000
1
0
0
0
python,rdf,freebase
25,625,683
1
false
1
0
The Freebase dump is in RDF format. The easiest way to query it is to dump it (or a subset of it) into an RDF store. It'll be quicker to query, but you'll need to pay the database load time up front first.
1
3
0
I downloaded the freebase data dump and I want to use it to get information about a query just like how I do it using the web API. How exactly do I do it? I tried using a simple zgrep but the result was a mess and takes too much time. Any graceful way to do it (preferably something that plays nicely with python)?
How to search freebase data dump
0.197375
0
1
964
24,072,231
2014-06-06T00:11:00.000
-1
0
0
0
python,csv,web-applications,flask
64,239,216
4
false
1
0
I am absolutely baffled by how many people discourage using CSV as an database storage back-end format. Concurrency: There is NO reason why CSV can not be used with concurrency. Just like how a database thread can write to one area of a binary file at the same time that another thread writes to another area of the sa...
2
3
0
I am using Flask to make a small webapp to manage a group project, in this website I need to manage attendances, and also meetings reports. I don't have the time to get into SQLAlchemy, so I need to know what might be the bad things about using CSV as a database.
Somthing wrong with using CSV as database for a webapp?
-0.049958
1
0
3,024
24,072,231
2014-06-06T00:11:00.000
1
0
0
0
python,csv,web-applications,flask
47,320,760
4
false
1
0
I think there's nothing wrong with that as long as you abstract away from it. I.e. make sure you have a clean separation between what you write and how you implement i . That will bloat your code a bit, but it will make sure you can swap your CSV storage in a matter of days. I.e. pretend that you can persist your data ...
2
3
0
I am using Flask to make a small webapp to manage a group project, in this website I need to manage attendances, and also meetings reports. I don't have the time to get into SQLAlchemy, so I need to know what might be the bad things about using CSV as a database.
Somthing wrong with using CSV as database for a webapp?
0.049958
1
0
3,024
24,072,413
2014-06-06T00:33:00.000
0
0
1
0
python,flask
24,072,542
1
false
1
0
What exactly is happening when Run is clicked? It run the app.py on the codebox vm. It maybe python app.py To update, you fist should save your change(ctrl-s), and stop the run app, run it again.
1
0
0
When I create a Python box, I run command pip install -r requirements.txt then I click the Run button on the side and I can see the existing app run. What exactly is happening when Run is clicked? I've updated the existing file app.py, I made def hello(): return something new, however, it seems like codebox does not...
How do I run flask on codebox IDE?
0
0
0
256
24,072,713
2014-06-06T01:16:00.000
4
0
0
0
python,filepath
24,072,745
2
false
1
0
If you are presenting a filename to a user for any reason, it's better if that filename follows the usual OS conventions. Windows has been able to use the / for path separators for as long as there have been paths - this was a DOS feature.
1
11
0
Currently I use os.path.join almost always in my django project for cross OS support; the only places where I don't currently use it are for template names and for URLs. So in situations where I want the path '/path/to/some/file.ext' I use os.path.join('path', 'to', 'some', 'file.ext'). However I just tested my project...
Is os.path.join necessary?
0.379949
0
0
2,005
24,074,684
2014-06-06T05:19:00.000
-1
0
0
1
python,linux,audio,alsa,pulseaudio
24,119,286
2
false
0
0
I guess it depends on what you would like to do with it after you got it "into" python. I would definitely look at the scikits.audiolab library. That's what you might use if you wanted to draw up spectrograms of what ever sound you are trying process (I'm guessing that's what you want to do?).
1
0
0
I was wondering if it was possible to play a sound directly into a input from python. I am using linux, and with that I am using OSS, ALSA, and Pulseaudio
How to play a sound onto a input stream
-0.099668
0
0
3,682
24,077,041
2014-06-06T08:05:00.000
1
0
0
1
python,google-app-engine
24,088,125
1
true
1
0
Unfortunately there is not currently a well-supported way to do this. However, with the disclaimer that this is likely to break at some point in the future, as it depends on internal implementation details, You can fetch the relevant _AE_Backup_Information and _AE_DatastoreAdmin_Operation entities from your datastore a...
1
0
0
I am taking the backup of datastore , using Taskqueues. I want to check whether the backup has completed successfully or not. I can check the end of the backup job by checking the taskqueue, but how can i check whether the backup was successful or it failed due to some errors.
Google App Engine Check Success of backup programmatically
1.2
0
0
69
24,077,365
2014-06-06T08:27:00.000
1
0
0
1
python,windows
24,079,238
1
true
0
0
I guess a work-around for this would be to check the process's memory usage with shell command. If the specific process does not matter, I guess you could run a shell command and get the general system memory status. But this will only work for memory hungry processes.
1
1
0
In python, is there any way to check the progress of another windows application. That is to say for example, downloading a file in chrome, or converting a file in handbrake, Is there any way to get the current status of these processes. Specifically I want my script to wait until another program finishes a conversion,...
Python, How to check windows application progress
1.2
0
0
81
24,081,061
2014-06-06T11:43:00.000
0
0
1
0
python,debugging,python-idle
24,083,884
1
false
0
0
Ensure that debug is enabled in IDLE by clicking on Debug -> Debugger on the menu bar. Break points are skipped if not in debug mode. It's also possible that the execution path never gets to your breakpoint. If that's the case, you should place a breakpoint earlier in your script.
1
0
0
When i set a breakpoint in a .py file in python IDLE , and rUn the debugger . The debugger bypasses the breakpoint and runs through the code without stopping at the breakpoint. Can anyone help me with this issue ?
Python IDLE debugger bypasses the breakpoint set?
0
0
0
796