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
4,551,457
2010-12-29T04:22:00.000
8
1
1
0
java,python
4,551,485
3
false
1
0
The simplest thing to do is to write a method like "assertCredentials" and call that method at the start of every method that needs credentials. If credentials are not set, the method should throw an exception, which will abort the parent method. Java has annotations that can be used to decorate methods, etc., but I do...
1
27
0
I spend most of my time programming in Python, so forgive me if my approach to this problem is short-sited: I want to have certain methods of a class require login credentials. Simply, each method should check whether the class variable user is set, and if so, continue, but if not, spit out a "you need to login" messag...
Python-like decorators in Java?
1
0
0
12,568
4,551,565
2010-12-29T04:52:00.000
1
0
1
1
python,tkinter
4,551,695
3
false
0
0
Use Synaptic Package Manager (System > Administration > Synaptic Package Manager). Search for "idle".
1
0
0
Installed Ubuntu 10.10 and Python 2.5.5. IDLE did not start from the terminal so I went into the Python interpreter and did "import _tkinter". The package was not found. After searching a bit, I found that Ubuntu/debian might not include _tkinter so I proceeded to "sudo apt-get install python-tk" as per my searches....
what is missing that prevents my IDLE from working?
0.066568
0
0
243
4,553,034
2010-12-29T09:48:00.000
0
0
0
0
python
4,553,233
1
false
1
0
So you have a requirement to NOT use a website for this? That's strange. But PDF forms is OK? And it's potentially a large amount of people? You realize the only way to collect that data is that people fill in the PDF form, save it and e-mail it. Or well, a lot of people will print the form out and send it by snail mai...
1
0
0
What options do I have for creating a form intended for collecting data from a potentially big amount of people? (Preferably in Python) I am looking for options other than HTML forms. PDF Forms seem to be an option, but my tendency until now has been to avoid them. Standard desktop app seems to be the way to go, but it...
Options for creating forms, distributing them and collecting info
0
0
0
59
4,553,869
2010-12-29T11:56:00.000
1
0
1
1
python,tkinter
4,553,921
1
true
0
0
No, setting TK_LIBRARY and TCL_LIBRARY should not be necessary. I suspect you are invoking a Python interpreter different from /usr/bin/python, or /usr/bin/python has been changed to point to a different Python interpreter than the one that goes with the python-tk package. Ubuntu 10.10 ships with Python 2.6 by default....
1
1
0
I'm trying to get _tkinter to import into Python. I suspect it may be due to not having values defined for the environment variables TK_LIBRARY and TCL_LIBRARY. This is as it stands after using apt-get for python-tk, tcl, and tk. If I have to set the environment variables manually, what would I set them to? I am usi...
TK_LIBRARY and TCL_LIBRARY environment variables on Ubuntu
1.2
0
0
2,839
4,555,188
2010-12-29T15:05:00.000
1
0
0
0
python,forms,sqlalchemy,flask
4,559,302
2
false
1
0
You can also use "deform" which currently powers repoze.BFG aka Pylons2. It has some nice "magical" methods for creating collection of forms and adding more forms on the fly. If you liked django then deform may be a good choice.
1
3
0
I am working on a web app based on Flask and SQLAlchemy. Most of forms/models are related and therefore need to use a library that's flexible enough to handle multiple forms and allows easy overriding [or creation] of default widgets. Can someone recommend a good forms library (other than formalchemy). I really liked d...
which Forms libaray to use with Flask and SQLAlchemy
0.099668
0
0
2,942
4,555,224
2010-12-29T15:10:00.000
9
0
0
1
python,emacs
4,555,319
1
true
0
0
You may want to hit "C-c C-z" (switch to interpreter) to see the results of and buffers or regions you evaluated.
1
7
0
I'm trying to use emacs to edit and run python programs (emacs23 and python 2.6 on Ubuntu 10.10). I read a file into Emacs (C-x -C-f) I start the interperter (Menu Python - Start interpreter, I haven't found the keyboard shortcut for this yet) Emacs split the frame in two windows I place the cursor in the python file...
How to load current buffer into Python interpreter in Emacs?
1.2
0
0
1,879
4,556,096
2010-12-29T17:05:00.000
1
0
0
0
ironpython,xbox360,xna-4.0
4,566,611
1
false
0
1
Most things in IronRuby will work on the compact framework (it runs on Windows Phone today). You may need to deploy the DLR yourself but because it's just an additional library it is possible to run it. IronPython could be made to work but it'll require some work to avoid doing code generation where it does today whi...
1
1
0
I've incorporated IronPython into my XNA game on Windows, but, of course, that won't work on the compact framework since the DLR stuff isn't available. Are there any scripting object implementations available that will work with the compact framework? It's really convenient to be able to tweak the system real-time with...
XNA - scripting on XBOX?
0.197375
0
0
446
4,556,847
2010-12-29T18:41:00.000
1
0
0
0
python,django,ide
4,556,856
2
false
1
0
You can do that with PyCharm from JetBrains.
1
2
0
I want to do runtime inspection for django apps, meaning, I want to run an app and be able to break/step through/inspect runtime variables. Is there any IDE that support this or anyway to commandline run django to do this? I know that the Django shell exists, however, that just sets up an environment and doesn't provid...
Is there a way to do runtime inspection for django apps? (Any IDE that does this?)
0.099668
0
0
305
4,557,045
2010-12-29T19:12:00.000
0
0
0
1
python,hadoop,mapreduce,hbase
4,567,653
1
true
1
0
It's not precisely an answer, but it's the closest I got -- I asked in #hbase on irc.freenode.net yesterday, and one of the Cloudera employees responded. The "Input Splits" problem I'm having with Pig is specific to Pig 0.7, and Pig 0.8 will be bundled with Cloudera CDH3 Beta 4 (no ETA on that). Therefore, what I want ...
1
1
1
I've been working on this for a long time, and I feel very worn out; I'm hoping for an [obvious?] insight from SO community that might get my pet project back on the move, so I can stop kicking myself. I'm using Cloudera CDH3, HBase .89 and Hadoop .20. I have a Python/Django app that writes data to a single HBase table...
Easiest non-Java way to write HBase MapReduce on CDH3?
1.2
0
0
1,322
4,557,551
2010-12-29T20:24:00.000
3
0
1
0
python,pdb
4,557,606
1
true
0
0
ctrl-C raised a KeyboardInterrupt exception in your script. Since you didn't catch that exception, the program terminated. Only then the interactive prompt appears. You can't continue because your program is already over. The fact that you pressed Ctrl-C just raised an exception, the program didn't pause at that exact ...
1
1
0
as an alternative to using pdb, I would have a use for the Python continue statement in interactive mode, after control-C during a script invocation with python -i. that way, say at a raw_input('continue->') prompt in my script, I could break out, inspect/modify things, and go right back to the raw_input prompt (or wha...
good idea to modify Python to accept continue statement in interactive mode?
1.2
0
0
304
4,557,635
2010-12-29T20:33:00.000
0
0
0
0
python,web.py
58,953,916
2
false
1
0
Or you can use the construct "%d" to convert ints to string, as: stringified_int="%d" % n or in the template style using your question: $ filename="img[0-%d]" % n I don't know if this works for python2, but for python3 it works.
1
2
0
I've spent way too much time trying to figure this out: I'm passing a template a number like so and trying to make it a string: $def with (num) $(str(num)) or $str(num) This generates an error saying global name "str" not found. Edit & Solution: I'm doing this so I can refer to "img[0-n].png". If num is passed as a num...
Using builtin 'str' function in web.py templates: global name not found
0
0
0
1,084
4,559,402
2010-12-30T01:47:00.000
0
0
0
0
python,mysql
4,559,691
4
false
0
0
In pretty much any scripting language, a variable will always take up more memory than its actual contents would suggest. An INT might be 32 or 64bits, suggesting it would require 4 or 8 bytes of memory, but it will take up 16 or 32bytes (pulling numbers out of my hat), because the language interpreter has to attach va...
2
1
0
I'm new to MySQL, and I have a question about the memory. I have a 200mb table(MyISAM, 2,000,000 rows), and I try to load all of it to the memory. I use python(actually MySQLdb in python) with sql: SELECT * FROM table. However, from my linux "top" I saw this python process uses 50% of my memory(which is total 6GB) ...
the Memory problem about MySQL "SELECT *"
0
1
0
4,116
4,559,402
2010-12-30T01:47:00.000
-1
0
0
0
python,mysql
4,559,443
4
false
0
0
This is almost certainly a bad design. What are you doing with all that data in memory at once? If it's for one user, why not pare the size down so you can support multiple users? If you're doing a calculation on the middle tier, is it possible to shift the work to the database server so you don't have to bring all t...
2
1
0
I'm new to MySQL, and I have a question about the memory. I have a 200mb table(MyISAM, 2,000,000 rows), and I try to load all of it to the memory. I use python(actually MySQLdb in python) with sql: SELECT * FROM table. However, from my linux "top" I saw this python process uses 50% of my memory(which is total 6GB) ...
the Memory problem about MySQL "SELECT *"
-0.049958
1
0
4,116
4,559,758
2010-12-30T03:17:00.000
1
0
0
1
python,scheduled-tasks
4,559,771
2
false
0
0
Answer to all three questions is No. sched is different from cron. It takes a generic timer or counter function and a delay function and lets you to schedule a function call after a particular time (an event as defined by your generic timer function). It won't run after you close your program, unless you maintain state...
1
0
0
I have read about python sched (task scheduler), it works like a cron. but I have a question : lets say if I schedule a function to run after every 2 hours and in the mean time my system gets shut down, then I again restart the system... Does the scheduler automatically start and run the function after 2 hours? Or...
Python sched scheduler and reboots
0.099668
0
0
1,117
4,560,554
2010-12-30T06:36:00.000
4
0
0
0
c#,python,algorithm
4,561,924
2
false
0
0
The important property of the bell curve is that it describes normal distribution, which is a simple model for many natural phenomena. I am not sure what kind of "normalization" you intend to do, but it seems to me that current score already complies with normal distribution, you just need to determine its properties (...
1
2
1
Here's a somewhat simplified example of what I am trying to do. Suppose I have a formula that computes credit points, but the formula has no constraints (for example, the score might be 1 to 5000). And a score is assigned to 100 people. Now, I want to assign a "normalized" score between 200 and 800 to each person, ba...
Bell Curve Gaussian Algorithm (Python and/or C#)
0.379949
0
0
4,989
4,560,717
2010-12-30T07:06:00.000
1
0
1
0
python,coding-style
11,096,738
6
false
0
0
By my experience, yes, some libraries use camelCase, however is not the most common one. I personally encourage to follow the python standard (as defined in the PEP008), the reason is very simple: Every person with a different programming language background may tend to "impose" its own code style and that is pretty da...
5
4
0
The PEP 8 style guide (Python) says methodnames should be lowercase and that sometimes method_names may have embedded underscores. Do experienced Python programmers often come across CamelCase (with leading capital) methods?
do you see CamelCase much in Python methods and functions?
0.033321
0
0
3,138
4,560,717
2010-12-30T07:06:00.000
7
0
1
0
python,coding-style
4,560,816
6
true
0
0
In my experience, a module's naming conventions depends on the following factors: If it's a newly written, Python-only module, or if the authors especially care for "Pythonic code" (quite common!), the naming usually sticks to the recommendations in the Python Style Guide. Beginners to Python often stick to their favo...
5
4
0
The PEP 8 style guide (Python) says methodnames should be lowercase and that sometimes method_names may have embedded underscores. Do experienced Python programmers often come across CamelCase (with leading capital) methods?
do you see CamelCase much in Python methods and functions?
1.2
0
0
3,138
4,560,717
2010-12-30T07:06:00.000
1
0
1
0
python,coding-style
4,562,745
6
false
0
0
I personally prefer not to use camelCase in Python (or at all -- my other daily use language is C), but I've seen it done. I had to do it once because we were using a mixed codebase (some Python and a lot of previously-written Matlab code) and the Matlab code used camelCase, though I'm not sure why since Matlab seems t...
5
4
0
The PEP 8 style guide (Python) says methodnames should be lowercase and that sometimes method_names may have embedded underscores. Do experienced Python programmers often come across CamelCase (with leading capital) methods?
do you see CamelCase much in Python methods and functions?
0.033321
0
0
3,138
4,560,717
2010-12-30T07:06:00.000
3
0
1
0
python,coding-style
4,560,753
6
false
0
0
I was notorious for camel-casing in Python, having just prior come from Java. No more of that, though. I much prefer the "method_name" style of capitalization. One Python library that I know of, that for sure has camel-cased method names, is the xml.dom package, and its subpackages (like xml.dom.minidom).
5
4
0
The PEP 8 style guide (Python) says methodnames should be lowercase and that sometimes method_names may have embedded underscores. Do experienced Python programmers often come across CamelCase (with leading capital) methods?
do you see CamelCase much in Python methods and functions?
0.099668
0
0
3,138
4,560,717
2010-12-30T07:06:00.000
0
0
1
0
python,coding-style
4,560,764
6
false
0
0
A few libraries have this convention. Many programmers come from a background that uses PascalCase for method names (Pascal Case is what you are actually referring to, it is the special case of leading capital camelCase that you mention). It's incorrect by the python style guide, so I recommend against writing code thi...
5
4
0
The PEP 8 style guide (Python) says methodnames should be lowercase and that sometimes method_names may have embedded underscores. Do experienced Python programmers often come across CamelCase (with leading capital) methods?
do you see CamelCase much in Python methods and functions?
0
0
0
3,138
4,561,909
2010-12-30T10:39:00.000
0
1
0
0
php,python,ruby
11,289,391
5
false
1
0
PHP and use codecanyon.net to get things up and running quick. I got INRtracker.com running in under 2 months with what I just mentioned. If you're going to use php, then get wamp and then after you install it, restart your computer. Then click on the Wampserver short cut on your desktop to start it up and then click ...
1
0
0
I've done a lot of web development in JSP/JSF, and lately quite a lot in ASP.NET. I would like to learn one of the following: ruby/python/php, for quick and simple projects. I don't really care which one it is as long as it meets following demands: - decent IDE (forget the notepad/pspad etc.), something with code com...
From asp.net to python/ruby/php
0
0
0
1,531
4,563,415
2010-12-30T14:33:00.000
6
0
1
0
python,sqlite
4,566,190
4
true
0
0
As others have noted, a snapshot of the pysqlite2 was merged into the Python standard library and released as the sqlite3 module in Python 2.5. There has been subsequent independent development on pysqlite2 which has been merged back into sqlite3 at various points for subsequent Python releases and sqlite3 has receive...
1
2
0
What was the first version of Python that included SQLite? What version of SQLite was included? I thought Python 2.5 was the first version to include SQLite, but I was hoping someone could confirm that and the version of SQLite that was first included.
What was the first version of Python that included SQLite?
1.2
0
0
713
4,566,330
2010-12-30T21:15:00.000
1
0
1
0
python,tkinter
4,570,554
1
true
0
1
You can use the methods winfo_rootx and winfo_rooty to get the x/y in the upper left corner. You can use winfo_width and winfo_height to get the width and height of the window. From that it's just a little math to figure out if two windows overlap. You can then use the geometry method to position the windows anywhere ...
1
1
0
Is there a way to check if part or an entire window is over/under another window in python? I have two windows and I'd like to make them not appear over each other. This is in Windows, using Tkinter.
Making windows not appear over each other
1.2
0
0
79
4,567,031
2010-12-30T23:20:00.000
0
0
0
0
python,html,django,templates
4,567,219
6
false
1
0
The readability of HTML doesn't matter. In a system like Django or Rails, HTML is an output format, not a source format. When people edit HTML by hand, they are right to be concerned about indentation and spacing, because it is a source format, and someone will have to edit it in the future. But the output of templa...
1
15
0
When using Django for html templating how do I create good html markup formatting. I am trying to make use of content blocks. But the content blocks show up at different levels of indentation in different templates. How do I get the content blocks to show indented like it would be if someone was to hand write the htm...
Creating readable html with django templates
0
0
0
5,075
4,567,692
2010-12-31T02:30:00.000
0
0
1
0
java,python,multiple-inheritance
4,567,713
8
false
1
0
You can define the abilities in interfaces and implement them in your classes.
4
1
0
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili...
Multiple inheritance in Python; how to do so in Java?
0
0
0
474
4,567,692
2010-12-31T02:30:00.000
0
0
1
0
java,python,multiple-inheritance
4,567,774
8
false
1
0
If what you need is interface inheritance, then as mentioned before, you can always implement multiple interfaces. If you're looking for implementation inheritance, you're somewhat out of luck. The best solution is probably to use delegation — replace the extra superclasses with fields, and implement methods that just ...
4
1
0
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili...
Multiple inheritance in Python; how to do so in Java?
0
0
0
474
4,567,692
2010-12-31T02:30:00.000
0
0
1
0
java,python,multiple-inheritance
4,567,861
8
false
1
0
This is a bit tangential, but you can have python code running in Java via Jython (http://www.jython.org/). This addresses the porting to Java part, not the solving multiple inheritance part (I think you need to determine which is relevant)
4
1
0
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili...
Multiple inheritance in Python; how to do so in Java?
0
0
0
474
4,567,692
2010-12-31T02:30:00.000
0
0
1
0
java,python,multiple-inheritance
4,567,720
8
false
1
0
In java you don't have multiple inheritance, instead you can implement multiple interfaces. So your class 1 will implement interface A and B. Class 2 will implement interface A, B and C. Class 3 will implement B and C.
4
1
0
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili...
Multiple inheritance in Python; how to do so in Java?
0
0
0
474
4,567,769
2010-12-31T02:53:00.000
0
0
0
1
python,google-app-engine,email
4,653,923
2
false
1
0
There is an easier way to do this than writing code that routes between different versions using URLFetch. If you have a large body of code that is email oriented and you need to have a development version, simply use one of your ten applications as the development application (version). This allows you to do things li...
2
5
0
I have an app that services inbound mail and I have deployed a new development version to Google App Engine. The default is currently set to the previous version. Is there a way to specify that inbound mail should be delivered to a particular version? This is well documented using URLs but I can't find any reference to...
Deliver to a specific version via Inbound Mail service
0
0
0
129
4,567,769
2010-12-31T02:53:00.000
5
0
0
1
python,google-app-engine,email
4,568,426
2
true
1
0
No, this isn't currently supported. You could write some code for your default version that routes mail to other versions via URLFetch, though.
2
5
0
I have an app that services inbound mail and I have deployed a new development version to Google App Engine. The default is currently set to the previous version. Is there a way to specify that inbound mail should be delivered to a particular version? This is well documented using URLs but I can't find any reference to...
Deliver to a specific version via Inbound Mail service
1.2
0
0
129
4,567,801
2010-12-31T03:01:00.000
6
0
1
0
python,command-line-interface
4,567,810
1
true
0
0
Use return statements properly for returning Outputs from function calls so that your I/O interfaces between functions are clear and meaningful. If you want debugging, use logging module and when your program is development phases, you can use print statements in between too.
1
0
0
I'm writing a CLI helper program for managing a video library. Is it better to keep any kind of print statements in a single module, passing data via return statements, or simply print my output when I need to, where I need to?
Python User Interface Print Statements
1.2
0
0
232
4,568,040
2010-12-31T04:17:00.000
0
0
0
0
python,sockets
4,568,045
2
false
0
0
Stop the program or the service which is the port which you are trying to use. Alternatively, for whatever program which you are trying to write, use a PORT number which is a sufficiently high number (> 1024 for sure) and is unused.
2
2
0
i got this error while running my function. "socket.error: [Errno 98] Address already in use" how can i close the address already in use and start new connection with port in python?
python socket programming error
0
0
1
2,831
4,568,040
2010-12-31T04:17:00.000
3
0
0
0
python,sockets
4,568,824
2
false
0
0
These scenarios will raise error "[Errno 98] Address already in use" when you create a socket at certain port: The port was't closed. When you created a socket, but forgot to close it, or annother program hold that. You have close the socket(or kill the process), but the port stay at TIME_WAIT status in 2 MSL(about 2 ...
2
2
0
i got this error while running my function. "socket.error: [Errno 98] Address already in use" how can i close the address already in use and start new connection with port in python?
python socket programming error
0.291313
0
1
2,831
4,568,704
2010-12-31T07:11:00.000
0
0
1
0
python
60,108,260
7
false
0
0
Complicated: Need a lot of brain juice (your internal CPU) to solve. But once you solved it, you know it is right. Solving a math problem is complicated. Once done, easy for you to do it a second time. But difficult again for your friend. Complex: Need a lot of intuition to solve (your accumulated experience). And once...
3
41
0
In "The Zen of Python", by Tim Peters, the sentence "Complex is better than complicated" confused me. Can anyone give a more detailed explanation or an example?
What does "Complex is better than complicated" mean?
0
0
0
11,053
4,568,704
2010-12-31T07:11:00.000
0
0
1
0
python
4,568,734
7
false
0
0
i haven't read this book. complex is in my opinion a solution that might be not easy to understand but is writen in simple and logic code. complicated is a solution that might be simple (or complex) but is written in code which is not easy to understand because there are no patterns or logic in it and no proper metapho...
3
41
0
In "The Zen of Python", by Tim Peters, the sentence "Complex is better than complicated" confused me. Can anyone give a more detailed explanation or an example?
What does "Complex is better than complicated" mean?
0
0
0
11,053
4,568,704
2010-12-31T07:11:00.000
-1
0
1
0
python
57,721,317
7
false
0
0
For "complicated", the difficult thing is on the surface. (You description is complicated.) For "complex", the difficult thing is under the table. (A car is complex.) Just as shown by EinLama's examples.
3
41
0
In "The Zen of Python", by Tim Peters, the sentence "Complex is better than complicated" confused me. Can anyone give a more detailed explanation or an example?
What does "Complex is better than complicated" mean?
-0.028564
0
0
11,053
4,570,006
2010-12-31T12:09:00.000
2
0
1
0
python,python-3.x
4,570,607
4
false
0
0
When you have questions like this, it's often best to search first, read all the relevant answers, then compare all those answers to your needs. If you still have an unmet need after reading all the previous answers, you have a good question. The same is true for Python 3.1. Search for all the libraries you need. I...
2
3
0
I started learning Python a few months back - and was immediately faced w/ this question. At that point I made the conscious decision to continue w/ 2.x [2.7.1 to be precise], because I was going to be involved in a project which was based on that version. Over time I've come across numerous occurrences of lines like ...
Take up Python 3.x or 2.x?
0.099668
0
0
909
4,570,006
2010-12-31T12:09:00.000
3
0
1
0
python,python-3.x
4,570,063
4
false
0
0
Continue with 2.7. This question is asked here every few months. We'll notify the world when the answer changes. :-)
2
3
0
I started learning Python a few months back - and was immediately faced w/ this question. At that point I made the conscious decision to continue w/ 2.x [2.7.1 to be precise], because I was going to be involved in a project which was based on that version. Over time I've come across numerous occurrences of lines like ...
Take up Python 3.x or 2.x?
0.148885
0
0
909
4,571,119
2010-12-31T16:23:00.000
1
1
0
0
php,python,ruby,import,lisp
4,571,760
4
false
0
0
I think the problem is that you are loading the csv in memory at once. If that is the case then I am sure that also python/ruby is going to blow up on you. I am a big fan of python, but that is just a personal opinion.
1
2
0
I have an application I wrote in PHP (on symfony) that imports large CSV files (up to 100,000 lines). It has a real memory usage problem. Once it gets through about 15,000 rows, it grinds to a halt. I know there are measures I could take within PHP but I'm kind of done with PHP, anyway. If I wanted to write an app that...
Ruby or Python for heavy import script?
0.049958
0
0
959
4,571,244
2010-12-31T16:51:00.000
-1
0
1
1
python,batch-file
54,316,566
14
false
0
0
start xxx.py You can use this for some other file types.
2
62
0
How can I create a simple BAT file that will run my python script located at C:\somescript.py?
Creating a BAT file for python script
-0.014285
0
0
296,010
4,571,244
2010-12-31T16:51:00.000
0
0
1
1
python,batch-file
57,697,370
14
false
0
0
i did this and works: i have my project in D: and my batch file is in the desktop, if u have it in the same drive just ignore the first line and change de D directory in the second line in the second line change the folder of the file, put your folder in the third line change the name of the file D: cd D:\python_pro...
2
62
0
How can I create a simple BAT file that will run my python script located at C:\somescript.py?
Creating a BAT file for python script
0
0
0
296,010
4,571,807
2010-12-31T18:52:00.000
3
0
1
0
c++,python,c,cython
4,571,848
2
true
0
0
Use C++; it has standard and highly-optimized versions of all of these. There's absolutely no reason or benefit to limit yourself to C. (ed: In other words, yes, that's a very standard practice. Remember, there's no requirement to use any of C++'s features when using C++; by design, you can pick and choose. I often ...
1
0
0
I'm interested in getting into C to get close to the metal performance, but would like to write in a Pythonic style and don't want to roll my own dynamic strings, lists, and dictionaries. Cython is pretty good, but would like to know how to use dynamic variables in straight C if possible. With C++ there is of course t...
Is there a standard set of libraries for dynamic strings, lists, and dictionaries in C?
1.2
0
0
380
4,572,880
2011-01-01T01:17:00.000
1
0
1
0
python,import,importerror
4,573,048
1
true
0
0
Think I found the problem. Somehow I had added the some of the python standard libraries into PYTHONPATH. Once I removed those, everything works fine.
1
3
0
I recently updated my python installation to 2.7 (previously 2.5), and I've noticed a strange problem where I cannot import certain modules that I created. I had no problem before. Normally, I edit the PYTHONPATH and add the directory I want to import modules. For some strange reason, I can no longer import. I chec...
Strange PYTHONPATH problem
1.2
0
0
306
4,573,094
2011-01-01T03:30:00.000
0
1
0
1
python
4,573,124
2
false
0
0
Rafe is likely correct - you can test this out by limiting your imports and seeing if that makes a difference in startup time. I.e., if you are doing from Tkinter import * then change that to import only the modules you actually need. Or write a quick null program that just sets up and tears down without using anything...
2
0
0
I have written a python script to draw the sierpinski gasket using Tkinter and when run from the python IDLE the program takes about half the time it takes to run when run from bash. I timed the script using them time module in python. Any ideas as to why this is happening will be appreciated. thanks
running python script in bash slower than running code in IDLE
0
0
0
830
4,573,094
2011-01-01T03:30:00.000
2
1
0
1
python
4,573,147
2
false
0
0
It's because of the way you're passing it. Based on your comment on the other answer, you're using python -c, and in IDLE you're using the Run command (or something similar). I'm not aware of any performance issues with python -c, but using Run in IDLE to run somescript.py is equivalent to python somescript.py. You rea...
2
0
0
I have written a python script to draw the sierpinski gasket using Tkinter and when run from the python IDLE the program takes about half the time it takes to run when run from bash. I timed the script using them time module in python. Any ideas as to why this is happening will be appreciated. thanks
running python script in bash slower than running code in IDLE
0.197375
0
0
830
4,573,468
2011-01-01T07:34:00.000
1
0
0
1
php,python,ruby-on-rails,system-administration,database-administration
4,573,569
2
false
1
0
I'm not a Unix security guru, but some basic things to think of: Make sure your web app runs as a specific user, and make sure that user has privileged rights only to those files which it is supposed to modify. Do not allow arbitrary inputs to be added to the files, have strict forms where each field is validated to c...
1
5
0
Can someone suggest some basic advice on dealing with web applications that interact with configuration files like httpd.conf, bind zone files, etc. I understand that it's bad practice, in fact very dangerous to allow arbitrary execution of code without fully validating it and so on. But say you are tasked to write a s...
What is good practice for writing web applications that control daemons (and their config files)
0.099668
0
0
332
4,573,980
2011-01-01T12:00:00.000
1
0
1
0
python,apache,ajp,flup
4,574,831
4
false
1
0
That setup will work, if you already know flup. There are about a million other configs, including using some pure python server (and Apache ProxyPass). If you need Tomcat, then this is totally reasonable. I recommend adding paste into the mix for managing the configuration.
2
1
0
I am considering to use python serving json based web services, my priorities are, in order: maintainability easy of coding high availability performance Apache->AJP->Flup->Python seems ok to me, would you recommend another setup or is this ok ?
python web app in prod
0.049958
0
0
312
4,573,980
2011-01-01T12:00:00.000
0
0
1
0
python,apache,ajp,flup
4,574,382
4
false
1
0
You don't give enough information to answer this question. What is your web service doing (apart from serving JSON)? Where does the data come from? How many different types of output are there? How dynamic is it? What sort of processing is required? Does it need authentication? Does it need a database connection? Will ...
2
1
0
I am considering to use python serving json based web services, my priorities are, in order: maintainability easy of coding high availability performance Apache->AJP->Flup->Python seems ok to me, would you recommend another setup or is this ok ?
python web app in prod
0
0
0
312
4,574,669
2011-01-01T16:21:00.000
2
0
1
0
python,windows,64-bit,clipboard
4,574,784
4
false
0
0
There only is one clipboard that is shared between all programs, whether they are 32 or 64 bit. In other words you can just use the same clipboard code on 64 bit Windows as you do on 32 bit. EDIT: I've just read İsmail's answer and I wonder if that is in fact what the OP is struggling with. My statement above is still ...
1
2
0
Is there a way to access (set, read etc.) the clipboard on Windows 7 64-bit in Python? I have seen PyWin32 but as far as I could see that was only 32-bit.
Access clipboard Windows (7) 64-bit
0.099668
0
0
2,026
4,575,709
2011-01-01T20:49:00.000
0
0
0
1
python,apache,nginx,wsgi,fastcgi
4,576,197
2
true
1
0
100 req/s is not that hard to achieve these days. Consider the deployment that your framework recommends. Zope for instance, has a decent webserver built in, so mod_proxy_http is good deployment. Since wsgi came to fruition, it has become the preferred mechanism for many frameworks, and they now the builtin web servers...
2
0
0
I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable): apache -> mod_wsgi apache -> mod_fcgid apache -> mod_proxy_ajp apache -> mod_proxy_http for a project that will serve REST services with small json formatted input and output m...
most widely used python web app deployment style
1.2
0
0
504
4,575,709
2011-01-01T20:49:00.000
2
0
0
1
python,apache,nginx,wsgi,fastcgi
4,575,875
2
false
1
0
apache -> mod-wsgi is currently the "recommended" solution. But it also depends on your needs quite a bit. There is quite a difference between running 1 heavy application versus 1 light aplication or many light applications. Personally my preferred setup is still nginx -> apache -> mod_wsgi with multiple apache servers...
2
0
0
I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable): apache -> mod_wsgi apache -> mod_fcgid apache -> mod_proxy_ajp apache -> mod_proxy_http for a project that will serve REST services with small json formatted input and output m...
most widely used python web app deployment style
0.197375
0
0
504
4,576,225
2011-01-01T23:08:00.000
0
0
1
0
ironpython,intellisense
4,576,812
1
false
0
0
You unfortunately need to add the library into your project for it to be picked up via intellisense. If you are working w/ just loose files (no solution) then you should be able to just open a file from the library and the full library should be analyzed.
1
0
0
I'm trying the VS2010 ironpython extension and the Pydev. Both of them support intellisense for .net library, but neither seems support for custom .net library. Is there any IronPython IDE which support intellisense for custom .net library?
ironpython IDE supporting intellisense for user library
0
0
0
515
4,577,156
2011-01-02T04:38:00.000
1
1
0
0
python,ruby,user-interface
4,577,169
2
false
1
1
I've never used Ruby but I'm sure there is virtually no difference between the 2 when it comes to libraries. I know what you want can be done with Python using wxPython or pygame (or the combination of two). But I'm sure there are similar libs for Ruby. So just look at both languages and use the one you like better.
2
0
0
I want to create a somehow complex application: It is a game level editor. You can put in tiles and other objects for a level. Then "compress" the level data into a file. With another application, it will read the file's data and play the game. The application is for Windows mainly. Other platforms are yet to be consid...
Making a somehow complex application: Ruby vs Python
0.099668
0
0
955
4,577,156
2011-01-02T04:38:00.000
4
1
0
0
python,ruby,user-interface
4,577,168
2
true
1
1
Python + PyGame. Hands down. You will benefit from: Good docs for both the language and PyGame GUI, sprites, and audio all in one, again with PyGame Better Windows support than Ruby (you can install both Python and PyGame from .exes) Desktop applications (esp. for Windows) aren't really Ruby's sweet spot. PyGame will...
2
0
0
I want to create a somehow complex application: It is a game level editor. You can put in tiles and other objects for a level. Then "compress" the level data into a file. With another application, it will read the file's data and play the game. The application is for Windows mainly. Other platforms are yet to be consid...
Making a somehow complex application: Ruby vs Python
1.2
0
0
955
4,577,345
2011-01-02T05:58:00.000
0
0
1
0
python,function,highest
4,577,444
4
false
0
0
Obviously it dose not handle variable length arguments. If you want variable length argument then that's a different issue. If you have 10 arguments then just add them in the definition and it will return the correct argument name (not necessarily started with 'p'). But the catch is the number of arguments (3 or 5 or 1...
1
1
0
Consider the following: p1=1; p2=5; p3=7; highest=max(p1,p2,p3). The max function would return 7. I am looking to create a similar function, which would return "p3". I have created a small function (by simple comparisons) for the above example, shown below. however I am having trouble when the number of arguments go u...
Create function in python to find the highest of all function arguments, and return the "tag" of the value
0
0
0
2,749
4,577,414
2011-01-02T06:22:00.000
4
0
0
0
python,web-applications,jsf,jsf-2,primefaces
4,577,421
3
false
1
0
The best approach is whatever is best for you. If Python isn't your strength but Java is, then use Java. If you're a Python expert and know little Java, use Python. There are so many resources on the Internet supporting so many platforms that the decision really comes down to what works best for you.
3
2
0
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I ca...
What web programming languages are capable of making this web app?
0.26052
0
0
1,046
4,577,414
2011-01-02T06:22:00.000
2
0
0
0
python,web-applications,jsf,jsf-2,primefaces
4,577,777
3
false
1
0
For starters, forget about JSP/JSF. This is an old combination that had many problems. Please consider Facelets/JSF. Facelets is the default templating language in the current version of JSF, while JSP is there only for backwards compatibility. What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certa...
3
2
0
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I ca...
What web programming languages are capable of making this web app?
0.132549
0
0
1,046
4,577,414
2011-01-02T06:22:00.000
1
0
0
0
python,web-applications,jsf,jsf-2,primefaces
4,578,505
3
false
1
0
No web technology does what you want. Parsing documents found at certain urls is out of the scope of building web interfaces. However, each of Java's web technologies will give you, without limits, access to a rich and varied (if not too rich and much too varied) set of libraries and frameworks running on JVM. You cou...
3
2
0
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I ca...
What web programming languages are capable of making this web app?
0.066568
0
0
1,046
4,578,307
2011-01-02T12:15:00.000
4
1
1
0
python,performance
4,578,373
5
false
0
1
The kind of game matters immensely. High performance games like the big name PC or console games are almost exclusively the domain of C++. Casual games can be written in almost any language, including slower languages like Python. If you're a garage type developer who gets his hands wet with some simple game developmen...
4
8
0
I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? I am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?
How "slow" is python for game development?
0.158649
0
0
13,393
4,578,307
2011-01-02T12:15:00.000
6
1
1
0
python,performance
4,578,311
5
false
0
1
Elebenty-seven. No, really, it's fast enough for most things, and can drop to C when you really need speed. Profile twice, optimize once.
4
8
0
I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? I am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?
How "slow" is python for game development?
1
0
0
13,393
4,578,307
2011-01-02T12:15:00.000
-3
1
1
0
python,performance
15,419,304
5
false
0
1
C++ is much more easier for object orientation. When you're doing things, it's easier to keep track of everything, because most IDEs for C++ are more based on projects, were as IDLE is more based on single files. The bottom line is for game development, use what you're comfortable with using. I mean, game developme...
4
8
0
I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? I am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?
How "slow" is python for game development?
-0.119427
0
0
13,393
4,578,307
2011-01-02T12:15:00.000
2
1
1
0
python,performance
4,578,381
5
false
0
1
Many if not most top-end commercial games these days include some kind of scripting engine for game logic. Game logic decisions, for the most part, aren't particularly performance-sensitive in the way that e.g. the rendering engine is. BTW - I'm not claiming any insider knowledge of game development - this is fairly we...
4
8
0
I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about? I am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?
How "slow" is python for game development?
0.07983
0
0
13,393
4,578,729
2011-01-02T14:14:00.000
1
0
0
1
java,python,google-app-engine
5,873,214
2
false
1
0
If you decide to use python, try a look to vikuit social. It runs over Google Appengine , it's open source ( GNU3) and perhaps it's a good base to your development.
1
1
0
I started developing my application in AppEngine Java, however I noticed that Facebook has officially discontinued the support for the Java API and the third party API was last updated a year ago. Does anybody use Java + Social plugins? How has it been going so far? Should I switch to Python, I'd not want to since, I'm...
AppEngine social application
0.099668
0
0
261
4,578,957
2011-01-02T15:10:00.000
-1
0
0
0
python,orm,air
4,580,914
5
false
1
0
Is the target platform windows? If so, consider C# with WPF. The UI is constructed using XAML which is very similar to HTML/CSS. C# uses the .NET framework, so while it is a much different programming language than PHP, the transition should not be too difficult.
3
3
0
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obvi...
Switching from web to desktop development
-0.039979
0
0
731
4,578,957
2011-01-02T15:10:00.000
0
0
0
0
python,orm,air
4,662,716
5
false
1
0
I've recently come across a project called Titanium. It's a platform for developing native desktop (and mobile) applications using web technology (html/css, javascript and server-side languages like python, ruby and PHP! That's exactly what I was looking for. However, I haven't found no decent documentation or examples...
3
3
0
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obvi...
Switching from web to desktop development
0
0
0
731
4,578,957
2011-01-02T15:10:00.000
1
0
0
0
python,orm,air
4,580,946
5
false
1
0
It just doesn't seem right to wait for a server response from a localhost Exactly! Did you profile your app, both on server side and in browser? There's no reason for a local web app to be slow, except if it is designed or implemented suboptimally. Same applies to a desktop app, which is generally harder to create. So...
3
3
0
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obvi...
Switching from web to desktop development
0.039979
0
0
731
4,579,051
2011-01-02T15:32:00.000
2
0
0
0
python,django,ipc,twisted
4,579,082
1
false
1
0
No. Django signals are restricted to a single Python interpreter. You'll need to put together something else (sockets, JSON-RPC, XMPP, etc.) in order to perform IPC.
1
1
0
So I have written a websocket application in Twisted. The application is a basic game between a number of users, but trying to use the web socket for setup and record saving is painful, so I was looking into using Django based rendering for the supplementary information (as in standings, game setup, lobby list, etc) a...
Django signals as IPC
0.379949
0
0
736
4,580,174
2011-01-02T19:50:00.000
2
0
1
0
python,eclipse,pydev
4,580,215
1
true
0
0
The PyDev Debugger simply uses the repr() function to show the values. So if overwrite the __repr__() function than you can change how the values are printed. I don't think there are any other options of changing the way your variables show, although you might (not sure about that) be able to get away with overwriting ...
1
1
0
Is it possible to see ints (and ints that are parts of dicts, lists, and tuples, etc.) as hex values when debugging with PyDev? More broadly, is it possible to make any given data type show up the way you want in the variable display tab?
Customizing debug print format with PyDev
1.2
0
0
791
4,581,441
2011-01-03T01:05:00.000
6
0
1
1
python,ncurses
8,763,488
4
false
0
0
textpad.Textbox(win, insert_mode=True) provides basic insert support. Backspace needs to be added though.
1
11
0
Has anybody got a working example of using the curses.textpad.Textbox widget to edit existing text? This is, of course, in a Linux terminal (e.g. xterm).
Edit text using Python and curses Textbox widget?
1
0
0
16,216
4,581,764
2011-01-03T02:46:00.000
1
0
1
0
python,syntax-error,latitude-longitude,gdal,geotiff
4,607,769
1
false
0
0
gdalinfo is a utility that works outside of the Python environment. It is used via the command line.
1
0
0
The gdalinfo does not work in my Python script Can anyone tell me what the prblem is? I imported all the packages from osgeo, all the other functions work except gdal
gdalinfo does not work
0.197375
0
0
968
4,582,567
2011-01-03T06:50:00.000
2
0
1
0
python,math,int,long-integer,openpgp
4,588,646
4
false
0
0
It's not only to big to fit in a long, it's too big to fit in the memory of any computer. I think you misunderstood something. As I understand it, the largest key value is 4,294,967,295 bytes. That's 4GB, not 137 GB. You hold that key in memory not as one number, but as a string of bytes. So I don't know where you get ...
2
0
0
How would I get python to work with values of the order of magnitude of 1099511627776 bits large (yeah. 137 gb)? I some what need to implement this (or if you can suggest a better way to do it, will change methods). apparently, pgp's new length types have 3 sections instead of 2. now they are: length type, value-of-len...
How do you handle extremely large values in python?
0.099668
0
0
772
4,582,567
2011-01-03T06:50:00.000
0
0
1
0
python,math,int,long-integer,openpgp
4,589,999
4
false
0
0
I interpret RFC4880 (November 2007) differently. Section 3.2 describes multiple precision integers as having a 2 octet length so the largest size would be 64KB. Section 4.2.2 describes the new packet format and documents numbers of the scale you are describing. But the packet format is not the same as the multiple prec...
2
0
0
How would I get python to work with values of the order of magnitude of 1099511627776 bits large (yeah. 137 gb)? I some what need to implement this (or if you can suggest a better way to do it, will change methods). apparently, pgp's new length types have 3 sections instead of 2. now they are: length type, value-of-len...
How do you handle extremely large values in python?
0
0
0
772
4,582,691
2011-01-03T07:23:00.000
2
0
0
1
python,macos
9,659,784
2
false
0
0
Since appscript is deprecated and no longer maintained, you might want to look at simply executing AppleScript directly from your python script with a popen() to /usr/bin/osascript.
1
2
0
Is it possible to use Python in the way that AppleScript is used to automate/customize the Mac OS?
Possible to use python to script for mac?
0.197375
0
0
144
4,583,367
2011-01-03T09:30:00.000
-9
0
1
0
python,windows,python-3.x,compatibility,python-2.x
4,583,387
20
false
0
0
Just call the correct executable
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
-1
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
11
0
1
0
python,windows,python-3.x,compatibility,python-2.x
64,197,741
20
false
0
0
One easy way for this is that you can use py -3.8 -m pip install virtualenv here -3.8 goes with your [version number] After installing the virtualenv, you can create the virtual environment of your application using py -3.8 -m virtualenv [your env name] then cd to venv, enter activate This would activate the python ver...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
1
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
35
0
1
0
python,windows,python-3.x,compatibility,python-2.x
55,149,006
20
false
0
0
For example for 3.6 version type py -3.6. If you have also 32bit and 64bit versions, you can just type py -3.6-64 or py -3.6-32.
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
1
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
18
0
1
0
python,windows,python-3.x,compatibility,python-2.x
53,846,889
20
false
0
0
install python C:\Python27 C:\Python36 environment variable PYTHON2_HOME: C:\Python27 PYTHON3_HOME: C:\Python36 Path: %PYTHON2_HOME%;%PYTHON2_HOME%\Scripts;%PYTHON3_HOME%;%PYTHON3_HOME%\Scripts; file rename C:\Python27\python.exe → C:\Python27\python2.exe C:\Python36\python.exe → C:\Python36\python3.exe pip pyth...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
1
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
0
0
1
0
python,windows,python-3.x,compatibility,python-2.x
71,782,660
20
false
0
0
Introduce more details based on the answer given by @Aman. Define different environment variables for different python versions. For example: You have E:\python2\python.exe and E:\python3\python.exe at the same time. Then you can set an environment variable %python2% for E:\python2\python.exe and %python2% for E:\pyth...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
0
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
5
0
1
0
python,windows,python-3.x,compatibility,python-2.x
33,001,153
20
false
0
0
Here's a quick hack: Go to the directory of the version of python you want to run Right click on python.exe Select 'Create Shortcut' Give that shortcut a name to call by( I use p27, p33 etc.) Move that shortcut to your home directory(C:\Users\Your name) Open a command prompt and enter name_of_your_shortcut.lnk(I use p...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
0.049958
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
-1
0
1
0
python,windows,python-3.x,compatibility,python-2.x
63,899,133
20
false
0
0
I thought this answer might be helpful to others having multiple versions of python and wants to use pipenv to create virtual environment. navigate to the project directory, and run py -[python version] pip install pipenv, example: py -3.6 pip install pipenv run pipenv --python [version] to create the virtual environm...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
-0.01
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
2
0
1
0
python,windows,python-3.x,compatibility,python-2.x
49,136,840
20
false
0
0
The easiest way to run multiple versions of python on windows is described below as follows:- 1)Download the latest versions of python from python.org/downloads by selecting the relevant version for your system. 2)Run the installer and select Add python 3.x to the path to set path automatically in python 3 (you just ha...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
0.019997
0
0
316,644
4,583,367
2011-01-03T09:30:00.000
169
0
1
0
python,windows,python-3.x,compatibility,python-2.x
4,584,180
20
true
0
0
Running a different copy of Python is as easy as starting the correct executable. You mention that you've started a python instance, from the command line, by simply typing python. What this does under Windows, is to trawl the %PATH% environment variable, checking for an executable, either batch file (.bat), command f...
9
228
0
I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP SP2.
How to run multiple Python versions on Windows
1.2
0
0
316,644
4,585,237
2011-01-03T14:25:00.000
0
0
1
1
python
4,585,382
2
false
0
0
All your schedulers are part of your a single Python process, then you won't be able to count the the individual timers which are scheduled. As the python schedulers are something you write, you can choose to keep a file which would be updated periodically. If each scheduler is a separate python process, then count the...
1
1
0
I have created the number of schedulers using python in windows which are running in background. Can anyone tell me any command to check how many schedulers running on windows and also how can I remove them?
problems in Python Sched
0
0
0
361
4,585,490
2011-01-03T14:59:00.000
0
1
0
0
php,python,screen-scraping
4,586,678
4
false
1
0
We do something sort of like this with RSS feeds using Python -- we use ElementTree since RSS is usually guaranteed to be well-formed. Beautiful Soup is probably better suited for parsing HTML. Insofar as dealing with 100 different sites, try to write an abstraction that works on most of them and transforms the page i...
2
3
0
I need to scrape about 100 websites that are very similar in the content that they provide. My first doubt. Should be possible to write a generic script to scrape all the 100 websites or in scraping techniques is only possible to write scripts for particular websites. (Dumb question.). I think I should ask what possibi...
Webscraping Techniques using PHP or Python
0
0
1
4,219
4,585,490
2011-01-03T14:59:00.000
0
1
0
0
php,python,screen-scraping
4,585,784
4
false
1
0
I've done this a few ways. 1: with grep, sed, and awk. This is about the same as 2: regex. These methods are very direct, but fail whenever the HTML structure of the site changes. 3: PHP's XML/HTML parser DomDocument. This is far more reliable than regex, but I found it annoying to work with (I hate the mixture of PHP ...
2
3
0
I need to scrape about 100 websites that are very similar in the content that they provide. My first doubt. Should be possible to write a generic script to scrape all the 100 websites or in scraping techniques is only possible to write scripts for particular websites. (Dumb question.). I think I should ask what possibi...
Webscraping Techniques using PHP or Python
0
0
1
4,219
4,586,026
2011-01-03T16:04:00.000
0
0
1
0
python,string,iterator,split
37,676,042
7
false
0
0
Look at itertools. It contains things like takewhile, islice and groupby that allows you to slice an iterable -- a string is iterable -- into another iterable based on either indexes or a boolean condition of sorts.
2
28
0
Does python have a build-in (meaning in the standard libraries) to do a split on strings that produces an iterator rather than a list? I have in mind working on very long strings and not needing to consume most of the string.
Splitting a string into an iterator
0
0
0
16,444
4,586,026
2011-01-03T16:04:00.000
3
0
1
0
python,string,iterator,split
4,586,438
7
false
0
0
If you don't need to consume the whole string, that's because you are looking for something specific, right? Then just look for that, with re or .find() instead of splitting. That way you can find the part of the string you are interested in, and split that.
2
28
0
Does python have a build-in (meaning in the standard libraries) to do a split on strings that produces an iterator rather than a list? I have in mind working on very long strings and not needing to consume most of the string.
Splitting a string into an iterator
0.085505
0
0
16,444
4,586,156
2011-01-03T16:20:00.000
0
0
1
1
python
17,237,758
2
false
0
0
Virtualenv and virtualenvwrapper make managing packages very nice!
2
1
0
Ubuntu (10.10) came installed with Python2.6, 2.7, and 3. In addition, I have installed the Enthought Python Distribution. Is there any way to manage Python packages within these distributions intelligently? For compatibility, I'd imagine switching between these distributions occasionally. If I install PyBlah, I'd like...
Multiple Python Distributions -- Managing Packages
0
0
0
320
4,586,156
2011-01-03T16:20:00.000
4
0
1
1
python
4,586,247
2
false
0
0
Well you can't install a package across 2.x-3.x distributions, they're not compatable. So the easiest ( and recommended way) is to install it for each version. If you're sure you want to install it for all your versions, you can install it somewhere like ~/lib/python/ and add that directory to your PYTHONPATH.
2
1
0
Ubuntu (10.10) came installed with Python2.6, 2.7, and 3. In addition, I have installed the Enthought Python Distribution. Is there any way to manage Python packages within these distributions intelligently? For compatibility, I'd imagine switching between these distributions occasionally. If I install PyBlah, I'd like...
Multiple Python Distributions -- Managing Packages
0.379949
0
0
320
4,588,045
2011-01-03T20:24:00.000
3
0
1
0
python,pyqt,python-2.3
4,588,075
2
false
0
1
Python 2.3 is extremely old. You really shouldn't be using it at all. I seriously doubt there's any qt bindings for it that would even compile. Why do you think using python 2.3 will save you so much file size? Adding pyqt will probably increase your file size by 10s of megabytes at least. Just use python at least 2.6....
1
0
0
Is there a PyQt3 (Or 4) Windows binary installer for Python 2.3? I've googled around for an hour now but to no avail. Why am I using version 2.3? With my project file size is paramount. Without the interface, un-needed modules and compressing using UPX the resulting .exe size is a mear 750KB's. Just need to add the int...
PyQt & Python2.3
0.291313
0
0
209
4,588,345
2011-01-03T21:03:00.000
2
0
0
0
python,html,beautifulsoup
4,588,436
1
false
1
0
Yes, you use BeautifulSoup or lxml. Both have methods to find the nodes you want to extract. You can then also recreate HTML from the node objects, and hence save that HTML to new files.
1
1
0
I've an HTML document I'm trying to break into separate, smaller chunks. Say, take each < h3 > header and turn into its own separate file, using only the HTML encoded within that chunk (along with html, head, body, tags). I am using Python's Beautiful Soup which I am new to, but seems easy to use for easy tasks such a...
How can/should I break an html document into parts using Python? (Techno- and logically)
0.379949
0
1
214
4,589,206
2011-01-03T23:00:00.000
1
0
1
0
python,image,windows-7,screenshot
49,323,467
3
false
0
0
I got the same problem on PIL or pyscreenshot, here's how I solved it. Right-click on python.exe, Properties, Compatibility tab, check 'Disable display scaling on high DPI settings'. Repeat for pythonw.exe.
1
17
0
I want to take a screenshot using python. I have tried using PIL, but since I am using 64bit windows and python PIL does not work (I could only find 32bit PIL versions). I am using python 2.7.1 by the way. I want to take a screenshot, it doesn't really matter how, as long as it can take more than 1 per second in speed....
Python windows 7 screenshot without PIL
0.066568
0
0
22,041
4,591,996
2011-01-04T09:08:00.000
1
0
1
0
python,python-3.x,pydev
4,592,043
3
false
0
0
I think it is a bad idea to set the grammar to 2.5 from 3.1. Just download the older python 2.5 version and use the compiler and the libraries with it. Between major versions changes happen to the API signatures and new features get added. You cannot afford to develop in high version in pydev and compile for another w...
2
0
0
I need to write Python compliant with 2.5.1. I currently have Python 3.1 on my machine. If I make a PyDev project and set the grammar to "2.5", will the code I write be compatible (both syntactically and semantically)? Or must I go download an older version of Python?
Versions of Python
0.066568
0
0
117
4,591,996
2011-01-04T09:08:00.000
3
0
1
0
python,python-3.x,pydev
4,592,175
3
false
0
0
PyDev's grammar setting only changes the syntax highlighting. To know if your code works you must run it with Python 2.5, so yes you must download it.
2
0
0
I need to write Python compliant with 2.5.1. I currently have Python 3.1 on my machine. If I make a PyDev project and set the grammar to "2.5", will the code I write be compatible (both syntactically and semantically)? Or must I go download an older version of Python?
Versions of Python
0.197375
0
0
117
4,592,922
2011-01-04T11:08:00.000
2
0
1
0
python,optparse
4,592,978
3
false
0
0
No, you can't. Either you can use argparse and or you get the option value from using the optparse module and explicitly check if the optionvalue is defined (like in the optparse set it to some default like None and check for not None) and if it is not defined, call sys.exit() asking the users to provide that option.
1
10
0
Is it possible to make an option in optparse a mandatory?
Is it possible to make an option in optparse a mandatory?
0.132549
0
0
10,428
4,593,235
2011-01-04T11:47:00.000
0
0
1
1
python,file,locking
4,594,300
2
false
0
0
Google up zc.lockfile or portalocker.py. Both libraries can lock a file in a portable manner (windows and posix systems). I usually use zc.lockfile.
1
0
0
I want to lock the file whenever I perform read/write operation on that file. No other program or function can access file until I do not release the file. How do you do this in Python?
File Locking in Python?
0
0
0
2,736
4,594,522
2011-01-04T14:12:00.000
1
0
0
0
python,django,garbage-collection
4,595,172
5
false
1
0
An alternative might be to disable GC altogether, and configure mod_wsgi (or whatever you're using) to kill and restart processes more frequently.
1
11
0
After 2 days of debug, I nailed down my time-hog: the Python garbage collector. My application holds a lot of objects in memory. And it works well. The GC does the usual rounds (I have not played with the default thresholds of (700, 10, 10)). Once in a while, in the middle of an important transaction, the 2nd generatio...
Django Python Garbage Collection woes
0.039979
0
0
4,978
4,595,197
2011-01-04T15:19:00.000
-1
0
1
0
python,text,file-io
4,595,284
4
false
0
0
I don't really know Python, but here's a bit of pseudocode. int header_found=0; [start where loop where you're looping through lines of file] if(header_found==1) [grab line]; header_found=0; if(line=~/[regexp for header]/) header_found=1; The idea is to have a variable that keeps track of whether or not you...
1
7
0
I am an amateur using Python on and off for some time now. Sorry if this is a silly question, but I was wondering if anyone knew an easy way to grab a bunch of lines if the format in the input file is like this: " Heading 1 Line 1 Line 2 Line 3 Heading 2 Line 1 Line 2 Line 3 " I won't know how many lines are after each...
How to grab the lines AFTER a matched line in python
-0.049958
0
0
16,585
4,595,268
2011-01-04T15:25:00.000
6
0
0
0
python,web-frameworks
4,595,408
3
false
0
0
I guess you won't find any "magic tools" for this purpose. Personally I would browse the web for a couple of hours and ask myself things such as: Are there any "official" communities/forums out there? Do they contain lots of documentation, references, videos, tutorials etc? Is the SDK recently updated? Are there good ...
1
1
0
Are there tools which can do that for me? For example I want to compare how big a community is for a web framework in Python. And for my dimploma thesis is interesting to know, how big a community is and trends for the future.
How do I find out how big is a community for example a web framework.
1
0
0
159
4,596,013
2011-01-04T16:38:00.000
2
0
1
1
c++,python,winapi,api
4,596,102
4
false
0
1
ActivePython (http://www.activestate.com/activepython/downloads) installs itself as an ActiveScript engine.The ProgID is Python.AXScript.2 . So you can use it with COM via the Windows standard IActiveScript interface. Read up on it. Distribution is another matter. Either you require that customers have it, or you could...
1
4
0
I am building a window application written in C++. I'd like to utilize several python libraries. I don't need any fancy Python interop here. My method is like this: Open a thread to run Python interpreter. Send commands from C++ to the Python interpreter. The C++ may need to write some intermediate files for the int...
Embed a Python interpreter in a (Windows) C++ application
0.099668
0
0
1,517