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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,200,745 | 2011-08-26T06:22:00.000 | 0 | 1 | 0 | 0 | python,mysql,sqlite,web-hosting | 7,200,805 | 1 | false | 0 | 0 | This very much depends about how much control your webhost gives you about the Python environment. For normal shared hosting, the runtime Python environment is fixed. | 1 | 1 | 0 | My webhost where our website is runs Python 2.4 & the website uses the SQLite3 python module (which is only part of Python 2.5 & up). This means that I cant use the module SQLite3 because its not part of Python 2.4.
Is there a way for me to upload the python SQLite3 module myself & just import/refernce that in my scrip... | Importing a specific module thats not part of my current Python 2.X version | 0 | 0 | 0 | 52 |
7,201,333 | 2011-08-26T07:24:00.000 | 1 | 0 | 1 | 0 | python | 7,201,514 | 3 | false | 0 | 0 | You can "delete" a function by assigning None to it.
EDIT
If you want to know what you typed, you should probably put your code inside a file and import or execute it. The buffer of the Python interactive interpreter is limited. | 1 | 0 | 0 | Just found out that when I pressed up in my cmd one of my function codes is no longer accessible meaning I couldn't see the code I made it with. Is there any way I can see it again? And is there any way I could see all the functions I created for this session in Python cmd? | Is there any way to see the codes of functions you've typed in your Python CMD | 0.066568 | 0 | 0 | 131 |
7,201,899 | 2011-08-26T08:23:00.000 | 1 | 0 | 1 | 0 | c#,.net,python,ironpython | 7,260,207 | 3 | false | 0 | 0 | You can compile your Python sources to a DLL with pyc.py, in the Samples directory of IronPython. However, you can't load this DLL from C# directly - you'll still need to host IronPython, but then you can reference the DLL with the IronPython engine and import from it. | 3 | 2 | 0 | I have to create a win32 python dll file which can used in C#.Net code.
And access the classes & functions present in the dll file through C#.
Is there any way to create a win32 python dll?
Please help me out.... | How to Create a python Dll file that should be used in C#.net? | 0.066568 | 0 | 0 | 3,684 |
7,201,899 | 2011-08-26T08:23:00.000 | 0 | 0 | 1 | 0 | c#,.net,python,ironpython | 7,204,932 | 3 | false | 0 | 0 | You don't need any DLL, you just need to load your Python sources using IronPython | 3 | 2 | 0 | I have to create a win32 python dll file which can used in C#.Net code.
And access the classes & functions present in the dll file through C#.
Is there any way to create a win32 python dll?
Please help me out.... | How to Create a python Dll file that should be used in C#.net? | 0 | 0 | 0 | 3,684 |
7,201,899 | 2011-08-26T08:23:00.000 | 0 | 0 | 1 | 0 | c#,.net,python,ironpython | 7,202,181 | 3 | false | 0 | 0 | Try do some investigation about Pyrex. I'm not sure if it will solve your issue, but at least I seen that some guys was trying to get it working. | 3 | 2 | 0 | I have to create a win32 python dll file which can used in C#.Net code.
And access the classes & functions present in the dll file through C#.
Is there any way to create a win32 python dll?
Please help me out.... | How to Create a python Dll file that should be used in C#.net? | 0 | 0 | 0 | 3,684 |
7,204,880 | 2011-08-26T12:52:00.000 | 2 | 0 | 1 | 0 | python,open-source,virtualenv | 7,204,953 | 1 | true | 0 | 0 | Fork the project on github, clone it to a directory separate from your virtualenv, make the pull request, and install your own fork into the virtualenv by pointing pip at your fork in github. | 1 | 3 | 0 | I have an open source python library sitting in my virtualenv site-packages. And I noticed a bug in that library and would like to contribute my patches back to the open source project.
The problem is, my virtualenv site-packages is not version controlled by git (obviously, since it was installed via pip) and it's a pa... | Generating patches for open source, source code in virtualenv site-packages | 1.2 | 0 | 0 | 76 |
7,205,060 | 2011-08-26T13:05:00.000 | 0 | 0 | 1 | 0 | parsing,python-3.x | 7,207,921 | 2 | true | 0 | 0 | I believe this is a solution:
import regex
text = "123 2 can't, 4 Å, é, and 中ABC _ sh_t"
print(regex.findall('\d+|\P{alpha}|\p{alpha}+', text))
Can it be improved?
Thank! | 2 | 0 | 0 | I want to create a very simple parser to convert:
"I wan't this to be ready by 10:15 p.m. today Mr. Gönzalés.!" to:
(
'I',
' ',
'wan',
'\'',
't',
' ',
'this',
' ',
'to',
' ',
'be',
' ',
'ready',
' ',
'by',
' ',
'10',
':',
'15',
' ',
'p',
'.',
'm',
'.',
'... | Simple text parser | 1.2 | 0 | 0 | 203 |
7,205,060 | 2011-08-26T13:05:00.000 | 0 | 0 | 1 | 0 | parsing,python-3.x | 7,205,235 | 2 | false | 0 | 0 | You are looking for a procedure called tokenization. That means splitting raw text into discrete "tokens", in our case just words. For programming languages this is fairly easy, but unfortunately it is not so for natural language.
You need to do two things: Split up the text in sentences and split the sentences into wo... | 2 | 0 | 0 | I want to create a very simple parser to convert:
"I wan't this to be ready by 10:15 p.m. today Mr. Gönzalés.!" to:
(
'I',
' ',
'wan',
'\'',
't',
' ',
'this',
' ',
'to',
' ',
'be',
' ',
'ready',
' ',
'by',
' ',
'10',
':',
'15',
' ',
'p',
'.',
'm',
'.',
'... | Simple text parser | 0 | 0 | 0 | 203 |
7,206,272 | 2011-08-26T14:33:00.000 | 3 | 1 | 0 | 0 | python,linux,ssh,fabric,paramiko | 7,207,845 | 2 | false | 0 | 0 | Try changing the banner timeout from 15 seconds to 30 secs in the transport.py file. Also, it could be that the sshd daemon on the server is hung. Can you SSH into it manually? | 2 | 6 | 0 | I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different but everytime I run my Fabric script I get the error Error reading SSH protocol ... | Paramiko Error: Error reading SSH protocol banner | 0.291313 | 0 | 1 | 29,345 |
7,206,272 | 2011-08-26T14:33:00.000 | 8 | 1 | 0 | 0 | python,linux,ssh,fabric,paramiko | 7,252,752 | 2 | true | 0 | 0 | This issue didn't lie with Paramiko, Fabric or the SSH daemon. It was simply a firewall configuration in ISPs internal network. For some reason, they don't allow communication between different subnets of theirs.
We couldn't really fix the firewall configuration so instead we switched all our IPs to be on the same subn... | 2 | 6 | 0 | I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different but everytime I run my Fabric script I get the error Error reading SSH protocol ... | Paramiko Error: Error reading SSH protocol banner | 1.2 | 0 | 1 | 29,345 |
7,206,499 | 2011-08-26T14:48:00.000 | 1 | 0 | 1 | 0 | python,regex,unicode | 7,207,524 | 7 | false | 0 | 0 | import re
text = "can't, Å, é, and 中ABC"
print(re.findall('\w+', text))
This works in Python 3. But it also matches underscores. However this seems to do the job as I wish:
import regex
text = "can't, Å, é, and 中ABC _ sh_t"
print(regex.findall('\p{alpha}+', text)) | 2 | 20 | 0 | How can I match a letter from any language using a regex in python 3?
re.match([a-zA-Z]) will match the english language characters but I want all languages to be supported simultaneously.
I don't wish to match the ' in can't or underscores or any other type of formatting. I do wish my regex to match: c, a, n, t, Å, é... | Match letter in any language | 0.028564 | 0 | 0 | 9,986 |
7,206,499 | 2011-08-26T14:48:00.000 | 1 | 0 | 1 | 0 | python,regex,unicode | 7,206,524 | 7 | false | 0 | 0 | Build a match class of all the characters you want to match. This might become very, very large. No, there is no RegEx shorthand for "All Kanji" ;)
Maybe it is easier to match for what you do not want, but even then, this class would become extremely large. | 2 | 20 | 0 | How can I match a letter from any language using a regex in python 3?
re.match([a-zA-Z]) will match the english language characters but I want all languages to be supported simultaneously.
I don't wish to match the ' in can't or underscores or any other type of formatting. I do wish my regex to match: c, a, n, t, Å, é... | Match letter in any language | 0.028564 | 0 | 0 | 9,986 |
7,208,961 | 2011-08-26T18:19:00.000 | 0 | 0 | 0 | 0 | python,tkinter,widget,tktable | 69,322,875 | 3 | false | 0 | 1 | I had a similar problem trying to show a complete panda's DataFrame using tkinter.
My first option was to create a grid like suggested someone in the first answer, but it bacame too heavy for so many info.
I guess is beter to create a finite numbers of cells and show only a part of the DF, changing that part with the m... | 1 | 11 | 0 | I want a Excel like table widget in tkinter for a gui I am writing. Do you have any suggestions? | Which widget do you use for a Excel like table in tkinter? | 0 | 0 | 0 | 36,436 |
7,209,285 | 2011-08-26T18:54:00.000 | 0 | 0 | 1 | 1 | python,curses | 7,241,397 | 3 | false | 0 | 0 | Well, I'm not sure I understand completly what you're trying to do. But what I've understood is this that you want to have a standard python console where you can type your code dynamically. But when you call, for exemple a function, the output of the processing of this function would appear into another terminal?
Well... | 1 | 15 | 0 | Is there a way to create a second terminal so that all calls to curses functions operate on that, rather than in the existing terminal? I work much faster when I can try things out interactively, so I'd like to be able to run an interactive python interpreter in one terminal and see the curses output in another.
As it... | Is there a way to interactively program a Python curses application? | 0 | 0 | 0 | 2,130 |
7,211,204 | 2011-08-26T22:36:00.000 | 3 | 0 | 0 | 0 | c#,java,python,sql,database | 7,211,297 | 1 | true | 0 | 0 | A full-on database engine is a pretty serious undertaking. You're not going to sit down and have a complete engine next week, so I'd have thought you would want to write the SQL parser piecemeal: adding features to the parser as the features are supported in the engine.
I'm guessing this is just something fun to do, r... | 1 | 1 | 0 | As a personal project, I have been developing my own database software in C#. Many current database systems can use SQL commands for queries. Is there anyone here that could point me in the right direction of implementing such a system in a database software written completely from scratch? For example a user familiar ... | C# custom database engine, how to implement SQL | 1.2 | 1 | 0 | 2,117 |
7,211,672 | 2011-08-27T00:09:00.000 | 1 | 0 | 0 | 0 | python,macos,pyqt4,pyside | 7,352,201 | 1 | false | 0 | 1 | You are still using the default Mac OS Python and not using the new installed one.
Check the python version: python must be 2.7.
find the new
version (should be inside /usr/local/bin )
update your
.bash_profile PATH=/usr/local/bin/:$PATH
Try again and try to
import PyQt4 | 1 | 1 | 0 | I'm running Python 2.7 on OS X Snow Leopard. I installed Python using Macports. Then, I installed py27-pyqt4 and py27-pyside, and I can't get them to work.
Python doesn't give errors when I import, but I get the following errors in the terminal when I test either:
pyside-uic : command not found
pyuic4 : command not fo... | pyside-uic/pyuic4: command not found | 0.197375 | 0 | 0 | 2,652 |
7,213,991 | 2011-08-27T10:36:00.000 | 3 | 0 | 0 | 0 | python,google-app-engine,gql,gqlquery | 7,214,401 | 2 | false | 1 | 0 | You can't. GQL is not SQL, and the datastore is not a relational database. An entity is stored as a single serialized protocol buffer, and it's impossible to fetch part of an entity; the whole thing needs to be deserialized. | 1 | 2 | 0 | Im trying to pull only one column from a datastore table
I have a Books model with
id, key, title, author, isbn and price
everything = db.GqlQuery('SELECT * FROM Books') gives me everything, but say i only want the title
books = db.GqlQuery('SELECT title FROM Books')
Ive tried everything people have suggested but nothi... | Google App Engine python, GQL, select only one column from datastore | 0.291313 | 1 | 0 | 1,553 |
7,214,799 | 2011-08-27T13:18:00.000 | 4 | 0 | 1 | 0 | ipython | 7,214,821 | 5 | false | 0 | 0 | Control-C works in the normal interactive Python shell, it should work in ipy also (except the program is catching the keyboardInterrupt exception) | 5 | 15 | 0 | I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython) | Can I stop execution of current module in ipython without leaving ipython | 0.158649 | 0 | 0 | 37,271 |
7,214,799 | 2011-08-27T13:18:00.000 | 0 | 0 | 1 | 0 | ipython | 18,939,511 | 5 | false | 0 | 0 | Kind of a jenky method but I can often quit a process without exiting ipython by typing something like: ']='. It creates a syntax error, terminating the process and, thereby, returning you to the ipython shell. | 5 | 15 | 0 | I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython) | Can I stop execution of current module in ipython without leaving ipython | 0 | 0 | 0 | 37,271 |
7,214,799 | 2011-08-27T13:18:00.000 | -1 | 0 | 1 | 0 | ipython | 40,076,179 | 5 | false | 0 | 0 | For the current version of IPython(Jupyter), you can simply click on Interrupt option under kernel tab. | 5 | 15 | 0 | I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython) | Can I stop execution of current module in ipython without leaving ipython | -0.039979 | 0 | 0 | 37,271 |
7,214,799 | 2011-08-27T13:18:00.000 | 0 | 0 | 1 | 0 | ipython | 57,966,727 | 5 | false | 0 | 0 | This answer may be a little too late, but for anyone who comes looking for an answer, you can use ESC | 5 | 15 | 0 | I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython) | Can I stop execution of current module in ipython without leaving ipython | 0 | 0 | 0 | 37,271 |
7,214,799 | 2011-08-27T13:18:00.000 | 11 | 0 | 1 | 0 | ipython | 9,827,576 | 5 | true | 0 | 0 | I had the same issue after reinstalling console2 and ipython on Windows. If you use the ipython.exe launcher, this seems to be a problem and it just closes the whole window. However, if you instead launch ipython with
python C:\python27\scripts\ipython-script.py
then it catches and handles the KeyboardInterrupt just f... | 5 | 15 | 0 | I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython) | Can I stop execution of current module in ipython without leaving ipython | 1.2 | 0 | 0 | 37,271 |
7,216,100 | 2011-08-27T17:17:00.000 | 0 | 0 | 0 | 0 | python,sqlalchemy | 7,216,293 | 2 | false | 0 | 0 | You would just go direct to the database utiltites and back it up there. Nothing to do with SQLAlchemy | 1 | 2 | 0 | I am relatively new to SQLalchemy and have done basic database creation, insert, update and delete. I have found it quite simple to use so far. My question is:
I want to move records from one database to another backup database. What is the simplest way to do this in SQLalchemy? | What is the easiest way to move data from one database to another backup database using SQLalchemy? | 0 | 1 | 0 | 1,472 |
7,216,925 | 2011-08-27T19:40:00.000 | 0 | 1 | 1 | 0 | python | 7,217,257 | 1 | false | 0 | 0 | You should pass a dict as the third argument to PyErr_NewException. The dict should have an __init__ key bound to your initializer function. | 1 | 0 | 0 | I'm trying to build an exception class that I can use both in a C extension and the Python modules that import the extension. I'm using the PyErr_NewException to create the class as a superclass of the Exception class, but I can't figure out how to create an __init__ constructor for the class. I assume that is the be... | Trying to build a Python class in a C extension that can be instantiated from a Python module | 0 | 0 | 0 | 242 |
7,218,916 | 2011-08-28T03:38:00.000 | 1 | 0 | 0 | 0 | openid,python-openid | 7,226,744 | 1 | true | 0 | 0 | You can not. Since SREG and AX are extensions to OpenID, you can't expect everyone to use it, and therefore you can't be sure that you will get any data back from a provider.
The standard method of handling this is to have a normal registration form with the missing fields. Simply use the SREG/AX data from the provider... | 1 | 1 | 0 | The site I am developing supports sign-in with the default SimpleOpenIDSelector providers (the same providers that are listed on stackoverflow login page). While it works for simple sign-ins, my AX-required requests remain unfulfilled. For example, Blogger does not disclose first/last/friendly name through AX.
How can ... | Reliable method of getting username or realname from OpenID | 1.2 | 0 | 1 | 97 |
7,219,511 | 2011-08-28T07:03:00.000 | 0 | 0 | 1 | 0 | python,module,io,operating-system | 7,219,522 | 7 | false | 0 | 0 | os.open() method opens the file file and set various flags according to flags and possibly its mode according to mode.
The default mode is 0777 (octal), and the current unmask value is first masked out.
This method returns the file descriptor for the newly opened file.
While,
io.open() method opens a file, in the mode ... | 2 | 41 | 0 | I realised that the open() function I've been using was an alias to io.open() and that importing * from os would overshadow that.
What's the difference between opening files through the io module and os module? | What's the difference between io.open() and os.open() on Python? | 0 | 0 | 0 | 21,358 |
7,219,511 | 2011-08-28T07:03:00.000 | 1 | 0 | 1 | 0 | python,module,io,operating-system | 56,229,810 | 7 | false | 0 | 0 | Database and system application developers usually use open instead of fopen as the former provides finer control on when, what and how the memory content should be written to its backing store (i.e., file on disk).
In Unix-like operating system, open is used to open regular file, socket end-point, device, pipe, etc. ... | 2 | 41 | 0 | I realised that the open() function I've been using was an alias to io.open() and that importing * from os would overshadow that.
What's the difference between opening files through the io module and os module? | What's the difference between io.open() and os.open() on Python? | 0.028564 | 0 | 0 | 21,358 |
7,219,541 | 2011-08-28T07:12:00.000 | 8 | 0 | 1 | 0 | javascript,python,syntax | 7,219,710 | 7 | false | 0 | 0 | Aside from the syntactical issues, it is partly cultural. In Python culture any extraneous characters are an anathema, and those that are not white-space or alphanumeric, doubly so.
So things like leading $ signs, semi-colons, and curly braces, are not liked. What you do in your code though, is up to you, but to real... | 3 | 61 | 0 | Python and JavaScript both allow developers to use or to omit semicolons. However, I've often seen it suggested (in books and blogs) that I should not use semicolons in Python, while I should always use them in JavaScript.
Is there a technical difference between how the languages use semicolons or is this just a cultur... | What is the difference between semicolons in JavaScript and in Python? | 1 | 0 | 0 | 6,980 |
7,219,541 | 2011-08-28T07:12:00.000 | 8 | 0 | 1 | 0 | javascript,python,syntax | 7,219,723 | 7 | false | 0 | 0 | JavaScript is designed to "look like C", so semicolons are part of the culture. Python syntax is different enough to not make programmers feel uncomfortable if the semicolons are "missing". | 3 | 61 | 0 | Python and JavaScript both allow developers to use or to omit semicolons. However, I've often seen it suggested (in books and blogs) that I should not use semicolons in Python, while I should always use them in JavaScript.
Is there a technical difference between how the languages use semicolons or is this just a cultur... | What is the difference between semicolons in JavaScript and in Python? | 1 | 0 | 0 | 6,980 |
7,219,541 | 2011-08-28T07:12:00.000 | 7 | 0 | 1 | 0 | javascript,python,syntax | 7,219,731 | 7 | false | 0 | 0 | The answer why you don't see them in Python code is: no one needs them, and the code looks cleaner without them.
Generally speaking, semicolons is just a tradition. Many new languages have just dropped them for good (take Python, Ruby, Scala, Go, Groovy, Io for example). Programmers don't need them, neither do compiler... | 3 | 61 | 0 | Python and JavaScript both allow developers to use or to omit semicolons. However, I've often seen it suggested (in books and blogs) that I should not use semicolons in Python, while I should always use them in JavaScript.
Is there a technical difference between how the languages use semicolons or is this just a cultur... | What is the difference between semicolons in JavaScript and in Python? | 1 | 0 | 0 | 6,980 |
7,225,684 | 2011-08-29T03:04:00.000 | 1 | 0 | 1 | 0 | php,python,multiprocess | 7,225,770 | 1 | false | 0 | 0 | One way to this would be though web services. You could have a PHP process sitting on a web server and running and calling a Python web service (using CherryPy) multiple times. You would pass variables using a standard object notation such as JSON which can be efficiently encoded/decoded by both PHP and Python.
You c... | 1 | 0 | 0 | I asked a question before about how to do multiprocessing in Python (although I did not use the word multiprocessing in the former question, because I was not sure I was asking about that yet).
Now I am wondering how to do multiprocessing when you have more then one language involved, particularly if you have a PHP scr... | Multiprocessing between different languages such as PHP and Python | 0.197375 | 0 | 0 | 335 |
7,226,036 | 2011-08-29T04:23:00.000 | 13 | 0 | 0 | 0 | python,django,django-models,django-south | 7,226,563 | 1 | true | 1 | 0 | Yes, this is the approach you should take. You should be doing schemamigration -> datamigration -> schemamigration for this. unfortunately if there is no way to do it in SQL, south cannot do it either. | 1 | 16 | 0 | Using South/Django, I am running into a problem where I'm trying to add a UNIQUE and NOT NULL column for a model with existing rows in the database. South prompts me to specify a default for the column, since it is NOT NULL. But since it also has a UNIQUE constraint, I can't add a default to the field in models.py, nor... | South: run a migration for a column that is both unique and not null | 1.2 | 0 | 0 | 2,209 |
7,227,776 | 2011-08-29T08:25:00.000 | 1 | 0 | 0 | 0 | python,django | 7,227,875 | 2 | false | 1 | 0 | I guess you could fold in your own load method into the django template language and add in a logmethod using Django logging, just out of curiosity, is it the complexity of the template variety that a logger makes it more conveinient to keep the helicopter view? | 2 | 1 | 0 | While rendering a template is there a way to make Django log something when unused tag libraries are loaded? | Detecting unused Django template libraries | 0.099668 | 0 | 0 | 219 |
7,227,776 | 2011-08-29T08:25:00.000 | -1 | 0 | 0 | 0 | python,django | 7,233,337 | 2 | false | 1 | 0 | Here is what I would do, although this may not be the best solution.
Write a script that goes through all of your urls.py files and builds up a tree of all the urls that exist in your project (I know there is a third-party django plugin to list all urls, but I cant seem to remember what it is)
Build a unittest that ta... | 2 | 1 | 0 | While rendering a template is there a way to make Django log something when unused tag libraries are loaded? | Detecting unused Django template libraries | -0.099668 | 0 | 0 | 219 |
7,227,850 | 2011-08-29T08:33:00.000 | 14 | 0 | 0 | 1 | python,scala,comet,lift,tornado | 7,286,848 | 3 | true | 1 | 0 | I think Python and Tornado are a great team, for the following reasons
Tornado is really an IOLoop that happens to come with an HTTP implementation that runs on it (and a few helpers).
This means that it comes with everything you need to do web development with it.
It also means that if you find, down the road, that... | 3 | 12 | 0 | I'm looking to start a Google Maps based web application.
My initial thoughts are that in the first phase the focus should be on the front-end, and the backend should be easy to write and to prototype, and should aid as much as possible the development of the frontend.
There will be no 'classic' pages, just a meebo.co... | Python+Tornado vs Scala+Lift? | 1.2 | 0 | 0 | 3,553 |
7,227,850 | 2011-08-29T08:33:00.000 | 6 | 0 | 0 | 1 | python,scala,comet,lift,tornado | 7,231,443 | 3 | false | 1 | 0 | Scala is a substantially cleaner language and enables you to use object-oriented and functional paradigms as you see fit.
Python has much more syntactic sugar and embraces the "there is only one way to do it" philosophy.
Scala is usually used with IDEs like Eclipse/Idea - although support for vim/emacs also exists, too... | 3 | 12 | 0 | I'm looking to start a Google Maps based web application.
My initial thoughts are that in the first phase the focus should be on the front-end, and the backend should be easy to write and to prototype, and should aid as much as possible the development of the frontend.
There will be no 'classic' pages, just a meebo.co... | Python+Tornado vs Scala+Lift? | 1 | 0 | 0 | 3,553 |
7,227,850 | 2011-08-29T08:33:00.000 | 3 | 0 | 0 | 1 | python,scala,comet,lift,tornado | 7,231,067 | 3 | false | 1 | 0 | I would suggest going with Python for these reasons:
1. Debugging
What I find especially useful when writing Python code, is the ability to easily debug ( see the pdb module ), all you need is a command prompt and a text editor to set your breakpoints.
With Scala, you will probably have to rely on a IDE to do all your... | 3 | 12 | 0 | I'm looking to start a Google Maps based web application.
My initial thoughts are that in the first phase the focus should be on the front-end, and the backend should be easy to write and to prototype, and should aid as much as possible the development of the frontend.
There will be no 'classic' pages, just a meebo.co... | Python+Tornado vs Scala+Lift? | 0.197375 | 0 | 0 | 3,553 |
7,230,327 | 2011-08-29T12:52:00.000 | 0 | 1 | 0 | 1 | python,mechanize | 7,236,208 | 1 | false | 0 | 0 | Mechanize doesn't retrieve images unless you specifically tell it to (on a one by one basis). | 1 | 0 | 0 | I'm on Ubuntu. I'd like to be able to retrieve images saved in my temp folder, and clear it, at will (or does mechanize not actually read images but rather just html?). | Where is the python mechanize cache/temp folder? How can I clear it? How can I retrieve files from it? | 0 | 0 | 0 | 341 |
7,232,061 | 2011-08-29T15:12:00.000 | 0 | 0 | 1 | 0 | python,virtualenv,distutils,pip,multiple-versions | 7,232,121 | 3 | false | 0 | 0 | One resource for this area is the book Expert Python Programming by Tarek Ziade. I'm ambivalent about the quality of the book, but the topics covered are just what you're focusing on. | 1 | 19 | 0 | Many posts on different aspects of this question but I haven't seen a post that brings it all together.
First a subjective statement: it seems like the simplicity we experience when working with the Python language is shot to pieces when we move outside the interpreter and start grappling with deployment issues. How b... | Best practices for Python deployment -- multiple versions, standard install locations, packaging tools etc | 0 | 0 | 0 | 5,305 |
7,233,546 | 2011-08-29T17:26:00.000 | 0 | 1 | 1 | 0 | python,configuration,pylons,ini,paster | 7,233,653 | 1 | true | 0 | 0 | You can use the ConfigParser module. | 1 | 2 | 0 | We're running a pylons app with multiple ini files (production, staging, development, etc). When a new setting is added that can be the same in all environments, it would be great to be able to set it once in some sort of master configuration that gets included with all .ini files. Or included via some other way to l... | any way to composite configuration/.ini files in pylons? | 1.2 | 0 | 0 | 539 |
7,233,631 | 2011-08-29T17:33:00.000 | 0 | 0 | 0 | 0 | python,firefox,selenium | 7,267,936 | 2 | false | 0 | 0 | Open Firefox with this profile (with profile manager), go to Firefox preferences, turn off updates - this works for me. | 1 | 4 | 0 | When I use selenium webdriver with a custom firefox profile I get the firefox Add-ons pop up showing 2 extensions: Firefx WebDriver 2.5.0 and Ubuntu Firefox Modifications 0.9rc2.
How can I get rid of this popup? I looked in the server jar to see if I could find the extensions, no luck. Looked online for the extensions,... | Using Selenium webdriver with a custom firefox profile - how to get rid of addins popup | 0 | 0 | 1 | 1,461 |
7,234,640 | 2011-08-29T19:07:00.000 | 3 | 1 | 0 | 0 | python,stdin,csh | 7,234,676 | 2 | false | 0 | 0 | You don't need to do anything.
Commands (such that a Python script) that you start from a shell (such as csh) will inherit the shell's stdin (and stdout, stderr) by default unless you actively do something to prevent it. | 1 | 2 | 0 | How do you redirect the stdin of a csh script to the stdin of a python script?
I have a cgi script I'm writing in csh that runs on a Solaris machine. This csh script is a wrapper to a python script that reads from the stdin (I know, scripting in csh is bad but I'm forced to in this case).
Thanks for help! (And sorry ... | csh stdin to Python stdin? | 0.291313 | 0 | 0 | 299 |
7,237,996 | 2011-08-30T02:10:00.000 | 4 | 0 | 0 | 1 | python,tcp,twisted | 7,238,064 | 1 | true | 0 | 0 | This problem is not specific to Twisted. Your protocol must have some acknowledgement that data was received, if you want to know that it was received.
The result from send() does not tell you that the data was authoritatively received by the peer; it just says that it was queued by the kernel for transport. From you... | 1 | 4 | 0 | I wrote a tcp based server with the twisted.internet module. It's a high concurrency environment.
I usually send data by the instance of protocol.Protocol, and I got a problem with that.
Some of the tcp connections may be closed caused by timeout, and it seems I cannot get any notification so that the data I have writ... | data loss problem of tcp protocol in twisted | 1.2 | 0 | 1 | 531 |
7,238,226 | 2011-08-30T02:58:00.000 | -1 | 0 | 1 | 0 | python,datetime,epoch | 52,536,894 | 3 | false | 0 | 0 | import time;
microtime=int(time.time()*1000);
print microtime; | 1 | 5 | 0 | I've looked all around, and there seem to be a lot of hacks, but no simple, "good" ways to do this. I want to convert a Python datetime object into microtime like time.time() returns (seconds.microseconds).
What's the best way to do this? Using mktime() strips off the microseconds altogether, you could conceivably buil... | Python datetime to microtime | -0.066568 | 0 | 0 | 6,310 |
7,239,518 | 2011-08-30T06:36:00.000 | 4 | 0 | 1 | 0 | python,import,pytz | 7,240,327 | 3 | true | 0 | 0 | You've got the package installed in pytz and also as a .egg. Remove the .egg and you won't get the warning.
However, note that it's referred to as a "spurious warning" -- this isn't actually a problem, though it could become one if the two were different. | 1 | 4 | 0 | I keep getting the following error while running Python code:
C:\Python26\lib\site-packages\pytz\__init__.py:32:
UserWarning: Module pytz was already imported from
C:\Python26\lib\site-packages\pytz\__init__.pyc,
but c:\python26\lib\site-packages\pytz-2011h-py2.6.egg
is being added to sys.path
from p... | Module pytz was already imported | 1.2 | 0 | 0 | 4,701 |
7,241,113 | 2011-08-30T09:24:00.000 | 2 | 0 | 1 | 0 | python,with-statement,circular-reference,contextmanager | 7,241,475 | 3 | false | 0 | 0 | What is the alternative?
Do nothing. Until you create millions of circular references like this -- and can prove that this (and only this) is breaking your program -- it doesn't actually matter. | 2 | 2 | 0 | My design is as follows:
__main__ references a
a references b
b references a
a is created and then disposed of from __main__
Thus a and b have circular references. However upon del a I would prefer both a and b disposed of.
I see in many places advice to use Context Managers, and specifically the with statement inste... | Disposing of objects with circular references | 0.132549 | 0 | 0 | 246 |
7,241,113 | 2011-08-30T09:24:00.000 | 0 | 0 | 1 | 0 | python,with-statement,circular-reference,contextmanager | 7,241,466 | 3 | false | 0 | 0 | Garbage collector is supposed to handle this. | 2 | 2 | 0 | My design is as follows:
__main__ references a
a references b
b references a
a is created and then disposed of from __main__
Thus a and b have circular references. However upon del a I would prefer both a and b disposed of.
I see in many places advice to use Context Managers, and specifically the with statement inste... | Disposing of objects with circular references | 0 | 0 | 0 | 246 |
7,241,240 | 2011-08-30T09:36:00.000 | 0 | 0 | 0 | 1 | python | 7,305,695 | 2 | true | 0 | 0 | The executable turned out to be fine. For some reason or the other there's wrong versions of the needed dlls in PATH and the executable ended up trying to use those. | 1 | 0 | 0 | I want to have my application read a document using xml.sax.parse. Things work fine but when I move the executable to a Windows server 2008 machine things break down. I get an SAXReaderNotAvailable exception with "No parsers found" message.
The setup I'm using to build the executable is:
64 bit windows 7
Python 2.7.2 ... | How can I use xml.sax module on an executable made with PyInstaller? | 1.2 | 0 | 1 | 446 |
7,244,683 | 2011-08-30T14:18:00.000 | 1 | 0 | 0 | 0 | python,templates,web.py,jinja2 | 7,269,896 | 2 | false | 1 | 0 | What was hard for me in Templetor is template inheritance. Instead of simple concept of blocks which is present e.g. in Jinja2, you have to select the base template once in the app code, then do the weird attribute setting in the actual template while accessing it in the base template. Still you have problems if you ne... | 1 | 1 | 0 | I'm adding a simple web interface to an already existing piece of software; web.py fits the job just right and that's what I'm using. Now I'm researching what templating engine to use and came down to two alternatives: either using web.py's own Templator or using Jinja2.
I already have both working in the app and I'm w... | Comparing web.py's Templator and Jinja2: strengths and weaknesses | 0.099668 | 0 | 0 | 1,277 |
7,247,179 | 2011-08-30T17:19:00.000 | 0 | 0 | 0 | 1 | python,hadoop,apache-pig | 7,247,519 | 2 | false | 0 | 0 | WholeFileRecordReader means not split the input file? If so, define mapred.min.split.size to a very large value, both mapreduce and Pig will take it. | 1 | 2 | 0 | It seems a very common use case but so hard to do in Hadoop (it is possible with WholeFileRecordReader class).
Is it at all possible in Dumbo or Pig?
Does anyone knows a way to process whole files as map tasks using Dumbo or Pig? | Process entire files in Hadoop using Python code (preferably in Dumbo) | 0 | 0 | 0 | 334 |
7,247,648 | 2011-08-30T17:58:00.000 | 3 | 0 | 1 | 0 | python,math | 7,247,764 | 4 | false | 0 | 1 | I don't think this is particularly unpythonic. It's not too unusual to distinguish types when they have the same domain, but when one has a particular frame of reference, such as a time zone, Since a point is the sum of a vector and the origin, it's reasonable to encode that in some way. | 4 | 0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point fro... | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0.148885 | 0 | 0 | 751 |
7,247,648 | 2011-08-30T17:58:00.000 | 3 | 0 | 1 | 0 | python,math | 7,247,805 | 4 | true | 0 | 1 | It seems superfluous. If you think about it, a point in cartesian space is entirely equivalent to a bound vector which begins at the origin. Sounds like you could be making a lot of work for yourself for nothing. | 4 | 0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point fro... | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 1.2 | 0 | 0 | 751 |
7,247,648 | 2011-08-30T17:58:00.000 | 1 | 0 | 1 | 0 | python,math | 7,248,651 | 4 | false | 0 | 1 | I understand your argument. I, too, have always struggled with classes for points. In my experience it's better (although I guess perhaps not "more pythonic") to take a more functional approach and write your API in terms of functions that takes lists/tuples.
The main objection to this, I think, is that you probably ... | 4 | 0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point fro... | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0.049958 | 0 | 0 | 751 |
7,247,648 | 2011-08-30T17:58:00.000 | 1 | 0 | 1 | 0 | python,math | 7,249,813 | 4 | false | 0 | 1 | Yes, this is poor design, as adding or subtracting two points has no conceptual meaning.
You can, however, add a vector to a point (obtaining a point) or add two vectors (obtaining a vector), so it sounds like you are just confusing points with vectors.
A point is not a vector, but it can be implemented in terms of one... | 4 | 0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point fro... | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0.049958 | 0 | 0 | 751 |
7,249,412 | 2011-08-30T20:30:00.000 | 0 | 0 | 0 | 0 | php,python,html | 7,249,558 | 3 | false | 1 | 0 | For Python
For timed tasks for N minutes create an UNIX cron job or Windows equivalent which runs your .py script regularly
Download the weather data using urllib2 module in .py script
Parse HTML using BeautifulSoup or lxml libraries
Select the relevant bits of HTML using XPath selectors or CSS selectors (lxml)
Proces... | 1 | 1 | 0 | I am trying to take updating weather data from a website that isn't mine and put a chunk of it into a generic text file every 30 minutes. The text file should not have any html tags or anything but could be delimited by commas or periods or tabs. The website generating the data puts the data in a table with no class or... | Saving select updating data points from an external webpage to a text file | 0 | 0 | 1 | 74 |
7,250,126 | 2011-08-30T21:37:00.000 | 0 | 0 | 0 | 1 | python | 7,250,363 | 4 | false | 0 | 0 | You will receive the process ID of the newly created process when you create it. At least, you will if you used fork() (Unix), posix_spawn(), CreateProcess() (Win32) or probably any other reasonable mechanism to create it.
If you invoke the "python" binary, the python PID will be the PID of this binary that you invoke.... | 2 | 18 | 0 | I am in Windows and Suppose I have a main python code that calls python interpreter in command line to execute another python script ,say test.py .
So test.py is executed as a new process.How can I find the processId for this porcess in Python ?
Update:
To be more specific , we have os.getpid() in os module. It returns... | getting ProcessId within Python code | 0 | 0 | 0 | 36,362 |
7,250,126 | 2011-08-30T21:37:00.000 | 0 | 0 | 0 | 1 | python | 16,131,293 | 4 | false | 0 | 0 | Another option is that the process you execute will set a console window title for himself.
And the searching process will enumerate all windows, find the relevant window handle by name and use the handle to find PID. It works on windows using ctypes. | 2 | 18 | 0 | I am in Windows and Suppose I have a main python code that calls python interpreter in command line to execute another python script ,say test.py .
So test.py is executed as a new process.How can I find the processId for this porcess in Python ?
Update:
To be more specific , we have os.getpid() in os module. It returns... | getting ProcessId within Python code | 0 | 0 | 0 | 36,362 |
7,251,648 | 2011-08-31T01:24:00.000 | 1 | 0 | 1 | 0 | python,memory-management,generator | 7,251,691 | 2 | false | 0 | 0 | This is not an operation supported by Python. | 1 | 2 | 0 | I noticed once a generator is exhausted, the object remains in memory. How can I make the generator object automatically remove itself from memory once it is exhausted? | Automatically remove generator object from memory at StopIteration (Python) | 0.099668 | 0 | 0 | 1,830 |
7,253,198 | 2011-08-31T06:11:00.000 | 2 | 1 | 0 | 1 | php,python,linux,shell,unix | 7,253,246 | 4 | false | 0 | 0 | In Python:
Use os.listdir to find names of all files in a directory. If you need to recursively find all files in sub-directories as well, use os.walk instead. Its API is more complex than os.listdir but it provides powerful ways to recursively walk directories.
Then use os.rename to rename the files. | 1 | 11 | 0 | I want to rename all files in a folder and add a .xml extension. I am using Unix. How can I do that? | How to add .xml extension to all files in a folder in Unix/Linux | 0.099668 | 0 | 1 | 13,442 |
7,254,377 | 2011-08-31T08:24:00.000 | 6 | 0 | 1 | 1 | python,eclipse,pydev,folding | 13,308,297 | 2 | false | 0 | 0 | By default the loop and condition folds are disabled, to enable them go to Window -> Preferences -> PyDev -> Editor -> Code Folding. Apply code folding to all entries | 1 | 5 | 0 | Is there a way that eclipse (edit: under windows) folds all comments and docstrings automatically when I open a python file? | How to make Eclipse (pydev) automatically fold all comments when opening a file? | 1 | 0 | 0 | 2,092 |
7,259,001 | 2011-08-31T15:01:00.000 | 1 | 0 | 0 | 0 | python,user-interface,wxpython | 7,262,848 | 4 | false | 0 | 1 | The best advice for you is not to start trying to build the actual GUI. Learning GUI programming is not trivial and you should start slowly and work up to the real thing.
Pick a framework (Tkinter, wxPython, Qt) and start with the simplest tutorial you can find. Then try progressively harder tasks until you have enough... | 1 | 0 | 0 | I have created some Python code which is really complicated but it basically asks for an input and then outputs a huge DNA sequence depending on the input given, along with some graphs and many equations. I would like to embed this code into the user interface that I will most likely make with wxPython or Tkinter. I do... | Embedding a python code to a GUI | 0.049958 | 0 | 0 | 2,928 |
7,261,242 | 2011-08-31T17:54:00.000 | 0 | 0 | 0 | 1 | python,macos,windows-7 | 7,261,504 | 2 | false | 0 | 0 | actually the issue is that windows has no equivalent of the execute bit for files.
the solution is to change the mount options on the share so that all the files have their execute bit set. | 1 | 0 | 0 | We have a server running Windows 7 Pro. I have several Python script I'd like to save to the server and have it so that client computers can run them by simply double-clicking. The client computers are all running OSX. This is proving to be... problematic.
First I tried to simply make the Python scripts executable, but... | Running a Python script saved on a Windows 7 server... on a Mac? | 0 | 0 | 0 | 231 |
7,261,451 | 2011-08-31T18:12:00.000 | 3 | 1 | 0 | 1 | python,mercurial,eclipse-plugin,osx-lion | 7,278,773 | 2 | false | 1 | 0 | Nobody answered me, but I figured out the answer. Maybe it will help someone.
I finally realized that since 'hg -y debuginstall' at the command line was giving me the same error message, it wasn't an Eclipse problem at all (duh). Reinstalling a newer version of Mercurial solved the problem. | 2 | 1 | 0 | I'm on Mac OS X 10.7.1 (Lion). I just downloaded a fresh copy of Eclipse IDE for Java EE Developers, and installed the Mercurial plugin. I get the following error message:
abort: couldn't find mercurial libraries in [...assorted Python directories...].
I do have Python 2.6.1 and 3.2.1 installed. I also have a directo... | Mercurial plugin for Eclipse can't find Python--how to fix? | 0.291313 | 0 | 0 | 1,116 |
7,261,451 | 2011-08-31T18:12:00.000 | 0 | 1 | 0 | 1 | python,mercurial,eclipse-plugin,osx-lion | 12,130,976 | 2 | false | 1 | 0 | I had two installation of mercurial in mac.
One was installed directly and another using macport.
Removing the direct installation solved the problem.
Remove the direct installation using
easy_install -m mercurial
Update "Mercurial Executable" path to "/opt/local/bin/hg"
Eclipse->Preference->Team->Mercurial->
Resta... | 2 | 1 | 0 | I'm on Mac OS X 10.7.1 (Lion). I just downloaded a fresh copy of Eclipse IDE for Java EE Developers, and installed the Mercurial plugin. I get the following error message:
abort: couldn't find mercurial libraries in [...assorted Python directories...].
I do have Python 2.6.1 and 3.2.1 installed. I also have a directo... | Mercurial plugin for Eclipse can't find Python--how to fix? | 0 | 0 | 0 | 1,116 |
7,262,604 | 2011-08-31T19:51:00.000 | 1 | 0 | 0 | 1 | python,blender | 7,262,679 | 3 | false | 0 | 0 | Two options:
Use py2exe to bundle the interpreter with the scripts.
Import the modules and call the functions automatically. | 1 | 1 | 0 | Here is the problem...
I'm writing very small plugin for Blender,
I have 10 python scripts, they parsing different file formats by using command-line, and I have a Main Python script to run all other scripts with proper commands...
for example, "Main.py" include:
txt2cfg.py -inFile -outFile...
ma2lxo.py -inFile -outFil... | How to run a Python script from another Python script in the cross-platform way? | 0.066568 | 0 | 0 | 3,446 |
7,265,548 | 2011-09-01T02:26:00.000 | 1 | 1 | 1 | 0 | python | 7,265,575 | 4 | false | 0 | 0 | I think Github (Git) or Bitbucket/Kiln (Mercurial) would be the best places to host any code. That way you can keep it in version control + get comments, suggestions, and even features or additional code for free via the pull requests. | 1 | 3 | 0 | Which sites are the best for posting Python code that actually works? To show/share, and get input? I would like to post my code. | Best site for posting Python code? | 0.049958 | 0 | 0 | 1,231 |
7,266,270 | 2011-09-01T04:57:00.000 | 2 | 1 | 0 | 0 | c#,runtime,ironpython,distribution,dynamic-language-runtime | 7,272,791 | 1 | true | 0 | 0 | The best thing to do is include the DLR DLLs in your application next to the IronPython DLLs. Putting them in the GAC will affect every other application on the system that uses the DLR, which is probably not what you want unless you have complete control of the systems involved.
What's in .NET 4 is probably the extent... | 1 | 2 | 0 | We're building a commercial (closed/proprietary) intranet application which makes used of hosted IronPython (2.7), targeting .NET 4.0.
What approach would you recommend for ensuring the DLR runtimes (Microsoft.Scripting.dll & Microsoft.Dynamic.dll - both included in the IronPython 2.7 binary distribution) are availab... | Distrubuting DLR runtime for C# Application with embedded (hosted) IronPython | 1.2 | 0 | 0 | 309 |
7,268,426 | 2011-09-01T09:26:00.000 | 1 | 0 | 1 | 0 | python,eclipse,pydev | 7,268,461 | 2 | false | 0 | 0 | Did you try rename? it seems to work in other language plugins.(make sure to right click on the module) | 2 | 1 | 0 | I'm using eclipse + pydev. I want to refactor and change the name of my module. I clicked on my module in the package explorer, but no refactoring (other than 'rename') in the context menu. Similarly, the refactoring on the top navigation menu is greyed out.
So how do i change my module name and have it reflected acros... | eclipse+pydev how to rename module? | 0.099668 | 0 | 0 | 1,767 |
7,268,426 | 2011-09-01T09:26:00.000 | 2 | 0 | 1 | 0 | python,eclipse,pydev | 7,272,489 | 2 | true | 0 | 0 | This feature is still not properly integrated in the pydev package explorer, so, for now, you have to find a place that uses the module you want in the code and rename that reference in the editor (you don't need to report that as a bug as that's already known and should be fixed soon). | 2 | 1 | 0 | I'm using eclipse + pydev. I want to refactor and change the name of my module. I clicked on my module in the package explorer, but no refactoring (other than 'rename') in the context menu. Similarly, the refactoring on the top navigation menu is greyed out.
So how do i change my module name and have it reflected acros... | eclipse+pydev how to rename module? | 1.2 | 0 | 0 | 1,767 |
7,268,563 | 2011-09-01T09:39:00.000 | -17 | 1 | 0 | 1 | python,debugging,fork | 7,272,926 | 5 | false | 0 | 0 | But I'm still curious if there's any similar feature in python debugger. I happen to find this feature in perldb and I find it's very handy
No.
You don't need it.
No matter how handy it may appear in other environments, you just don't need it.
You don't need fork() in Python; therefore you don't need fancy debugging t... | 4 | 5 | 0 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? | How to debug python scripts that fork | -1 | 0 | 0 | 2,992 |
7,268,563 | 2011-09-01T09:39:00.000 | 1 | 1 | 0 | 1 | python,debugging,fork | 45,673,792 | 5 | false | 0 | 0 | The debugger in pyCharm does this nicely. It seems to use gdb with python support to accomplish that, however all the tutorials on how to do this with gdb by Hand which I've found so far didn't work for me. In pyCharm it just works. | 4 | 5 | 0 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? | How to debug python scripts that fork | 0.039979 | 0 | 0 | 2,992 |
7,268,563 | 2011-09-01T09:39:00.000 | 0 | 1 | 0 | 1 | python,debugging,fork | 23,942,909 | 5 | false | 0 | 0 | One possible way to debug a fork is to use pdb on the main process and winpdb on the fork. You put a software break early in the fork process and attach the winpdb app once the break has been hit.
It might be possible to run the program under winpdb and attach another instance after the fork - I haven't tried this. You... | 4 | 5 | 0 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? | How to debug python scripts that fork | 0 | 0 | 0 | 2,992 |
7,268,563 | 2011-09-01T09:39:00.000 | 3 | 1 | 0 | 1 | python,debugging,fork | 7,268,624 | 5 | true | 0 | 0 | You can emulate forked process if you will set instead of fork and its condition (pid == 0) always True. For debugging main process debugger will work.
For debugging multi-processing interaction better to use detailed logs as for me | 4 | 5 | 0 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? | How to debug python scripts that fork | 1.2 | 0 | 0 | 2,992 |
7,269,669 | 2011-09-01T11:31:00.000 | 2 | 0 | 0 | 0 | python,django | 7,269,703 | 1 | true | 1 | 0 | settings is a proxy object that you use in your code to access the settings.
global_settings is a module internal to Django, containing default settings, used when you leave out a variable out of project's settings. I.e. you don't touch it, unless you're changing Django core. | 1 | 0 | 0 | What is the difference between django.conf.settings and django.conf.global_settings ? | What is the difference between django.conf.settings and global_settings? | 1.2 | 0 | 0 | 339 |
7,270,356 | 2011-09-01T12:35:00.000 | 0 | 0 | 1 | 0 | python,printing,apostrophe | 7,270,541 | 2 | false | 0 | 0 | Convert it to float ... It is a string, so you need to do string to float conversion | 1 | 0 | 0 | I'm using a program called CityEngine which has a python element to it.
The problem: I've just called a function on an object and returns me a list of numbers, xyz. I split the xyz into their own names. I also call a function to retrieve a different attribute related to this object to replace the previously retrieved... | python trying to remove single apostrophe | 0 | 0 | 0 | 1,197 |
7,273,779 | 2011-09-01T17:01:00.000 | 1 | 0 | 0 | 0 | python,qt,pyqt,openmp,python-c-extension | 7,441,730 | 3 | false | 0 | 1 | As a workaround, you can create a stand alone program using openmp, and a Qt frontend program. and make them communicate by using tcp socket or something you familiar (dll is another option?).
the point is, isolate different modules, if one module fails, you know which part fails.
as one whole big program, it is hard t... | 2 | 1 | 0 | I'm developing a python application that uses a C-extension module I also developed myself. The extension module does some heavy number crunching and makes use of OpenMP.
I was recently adding some GUI components to my Python application using PyQt4. However, when I show a window, the application crashes before the win... | Crash when showing a PyQt4 Window after importing a python extension that uses OpenMP | 0.066568 | 0 | 0 | 246 |
7,273,779 | 2011-09-01T17:01:00.000 | 1 | 0 | 0 | 0 | python,qt,pyqt,openmp,python-c-extension | 7,467,392 | 3 | false | 0 | 1 | Make sure that the OpenMP number crunching extension is free of race conditions.
Avoid updating windows or any other GUI operations from multiple threads - use #pragma omp single or #pragma omp master to this kind of stuff.
If you have a variable/callback to the python code, make sure that all threads have finished wha... | 2 | 1 | 0 | I'm developing a python application that uses a C-extension module I also developed myself. The extension module does some heavy number crunching and makes use of OpenMP.
I was recently adding some GUI components to my Python application using PyQt4. However, when I show a window, the application crashes before the win... | Crash when showing a PyQt4 Window after importing a python extension that uses OpenMP | 0.066568 | 0 | 0 | 246 |
7,273,954 | 2011-09-01T17:17:00.000 | 2 | 0 | 1 | 0 | python,filesystems | 7,274,042 | 2 | true | 0 | 0 | I'm not sure how you'd get more efficient than os.walk and stat since that's fundamentally what you're doing. You could use some external command/service through Python's subprocess.Popen but then that's hardly "in python". | 1 | 1 | 0 | What's the best way in Python to find all empty (zero byte) files, recursively, from a given directory? I could use os.walk and stat each file, but that seems very inefficient. Thanks. | Finding empty files in Python | 1.2 | 0 | 0 | 1,005 |
7,274,049 | 2011-09-01T17:24:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,nosql,google-cloud-datastore | 7,342,091 | 2 | true | 1 | 0 | There are a few ways to do this:
Accumulate logs and write them in a single datastore put at the end of the request. This is the highest latency option, but only slightly - datastore puts are fairly fast. This solution also consumes the least resources of all the options.
Accumulate logs and enqueue a task queue task ... | 2 | 2 | 0 | Is it viable to have a logger entity in app engine for writing logs? I'll have an app with ~1500req/sec and am thinking about doing it with a taskqueue. Whenever I receive a request, I would create a task and put it in a queue to write something to a log entity (with a date and string properties).
I need this because ... | Logger Entity in App engine | 1.2 | 0 | 0 | 157 |
7,274,049 | 2011-09-01T17:24:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,nosql,google-cloud-datastore | 7,332,700 | 2 | false | 1 | 0 | How about keeping a memcache data structure of request info (recorded as they arrive) and then run an every 5 minute (or faster) cron job that crunches the stats on the last 5 minutes of requests from the memcache and just records those stats in the data store for that 5 minute interval. The same (or a different) cron ... | 2 | 2 | 0 | Is it viable to have a logger entity in app engine for writing logs? I'll have an app with ~1500req/sec and am thinking about doing it with a taskqueue. Whenever I receive a request, I would create a task and put it in a queue to write something to a log entity (with a date and string properties).
I need this because ... | Logger Entity in App engine | 0 | 0 | 0 | 157 |
7,275,109 | 2011-09-01T18:59:00.000 | 2 | 0 | 0 | 0 | c++,python,django,architecture,quickfix | 7,275,284 | 4 | true | 1 | 0 | Well you have to use some IPC method. One that you don't mention here is having the C++ process listen to a socket. That would add in flexibility (with slight speed cost) that the processes don't even need to be on the same machine.
I've been doing a sort of similar thing, coming from C++ but wanting to write UX in py... | 1 | 6 | 0 | We are creating a trading application, where the backend is totally in C++ (using QuickFix engine). We would like to build a web application in Django on top of this backend, where the user can place his orders. Both the Django (python) and the C++ application will be running in their own processes and address space. W... | Passing data from Django to C++ application and back | 1.2 | 0 | 0 | 3,443 |
7,275,980 | 2011-09-01T20:15:00.000 | 0 | 0 | 1 | 0 | python,regex,parsing,math,language-design | 7,302,898 | 5 | false | 0 | 0 | It turns out I can use a recursive function that recognizes letters and numbers and then when parsing expressions, say for example "x+y", it checks whether "x" and "y" are valid math. So whenever you are validating an expression, if it is a letter or a number it is valid or if it is an operator with valid stuff on eit... | 1 | 0 | 0 | I am creating a programming language in Python and one main component that I'm missing for the basic language is the ability to parse mathematical equations. I have the function to parse the math but I need to be able to check if the input is a math equation. I'm looking for a regex to match something like 3*x^(4*y)+... | Python Math Regex | 0 | 0 | 0 | 2,807 |
7,276,011 | 2011-09-01T20:18:00.000 | 0 | 0 | 0 | 0 | python,django,django-apps | 7,276,084 | 4 | false | 1 | 0 | A portal = A django project
A ads system, gallery photos, catalog of products = Apps | 2 | 1 | 0 | I want to switch from Rails to Django, to broaden my mind, and a question has bobbed up in my mind.
My Rails app is quite a mess, since my hobby-based development approach is a patch-and-glue one. I have seen very early that Django divied between a project and an app. According to their site, a project is made of many ... | What exactly are Django Apps | 0 | 0 | 0 | 538 |
7,276,011 | 2011-09-01T20:18:00.000 | 6 | 0 | 0 | 0 | python,django,django-apps | 7,276,061 | 4 | true | 1 | 0 | A django App is a fancy name for a python package. Really, that's it. The only thing that would distinguish a django app from other python packages is that it makes sense for it to appear in the INSTALLED_APPS list in settings.py, because it contains things like templates, models, or other features that can be auto-d... | 2 | 1 | 0 | I want to switch from Rails to Django, to broaden my mind, and a question has bobbed up in my mind.
My Rails app is quite a mess, since my hobby-based development approach is a patch-and-glue one. I have seen very early that Django divied between a project and an app. According to their site, a project is made of many ... | What exactly are Django Apps | 1.2 | 0 | 0 | 538 |
7,279,761 | 2011-09-02T06:05:00.000 | 7 | 0 | 0 | 0 | python,sql,performance | 7,279,821 | 5 | false | 0 | 0 | Let the DB figure out how best to retrieve the information that you want, else you'll have to duplicate the functionality of the RDBMS in your code, and that will be way more complex than your SQL queries.
Plus, you'll waste time transferring all that unneeded information from the DB to your app, so that you can filte... | 3 | 9 | 0 | I am dealing with an application with huge SQL queries. They are so complex that when I finish understanding one I have already forgotten how it all started.
I was wondering if it will be a good practice to pull more data from database and make the final query in my code, let's say, with Python. Am I nuts? Would it be ... | Should I use complex SQL queries or process results in the application? | 1 | 1 | 0 | 3,111 |
7,279,761 | 2011-09-02T06:05:00.000 | 3 | 0 | 0 | 0 | python,sql,performance | 7,280,826 | 5 | true | 0 | 0 | I would have the business logic in the application, as much as possible. Complex business logic in queries are difficult to maintain. (when I finish understanding one I have already forgotten how it all started)Complex logic in stored procedures are ok. But with a typical python application, you would want your busines... | 3 | 9 | 0 | I am dealing with an application with huge SQL queries. They are so complex that when I finish understanding one I have already forgotten how it all started.
I was wondering if it will be a good practice to pull more data from database and make the final query in my code, let's say, with Python. Am I nuts? Would it be ... | Should I use complex SQL queries or process results in the application? | 1.2 | 1 | 0 | 3,111 |
7,279,761 | 2011-09-02T06:05:00.000 | 1 | 0 | 0 | 0 | python,sql,performance | 7,282,367 | 5 | false | 0 | 0 | @Nivas is generally correct.
These are pretty common patterns
Division of labour - the DBAs have to return all the data the business need, but they only have a database to work with. The developers could work with the DBAs to do it better but departmental responsbilities make it nearly impossible. So SQL to do moret... | 3 | 9 | 0 | I am dealing with an application with huge SQL queries. They are so complex that when I finish understanding one I have already forgotten how it all started.
I was wondering if it will be a good practice to pull more data from database and make the final query in my code, let's say, with Python. Am I nuts? Would it be ... | Should I use complex SQL queries or process results in the application? | 0.039979 | 1 | 0 | 3,111 |
7,279,934 | 2011-09-02T06:30:00.000 | 0 | 0 | 1 | 0 | python,xgoogle | 58,943,849 | 3 | false | 0 | 0 | A little more googling and it appears xgoogle is no longer supported or works.
Part of the trouble is that Google changes the layout of its results pages every so often and so any scraping software that assumes some standard layout is in time doomed to failure.
There are however other search engines that are locally in... | 1 | 3 | 0 | I was using the xgoogle python library for one of my projects. It was working fine till recently. I am not getting the resultset that I used to get before. If anyone who has used this library written by Peter Krummins, faced a similar situation, can you please suggest a work around ? | xgoogle python library is not working any more? | 0 | 0 | 0 | 2,486 |
7,284,658 | 2011-09-02T14:06:00.000 | 0 | 0 | 0 | 0 | python,powerpoint | 57,909,052 | 4 | false | 0 | 1 | I agree with the accepted answer. I would like to point out that I needed to prefix the FileName string with an 'r' to treat the backslashes as literal characters. Escaping the backslashes by replacing single backslashes with double also works. @vestland this may be helpful | 1 | 3 | 0 | I have been tasked with inserting and re-sizing several hundred images to a powerpoint.
I need to use a particular source format that is similar to other power points used by our company.
I have been playing around with activepython's win32com API's and I have figured out how to open up a file and create a blank slide.... | Insert images to powerpoint slide using python (win32com.client) | 0 | 0 | 0 | 6,999 |
7,285,135 | 2011-09-02T14:43:00.000 | 0 | 0 | 0 | 0 | python,cx-oracle | 7,530,424 | 1 | true | 0 | 0 | Do you have an Oracle support contract? If I would file an SR and upload the trace to Oracle and have them tell you what it is complaining about. Those code calls are deep in their codebase from the looks of it. | 1 | 1 | 0 | My python application is dying, this oracle trace file is being generated. I am using cx_Oracle, how do I go about using this trace file to resolve this crash?
ora_18225_139690296567552.trc
kpedbg_dmp_stack()+360<-kpeDbgCrash()+192<-kpureq2()+3194<-OCIStmtPrepare2()+157<-Cursor_InternalPrepare()+298<-0000000000EA3010<-... | I have an Oracle Stack trace file Python cx_Oracle | 1.2 | 1 | 0 | 653 |
7,285,874 | 2011-09-02T15:39:00.000 | 2 | 1 | 0 | 1 | python | 7,285,945 | 2 | true | 0 | 0 | Rather than using blocking calls with long timeouts, use event-driven networking. This will allow you never to have long periods of time doing uninterruptable operations. | 1 | 1 | 0 | We are running a very large framework of python scripts for test automation and I do really miss the opportunity to kill a running python script with ctrl + c in some situations on Windows.
When the script might be doing some socket communications with long time-outs the only options sometimes is to kill the DOS window... | Make running python script more responsive to ctrl c? | 1.2 | 0 | 0 | 200 |
7,288,143 | 2011-09-02T19:06:00.000 | 7 | 1 | 0 | 0 | python,forms,pyramid,wtforms | 8,394,921 | 3 | true | 0 | 0 | I'd recommend deform. Beyond supporting form generation and validation it has great documentation, a running demo app and it supports localization and ajax. I don't believe formalchemy directly support ajax. | 1 | 9 | 0 | Since Pyramid does not have any form dependencies, I need recommendations for form handling.
This covers form generation, validation, etc.
I only know wtforms, but I dont mind to use some other thing more advanced. | Form handling in Pyramid | 1.2 | 0 | 0 | 3,636 |
7,288,543 | 2011-09-02T19:47:00.000 | 3 | 0 | 0 | 0 | python,wxpython | 7,291,001 | 1 | true | 0 | 1 | The wx demo has an image example, under Using Images|Image. It shows how to convert and display a jpg, and other types as well. If you don't already have the demo, you can get it from the main wx download page. | 1 | 0 | 0 | All the examples I've seen seem very complicated.
Thanks! | What is the easiest way to display a JPG using wxPython? | 1.2 | 0 | 0 | 399 |
7,290,370 | 2011-09-03T00:27:00.000 | 1 | 0 | 1 | 0 | python,matplotlib | 8,822,734 | 5 | false | 0 | 0 | I produced figures for a number of papers using matplotlib. Rather than thinking of saving the figure (as in MATLAB), I would write a script that plotted the data then formatted and saved the figure. In cases where I wanted to keep a local copy of the data (especially if I wanted to be able to play with it again) I fou... | 2 | 50 | 1 | I work in an psudo-operational environment where we make new imagery on receipt of data. Sometimes when new data comes in, we need to re-open an image and update that image in order to create composites, add overlays, etc. In addition to adding to the image, this requires modification of titles, legends, etc.
Is th... | Store and reload matplotlib.pyplot object | 0.039979 | 0 | 0 | 43,605 |
7,290,370 | 2011-09-03T00:27:00.000 | 0 | 0 | 1 | 0 | python,matplotlib | 7,843,630 | 5 | false | 0 | 0 | Did you try the pickle module? It serialises an object, dumps it to a file, and can reload it from the file later. | 2 | 50 | 1 | I work in an psudo-operational environment where we make new imagery on receipt of data. Sometimes when new data comes in, we need to re-open an image and update that image in order to create composites, add overlays, etc. In addition to adding to the image, this requires modification of titles, legends, etc.
Is th... | Store and reload matplotlib.pyplot object | 0 | 0 | 0 | 43,605 |
7,293,290 | 2011-09-03T13:09:00.000 | 0 | 0 | 0 | 0 | python,apache,memory-management,mod-wsgi | 7,293,404 | 2 | false | 1 | 0 | All Python globals are created when the module is imported. When module is re-imported the same globals are used.
Python web servers do not do threading, but pre-forked processes. Thus there is no threading issues with Apache.
The lifecycle of Python processes under Apache depends. Apache has settings how many child pr... | 1 | 4 | 0 | In a regular application (like on Windows), when objects/variables are created on a global level it is available to the entire program during the entire duration the program is running.
In a web application written in PHP for instance, all variables/objects are destroyed at the end of the script so everything has to be... | Memory model for apache/modwsgi application in python? | 0 | 1 | 0 | 193 |
7,294,218 | 2011-09-03T16:06:00.000 | 5 | 1 | 0 | 0 | python,active-directory | 7,365,734 | 3 | true | 0 | 0 | To unlock a user, you need to set the lockoutTime attribute to 0. | 1 | 0 | 0 | I recently implemented password reset on AD using python ldap module.
This involved passing modified attributes in this manner:
add_pass = [(ldap.MOD_REPLACE, "unicodePwd", )]
This worked since the passwords on AD are stored in attribute "unicodePwd".
Now I want to unlock a locked user account but I cannot find the att... | unlocking Locked user accounts on Active Directory using Python ldap module | 1.2 | 0 | 0 | 6,179 |
7,296,159 | 2011-09-03T22:10:00.000 | 0 | 0 | 0 | 0 | python,django,django-sessions | 70,458,388 | 5 | false | 1 | 0 | I know this post is old but I tried this command/attribute and it worked for me.
In the 'base.html' file, I inserted:
{{ request.session.clear_expired }}
This clears expired records from the django_session table when the user clicks on any link in the template after the session expires.
Even so, it is necessary to crea... | 1 | 44 | 0 | Does this table need to be purged or is it taken care of automatically by Django? | Session database table cleanup | 0 | 0 | 0 | 26,514 |
7,296,987 | 2011-09-04T02:02:00.000 | 1 | 0 | 1 | 0 | python,transition,pygame,blit | 7,300,851 | 3 | false | 0 | 1 | Here, what is wanted is to be able to share the variables between two different applications: 2 different scripts with event loops, blits, etc. So by definition, they should be on different process (if they must be running at the same time).
There is two major ways of doing this:
1 - Client-Server Architecture (like a ... | 2 | 1 | 0 | Sorry if this question is incredibly easy to answer, or I sound like an idiot. I'm wondering how I would execute a script in one file, pygame event loop, blits, etc, then switch to another file, SelectWorld.py, which has it's own event loop, and blits, and etc. If I just call it's main function, does it create any slow... | Python/Pygame transitioning from one file to another | 0.066568 | 0 | 0 | 790 |
7,296,987 | 2011-09-04T02:02:00.000 | 0 | 0 | 1 | 0 | python,transition,pygame,blit | 10,609,284 | 3 | true | 0 | 1 | Turns out the answer to this was painfully simple, and I asked this back when I was just learning Python. There is no speed downgrade from just calling a function from another file and letting it do all the work. Thanks for all the answers, guys. | 2 | 1 | 0 | Sorry if this question is incredibly easy to answer, or I sound like an idiot. I'm wondering how I would execute a script in one file, pygame event loop, blits, etc, then switch to another file, SelectWorld.py, which has it's own event loop, and blits, and etc. If I just call it's main function, does it create any slow... | Python/Pygame transitioning from one file to another | 1.2 | 0 | 0 | 790 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.