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,782,047
2013-05-28T00:04:00.000
0
0
1
0
python
16,782,089
7
false
0
1
You can't. In Windows, custom icons can only be assigned to certain types of files (executables and shortcuts, mostly), and Python scripts are not one of those types.
2
7
0
I am developing a game in Python and was wondering how to give it its own icon. I am using a windows computer and have no extra things installed with Python. Oh also I am using version 3.3 Is this even possible. P.S I have found other things on Stack Overflow but they are using different Operating Systems like Ubunt...
How To Add An Icon Of My Own To A Python Program
0
0
0
40,170
16,782,047
2013-05-28T00:04:00.000
2
0
1
0
python
16,782,121
7
false
0
1
If you are trying to change the icon of the shortcut for your program, then you need to get to the file where ever it is right-click it and go to create a shortcut then drag that shortcut to your desktop then right-click that shortcut and click properties then click on "Change Icon" then go to where your desire .i...
2
7
0
I am developing a game in Python and was wondering how to give it its own icon. I am using a windows computer and have no extra things installed with Python. Oh also I am using version 3.3 Is this even possible. P.S I have found other things on Stack Overflow but they are using different Operating Systems like Ubunt...
How To Add An Icon Of My Own To A Python Program
0.057081
0
0
40,170
16,782,531
2013-05-28T01:24:00.000
0
0
1
0
python,ssh,paramiko
17,585,357
1
true
0
0
What I ended up doing here is use queues to ferry out the STDOUT/STDERR and ferry in STDIN to this thread class. Worked wonderfully as expected.
1
0
0
Trying to implement a generic class which will do remote command execution using Paramiko. Faced with this question. The init() method of the class which is inheriting threading.Thread will do the connect to the host and the run() method will do the command execution on the remote host. Now the command which is gett...
Python - Threads inside Thread - kosher?
1.2
0
0
808
16,784,271
2013-05-28T05:09:00.000
1
0
0
0
python,orm,module,openerp
16,789,456
1
true
1
0
there is a model called 'ir.sequence'. You can create a sequence type and sequence for your model and then just by calling the code of the sequence you will be able to generate new sequences
1
0
0
I need a field which adds a counter to a specific item i add in the product section of a custom module. Like an automatic number generated by the system, for let's say Internal Reference, so every time i save a new product this field will create a number for it in this field, like IN0001, IN0002, IN0003, etc... I've l...
Counter in OpenErp - Python
1.2
0
0
171
16,786,183
2013-05-28T07:27:00.000
3
0
1
1
python,python-bindings
16,788,200
1
true
0
0
I can hardly imagine a case where one would prefer wrapping a library's command line interface over wrapping the library itself. (Unless there is a library that comes with a neat command line interface while being a total mess internally; but the OP indicates that the same functionality available via the command line i...
1
3
0
I have a question regarding python bindings. I have a command-line which exposes some functionality and code is re-factored to provide the functionality through a shared library. I wanted to know what the real advantage that I get from "writing a python binding for the shared library" vs "calling the command line dire...
"writing a python binding" vs "using command-line directly"
1.2
0
0
619
16,794,333
2013-05-28T14:13:00.000
1
0
0
0
python,pygame,sprite,rect
16,797,483
1
true
0
1
Unless you manually clear your screen surface, flip will not change its content. Thus, if you neglect to draw to a certain location, it will remain the same. If you want to get rid of this effect, usually called "hall of mirrors", you will have to keep track of what portions of the screen have not been drawn to yet and...
1
0
0
I made a 2D project with a lot of tile sprites, and one player sprite. I'm trying to get the camera to follow the player, and for the most part it's working. However, there's one problem: If you go to the edge of the map, it scrolls normally, but instead of the black background, it displays copies of the sprites on the...
(pygame) Empty squares displaying copies of what was previously there instead of background
1.2
0
0
86
16,794,658
2013-05-28T14:29:00.000
0
1
0
0
python,bluetooth,hidden,device
16,795,191
2
false
0
0
You could attempt to connect to your phone. If it's nearby, the connection will succeed. Devices can be connectable when they are not discoverable. You would have to already know the device address of your phone (via discovery when your phone was visible) in order to initiate the connection.
1
1
0
Im trying to make a algorithm in python to detect if my phone is in the area. Im using this to find my device: bluetooth.discover_devices() But it only detects my phone if I set my Bluetooth on my phone to "visible". Is there a function or command to detect my phone when it's set to hidden? Im fairly new to python so ...
How to find bluetooth devices not set to visible in python?
0
0
0
1,954
16,794,850
2013-05-28T14:38:00.000
1
0
0
0
python,security,networking,windows-7,wifi
16,797,510
1
true
0
0
No. Python standard library doesn't ship with any functionality to control platform-specific functionality like wireless adapters. You have to invoke the tools shipped with the platform, find some 3rd party libraries that control this functionality, or write your own such libraries.
1
0
0
My question I guess is: Is this possible without shelling out to command line and without 3rd party Python packages? I can't seem to find any native Python commands to manipulate or configure a wireless network connection. I know there are already built-in 'netsh wlan' commands in Windows 7, but would rather this all b...
Simple Python program to connect to a secure wifi network with user input credentials
1.2
0
1
1,246
16,795,018
2013-05-28T14:46:00.000
2
0
0
0
python,django,django-models,security
16,795,862
4
false
1
0
Storing passwords using a reversible encryption is about as safe as plain text. Use OAuth or something similar, or prepare for serious troubles when (not "if" - "when") someone will hack your database.
1
1
0
I have to store some sensitive information in my database using Django. I have a Client model and each client has a bunch of SocialAccounts (twitter, fb, etc) with an URL, client and password. Considering ALL users that belong to the group "Administrator" should be able to see the passwords. What's a safe way to store ...
How to store sensitive information that needs to be shared across different users?
0.099668
0
0
2,061
16,799,088
2013-05-28T18:37:00.000
1
1
1
0
python,django,file,checksum
16,799,533
4
false
0
0
md5 tends to work great for checksums ... same with SHA-1 ... both have very small probability of collisions although I think SHA-1 has slightly smaller collision probability since it uses more bits if you are really worried about it, you could use both checksums (one md5 and one sha1) the chance that both match and th...
1
4
0
I am creating an application related to files. And I was looking for ways to compute checksums for files. I want to know what's the best hashing method to calculate checksums of files md5 or SHA-1 or something else based on this criterias The checksum should be unique. I know its theoretical but still I want the proba...
File Checksums in Python
0.049958
0
0
2,494
16,802,879
2013-05-28T23:00:00.000
0
0
1
0
pypy,rpython
16,895,246
1
false
0
0
There are a lot of possible answers to this question. One answer is that yes, you can try, but it's not really interesting. Yes, you can play with a different front-end that feeds into the same toolchain; but then you're only changing the syntax, and that's it. Let's take the example of writing "RuRu" in "RRuby" rath...
1
2
0
What would be the steps involved in updating the PyPy toolchain, to allow one to substitute RPython with any well-defined statically-typed language (e.g "RRuby", "RJavaScript", or any subsets of Haskell or ML or C that map to RPython's functionality)? Would it be possible to define an AST generator for each of those l...
Making PyPy toolchain input-language-independent
0
0
0
110
16,803,144
2013-05-28T23:26:00.000
5
0
1
0
python,python-2.7,dictionary
16,803,155
2
true
0
0
Yes, dictionaries are not special and can be imported into other modules, just like anything else you define in a Python module. Like functions and classes, dictionaries are Python objects, and importing does nothing but create a new reference in the current module to values you imported. You can manipulate the diction...
1
3
0
Can dictionaries be accessed by multiple files in Python 2.7? One can import classes and functions from other files, but can the same be done with dictionaries? I might have a file with a dictionary and an assortment of functions that can be used by other files to do things with the dictionary, but is it necessary to w...
Accessing and editing a dictionary from multiple files
1.2
0
0
5,750
16,803,826
2013-05-29T00:55:00.000
0
0
0
0
android,python,eclipse,pygame,pydev
16,803,982
1
false
0
1
No, there's really no way of doing this. Pygame is not natively runnable on Android: you'd need to somehow find a Pygame port to Jython and then figure out how to make that work using the Android drawing primitives. Probably more work than it is worth.
1
0
0
I am working on a project in eclipse, i have been working for the last few months in python/pygame, making pygames in the Python IDLE. I have my eclipse build setup with android sdk and pydev to run python programs (pygame) in eclipse. What I am trying to do is build an app with the android sdk that can use my pygame i...
How do you integrate PyGame and Android SDK together inside Eclipse to build an Android App running Java SDK as the main menu for PyGame?
0
0
0
418
16,804,806
2013-05-29T03:04:00.000
3
0
1
0
python,windows-xp,cx-freeze
16,848,122
1
true
0
1
Thank you eveyone for your help. I finally get it working with a different solution. I found other programs in my system that has this dlls too. Eclipese was one of them (in this path: eclipse\plugins\com.intland.hgbinary.win32_2.3.2\os\win32 )so I just took: Microsoft.VC90.CRT.manifest msvcm90.dll msvcp90.dll msvc...
1
6
0
I have used cx_freeze several times in my windows 7 and I had never any problem with it but now I want to run the executable produced by cx_freeze in a Windows XP. But when I run the program I get this error: the application configuration is incorrect. Reinstalling this application may fix this problem I have searched ...
Python Cx_Freeze error in Windows XP
1.2
0
0
1,636
16,808,328
2013-05-29T07:54:00.000
1
0
0
0
python,d3.js,web2py
16,812,347
1
true
1
0
No, there should not be any compatibility issues. web2py is primarily a server-side framework, and D3 is all client-side. They are completely independent. web2py does provide some client-side scaffolding, but it is optional and won't interfere with D3 anyway.
1
1
0
I'm a relatively unexperienced developer starting on a new project to expose some pre-existing Python analytical libraries' functions in a web application through javascript visualization library d3.js. I've explored the web2py framework for Python, and would just like to ask a simple question: Are there any compatibil...
web2py and d3.js compatibility
1.2
0
0
358
16,811,683
2013-05-29T10:38:00.000
2
0
1
0
python,logging
16,811,734
3
false
0
0
This is not possible through the logger. If you want this, you'll have to write your own custom logger, read all the entries in the log file, add the new entry to the top, then write the entire log file again.
3
1
0
I'm using the Python logging module. Each time I open the log file I have to scroll all the way down to read the latest entries. Is there a way I can make the logger prepend entries to the beginning of file?
Prepend entry to log file
0.132549
0
0
802
16,811,683
2013-05-29T10:38:00.000
0
0
1
0
python,logging
16,816,812
3
false
0
0
Prepending data to the head of a log file would be quite resource intensive because you'd have to write out the entire file every time. Instead of 'scrolling' at all, why not just use 'tail -f ' to seek to the end and begin reading? On Linux you can use tail -F , which will re-open the logfile if it gets removed/recrea...
3
1
0
I'm using the Python logging module. Each time I open the log file I have to scroll all the way down to read the latest entries. Is there a way I can make the logger prepend entries to the beginning of file?
Prepend entry to log file
0
0
0
802
16,811,683
2013-05-29T10:38:00.000
1
0
1
0
python,logging
16,816,940
3
false
0
0
I concur with others: prepending to a file is costly, and making your code more complex than it should be. If you view your log using tools such as more or less, then press the capital G key will bring you all the way to the end.
3
1
0
I'm using the Python logging module. Each time I open the log file I have to scroll all the way down to read the latest entries. Is there a way I can make the logger prepend entries to the beginning of file?
Prepend entry to log file
0.066568
0
0
802
16,813,243
2013-05-29T11:57:00.000
2
1
0
0
java,c++,python,machine-learning,artificial-intelligence
16,813,957
2
false
0
0
Quake 3 is an ideal candidate for bot design. open source code base. Realistic scenario (compared to robocode which is a toy domain). existing bots and I believe the first bots used in Quake 3 where the output of a Ph.D. lots of documentation.
1
0
0
I'm looking for a game which will allow me to test various artificial intelligence, reinforcement learning and machine learning algorithms. It would be great, if there will be good documentation or even helpful framework for writing AI. I know about TORCS, but do you know other games? It doesn't matter in which languag...
Game which allows to test AI algorithms
0.197375
0
0
520
16,814,703
2013-05-29T13:04:00.000
0
0
1
0
python,regex
16,814,785
3
false
0
0
group1 will be at least one number and group0 will contain group1 and maybe other characters but not necessarily. edit to answer the edited question: AFAIK there should be no difference in the matching between those 2 other than the grouping.
1
0
0
Is the meaning of this regex: (\d+).*? - group a set of numbers, then take whatever that comes after (only one occurance of it at maximum, except a newline)? Is there a difference in: (\d+) and [\d]+?
Meaning of regex Python
0
0
0
91
16,816,914
2013-05-29T14:40:00.000
-1
0
0
0
python,windows,cairo,pango
68,884,724
2
false
0
0
For Mac you can use Brew to install Pango: brew install pango
2
5
0
Since ReportLab does not support Python 3 I am now attempting to generate PDF with cairo, which works but lacks text-wrapping support. The next step seems to require pango and its Python-bindings, but I cannot find any information on how to install this for Windows.
How to install pango for Python on Windows?
-0.099668
0
0
5,509
16,816,914
2013-05-29T14:40:00.000
0
0
0
0
python,windows,cairo,pango
51,411,884
2
false
0
0
You can use Anaconda's conda package manager. But, what i found from the personal experiment that the pango works with python3 and cairo works with python2. and You my friend is stuck in middle.
2
5
0
Since ReportLab does not support Python 3 I am now attempting to generate PDF with cairo, which works but lacks text-wrapping support. The next step seems to require pango and its Python-bindings, but I cannot find any information on how to install this for Windows.
How to install pango for Python on Windows?
0
0
0
5,509
16,816,929
2013-05-29T14:41:00.000
2
0
1
0
python,twisted,scrapy,importerror
16,818,251
1
false
1
0
Verify that you have zope.interface 4.0.5 installed on the same version of Python as you are using to run scrapy. Most likely you have more than one version of Python installed and scrapy is using a different version than you expect.
1
3
0
When I try to run Scrapy I get an ImportError stating that Twisted requires zope.interface 3.6.0 or later. The version of zope.interface I have is 4.0.5, so I'm perplexed by this error. I've read other suggestions recommending installing zope.interface via pip, but that did not work. I'd like some help figuring out how...
Scrapy ImportError
0.379949
0
0
907
16,817,623
2013-05-29T15:10:00.000
1
1
1
0
python
16,817,965
1
false
0
0
This is just my opinion, but I would probably use a combination of virtualenvs and Makefiles/scripts in this case. I haven't done it for your specific use case, but I often set up multiple virtualenvs for a project, each with a different python version. Then I can use Makefiles to run my code or tests in one or all of ...
1
2
0
I'm using Python with a Cygwin environment to develop data processing scripts and Python packages I'd like to actively use the scripts while also updating the packages on which those scripts depend. My question is what is the best practice, recommendation for managing the module loading path to isolate and test my ...
Separate Python paths for development and production
0.197375
0
0
170
16,817,777
2013-05-29T15:17:00.000
0
1
0
0
java,android,python,bluetooth,playstation
16,818,550
2
false
1
0
Im pretty sure you need an emulator for this. Correct me if Im wrong.
1
1
0
i am trying to find if it is possible to send a message over Bluetooth to consoles like playstation 3 to make it turn on or off? since it is possible to be done from controllers. I been reading around about it. but was wondering if there is any information or exapmles that could help. as all i could find was python cod...
Android to Playstation and other consoles
0
0
0
150
16,820,895
2013-05-29T18:03:00.000
1
0
1
1
python,pyparsing
16,822,978
1
false
0
0
Try Suppress("\r\n") instead of Suppress(LineEnd())
1
1
0
I have a simple pyparsing construct for extracting parts of a log message. It looks like this log_line = timestamp + task_info + Suppress(LineEnd()) This construct parses a log file generated in Linux very well but doesn't parse a similar file generated in windows. I am pretty sure it is because of the new line represe...
pyparsing not working on windows text file but works on linux text file
0.197375
0
0
147
16,820,903
2013-05-29T18:04:00.000
1
0
1
0
python,matplotlib,python-3.3
16,823,062
2
true
0
0
I suspect you need to install python3-matplotlib, python3-numpy, etc. python-matlab is the python2 version.
1
1
1
Today I upgraded to Xubuntu 13.04 which comes with Python 3.3. Before that, I was working with Pyton 3.2, which was working perfectly fine. When running my script under Python 3.3, I get an ImportError: No module named 'pylab' in import pylab. Running in Python 3.2, which I reinstalled, throws ImportError: cannot im...
Pylab after upgrading
1.2
0
0
312
16,822,338
2013-05-29T19:31:00.000
2
0
1
0
python,select,boolean,pygame,midi
16,822,525
2
true
0
1
When developing games you usually do everything in a main loop. If you want e.g. 50 fps, then you want to go through this loop 50x per second. If you assume that you are not doing anything time consuming, then you can sleep for 20ms at the end of every iteration. So I think that's the reason why only poll is available,...
2
0
0
i need to use select() on a bool because the module pygame.midi lets you know when a midi message is ready only through the function Input.poll() that returns a bool. if i check this value in the simple way, i do busy waiting and my cpu works at 100% all the time. is there a way to use the select() or similar functions...
python - select() on boolean variable
1.2
0
0
364
16,822,338
2013-05-29T19:31:00.000
0
0
1
0
python,select,boolean,pygame,midi
16,822,580
2
false
0
1
If your input doesn't have any way to fire events, you have to check it on a timer. In most games, your main event loop already has some "frame limiter" code, so the event loop runs no more than 50 times/sec. So, you can just poll once per event loop. If not, you'll essentially have to add a frame limiter now. If your ...
2
0
0
i need to use select() on a bool because the module pygame.midi lets you know when a midi message is ready only through the function Input.poll() that returns a bool. if i check this value in the simple way, i do busy waiting and my cpu works at 100% all the time. is there a way to use the select() or similar functions...
python - select() on boolean variable
0
0
0
364
16,823,109
2013-05-29T20:21:00.000
2
0
1
1
python,file,unix,file-io,operating-system
17,035,837
1
true
0
0
It is almost certainly not python's fault. If python closes the file, OR exits cleanly (rather than killed by a signal), then the OS will have the new contents for the file. Any subsequent open should return the new contents. There must be something more complicated going on. Here are some thoughts. What you describe ...
1
4
0
I have a library that interacts with a configuration file. When the library is imported, the initialization code reads the configuration file, possibly updates it, and then writes the updated contents back to the file (even if nothing was changed). Very occasionally, I encounter a problem where the contents of the conf...
When does Python write a file to disk?
1.2
0
0
1,521
16,824,419
2013-05-29T21:46:00.000
2
0
0
1
python,beautifulsoup,ipython
16,824,528
3
false
0
0
Just install virtualenv once, then work on local environments. It's a good practice too.
1
0
0
I don't have admin privileges on my work computer (OSX) and do some light Python scripting (mostly web scraping). I don't have admin privileges at work and don't really want to learn OSX but I also don't want to lug my Ubuntu laptop around everyday just to write scrapers. Is there a straightforward way for me to insta...
How do I install Python modules on OSX if I don't have admin privs?
0.132549
0
0
709
16,824,942
2013-05-29T22:26:00.000
0
1
1
1
python,eclipse,pydev,jython
18,384,815
1
false
0
0
The version that PyDev uses internally is Jython 2.1, so, you can't add newer libraries to that version unless they're compatible... If you need to use a different version, you'd need to first update the version used inside PyDev itself (it wasn't updated so far because the current Jython size is too big -- PyDev has ...
1
2
0
PyDev has its own jython interpreter, inside pydev.jython.VERSION that jython has its own python libraries i.e. pydev.jython.VERSION/LIB/zipfile.py Now if I write a jython script for pydev-jython-scripting, it will load only its internal Lib pydev.jython.VERSION/LIB/ How do I have this pydev-jython recognize PYTHONPAT...
pydev eclipse, jython scripting , syspath
0
0
0
205
16,825,742
2013-05-29T23:47:00.000
0
0
0
0
wxpython
16,826,193
1
false
0
1
It's probably due to circular imports. One file is not yet fully imported when it imports another, which then imports the first one again. Since it was already started the original module object is returned, but it hasn't yet defined the class you are looking for.
1
0
0
So, I am actually trying to restart a frame. I have my frame defined in my mainF.py file, and my panels defined as classes in a panels.py file. I call these two methods when my clear button is pressed: self.frame.Destroy() main() where main() is my method for jumpstarting my frame object. In my mainF file, I am usin...
wxpython global name not defined error
0
0
0
173
16,826,233
2013-05-30T00:51:00.000
5
0
0
0
python,css,debugging,sass,webassets
16,826,275
2
false
1
0
Figured it out. Webassets does not pick up on changes to scss files that are included in other scss files using @import. The only solution is to always make a change to the including scss file if you make a change to the included one.
1
3
0
I'm using the pyscss compiler in the python webassets library with webassets debug configs all set to true. But when I make changes to an scss file and reload the page that includes the generated css file, I see that the css file has not be regenerated and does not include my changes. Why is this happening?
Why won't python webassets pyscss regenerate css from scss files in debug mode?
0.462117
0
0
850
16,826,304
2013-05-30T00:59:00.000
1
0
0
0
python,robotframework
16,847,883
1
false
1
0
The Execute Javascript extension isn't a part of RobotFramework, it's something added by the Selenium integration, it would therefore follow that you can't use Selenium to execute a .py file. That said, RobotFramework is written in Python and can obviously be extended with a Python script. Can you clear up what you're ...
1
1
0
Has anyone found a method for executing their .py files from the Robot Framework like you can for JS? RobotFramework: Executes the given JavaScript code. code may contain multiple statements and the return value of last statement is returned by this keyword. code may be divided into multiple cells in the test data...
Can Not execute Python .py file using RobotFramework like Javascript
0.197375
0
1
635
16,829,049
2013-05-30T06:05:00.000
1
0
0
0
python,tkinter
16,834,234
1
true
0
1
You will want to use the text widget. To color certain words or characters you will need to define a tag, and apply that tag to a range of text.
1
0
0
I would like to display a file having Unicode data (Malayalam) in a window with a scrolled area, with all the named entities in different colours in tkinter (PYTHON). For example, consider the sentence - 'Python is a programming language.' In my window, Python should be in a different colour. My file contains more tha...
How to display unicode data in a file with named entities in different colours in a popup window with scrolled area in tkinter?
1.2
0
0
65
16,831,701
2013-05-30T08:50:00.000
1
1
1
0
python,doctest
16,831,858
2
false
0
0
Your doctest could use module StringIO to provide a file object from a string.
1
4
0
my function reads from a file, and a doctest needs to be written in a way independent of an absolute path. What's the best way of wrting a doctest? Writing a temp file is expensive and not failproof.
How to write a doctest for a function that reads from a file?
0.099668
0
0
1,135
16,833,285
2013-05-30T10:05:00.000
0
0
1
0
python,python-2.7,printing,syntax-highlighting,python-idle
64,529,376
6
false
0
0
I do this all the time with large amounts of code. Just install SciTE "https://www.scintilla.org/SciTEDownload.html" Copy and paste your code and print. I like to grab some tape and markers stick all the sheets on a wall and put some music on. Happy coding!
3
9
0
I have searched for an answer to this but the related solutions seem to concern 'print'ing in the interpreter. I am wondering if it is possible to print (physically on paper) python code in color from IDLE? I have gone to: File > Print Window in IDLE and it seems to just print out a black and white version without prom...
How to physically print python code in color from IDLE?
0
0
0
23,412
16,833,285
2013-05-30T10:05:00.000
2
0
1
0
python,python-2.7,printing,syntax-highlighting,python-idle
26,572,656
6
false
0
0
Use the IDLE extension called IDLE2HTML.py (search for this). This lets IDLE print to an HTML file that has color in its style sheet. Then save the HTML file to a PDF (the color will still be there).
3
9
0
I have searched for an answer to this but the related solutions seem to concern 'print'ing in the interpreter. I am wondering if it is possible to print (physically on paper) python code in color from IDLE? I have gone to: File > Print Window in IDLE and it seems to just print out a black and white version without prom...
How to physically print python code in color from IDLE?
0.066568
0
0
23,412
16,833,285
2013-05-30T10:05:00.000
0
0
1
0
python,python-2.7,printing,syntax-highlighting,python-idle
58,010,122
6
false
0
0
I had the same problem and opened the py file into Visual Studio Code, then simply copied (Ctrl A / Ctrl C) and pasted the text (Ctrl V) into a Microsoft editor such as Word or RTF, or even outlook. The colors stay, including when printing. Note that in order to avoid the night mode set as a default in VS Code, go to ...
3
9
0
I have searched for an answer to this but the related solutions seem to concern 'print'ing in the interpreter. I am wondering if it is possible to print (physically on paper) python code in color from IDLE? I have gone to: File > Print Window in IDLE and it seems to just print out a black and white version without prom...
How to physically print python code in color from IDLE?
0
0
0
23,412
16,837,715
2013-05-30T13:35:00.000
0
0
1
0
python,function,binary
16,837,739
1
false
0
0
Yes. Read the source code of the library.
1
0
0
I am trying to modify a program. I see function calls that go into a file called myProgLib.so Its a binary file but I want to know what happens in these functions that are being called, is there a way to do this? I need to understand them before I can modify them to my needs Thank you
.so files in python
0
0
0
595
16,838,198
2013-05-30T13:58:00.000
0
0
0
0
python,xml,soap,httpresponse,minidom
16,850,655
1
true
0
0
Ok the solution was just to cast it to a string using str(response)
1
0
0
Is there a way to parse a SOAP Response (similar to XML) in Python? I have browsed through most of Stackoverflow solutions and they usually use minidom or ET functions parse() or parseString(). parse() takes a filename as input, while parseString() takes a string as input. However SOAP response type is HTTPResponse and...
Parse SOAP Response in Python
1.2
0
1
1,989
16,838,457
2013-05-30T14:09:00.000
6
0
1
0
python,dictionary,python-3.x,encryption
16,838,485
1
true
0
0
Encode the dict as a string with e.g. json, and then encrypt the resultant string.
1
4
0
I have a dictionary, myDict = {1:'a',2:'b',3:'c'}, that I'd like to encrypt and write to an external raw text file. I've already downloaded and installed PyCrypto since a lot of other threads seem to recommend it, but it's too confusing for me to grasp its terminology and syntax. Could someone explain how I'd go about ...
How do I encrypt/decrypt a dictionary in Python 3.3?
1.2
0
0
4,783
16,838,499
2013-05-30T14:11:00.000
1
0
1
0
python,windows-7
16,839,021
2
false
0
0
Well as Tim Peters explained it's because of the whitespace/null space or embedded space in the path. If ever you've used an older windows version and tried cd'in to a path such as documents and settings you'd get an error saying 'documents' not recognized blah blah.. that's because it thinks documents is a directory, ...
1
9
0
Apologies for a likely stupid question, but no amount of Googling or searching here for my query could get me anywhere. Just having issues with root installations lead me to wonder WHY Python 2.7 is naturally set up in the root directory of Windows, when everything else is in ProgramFiles? Is there a simple answer for ...
Why is Python 2.7 installed at root, unlike most programs today?
0.099668
0
0
186
16,840,711
2013-05-30T15:55:00.000
1
0
1
0
python,image,pygame
16,841,217
2
false
0
1
I believe you need to load the image as a Surface before you can get its width and height. You do that with foo = pygame.image.load(PATHNAME). Then you can get the width and height by creating a Rectangle with foo.get_rect() and asking the rectangle.
1
1
0
If I'm using an image and I want to know the image's size in the file. There is a function to get the picture's height and width ? EDIT: Of course I loaded the image to the program with pygame.image.load(PATH).
How to get the picture size in pygame (python)
0.099668
0
0
3,476
16,846,264
2013-05-30T21:36:00.000
2
0
1
1
python
16,846,327
2
false
0
0
Not with os.startfile(), no; it provides no way of communicating with the launched process. You could use the subprocess module, though; this will allow you to send data to and receive data from the launched process through standard in/out. Or, since the thing you want to call is another Python script, simply import th...
1
6
0
I'm wondering if it is possible to run another file: os.startfile('File.py') and have that file return a value to the file that called the other file. For example, you have File1. Is it possible for File1 to call and run File2 and have File2 return a value to File1?
Is it possible to return a value from one Python file to another?
0.197375
0
0
1,474
16,846,391
2013-05-30T21:45:00.000
3
0
0
0
python,django,web-applications
16,846,436
4
false
1
0
For this to be meaningful, you likely need to connect to the same database Why would you need two codebases? You have two copies of a single codebase.
3
2
0
I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website. So far I see my only option is as follows... Copy the apps to the server which means I have two...
Does a Django site with a Tastypie interface need two codebases?
0.148885
0
0
134
16,846,391
2013-05-30T21:45:00.000
1
0
0
0
python,django,web-applications
16,846,450
4
false
1
0
Why don't you run the api on the same server on a different port? that will save you a lot of problems to start with. Sharing database connections cross servers will likely require you to think about security, a lot. Also if you are reusing the same apps in different projects you might want to package and version your ...
3
2
0
I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website. So far I see my only option is as follows... Copy the apps to the server which means I have two...
Does a Django site with a Tastypie interface need two codebases?
0.049958
0
0
134
16,846,391
2013-05-30T21:45:00.000
2
0
0
0
python,django,web-applications
16,855,093
4
true
1
0
I wouldn't recommend splitting your project like this. Every time you edit a model you have to edit it on both immediately or risk things getting out of sync. This will get very very painful, instead; Is the server the bottleneck? Split site and api machines (but using the same models.py) and share the connection to t...
3
2
0
I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website. So far I see my only option is as follows... Copy the apps to the server which means I have two...
Does a Django site with a Tastypie interface need two codebases?
1.2
0
0
134
16,846,967
2013-05-30T22:37:00.000
1
0
0
0
android,python,sockets,tcp
16,847,185
2
false
0
1
Well, you could have the Android Application save the image to a folder and have the Python file import that image.
2
1
0
I have an Android application that captures an image and Python code that extracts some features from images. I want to connect them to each other (receive the image in Python from the Android application). I read some things about building a TCP Server, but I don't know how to do it and how to start as it's my first t...
Connect Android to Python
0.099668
0
0
653
16,846,967
2013-05-30T22:37:00.000
-1
0
0
0
android,python,sockets,tcp
36,057,987
2
false
0
1
You can upload a image to server using any of the database, use python code on server side and you will get the result.
2
1
0
I have an Android application that captures an image and Python code that extracts some features from images. I want to connect them to each other (receive the image in Python from the Android application). I read some things about building a TCP Server, but I don't know how to do it and how to start as it's my first t...
Connect Android to Python
-0.099668
0
0
653
16,847,597
2013-05-30T23:40:00.000
1
0
1
0
python,python-2.7,random
16,847,624
4
false
0
0
1) Calculate how many elements you want to remove, call it k. 2) random.randrange(len(listA)) will return a random number between 0 and len(listA)-1 inclusive, e.g. a random index you can use in listA. 3) Grab the element at that index, remove it from listA, append it to listB. 4) Repeat until you have removed k elemen...
1
1
0
I am new to python and programming, so apologies in advance. I know of remove(), append(), len(), and rand.rang (or whatever it is), and I believe I would need those tools, but it's not clear to me how to code it. What I would like to do is, while looping or otherwise accessing List_A, randomly select an index within ...
Is it possible to randomly *remove* a percentage/number of items from a list & then *append* them to another list?
0.049958
0
0
2,089
16,848,912
2013-05-31T02:34:00.000
1
0
0
0
python,windows,qt,gtk,pyqt
16,854,156
2
false
0
1
I prefer PyQt, there is some examples in the pyqt release directory, you can try it out. I think the effect is really cool. I haven't tried other library so i could not compare PyQt with others . As I am familiar with Qt, the coding experience is very easy if you switch Qt to PyQt.
1
1
0
In your opinion, what is the best way to create gui in Windows with python ? Do you recommend PyQt for windows?
Your best library for create GUI with Python (PyQt, PyGTK, wxPython, IronPython, etc)
0.099668
0
0
5,220
16,852,911
2013-05-31T08:23:00.000
-1
0
1
0
python,date,pandas
60,213,042
10
false
0
0
Try to convert one of the rows into timestamp using the pd.to_datetime function and then use .map to map the formular to the entire column
2
133
1
I have a Pandas data frame, one of the column contains date strings in the format YYYY-MM-DD For e.g. '2013-10-28' At the moment the dtype of the column is object. How do I convert the column values to Pandas date format?
How do I convert strings in a Pandas data frame to a 'date' data type?
-0.019997
0
0
297,830
16,852,911
2013-05-31T08:23:00.000
25
0
1
0
python,date,pandas
33,577,649
10
false
0
0
Now you can do df['column'].dt.date Note that for datetime objects, if you don't see the hour when they're all 00:00:00, that's not pandas. That's iPython notebook trying to make things look pretty.
2
133
1
I have a Pandas data frame, one of the column contains date strings in the format YYYY-MM-DD For e.g. '2013-10-28' At the moment the dtype of the column is object. How do I convert the column values to Pandas date format?
How do I convert strings in a Pandas data frame to a 'date' data type?
1
0
0
297,830
16,853,789
2013-05-31T09:12:00.000
1
1
1
0
python
16,853,869
2
false
0
0
No. Think about it: If Python is slower than C for a processor running at speed X, what can you say about the speed of Python vs. C for a processor running at speed 2X? But then... You can write operating systems in dynamic languages. And people do. Once you bootstrap the interpreter. But this won't become mainstream. ...
1
1
0
I have a question which has been on my mind for a while. I'm aware that languages like C are faster than Python and are therefore used to write operating systems. I've read somewhere that an operating system written in Python will be very slow. So here is my question: As processor speed is continuously improved, does t...
Python's speed in operating system development
0.099668
0
0
190
16,859,674
2013-05-31T14:27:00.000
0
0
0
1
python,google-app-engine,python-memcached
16,866,096
3
false
1
0
Any object is a valid key, provided that the object can be serialized using pickle. If pickle.dumps(key) succeeds, then you shouldn't get a BadKeyError.
2
1
0
Is there a function in Google App Engine to test if a string is valid 'string key' prior to calling memcache.get(key) without using db.get() or db.get_by_key_name() first? In my case the key is being passed from the user's get request: obj = memcache.get(self.request.get("obj")) Somehow I'd like to know if that string...
Test if string is valid key prior to memcache.get()
0
0
0
581
16,859,674
2013-05-31T14:27:00.000
1
0
0
1
python,google-app-engine,python-memcached
16,867,410
3
false
1
0
A db module key sent to a client should pass through str(the_key) which gives you an URL safe encoded key. Your templating environment etc.. will do this for you just by rendering the key into a template. On passing the key back from a client, you should recreate the key with key = db.Key(encoded=self.request.get("ob...
2
1
0
Is there a function in Google App Engine to test if a string is valid 'string key' prior to calling memcache.get(key) without using db.get() or db.get_by_key_name() first? In my case the key is being passed from the user's get request: obj = memcache.get(self.request.get("obj")) Somehow I'd like to know if that string...
Test if string is valid key prior to memcache.get()
0.066568
0
0
581
16,861,536
2013-05-31T16:07:00.000
0
0
1
0
python,regex,file-io
16,861,680
3
false
0
0
Use the csv module to read the files in, create a dictionary of the measurement names, and make the values in the dictionary a list of the values from the file.
1
2
0
I am attempting to combine a collection of 600 text files, each line looks like Measurement title Measurement #1 ebv-miR-BART1-3p 4.60618701 .... evb-miR-BART1-200 12.8327289 with 250 or so rows in each file. Each file is formatted that way, with the same data headers. What I would like to do is combine the files suc...
Combining files in python using
0
0
0
160
16,863,537
2013-05-31T18:24:00.000
1
0
1
0
python
16,863,623
2
false
0
0
This probably has to do with Python's roots being in C. In C, false == 0. Also at an academic level, in binary representation, 0 is almost always regarded as false.
2
0
0
Python is an object-oriented programming language, although it treats 0 as False, while languages like, for example, Ruby evaluates 0 to true, because (I believe) 0 it's a number and numbers are objects so they must evaluate to true because they exists. well, all I know about these conventions is that, they are there b...
Why python evaluates 0 to False?
0.099668
0
0
404
16,863,537
2013-05-31T18:24:00.000
0
0
1
0
python
16,863,633
2
false
0
0
Almost every common language (everything on the C branch, Haskell, Python, etc.) interpret 0 as False. This makes a lot of sense, because the question "Does this variable contain something meaningful?" is most often True when > 0, and False when 0. The only place I recall seeing 0 being used as True is in the Unix she...
2
0
0
Python is an object-oriented programming language, although it treats 0 as False, while languages like, for example, Ruby evaluates 0 to true, because (I believe) 0 it's a number and numbers are objects so they must evaluate to true because they exists. well, all I know about these conventions is that, they are there b...
Why python evaluates 0 to False?
0
0
0
404
16,865,213
2013-05-31T20:12:00.000
0
0
1
0
python,global-variables
37,989,329
7
false
0
0
A normal variable is only usable inside of a function, a global variable can be called for outside the function, but don't use this if you don't need to, it can create errors and big programming companies consider this a rookie thing to do.
2
19
0
How do I set a global variable inside of a python function?
How do I use global variables in python functions?
0
0
0
33,612
16,865,213
2013-05-31T20:12:00.000
1
0
1
0
python,global-variables
16,865,257
7
false
0
0
Explicit declaration by using global <variable name> inside a function should help
2
19
0
How do I set a global variable inside of a python function?
How do I use global variables in python functions?
0.028564
0
0
33,612
16,865,390
2013-05-31T20:23:00.000
2
0
1
0
python
16,865,448
6
false
0
0
I would say because finding the length depends on OS specific functionality. You can find the length of a file with this code: import os os.path.getsize('C:\\file.txt') You could also read the entire file into a string and find the length of the string. However you would want to be sure that the file is not of a huge s...
2
23
0
I'm not exactly new to Python, but I do still have trouble understanding what makes something "Pythonic" (and the converse). So forgive me if this is a stupid question, but why can't I get the size of a file by doing a len(file)? file.__len__ is not even implemented, so it's not like it's needed for something else? Wo...
Why no len(file) in Python?
0.066568
0
0
55,177
16,865,390
2013-05-31T20:23:00.000
24
0
1
0
python
16,865,516
6
false
0
0
Files have a broader definition, especially in Unix, than you may be thinking. What is the length of a printer, for example? Or a CDROM drive? Both are files in /dev, and sort of in Windows. For what we normally think of as a file, what would its length be? The size of the variable? The size of the file in bytes? The l...
2
23
0
I'm not exactly new to Python, but I do still have trouble understanding what makes something "Pythonic" (and the converse). So forgive me if this is a stupid question, but why can't I get the size of a file by doing a len(file)? file.__len__ is not even implemented, so it's not like it's needed for something else? Wo...
Why no len(file) in Python?
1
0
0
55,177
16,867,749
2013-06-01T00:15:00.000
0
0
0
0
android,python,sockets,tcp
16,868,676
2
false
0
0
poof's answer is a good overview, but here are some notes on the various options: Option 1: Have your Android get the picture and do a HTTP POST to a Python application running a framework such as Django. It should be 1 line of code on Android, and only a few lines of code on Python (around your existing code). The up...
1
0
0
I am currently involved in a project where we performed some computer vision object recognition and classification using python. It is necessary to use photos taken from an Android phone (photos should be automatically sent from android to python). I actually don't know how should I connect both applications (android a...
Tcp/IP socket programming in python
0
0
1
780
16,867,823
2013-06-01T00:26:00.000
3
0
0
0
python,mysql,mysql-python
16,867,914
4
false
0
0
Yes if you really need unlimited precision then you'll have to use a blob because even strigns are limited. But really I can almost guarantee that you'll be fine with a NUMERIC/DECIMAL data type. 65 digits means that you can represent numbers in the range (-10^65, 10^65). How large is this? To give you some idea: The ...
1
2
0
I need to represent instances of Python "Long integer" in MySQL. I wonder what the most appropriate SQL data type I should use. The Python documentation (v2.7) says (for numbers.Integral): Long integers These represent numbers in an unlimited range, subject to available (virtual) memory only. For the purpose of shift...
What are the options for storing Python long integers in MySQL?
0.148885
1
0
1,333
16,868,320
2013-06-01T01:54:00.000
1
0
1
1
python,unicode,encoding,enthought,canopy
16,913,698
1
true
0
0
are you running this code from an unsaved buffer? If yes, this is a known issue in Canopy 1.0 and should be fixed in the next update. If no, can you provide a minimal example to reproduce your problem, so this can be fixed? Thanks!
1
0
0
I've been using python from time to time for some small projects and just started using it again after quite a while. I'm using Enthoughts Canopy IDE and get the following error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128) I know that I have to define the en...
Enthought Canopy Encoding Error
1.2
0
0
763
16,869,024
2013-06-01T04:24:00.000
4
0
1
0
python,python-3.x,caching
43,122,347
11
false
0
0
In 3.2 and later, Python saves .pyc compiled byte code files in a sub-directory named __pycache__ located in the directory where your source files reside with filenames that identify the Python version that created them (e.g. script.cpython-33.pyc)
4
936
0
From what I understand, a cache is an encrypted file of similar files. What do we do with the __pycache__ folder? Is it what we give to people instead of our source code? Is it just my input data? This folder keeps getting created, what it is for?
What is __pycache__?
0.072599
0
0
470,821
16,869,024
2013-06-01T04:24:00.000
5
0
1
0
python,python-3.x,caching
50,962,374
11
false
0
0
The python interpreter compiles the *.py script file and saves the results of the compilation to the __pycache__ directory. When the project is executed again, if the interpreter identifies that the *.py script has not been modified, it skips the compile step and runs the previously generated *.pyc file stored in the _...
4
936
0
From what I understand, a cache is an encrypted file of similar files. What do we do with the __pycache__ folder? Is it what we give to people instead of our source code? Is it just my input data? This folder keeps getting created, what it is for?
What is __pycache__?
0.090659
0
0
470,821
16,869,024
2013-06-01T04:24:00.000
5
0
1
0
python,python-3.x,caching
56,339,890
11
false
0
0
Execution of a python script would cause the byte code to be generated in memory and kept until the program is shutdown. In case a module is imported, for faster reusability, Python would create a cache .pyc (PYC is 'Python' 'Compiled') file where the byte code of the module being imported is cached. Idea is to speed u...
4
936
0
From what I understand, a cache is an encrypted file of similar files. What do we do with the __pycache__ folder? Is it what we give to people instead of our source code? Is it just my input data? This folder keeps getting created, what it is for?
What is __pycache__?
0.090659
0
0
470,821
16,869,024
2013-06-01T04:24:00.000
0
0
1
0
python,python-3.x,caching
71,937,472
11
false
0
0
does the byte code in __pycache__ get automatically invoked the next time the application is started? I.E: if we run some application main.py for the first time and all the necessary modules get complied and stored in pycache then the next time are they automatically used even if I call python main.py? or we will have ...
4
936
0
From what I understand, a cache is an encrypted file of similar files. What do we do with the __pycache__ folder? Is it what we give to people instead of our source code? Is it just my input data? This folder keeps getting created, what it is for?
What is __pycache__?
0
0
0
470,821
16,869,621
2013-06-01T06:00:00.000
2
0
0
0
java,android,python,pygtk,kivy
16,878,423
1
false
0
1
I see you tagged the question with kivy, I can only answer that we don't have such a thing for kivy yet, although a GSOC student got accepted for this and will start working on it soon, let's hope it'll work out nicely :). I'm of the opinion that the kvlang we have in kivy makes the need of a Graphical Designer far les...
1
3
0
I want to use pygtk app for android app development. I want to use app like pygtk which will have easy drag and drop options for developing the front end for android application. Is there any of such thing which can let me design my front end for android app with drag and drop? (specially in python or else in java)
use pygtk for android apps development
0.379949
0
0
1,574
16,870,858
2013-06-01T08:44:00.000
1
0
1
0
python,flask
16,891,362
3
false
1
0
I have not threading solution: I'm using celery for hard operations: send email, fetch url, create many database records, periodic tasks. + you can use flask application and celery instances on different servers - you need backend (rabbitmq, redis, mongodb and etc.)
1
2
0
Recently I've been practicing to build a website with flask. Now i encounter a problem.There is a function which to achieve registration. The code like this: def register(): ... some judgment ... if true: sendmail() return redirect(url_for('onepage')) My question is...
threading programming in python
0.066568
0
0
2,730
16,871,254
2013-06-01T09:33:00.000
12
0
1
0
python,django,virtualenv
16,871,438
1
true
1
0
Nope, it doesnt infuence the performance. Basically all what it do is changing python path to the virtualenvs ones. So there shouldn`t be any difference with performance.
1
8
0
I have a django app up and running. I never encountered any performance problems, though the app is hosted on a shared hosting platform. The provider asked my recently to use python's virtualenv. Since then the performance has been really bad, though I can't detect the change in CPU usage or any other statistic. So m...
Does using a virtual environment influence the performance of a web app?
1.2
0
0
2,134
16,872,221
2013-06-01T11:31:00.000
6
0
0
0
python,mysql,mongodb,nlp,bigdata
16,873,052
1
true
0
0
This really depends on what exactly you are storing and which operations you will perform on this data. SQL vs. NoSQL is a very fundamental decision and no one can give you a good advice here. If your data fits relational model well, then, SQL (PostgreSQL or MySQL) is your choice. If your data is more like documents, u...
1
0
0
Can someone advise on what database is better for storing textual information such as part of speech sequences, dependencies, sentences used in NLP project written in python. Now this information is stored in files and they need to be parsed every time in order to extract the mentioned blocks which are used as an input...
Database for NLP project
1.2
1
0
2,075
16,874,046
2013-06-01T15:04:00.000
17
0
1
0
python,console,pycharm
29,418,064
9
false
0
0
For anyone still having this problem: Go to the Run/Debug menu, choose Edit Configuration, check the box 'Show command line' this will enable you to enter parameters in the console at the >>> prompt and test your function. Edit: To make this change apply to all your .py files (as this check box only applies to the cur...
2
25
0
I'm new to python and pycharm and I'd like to run a module from the pycharm console in the same way as you can from IDLE, if it's possible. The idea is to create simple functions and test them "live" using the console. ...how do you do that in pycharm?
Running a module from the pycharm console
1
0
0
69,594
16,874,046
2013-06-01T15:04:00.000
3
0
1
0
python,console,pycharm
27,771,551
9
false
0
0
Select the script lines that you want to execute and press Shift+Alt+E
2
25
0
I'm new to python and pycharm and I'd like to run a module from the pycharm console in the same way as you can from IDLE, if it's possible. The idea is to create simple functions and test them "live" using the console. ...how do you do that in pycharm?
Running a module from the pycharm console
0.066568
0
0
69,594
16,874,716
2013-06-01T16:22:00.000
0
0
0
0
python,import,intellij-idea,pygame
32,979,653
1
false
0
1
you can try to install the pygame lib to your python directory, but you might have to make your python 32 bit for that to work dunno how it works on windows. On mac though there are several tutorials.
1
3
0
I use intellij idea plug in for python developing. I want to import pygame module to my project, but everytime I get error "ImportError: No module named 'pygame'". I tried to add the pygame lib folder to dependencies but it didn't work, I also added it to library but it didn't work either. Could anyone help me with thi...
importing pygame in Intellij IDEA
0
0
0
1,211
16,876,974
2013-06-01T20:30:00.000
2
0
1
1
python,virtualenv
54,860,786
2
false
0
0
virtualenv --python=python3 mynewenv
1
2
0
I recently have started learning python and have run into an issue. When I run python on my mac without virtualenv, the version number is Python 2.7.5. Unfortunately, when I go into my virtualenv, and run Python, the version number is Python 2.6.1. I tried, creating another virtualenv using: virtualenv -p /usr/bin/pyth...
Virtualenv is installing with wrong version of Python
0.197375
0
0
3,193
16,877,448
2013-06-01T21:29:00.000
2
0
1
0
python,scikit-learn
16,877,799
1
true
0
0
Found it, there's a note on the svm page that if you enable verbose settings multiprocessing may break. Disabling verbose fixed it
1
1
1
Trying to use gridsearch CV with multiple jobs via the n_jobs argument and I can see using htop that they're all launched and running but they all get stuck/assigned on the same core using 25% each (I'm using a 4 core machine). I'm on Ubuntu 12.10 and I'm running the latest master pulled from github. Anyone know how to...
Scikit-Learn n_jobs Multiprocessing Locked To One Core
1.2
0
0
391
16,879,278
2013-06-02T02:45:00.000
1
0
0
0
python,django
16,879,697
1
true
1
0
You don't need to copy whole django-userena module in you project directory. You only need to copy "emails" folder from userena/templates/userena/ into you project template directory with same directory structure. For Example : you_project_dir/templates/userena/emails After that just change activation_email_message.tx...
1
0
0
I want to replace the default django-userna email message for user account activation with one that is website specific. I've thought of some ways to do this like copying the entire installed django-userna module into a project specific app and replacing the default message stored in the module, but, all of my solutio...
How to overwrite the default email message for user account activation in django-userna?
1.2
0
0
173
16,881,335
2013-06-02T09:08:00.000
0
1
0
0
php,python,selenium,hostmonster
16,975,487
2
false
0
0
when i enter import sys and then print sys.path into ssh shell I receive the following: ['', '/home2/klickste/python/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/home2/klickste/python/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg', '/home2/klickste/python/lib/python2.7/site-packages/html2text-3.2...
2
0
0
I have created a python script that uses selenium to automate an online task. The script works perfect on my local machine (windows 7) and gives the output i am looking for. I am now trying to get it up and running from PHP on my hostmonster shared server which is running linux and having no luck. I have installed thi...
Import selenium error on hostmonster shared linux server
0
0
1
238
16,881,335
2013-06-02T09:08:00.000
1
1
0
0
php,python,selenium,hostmonster
16,991,512
2
true
0
0
I have resolved the issue. I used the following command to install selenium outside of the python folder. easy_install --prefix=$HOME/.local/ selenium I also added these lines at the bottom of my .bashrc file located in my home directory export PYTHONPATH=$HOME/.local/lib/python/site-packages:$PYTHONPATH export PYTHONP...
2
0
0
I have created a python script that uses selenium to automate an online task. The script works perfect on my local machine (windows 7) and gives the output i am looking for. I am now trying to get it up and running from PHP on my hostmonster shared server which is running linux and having no luck. I have installed thi...
Import selenium error on hostmonster shared linux server
1.2
0
1
238
16,885,902
2013-06-02T18:25:00.000
1
0
1
1
python,github,virtualenv,github-for-mac
16,885,929
2
false
0
0
Open terminal. cd into your virtualenv directory, and run git clone from there.
1
3
0
I could be missing something fundamental here, but I'm struggling to work out what. I'm using Github for Mac for the first time. I've found a repo i want to look at, so I've logged into GH and installed and configured the mac app. I've created a virtualenv that I want to work in. added python 2.7. I've forked the repo ...
how to clone a repo to a virtualenv on mac Mountain Lion
0.099668
0
0
2,468
16,889,768
2013-06-03T03:51:00.000
1
1
0
0
python,http,ftp
16,889,799
1
true
0
0
In your case I would use the HTTP because: Your service is stateless. If you use TCP you will have problem scaling up your service (since every request will be directed to the server that establish the TCP connection ), this relate to that your service is stateless. In HTTP you just add more servers behind load balane...
1
0
0
I am building a back end that will handle requests from web apps and mobile device apps. I am trying to decide if an TCP server is appropriate for this vs. Regular http GET and POST requests. Use case 1: 1. Client on mobile device executes a search on the device for the word "red". Word sent to server (unclear wether ...
Should I build a TCP server or use simple http messages for a back-end?
1.2
0
1
110
16,890,209
2013-06-03T04:54:00.000
2
0
0
0
python,hash,web-scraping
16,890,397
2
false
1
0
You can keep track of the date of the last version you got and use the If-Modified-Since header in your request. However, some resources ignore that header. (In general it's difficult to handle it for dynamically-generated content.) In that case you'll have to fall back to less efficient method.
2
0
0
I have some webpages where I'm collecting data over time. I don't care about the content itself, just whether the page has changed. Currently, I use Python's requests.get to fetch a page, hash the page (md5), and store that hash value to compare in the future. Is there a computationally cheaper or smaller-storage stra...
Efficient way to check whether a page changed (while storing as little info as possible)?
0.197375
0
1
89
16,890,209
2013-06-03T04:54:00.000
0
0
0
0
python,hash,web-scraping
16,890,487
2
true
1
0
A hash would be the most trustable source of change detection. I would use CRC32. It's only 32 bits as opposed to 128bits for md5. Also, even in browser Javascript it can be very fast. I have personal experience in improving the speed for a JS implementation of CRC32 for very large datasets.
2
0
0
I have some webpages where I'm collecting data over time. I don't care about the content itself, just whether the page has changed. Currently, I use Python's requests.get to fetch a page, hash the page (md5), and store that hash value to compare in the future. Is there a computationally cheaper or smaller-storage stra...
Efficient way to check whether a page changed (while storing as little info as possible)?
1.2
0
1
89
16,893,102
2013-06-03T08:54:00.000
2
0
0
0
python,matplotlib,tiff
16,893,364
1
true
0
0
Using matplotlib to export to TIFF will use PIL anyway. As far as I know, matplotlib has native support only for PNG, and uses PIL to convert to other file formats. So when you are using matplotlib to export to TIFF, you can use PIL immediately.
1
0
1
I'm trying to save some arrays as TIFF with matplotlib, but I'm getting 24 bit RGB files instead with plt.imsave(). Can I change that without resorting to the PIL? It's quite important for me to keep everything in pure matplotlib.
How to save 32/64 bit grayscale floats to TIFF with matplotlib?
1.2
0
0
792
16,893,882
2013-06-03T09:43:00.000
0
0
1
1
python,python-module
16,894,057
2
false
0
0
You need to change the permissions for the directory the process wants to write to. Find out what directory joblib wants to put things in and change its permissions or use a different directory with the needed permissions for this. In order to be able to give the permissions and to allow Python to write to the filesyst...
1
0
0
Anyone knows what this error is and how to fix it? I've already tried to chmod -R 777 /usr/local/python2.6/dist-packages/joblib but with no luck.
/usr/local/lib/python2.6/dist-packages/joblib/parallel.py:40: UserWarning: [Errno 30] Read-only file system. joblib will operate in serial mode
0
0
0
776
16,897,305
2013-06-03T12:58:00.000
1
0
1
0
python,python-3.x
16,900,464
2
true
0
0
You'll have to install 32-bit Python to run 32-bit extension modules. In my experience, two Python installations can live side-by-side quite nicely on Windows, as long as you make sure your environment (PYTHONPATH esp.) is set properly.
1
2
0
Note: Running windows7X64 I want to use some audio functions I have seen allot for python 2.7 like snack and such, however I'm using python 3.3. I have come across pygame.py that has some audio functions however pygame doesn't support 64bit arch yet. So can it be done? if not do we know of any python audio integration ...
Run Python 64bit In 32Bit mode?
1.2
0
0
9,258
16,898,086
2013-06-03T13:36:00.000
0
0
1
0
python,multithreading,timing
16,898,280
1
false
0
0
You could create a scheduler using a priority queue and a time quantum. Not sure on the specifics for this in Python, but the concept is the same: create a Scheduler class that accepts a thread, add the thread to a priority queue with a given priority, then sleep the thread after a specified time quantum has elapsed. Y...
1
2
0
Is it possible to control the proportional execution time of a thread in python. For example, I have three functions F1, F2 and F3 in my program. I am calling each function with using start_new_thread in python. I want F2 thread to execute 70 percent of time while F1 and F3 should share rest of 30 percent. Is there a w...
Controlling Thread Execution Time in Python
0
0
0
321
16,898,520
2013-06-03T13:57:00.000
0
0
0
0
javascript,python,html,web-applications,flask
16,898,841
3
false
1
0
Yuo should try localstorage .
1
1
0
I am building a website that does not require people to login, but still needs large session data. Example: a person uploads a 0.5 MB file. I want to able to manipulate this this from now and then. Where should I store it? I would prefer something like a cookie system, but obviously this is too small. Redis seems like ...
What is the best way to store large session data in web applications?
0
0
0
758
16,899,170
2013-06-03T14:30:00.000
1
0
1
0
python,installation,version,pygame
16,899,819
2
true
0
1
I solved it. I installed "Lion apple supplied python: pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip" Then i went into terminal and tried to import pygame through Aplle python and it prompted me to install "Xquartz" after i did this pygame works in both Terminal and 64 bit Idle 2.7.5.
1
0
0
Im running Mac OS 10.8.3 and python/idle 2.7.5. I tried to install pygame 1.9.1 but it didnt work. Is this the right pygame? if not which is?
Which pygame should i install?
1.2
0
0
356
16,899,597
2013-06-03T14:51:00.000
0
0
0
0
python,django,django-views
16,899,786
3
false
1
0
You can totally do that, it is only a convention to use views.py. Now, the question is: do you really need to create a new file to put your views inside ? Shouldn't these regrouped in a new application ? Think of an other person reviewing your code: would the reason of the separation be crystal clear to him ?
1
3
0
I have just started learning Django. I was wondering if Django app can have more than one views file? Let's say, I have two separate classes. Should I keep them in one views file or can I make two views files? Thanks in advance!
Can a django app have more than one views.py?
0
0
0
1,066
16,900,215
2013-06-03T15:20:00.000
4
0
0
0
python,django,javascriptmvc
16,900,507
1
false
1
0
If you don't want to render a template, simply don't render it. Django won't render anything unless you specifically call template.render or one of the shortcuts. If you just want to return an HTML file, you could just open it as a normal file, read it, then return the content as the response. Alternatively, as suggest...
1
2
0
I'm writing a single view Javascript application with a Django backend that only needs to return the initial index.html and all other templates come from a CDN. My problem is that this first index.html file is parsing out some of my "{{}}" handlebars which I wanted to leave for the JS library to interpret. I DO NOT wan...
Django return .html file directly without parsing for template tags at all
0.664037
0
0
2,717
16,901,130
2013-06-03T16:07:00.000
1
0
1
0
python,api,sdk,dropbox,importerror
17,679,874
1
true
0
0
Update: I found the problem, i called my own file dropbox.py and in that file imported dropbox. I accidently imported my own file. Renamed my file and now it works.
1
2
0
I am trying to use the dropbox sdk for python. I installed a virtual enviroment and used pip install to install dropbox-sdk. When I try to run the example code (see below) I get a importerror client cannot be found, but if I try to do it from the interactive intreperter it works. So what am I doing wrong. APP key and s...
Dropbox python sdk import error
1.2
0
1
216
16,901,650
2013-06-03T16:41:00.000
0
1
0
0
python,sftp,checksum,paramiko
68,450,855
1
false
0
0
I came with a similar scenario. the solution I currently take is to compare the remote file's size by using item.st_size for item in sftp.listdir_attr(remote_dir) with the local file's size by using os.path.getsize(local_file). when the two files are around 1MB or smaller,this solution is fine. However, a weird thing ...
1
2
0
I have a script that downloads a lot of fairly large (20MB+) files. I would like to be able to check if the copy I have locally is identical to the remote version. I realize I can just use a combination of date modified and length, but is there something even more accurate I can use (that is also available via paramiko...
Python + Paramiko - Checking whether two files are identical without downloading
0
0
1
614
16,905,303
2013-06-03T20:29:00.000
1
0
0
1
java,python,google-app-engine,load-testing
23,557,544
2
false
1
0
We had a similar problem - I found that disabling the app in Application Settings and then re-enabling it terminated all 88 instances we had running, without any other adverse effects.
2
1
0
We are running multiple load tests every day against one of our GAE apps. We use the following pattern: Start a load test and let it run for a few hours. Look at graphs. Optionally deploy a new version of our app with performance improvements. Go back to 1. Each load test creates a couple hundred front end instances....
How to shutdown all dynamic instances in Google App Engine without re-deploying the app?
0.099668
0
0
1,179
16,905,303
2013-06-03T20:29:00.000
0
0
0
1
java,python,google-app-engine,load-testing
16,909,149
2
false
1
0
Maybe have them all periodically probe the datastore (or memcache) for a kill value?
2
1
0
We are running multiple load tests every day against one of our GAE apps. We use the following pattern: Start a load test and let it run for a few hours. Look at graphs. Optionally deploy a new version of our app with performance improvements. Go back to 1. Each load test creates a couple hundred front end instances....
How to shutdown all dynamic instances in Google App Engine without re-deploying the app?
0
0
0
1,179