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
5,060,382
2011-02-20T22:02:00.000
1
0
0
0
python,client-side
9,805,718
5
false
1
0
skulpt is an interesting new project
3
1
0
Is there any way to get Python to run on a web browser, other than silverlight? I'm pretty sure not, but it never hurts to ask (usually).
web: client-side python?
0.039979
0
1
717
5,061,325
2011-02-21T00:57:00.000
2
0
1
0
python,introspection
5,061,542
4
false
0
0
I wrote a documentation validator that runs tests on PDF files to check for various problems with them. The tests are methods of special classes that represent Subversion branches, products, manuals, and arbitrary groupings of various types. The validator engine uses introspection to find these special classes, instan...
3
15
0
I have been programming mainly in PHP, and I am trying to make a switch to python. I am skilled with PHP, and I have never needed to use introspection / introspection like capabilities. What good is code introspection, and in what situations would I find it indispensable? Here is the only way I find it useful: From...
How is introspection useful?
0.099668
0
0
6,123
5,061,325
2011-02-21T00:57:00.000
1
0
1
0
python,introspection
63,227,987
4
false
0
0
A little bit late on this, but another example of introspection in use is with Active Record (a Ruby library that maps objects to database tables). Active Record uses introspection to look at the name of the class, determine the associated table, and defines methods that access object attributes after inferring their n...
3
15
0
I have been programming mainly in PHP, and I am trying to make a switch to python. I am skilled with PHP, and I have never needed to use introspection / introspection like capabilities. What good is code introspection, and in what situations would I find it indispensable? Here is the only way I find it useful: From...
How is introspection useful?
0.049958
0
0
6,123
5,061,325
2011-02-21T00:57:00.000
14
0
1
0
python,introspection
5,061,360
4
true
0
0
Suppose you are given a custom object and you want to know if the object has certain attributes or has as a certain method, then the introspection function such as hasattr can be used to find that out. Also like the DiveintoPython book already illustrates, suppose you are building a GUI Editor with Auto-Completion feat...
3
15
0
I have been programming mainly in PHP, and I am trying to make a switch to python. I am skilled with PHP, and I have never needed to use introspection / introspection like capabilities. What good is code introspection, and in what situations would I find it indispensable? Here is the only way I find it useful: From...
How is introspection useful?
1.2
0
0
6,123
5,061,874
2011-02-21T03:04:00.000
1
0
1
0
python,python-3.x,installation
5,064,024
2
true
0
0
No, installing the modules you have installed in 3.1 should be all you need to do. Also of course, if you are compiling from scratch, make sure you have all the libraries installed you have when you compiled 3.1, as some of the standard lib otherwise may be unavailable.
2
2
0
I'm upgrading from 3.1 to 3.2. Other than looking at 3.1's site-packages directory to see what packages I've been using so that I can install them for 3.2, are there other places I should check for things to install or other issues to look at? I'm not asking about changes to the language between 3.1 and 3.2. I just wa...
Upgrading python 3.1 to 3.2
1.2
0
0
640
5,061,874
2011-02-21T03:04:00.000
0
0
1
0
python,python-3.x,installation
5,062,006
2
false
0
0
You should be able to install 3.2 in parallel with 3.1, simply by putting it in a different directory. Then if at some point you find you are missing something from your environment you can always figure out what you had before. Nearly everything you installed that's Python-related should be in site-packages, so it sho...
2
2
0
I'm upgrading from 3.1 to 3.2. Other than looking at 3.1's site-packages directory to see what packages I've been using so that I can install them for 3.2, are there other places I should check for things to install or other issues to look at? I'm not asking about changes to the language between 3.1 and 3.2. I just wa...
Upgrading python 3.1 to 3.2
0
0
0
640
5,063,037
2011-02-21T06:37:00.000
23
0
1
0
python,matlab,numpy,scipy
5,065,585
6
false
0
0
I have found python+numpy+scipy+matplotlib+IPython+[random sci/numerical packages] to be almost a complete replacement for matlab. There are certainly some packages missing, so if there is a specialized set of tools that are available in matlab but not in python, this might be an issue, but otherwise, I haven't looked ...
2
10
0
I recently have been considering switching to the Python programming language. Currently, Matlab is the language of choice in my department for rapid development and prototyping of code. It’s very good at this, but Mathworks (the company who produces Matlab) have been tinkering with the licencing terms, leading to ha...
Should i switch to Python?
1
0
0
11,007
5,063,037
2011-02-21T06:37:00.000
11
0
1
0
python,matlab,numpy,scipy
5,063,196
6
false
0
0
The choice comes down to cost. If you are happy paying for Matlab - especially if you use the toolboxes - you will likely find Python doesn't provide such an integrated package. Having a matrix as the basic data type makes Matlab an intuitive language for many mathematical tasks. Personally, I find the this coupled wit...
2
10
0
I recently have been considering switching to the Python programming language. Currently, Matlab is the language of choice in my department for rapid development and prototyping of code. It’s very good at this, but Mathworks (the company who produces Matlab) have been tinkering with the licencing terms, leading to ha...
Should i switch to Python?
1
0
0
11,007
5,063,165
2011-02-21T06:57:00.000
1
0
1
0
python
5,063,247
2
true
0
0
Before I tried it, I thought Python was about as deep as the characters from its namesake "Monty Python's Flying Circus" ... was I ever mistaken! It's got the lot and more, and is very well documented, and consistant and simple in its format... How much will you benefit from it? Probably a lot, because as you say, ...
1
1
0
Need to know why would someone move to python, well may be for intrest of learning new thing ( i have that intrest) but what i will get if i learned python, why should i use python i am not starting a debate here on which is better language or anything like that. just need to know the speciality of python that makes it...
move to python?
1.2
0
0
265
5,063,658
2011-02-21T08:17:00.000
1
0
0
0
python,database,django,django-models,coding-style
5,064,564
2
true
1
0
I recommend extending Django's Model-Template-View approach with a controller. I usually have a controller.py within my apps which is the only interface to the data sources. So in your above case I'd have something like get_all_parties_and_people_for_user(user). This is especially useful when your "data taken from seve...
2
3
0
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a...
Correct way of implementing database-wide functionality
1.2
1
0
110
5,063,658
2011-02-21T08:17:00.000
0
0
0
0
python,database,django,django-models,coding-style
5,065,280
2
false
1
0
User.get_attended_birthday_parties() or Event.get_attended_parties(user) work fine: it's an interface that makes sense when you use it. Creating an additional "all-purpose" object will not make your code cleaner or easier to maintain.
2
3
0
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a...
Correct way of implementing database-wide functionality
0
1
0
110
5,065,892
2011-02-21T12:26:00.000
2
0
0
0
python,forms,plone,ploneformgen
5,065,975
3
false
1
0
All PFG types, adapters etc. are all based on Archetypes. Related example code can be found in PloneFormGen/content. The saveDataAdapter.py or fields.py files provide reasonable example code...
1
3
0
Are there any example add-ons where to look at when one would like to 1) Create custom action adapters for PloneFormGen 2) Add new field types to PloneFormGen
Extending PloneFormGen
0.132549
0
0
983
5,066,357
2011-02-21T13:12:00.000
2
0
0
1
python,google-app-engine
5,720,652
4
false
1
0
I use GQL to query a find the Entity and if exists update de atribute. result = db.GqlQuery('select name from Person where name = "tadeu"') if result: for r in result: r.attribute = "value" r.put()
1
4
0
How to update existing record in app engine.
Update app engine entity
0.099668
0
0
6,215
5,066,530
2011-02-21T13:28:00.000
1
1
0
1
python,project,upgrade,pylons
5,067,114
1
false
1
0
might be obvious but did you run "python setup.py develop" on the application package so that the dependencies could be installed?
1
2
0
I have an old project, it written under Python 2.5/2.6, Windows. We had Python 2.6/Win7/x64 now, and I tried to start it. I got the old project that running nondebug mode in a server, and copied into local folder. When I tried to yesterday start it, I got this error: 15:44:58,038 DEBUG [pylons.configuration] Loade...
Pylons - how to use an old project in a new environment?
0.197375
0
0
68
5,066,569
2011-02-21T13:30:00.000
3
0
0
0
python,database-design,postgresql,psycopg2
5,066,699
1
false
0
0
If I understand this "...I have been iterating over the update methods" it sounds like you are updating the database rows as you go? If this is so, consider writing some code that passes the XML, accumulates the totals you are tracking, outputs them to a file, and then loads that file with COPY. If you are updating ex...
1
0
0
So I am trying to take a large number of xml files (None are that big in particular and I can split them up as I see fit.) In all there is about 70GB worth of data. For the sake of reference the loading script is written in python and uses psycopg2 to interface with a postgres table. Anyway, what I am trying to do is ...
Efficiently creating a database to analyze relationships between information
0.53705
1
0
126
5,067,578
2011-02-21T15:08:00.000
5
0
0
0
python,user-interface
5,067,597
6
false
0
1
Have you tried Qt? It is a cross platform C++ GUI toolkit for higher level language (PyQt). And it seemed very simple to me.
3
2
0
I have a little programming experience and I did get to work with Swing (Java) and wxPython. Some years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the on...
Why are there no simple, cross-platform, C/C++ GUI tookits for higher level languages?
0.16514
0
0
653
5,067,578
2011-02-21T15:08:00.000
0
0
0
0
python,user-interface
5,067,655
6
false
0
1
My guess is that windows developers couldn't be bothered as they have wpf etc and linux developers couldn't be bothered as they are used to it. So only people who are sick of win developement and moving to linux would embrace it. Maybe its time for you to start an open source project :) I was thinking something like wp...
3
2
0
I have a little programming experience and I did get to work with Swing (Java) and wxPython. Some years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the on...
Why are there no simple, cross-platform, C/C++ GUI tookits for higher level languages?
0
0
0
653
5,067,578
2011-02-21T15:08:00.000
2
0
0
0
python,user-interface
5,067,669
6
false
0
1
What you ask is a simple lib with enormous flexibility. Be able to build 3 * 3 executables, having good documentation and using other libraries all with a different background. And all of that on different OS platforms. It is quite a challenge it think QT would com the closest but it does not meet all your criteria.
3
2
0
I have a little programming experience and I did get to work with Swing (Java) and wxPython. Some years ago, I ended up having to port an app I did to OS X and all the problems I've had with wxPython just multiplied. I've started looking at alternatives and I could not find anything better than wxPython. QT was the on...
Why are there no simple, cross-platform, C/C++ GUI tookits for higher level languages?
0.066568
0
0
653
5,068,508
2011-02-21T16:31:00.000
0
0
1
0
python,multithreading,dynamic,multiprocessing,dynamic-linking
5,068,825
3
false
0
0
The best answer I can give you is "not impossible, but I don't know if it happens". You have to think about what is actually happening. When you encounter a .py file, Python has to read the file, compile it, and then execute byte code. Compilation takes place inside of the process, and so can't be shared. When you en...
2
3
0
As I understand there are two types of modules in python (CPython): - the .so (C extension) - the .py The .so are only loaded once even when there are different processes/interpreters importing them. The .py are loaded once for each process/interpreter (unless reloading explicitly). Is there a way .py can be shared ...
Python Shared Libraries
0
0
0
1,279
5,068,508
2011-02-21T16:31:00.000
0
0
1
0
python,multithreading,dynamic,multiprocessing,dynamic-linking
5,068,669
3
false
0
0
No, there is no way. Python is so highly dynamic that each process that I'm not sure it would make any sense anyway, as you could monkey-patch the modules, for example. Perhaps there would be a way to share the code anyway, but the benefit would be very small for something that is likely to be a lot of work.
2
3
0
As I understand there are two types of modules in python (CPython): - the .so (C extension) - the .py The .so are only loaded once even when there are different processes/interpreters importing them. The .py are loaded once for each process/interpreter (unless reloading explicitly). Is there a way .py can be shared ...
Python Shared Libraries
0
0
0
1,279
5,069,495
2011-02-21T18:02:00.000
0
0
0
0
javascript,python,ajax,django,performance
5,069,558
2
false
1
0
Always include them directly if you have the choice, it will give a considerable benefit to page load speed.
2
3
0
I'm using JavaScript with jQuery, talking to a Django back end. There are some UI needs that require Ajax, because we can't know what data to send until the user gives some input. However, there is other data that is known at template time. What are the pros and cons of including that data in the template directly, ins...
Ajax v. including data in the HTML
0
0
0
196
5,069,495
2011-02-21T18:02:00.000
3
0
0
0
javascript,python,ajax,django,performance
5,069,704
2
true
1
0
The obvious answer in MOST applications is to include them directly, although I would always recommend treating every usage per its own needs. Remember that 'page load speed' is as much perception as it is a measurable stat, especially when dealing with ajax functionality. Example You have loads and loads of data to d...
2
3
0
I'm using JavaScript with jQuery, talking to a Django back end. There are some UI needs that require Ajax, because we can't know what data to send until the user gives some input. However, there is other data that is known at template time. What are the pros and cons of including that data in the template directly, ins...
Ajax v. including data in the HTML
1.2
0
0
196
5,070,055
2011-02-21T19:03:00.000
1
1
0
0
python,notifications,plone
5,070,368
4
false
1
0
You can easily customize the registered.pt template add a simple call to a PythonScript sending out an email through the MailHost api. Doing a proper customization of plone.app.users.browser.register.py is much more complex.
3
2
0
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like...
Is there an easy way in Plone to get email notifications when new users join the portal?
0.049958
0
0
1,115
5,070,055
2011-02-21T19:03:00.000
1
1
0
0
python,notifications,plone
5,146,475
4
false
1
0
You can also just have login_next traverse to a Controller Python Script (you'll fine other similar ones in the /plone_login area of the core Plone product that end with the extension '.cpy') that you write that sends the email (perhaps notifyMangersUponLogin ) rather than it's default of traversing to login_success. T...
3
2
0
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like...
Is there an easy way in Plone to get email notifications when new users join the portal?
0.049958
0
0
1,115
5,070,055
2011-02-21T19:03:00.000
0
1
0
0
python,notifications,plone
5,318,895
4
false
1
0
If you want to do it the right way, follow Martijn's directions above. If you want another dirty solution, do the following: make a copy of register.cpy insert the following code: context.MailHost.send('Content-Type: text/plain\n\n' + 'User has registered: ' + str(username), mfrom='me@gmail.com', ...
3
2
0
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like...
Is there an easy way in Plone to get email notifications when new users join the portal?
0
0
0
1,115
5,071,365
2011-02-21T21:16:00.000
0
0
0
0
python,django,caching
5,072,157
2
false
1
0
Not quite what you are after, but johnny-cache will cache querysets, automatically invalidating on writes. It may do enough of what you are after: and it is no work to use after setting up.
1
4
0
My question is about best practices for caching database updates in Django. I'm writing a ticketing system. I have a Ticket model and an Update model. Each time a user adds an update to a ticket, an Update is created and linked as foreign key to the Ticket. I have a TicketDetail view, that shows the Ticket descriptio...
Django caching for web applications
0
0
0
1,151
5,072,066
2011-02-21T22:35:00.000
2
0
0
1
python,mysql,django,macos
5,072,940
2
true
1
0
I eventually managed to solve the problem by Installing python 2.7 with Mac Ports and installing mysqldb using Mac Ports - was pretty simple after that.
2
2
0
I am using Python 2.7 and trying to get a Django project running on a MySQL backend. I have downloaded mysqldb and followed the guide here:http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/ Yet when I go to run the django project the following traceback occurs: Traceback (most recent call last): ...
Python mysqldb on Mac OSX 10.6 not working
1.2
1
0
1,535
5,072,066
2011-02-21T22:35:00.000
0
0
0
1
python,mysql,django,macos
5,305,496
2
false
1
0
you needed to add the MySQL client libraries to the LD_LIBRARY_PATH.
2
2
0
I am using Python 2.7 and trying to get a Django project running on a MySQL backend. I have downloaded mysqldb and followed the guide here:http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/ Yet when I go to run the django project the following traceback occurs: Traceback (most recent call last): ...
Python mysqldb on Mac OSX 10.6 not working
0
1
0
1,535
5,072,519
2011-02-21T23:36:00.000
2
0
1
0
python
5,072,633
3
false
0
0
I assume when you say "no answers", you mean no code. Open the file. Read the command line argument (n). Create a list (x). Enter a loop, executed n times. Read n entries from the file into another list (y) (probably a sub-loop). Add list y to list x. Breaking things into individual small goals like that often make...
2
1
0
Write a function table() that takes a parameter a string representing a file name and a number n. The function should open and read the contents of the corresponding file. The file will contain one line with exactly n*n numbers separated by blank spaces. The function table() should create and return an n x n two-dim...
function that produces a two dimensional list from files containing numbers
0.132549
0
0
510
5,072,519
2011-02-21T23:36:00.000
0
0
1
0
python
5,072,530
3
false
0
0
Pointers: Create an n*n size matrix, use a two nested for loops from 0 to n-1 and read each element sequentially into [i][j] where i is the iterator in the outer loop and j the one in the inner loop.
2
1
0
Write a function table() that takes a parameter a string representing a file name and a number n. The function should open and read the contents of the corresponding file. The file will contain one line with exactly n*n numbers separated by blank spaces. The function table() should create and return an n x n two-dim...
function that produces a two dimensional list from files containing numbers
0
0
0
510
5,073,054
2011-02-22T01:06:00.000
1
0
0
0
python,wxpython,focus
5,082,357
2
false
0
1
That seems a little counter-intuitive. However, you can also simulate this by creating and showing the second frame and then calling Raise() on the original frame.
1
2
0
How do I make a newly created window in wxPython not take focus? I'd like to be able to create a new window, without focus jumping to it.
Preventing New Windows from Capturing Focus wxPython
0.099668
0
0
527
5,073,575
2011-02-22T03:01:00.000
0
1
0
0
python,ip-address,connect,smtplib
5,073,815
2
true
0
0
No such option - at least not without hacking smtplib.connect() yourself.
1
1
0
On a host with multiple network interfaces, is it possible to bind the connect method from the Python smtplib to an specific source address?
Python smtplib: bind to specific source IP address in a machine with multiple network interfaces
1.2
0
1
984
5,074,537
2011-02-22T05:52:00.000
1
0
0
0
python,django,django-authentication,django-apps
5,085,483
1
true
1
0
There shouldn`t be any problems there. Django-Socialauth adda new auth backends, and it should works fine with permissions and decorators. And Django resistration just register a user on site, so unless you remove standard auth backend, it will work fine too.
1
0
0
Have anyone used these 2 django apps together? I want to know how well these 2 gel together along with Django's User Authentication system. When I mean Django's User Authentication System, I mean I should be able to use decorators like @login_required or grant permission to specific views (or functions in views.py) bas...
Django-registration & Django-Socialauth
1.2
0
0
529
5,074,899
2011-02-22T06:39:00.000
1
0
1
0
python,pylons,virtualenv,pyramid
5,079,226
3
false
0
0
this isn't really specific to pyramid. you need to look into version control. get a free account on github or bitbucket and push/pull your code from there.
1
3
0
I'm really interested in trying out the Pyramid Framework but only half of my programming time is spent on my computer here at home; I spend a considerable amount of time at school and use their computers as well, and according to the documentation for virtualenv, environments can't be moved around like projects. What...
Python, virtualenv - Is it possible to use a single Pyramid project with multiple virtualenvs on different computers?
0.066568
0
0
678
5,075,232
2011-02-22T07:23:00.000
1
0
1
0
python,qt,pyqt,pyqt4
5,077,111
1
true
0
1
That might somehow be possible by overwriting QTabWidget, but I think the much cleaner, faster and easier solution would be to combine QComboBox and QStackedWidget to a new widget.
1
1
0
Is it possible to convert a QTabBar inside the QTabWidget into a QComboBox?
Is it possible to convert a QTabBar inside the QTabWidget into a QComboBox?
1.2
0
0
161
5,077,336
2011-02-22T11:12:00.000
1
0
0
1
python,google-app-engine,yaml
5,077,700
1
true
1
0
you should put your static files into some directory, for example staticdata then your app.yaml would look like: application: temp version: 1 runtime: python api_version: 1 handlers: - url: /staticdata static_dir: staticdata - url: /.* script: temp.py
1
1
0
I registered a Google App Engine app and I have some files below: /index.html /tabs.css /tab.js /temp.py How should I write the app.yaml file?
How to write `app.yaml` file for Google App Engine app?
1.2
0
0
1,439
5,078,338
2011-02-22T12:51:00.000
4
0
0
0
python,sockets,dns
5,078,532
2
true
0
0
Please correct me, if I'm wrong, but isn't this operating system's responsibility? gethostbyaddr is just a part of libc and according to man: The gethostbyname(), gethostbyname2() and gethostbyaddr() functions each return a pointer to an object with the following structure describing an internet host refer- ...
1
5
0
is there any way to specify dns server should be used by socket.gethostbyaddr()?
python: how to tell socket.gethostbyaddr() which dns server to use
1.2
0
1
5,038
5,078,749
2011-02-22T13:28:00.000
0
0
0
0
python,ftp,nat
5,078,819
1
true
0
0
To do this without a server you could setup port forwarding on one of the NAT routers. e.g. machine1 behind nat1, machine2 behind nat2. Setup a port on nat1 forward to the FTP port of machine1. You should then be able to FTP from machine2 using the public IP address of nat1. Use passive mode FTP to avoid having to open...
1
0
0
I have 2 computers behind diferent NAT's and FTP-server. How can i connect computers to each other without server program? I read about STUN and UDP hole punching, but as i see, it needs some server side program, isn't it? It's will be used in python program.
Can I connect 2 NAT-covered computers using FTP?
1.2
0
1
493
5,079,885
2011-02-22T15:09:00.000
5
0
0
1
python,google-app-engine,google-cloud-datastore
5,079,939
3
true
1
0
Assuming you have a DateProperty on the entities indicating when the election ended, you can have a cron job search for any older than 3 months every night and delete them.
1
3
0
I'm building my first app with GAE to allow users to run elections, and I create an Election entity for each election. To avoid storing too much data, I'd like to automatically delete an Election entity after a certain period of time -- say three months after the end of the election. Is it possible to do this automa...
Automatic deletion or expiration of GAE datastore entities
1.2
1
0
2,483
5,080,844
2011-02-22T16:23:00.000
0
0
0
1
python,django,google-app-engine,django-nonrel
5,083,039
2
false
1
0
Does Django signals work on google app engine ? Yes, as long as you save those models use the Model.save()
2
1
0
Does Django signals work on google app engine ? I am using django-nonrel. Thanks
django signal on GAE
0
0
0
124
5,080,844
2011-02-22T16:23:00.000
0
0
0
1
python,django,google-app-engine,django-nonrel
5,080,893
2
true
1
0
Works fine. Signals do not use the db.
2
1
0
Does Django signals work on google app engine ? I am using django-nonrel. Thanks
django signal on GAE
1.2
0
0
124
5,081,499
2011-02-22T17:19:00.000
2
0
0
0
python,windows,tk,turtle-graphics,activepython
5,137,220
2
false
0
1
The immediate cause of the freeze is that the Tk event loop is not being serviced. Without that, Tk windows do not display or update correctly (all GUI toolkits are event based, but Tk is particularly so). Unfortunately, I don't know Python's Tk binding or IDLE nearly well enough to be able to say what that is caused b...
2
2
0
I've installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opened (with Tk icon), which freezes and shows nothing. What could be wrong?
Why ActivePython freezes after I use the turtle module?
0.197375
0
0
906
5,081,499
2011-02-22T17:19:00.000
0
0
0
0
python,windows,tk,turtle-graphics,activepython
5,092,475
2
false
0
1
Partially resolved by not running it in IDLE, I execute it as a python script and wait for input to see what is drawn.
2
2
0
I've installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opened (with Tk icon), which freezes and shows nothing. What could be wrong?
Why ActivePython freezes after I use the turtle module?
0
0
0
906
5,081,501
2011-02-22T17:19:00.000
2
0
1
0
python
5,081,579
1
true
0
0
The PATH doesn't affect where data files are found. (And your script is a data file as far as Windows is concerned). You should cd C:\Path\to\folder\with\your\scripts when you open your command prompt, and then you'll be able to python myscript.py from there. (You might like to make a dedicated shortcut to the command ...
1
0
0
I'm "new school" meaning that i've never really used the command prompt(they didn't teach us anything but IDE's in school). I would like to setup Python using Notepad++ for the editor, and winpdb as my debugger. I want stuff to work really easy from the cmd prompt but it is not. This is what I put in my System Environm...
Python command line SETUP for ABSOLUTE BEGINNER with Python
1.2
0
0
548
5,082,642
2011-02-22T19:03:00.000
0
0
0
0
python,canvas,widget,scroll,tkinter
5,082,704
1
true
0
1
The solution is pretty simple: bind to the <Configure> event of the canvas -- this will cause your callback to be called whenever the canvas widget is resized. You then simply need to get the width of the canvas and use that to iteratively resize all the embedded windows.
1
1
0
I'm using Python Tkinter and I want to place a variable number of text box widgets in a frame or canvas. The text boxes are packed vertically down the frame, so the first one is on top, the second one is found below, etc.. I can have all the button, listbox, etc widgets in a "left section" of the GUI, while a "right se...
Python Tkinter - Scrollable canvas containing expandable widgets
1.2
0
0
1,473
5,083,701
2011-02-22T20:40:00.000
0
0
0
0
python,networking,project
5,618,464
2
false
0
0
My first net project was a web spider that traversed the web (Obviously), and created a DB to be used as a search engine. Spider & web search engine in Python (I used mod_python for the web page, but I'd recommend Django), and the DB in MySQL. Create a GUI for managing the DB or Spider (Or both, up to you). Ended up us...
1
2
0
I was wondering if you guys know any websites or have any ideas on beginner-intermediate level Python network programming projects/practice problems to practice Python network programming? I just finished reading "Foundations of Python Network Programming" and am looking for practice assignments that aren't too difficu...
Python network programming project?
0
0
1
4,415
5,083,824
2011-02-22T20:51:00.000
2
0
1
0
ironpython
5,084,686
1
false
1
0
For paths, you can set the IRONPYTHONPATH environment variable; it's a semi-colon separated list of paths that are added sys.path on startup. For imports, I like -i option: create a .py file that has your common imports, and run it with ipy -i myscript.py (I would recommend creating a batch file for that). You could al...
1
1
0
Everytime i start up the IronPython console to do some playing, the first thing i find myself doing is sys.path.append('myscripts') How can i have the console load default stuff such as appending paths, importing .NET stuff -- that way i dont have to type it in everytime i launch the console. thank you.
How can i setup default paths, variables, etc when i launch the IronPython Console?
0.379949
0
0
163
5,084,512
2011-02-22T22:00:00.000
1
0
1
0
python,setuptools
5,084,538
2
false
0
0
You might want to look into virtualenv. It lets you have a "virtual environment" for Python that would eliminate this need in the future. As for getting the old libs on the new system, you can check the PYTHONPATH environment variable and/or sys.path from the interpreter to see what all paths are searched and you can...
1
1
0
My windows laptop is being replaced due to some hardware problems. I've spent the last two years installing third party libraries every so often, which I'll need to reinstall on the new machine. I just need to: Generate a list of third party python libs current installed Reinstall those on the new machine My though...
What is an efficient way to reinstall all my python libraries after baselining my windows pc?
0.099668
0
0
150
5,084,578
2011-02-22T22:07:00.000
1
0
0
0
python,nlp,nltk,named-entity-recognition
6,637,984
2
false
0
0
I haven't used NLTK enough recently, but if you have words that you know are skills, you don't need to do NER- just a text search. Maybe use Lucene or some other search library to find the text, and then annotate it? That's a lot of work but if you are working with a lot of data that might be ok. Alternatively, you cou...
1
4
1
I try to do named entity recognition in python using NLTK. I want to extract personal list of skills. I have the list of skills and would like to search them in requisition and tag the skills. I noticed that NLTK has NER tag for predefine tags like Person, Location etc. Is there a external gazetter tagger in Python I c...
Named Entity Recognition from personal Gazetter using Python
0.099668
0
0
2,226
5,085,099
2011-02-22T23:02:00.000
0
0
0
0
python,django,production-environment
48,786,643
3
false
1
0
Steps to get your Django App from development to Production open your project folder then find settings.py find the following line, SECURITY WARNING: don't run with debug turned on in production! DEBUG = False Change the debug to false. Change your db credentials with the actual production server db credentials in y...
1
1
0
I've been developing a django web-application for three months now, and I'd like to set it to production. I'm currently using South as database schema manager and I haven't got any clue on how to export my application databases schemas and content, and my project code to another directory; in order to set my production...
Exporting a development django application to production
0
0
0
2,805
5,085,365
2011-02-22T23:38:00.000
0
1
1
0
python,objective-c,datetime,serialization,date
5,085,395
2
false
0
0
Yes, Python supports creating Date objects from Unix epoch time (although I'm not 100% sure it's in seconds, may be in ms) Most languages should have built-in support for Unix time, and if not it wouldn't be hard to create a function to do so.
1
1
0
Seems simple but I just don't know. I'm interested in serializing a date to a string or integer and sending it from Objective-C to Python, and I want to know if there's a way I should be doing it. Sending the integer seconds since the Unix epoch seems pretty reasonable (and NSDate supplies that readily) but does Python...
Are there standard rules and practices for Date serialization between two languages or frameworks?
0
0
0
125
5,085,571
2011-02-23T00:04:00.000
0
0
1
0
python
5,085,651
1
false
0
0
The first process that requests exclusive access to a file is the one that determines whether or not other processes can also have access to the file. A process that comes along later (such as your script) has no say in it.
1
1
0
How do I open a file with shared permission in python? There's another process already opens the file that my python script tries to write something to it. I am using open() but it doesn't seem to open the file with shared permission because I can't write anything to the file.
open a file with shared permission
0
0
0
561
5,086,239
2011-02-23T02:03:00.000
4
0
0
1
python,google-app-engine,editor,directory,yaml
5,086,257
3
true
1
0
Why not use your favorite editor? Textmate or gvim or emacs anything should do here. All them support Python and YAML syntax.
2
2
0
What editors are best for use with the "Edit" button in GoogleAppEngineLauncher for Mac? A good editor would preferably be able to edit Python and YAML and be able to open directories.
Editor for use with GoogleAppEngineLauncher on Mac
1.2
0
0
226
5,086,239
2011-02-23T02:03:00.000
0
0
0
1
python,google-app-engine,editor,directory,yaml
5,087,788
3
false
1
0
Have you tried TextWrangler or jEdit? You can get the links to them on Apple site or you can google for them. They are pretty good editors.
2
2
0
What editors are best for use with the "Edit" button in GoogleAppEngineLauncher for Mac? A good editor would preferably be able to edit Python and YAML and be able to open directories.
Editor for use with GoogleAppEngineLauncher on Mac
0
0
0
226
5,086,409
2011-02-23T02:32:00.000
0
0
1
0
python,heap,a-star
10,536,160
3
false
0
0
I always end up implementing my own version of a Heap type, for the exact reason that you can't actually search in a Heap, while all efficient methods require "a pointer to the element" as input. Usually, I implement my Heap as a combination of an unstructured container of Items, and a Heap of pointers (or indeces) to...
2
4
0
Here is my scenario. I want to implement A* (in Python) without having to resort to linear-time min or in operations. I need a heap to be able to efficiently get the lowest weight item. My immediate response was 'Easy! I'll use heapq!' Then I discovered that life is rarely as simple as we would like it to be. It turns...
Heap that supports modification of its elements?
0
0
0
2,083
5,086,409
2011-02-23T02:32:00.000
0
0
1
0
python,heap,a-star
5,086,476
3
false
0
0
It's true, neither the heap functions in heapq nor Queue.PriorityQueue are very functional. It probably takes about equal time to either A: write a rant on your blog or B: implement one yourself.
2
4
0
Here is my scenario. I want to implement A* (in Python) without having to resort to linear-time min or in operations. I need a heap to be able to efficiently get the lowest weight item. My immediate response was 'Easy! I'll use heapq!' Then I discovered that life is rarely as simple as we would like it to be. It turns...
Heap that supports modification of its elements?
0
0
0
2,083
5,086,524
2011-02-23T02:54:00.000
0
0
0
0
asp.net,python,selenium-rc
5,086,635
1
true
1
0
Ok, I upgrade my selenium-server to 2.0b2, now it's ok.
1
0
0
I use selenium-rc to test an asp.net website, test script is written in Python and the browser is Firefox 3.6. But When selenium open the first page of the website, A download dialog appear, not the web page, seems the page is proccessed as application/octet-stream, this cause my test script can not run successfully. S...
Why selenium can not open some asp page?
1.2
0
1
218
5,088,671
2011-02-23T08:47:00.000
0
0
1
0
java,python,mysql,binary,byte
31,187,500
3
false
0
0
I found ''.join(map(lambda x: chr(x % 256), data)) to be painfully slow (~4 minutes) for my data on python 2.7.9, where a small change to str(bytearray(map(lambda x: chr(x % 256), data))) only took about 10 seconds.
1
1
0
I know that if I figure this one out or if somebody shows me, it'll be a forehead slapper. Before posting any questions, I try for at least three hours and quite a bit of searching. There are several hints that are close, but nothing I have adopted/tried seems to work. I am taking a byte[] from Java and passing that vi...
Convert Java byte array to Python byte array
0
1
0
7,408
5,089,649
2011-02-23T10:29:00.000
1
0
1
1
python,macos,gtk,pip,homebrew
5,090,869
2
true
0
0
You need to install pygtk yourself - at least because since some of its dependencies like dextras are not available through PyPI.
1
8
0
Ideally, I would like to install pygtk using pip or Homebrew. Neither one seems to be possible. I am running Leopard.
Easiest way to install pygtk on Mac OS X
1.2
0
0
11,837
5,090,870
2011-02-23T12:23:00.000
3
0
0
0
python,mysql
5,090,944
1
true
0
0
Just open your CMD/Console, type python, press Enter, type import MySQLdb and then press Enter again. If no error is shown, you're ok!
1
0
0
I have installed MySqldb through .exe(precompiled). Its is stored in site-packages. But now i don't know how to test, that it is accessable or not. And major problem how to import in my application like import MySqldb. Help me i am very new techie in python i just want to work with my existing Mysql. Thanks in advance....
how to import mysqldb
1.2
1
0
165
5,090,901
2011-02-23T12:25:00.000
1
0
0
0
python,mysql,database,postgresql,abstraction
5,090,938
2
false
0
0
Have a look at SQLAlchemy. You can use it to execute literal SQL on several RDBMS, including MySQL and PostgreSQL. It wraps the DB-API adapters with a common interface, so they will behave as similarly as possible. SQLAlchemy also offers programmatic generation of SQL, with or without the included ORM, which you may fi...
1
1
0
I want to retain the flexibility of switching between MySQL and PostgreSQL without the awkwardness of using an ORM - SQL is a fantastic language and i would like to retain it's power without the additional overhead of an ORM. So...is there a best practice for abstraction the database layer of a Python application to pr...
Starting new project: database abstraction in Python, best practice for retaining option of MySQL or PostgreSQL without ORM
0.099668
1
0
965
5,092,356
2011-02-23T14:42:00.000
6
0
1
0
python
5,092,384
3
false
0
0
I think by boundary you mean whether there is an upper bound on the number of elements in a list or dict. Python does not define any limits on them, so they can be as big as the memory available on your machine permits.
3
2
0
Is there a boundary on list and dictionary in python? if there is, what is the limit?
python list boundary
1
0
0
186
5,092,356
2011-02-23T14:42:00.000
1
0
1
0
python
5,092,378
3
false
0
0
The amount of memory you have is the limit.
3
2
0
Is there a boundary on list and dictionary in python? if there is, what is the limit?
python list boundary
0.066568
0
0
186
5,092,356
2011-02-23T14:42:00.000
3
0
1
0
python
5,092,454
3
false
0
0
Actually, currently hash implementation for inner Python objects use 32 bit hashes --so, at a point close to 2^32 elements on a dictionary (assuming you have memory for that much), you will start to have a lot of collisions, and will have a significant slow down in dictionary usage. But that won't prevent it from worki...
3
2
0
Is there a boundary on list and dictionary in python? if there is, what is the limit?
python list boundary
0.197375
0
0
186
5,093,153
2011-02-23T15:41:00.000
1
0
0
0
python,user-interface,macros,recorder
5,093,338
3
false
0
1
Thinking in high level, this is what I'd do: Develop a decorator function, with which I'd decorate every event-handling functions. This decorator functions would take note of thee function called, and its parameters (and possibly returning values) in a unified data-structure - taking care, on this data structure, to m...
2
2
0
I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Un...
Implementing a macro recorder for a python gui?
0.066568
0
0
1,816
5,093,153
2011-02-23T15:41:00.000
1
0
0
0
python,user-interface,macros,recorder
5,093,408
3
false
0
1
You could apply the command design pattern: when your user executes an action, generate a command that represents the changes required. You then implement some sort of command pipeline that executes the commands themselves, most likely just calling the methods you already have. Once the commands are executed, you can...
2
2
0
I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Un...
Implementing a macro recorder for a python gui?
0.066568
0
0
1,816
5,093,164
2011-02-23T15:42:00.000
0
0
1
1
python,multithreading
5,161,519
2
false
0
0
So it doesn't have to be a Python launcher? Back when I was doing heavy sys admin, I wrote a Perl script using the POE framework to run scripts or whatever with a limited concurrency. Worked great. for example when we had to run a script over a thousand user accounts or a couple of hundred data bases. Limit it to just ...
1
1
0
I have aa few scripts written in python. I am trying to multi thread them. When Script A starts. I would like scripts B, C, and D to start. After A runs, I would A2 to run. After B runs, I would B2 to run, then B3. C and D have no follow up scripts. I have checked that the scripts are independent of each other. ...
Multi-threading different scripts
0
0
0
4,367
5,093,622
2011-02-23T16:18:00.000
1
0
0
0
python,http
5,122,434
1
false
0
0
After being convinced by friends that this should be possible, I found a way to do it. I override httplib.HTTPResponse (n.b. httplib.HTTPConnection is nice enough to let you specify the response_class it will instantiate). Looking at socket.py and httplib.py (especially _fileobject.read()), I had noticed that read() o...
1
2
0
Should it be possible to send a plain, single http POST request (not chunk-encoded), in more than one segment? I was thinking of using httplib.HTTPConnection and calling the send method more than once (and calling read on the response object after each send). (Context: I'm collaborating to the design of a server that ...
multiple send on httplib.HTTPConnection, and multiple read on HTTPResponse?
0.197375
0
1
724
5,094,042
2011-02-23T16:50:00.000
0
0
0
0
java,python,xml,jython,xom
5,108,534
4
false
0
0
there is a lxml python library, that can parse large files, without loading data to memory. but i don't know if i jython compatible
2
0
0
I need to parse a large (>800MB) XML file from Jython. The XML is not deeply nested, containing about a million relevant elements. I need to convert these elements into real objects. I've used nu.xom.* successfully before, but now that I've switched from Java to Jython, the library fails with the following message: T...
Best way to parse large XML document in Jython
0
0
1
3,156
5,094,042
2011-02-23T16:50:00.000
3
0
0
0
java,python,xml,jython,xom
5,094,073
4
false
0
0
Try using the SAX parser, it is great for streaming large XML files.
2
0
0
I need to parse a large (>800MB) XML file from Jython. The XML is not deeply nested, containing about a million relevant elements. I need to convert these elements into real objects. I've used nu.xom.* successfully before, but now that I've switched from Java to Jython, the library fails with the following message: T...
Best way to parse large XML document in Jython
0.148885
0
1
3,156
5,094,697
2011-02-23T17:42:00.000
5
0
0
0
python,pygame,latency
5,094,771
2
true
0
0
Question 1) Yes, but if you're doing real time movement like that, I would consider rendering it locally (using collision detection and what not) and then validation on the server to ensure they didn't cheat it (i.e. update the position on the server every second, and make sure they could have gone from A to B in one s...
2
4
0
I'm working on a hobby project consisting of a multi-player web browser game. It is my first and I have just stumbled into the latency issue. I am trying to make user control as smooth as possible and latency is getting in the way. I reckon that average latencies might be around 80-200ms and that for virtually-smooth ...
How should I deal with latency in game development?
1.2
0
1
356
5,094,697
2011-02-23T17:42:00.000
1
0
0
0
python,pygame,latency
5,094,815
2
false
0
0
One important thing is to load resources when needed. That is, in most 3D 'moving'-games, load resources as approaching the objects needing them.
2
4
0
I'm working on a hobby project consisting of a multi-player web browser game. It is my first and I have just stumbled into the latency issue. I am trying to make user control as smooth as possible and latency is getting in the way. I reckon that average latencies might be around 80-200ms and that for virtually-smooth ...
How should I deal with latency in game development?
0.099668
0
1
356
5,095,117
2011-02-23T18:13:00.000
1
0
0
1
java,python,google-app-engine
5,271,776
2
true
1
0
There is an API only available to Google Apps Resellers, if you are one of them you should get access to it.
1
1
0
I am currently working on a project that involves the google apps provisioning api. Without getting too detailed about the purpose or inner workings of the project, I would like to ask a very simple question: Is there a way to programmatically create a google apps for business domain (especially as a reseller)? After t...
Programmatically create Google Apps Domain
1.2
0
0
671
5,096,057
2011-02-23T19:33:00.000
0
1
0
1
python,apache,mod-python
5,098,486
1
false
1
0
I'd say that even it is possible, it would be a tremendous hack (and instable) - you should set-up a process external to apache in this case, that would supervise running processes and kill an individual apache when it goes beyond memory/time predefined limits. Such a script can be kept running continuously with a main...
1
1
0
We are having a problem with individual apache processes utilizing large amounts of memory, depending on the request, and never releasing it back to the main system. Since these requests can happen at any time, over time the web server is pushed into swap, rendering it unresponsive even to SSH. Worse, after the reque...
Killing individual Apache processes in mod_python
0
0
0
318
5,097,795
2011-02-23T22:07:00.000
6
0
1
0
python,setuptools,pip,easy-install
5,135,401
5
true
0
0
Pip does require setuptools. Pip is really just a wrapper around setuptools to provide a better installer than easy_install and some nicer installation behaviors, plus uninstall, requirements files, etc. Even if you somehow got pip installed without setuptools it still won't run without it.
1
7
0
Seems kinda weird that they'd require a package manager to install a package manager. I'm on Windows BTW.
Python - Is there any way to get pip without setuptools?
1.2
0
0
5,442
5,098,183
2011-02-23T22:44:00.000
0
1
1
0
python,ironpython,jython,pyjamas
5,099,381
2
false
1
0
But how does it scale? As well as anything else. Scalability is about architecture, not language. Anyone use these frameworks in industry? Yes.
2
6
0
EDIT Okay, rookie here so please bear with me. What I'm trying to ask is the following: Is it plausible for a Python-syntax fan to use one of these options while other team members "plain vanilla" version? Is it a matter of personal preference, or would it require converting other people to using these technologies ...
What are the advantages/disadvantages of using Jython/IronPython/Pyjamas?
0
0
0
3,513
5,098,183
2011-02-23T22:44:00.000
5
1
1
0
python,ironpython,jython,pyjamas
5,209,736
2
true
1
0
You are talking about two different things. First, Jython and IronPython are Python implementations that you can embed in a Java or C# application to provide scripting capability. This reduces the amount of code that you have to write overall. Or you can look at them as a way to glue together and leverage an existing c...
2
6
0
EDIT Okay, rookie here so please bear with me. What I'm trying to ask is the following: Is it plausible for a Python-syntax fan to use one of these options while other team members "plain vanilla" version? Is it a matter of personal preference, or would it require converting other people to using these technologies ...
What are the advantages/disadvantages of using Jython/IronPython/Pyjamas?
1.2
0
0
3,513
5,098,334
2011-02-23T22:56:00.000
0
0
0
1
python,multithreading,subprocess
5,106,150
1
true
0
0
What are the program listings for abc.py and def.py? Are you sure that the commands you are executing ever end? Try running it with the two subprocess.call() lines commented out and see if it works as intended. If it suddenly works, then the problem is somewhere related to the scripts you're calling outside of the c...
1
0
0
Hello people within the while True processing never ends, even if I use q.task_done, what is wrong? fileQueue = Queue() def submit(i, q): global filespath while True: filename = q.get() retVT = subprocess.call("python abc.py -f %s" % (filespath + filename), shell=True, stdout=open('/dev/null', 'w')...
python: subprocess.call threads problem
1.2
0
0
577
5,098,356
2011-02-23T22:58:00.000
8
1
0
0
emacs,path,mode,python-mode
5,098,431
1
true
0
0
C-hf python-mode RET will tell you which file it lives in, and you can browse to that file by following the link. You can also use M-x find-function RET python-mode RET to go there directly. (I find it handy to have find-function bound to C-hC-f) In general, you could use the following: M-: (find-function major-mode) R...
1
3
0
I'm trying out a new Python mode for Emacs 23, but I'm not sure how to tell if I'm using the new mode (source code located at ~/.elisp/python.el) or the bundled python.el mode. Is there a way to find out where the current (or any active) mode was loaded from? C-h m does not seem to provide that information, and I don't...
Determine path to source code of current mode in Emacs 23
1.2
0
0
318
5,099,012
2011-02-24T00:23:00.000
1
0
0
0
python,google-app-engine,sorting
5,099,184
3
false
1
0
You could get the count of number of entities that have total_value less than or equal to the current users total_value. You could use the count() method to do so (on a Query object).
1
2
0
In my Main model I have a total_value and I sort with this value. When a user enters a value I wish to tell the user the order of his total_value. How do I do this? In other words, if total_values in database are 5,8,10,25 and a user enters a total_value of 15 how do I tell him that he will be in the 4th place? Thanks...
Google App Engine: how to tell sort location for a user value?
0.066568
0
0
95
5,099,674
2011-02-24T02:21:00.000
1
0
1
0
python,mediawiki
5,099,718
3
true
0
0
A manner is to download the page with urllib or httplib, then to analyze it with regexes to extract the precise information you want. It may be long, but it's relatively easy to do. Maybe there are other solutions to analyze the source of the page, parsers or something like that; I don't know enough about them.
1
0
0
I am currently developing a wiki and will keep posting information into the wiki. However, I'll have to fetch the information from the wiki using a python code. For example, if I have a wiki page about a company, say Coca Cola, I will need all the information (text) that I have posted on the wiki to be parsed to my pyt...
Fetching data from the Wiki
1.2
0
0
175
5,099,816
2011-02-24T02:48:00.000
3
0
1
0
java,python,jython,cpython
5,100,178
1
false
1
0
Python modules can depend on certain Python versions (e.g. Python 3 vs Python 2 and even may require a minimum Python version (e.g. 2.6) in case of using dedicated language features introduced in some Python version) Python modules may depend on C extensions which won't work with Jython Python modules may use CPython f...
1
0
0
Can Python code be used from Java using Jython, without modifying the Python code in a way which will prevent it from working correctly in CPython? If yes, what steps would have to be taken (in the Java code)? If not, what are the reasons that this cannot be done (so far)?
Can python modules be used from Java programs using Jython without modification?
0.53705
0
0
261
5,100,159
2011-02-24T03:50:00.000
-1
0
0
0
python,html,beautifulsoup
5,484,677
2
false
1
0
Since no solution with a parser has been proposed to you, may I suggest that you should manage by yourself with regular expressions ? The second point of Danish is of the same nature, as the name grep comes from 'global - regular expression - print'. But it is complicated by the fact the prettify functionality must be ...
1
4
0
We deal with long aggregated HTML documents (for conversion to PDF). In some situations the aggregated HTML document must be split by chapter (dedicated HTML pages starting with a H1 tag) or by subchapters (dedicated HTML pages starting with each H1 or H2 tag). We are using BeautifulSoup for manipulating the aggregated...
Splitting a HTML document using BeautifulSoup
-0.099668
0
0
1,744
5,102,909
2011-02-24T09:48:00.000
1
0
0
1
python,multiplatform
5,102,951
2
false
0
0
As long as you stick to the common and POSIX/UNIX interfaces, it will work equally fine on both Ubuntu and OS X barring any deep magic. Since you haven't described the problem, that's the only advice that can be given.
1
0
0
I wrote a python script for a friend to make a job task easier. Now her company wants to pay me for another script (woot!). However she works on a Mac and I have only a Windows pc and an Ubuntu pc. While python is multi-platform, I ran into a problem with the first script that was only happening on her Mac. So is there...
Writing python script for a Mac on a linux or windows machine
0.099668
0
0
315
5,104,215
2011-02-24T11:48:00.000
0
1
0
1
python,web-services,frameworks
5,104,394
2
false
1
0
For REST, I am very satisfied with Flask.
1
0
0
i want to create a webservice (SOAP & REST) in python which cab be called from iphone, now i have install python 2.7.1 on Ubuntu 10.04.2 LTS using Putty. so now i am searching for a nice and easy framework that helps me in creating webservices and web programming. I have searched a lot but confused with the combinatio...
webservices in python
0
0
0
931
5,104,276
2011-02-24T11:53:00.000
-1
1
0
0
python,database,unit-testing,nosetests
5,105,166
3
false
0
0
Nose supports test suites just import and use unittest.TestSuite. In fact nose will happily run any tesys written using the standard lib's unittest module so tesys do not need to be written in the nose style to be discovered by the nose test runner. However, I suspect you need morw than test suite support to do the...
2
5
0
I have some Python code abstracting the database and the business logic on it. This code is already covered by unit tests but now I need to test this code against different DBs (MySQL, SQLite, etc...) What is the default pattern for passing the same set of tests with different configurations? My goal is making sure tha...
Running the same tests with different configurations
-0.066568
0
0
414
5,104,276
2011-02-24T11:53:00.000
-1
1
0
0
python,database,unit-testing,nosetests
6,515,097
3
false
0
0
use --attrib plugin, and in the commadn line 1. nosetests -s -a 'sqlite' 2. nosetests -s -a 'mysql'
2
5
0
I have some Python code abstracting the database and the business logic on it. This code is already covered by unit tests but now I need to test this code against different DBs (MySQL, SQLite, etc...) What is the default pattern for passing the same set of tests with different configurations? My goal is making sure tha...
Running the same tests with different configurations
-0.066568
0
0
414
5,107,675
2011-02-24T16:43:00.000
2
0
0
1
python,http,google-app-engine,asynchronous,request
5,111,470
4
false
1
0
Use the taskqueue. If you're just pushing data, there's no sense in waiting for the response.
2
4
0
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
async http request on Google App Engine Python
0.099668
0
1
1,253
5,107,675
2011-02-24T16:43:00.000
0
0
0
1
python,http,google-app-engine,asynchronous,request
5,111,384
4
false
1
0
I've done this before by setting doing a URLFetch and setting a very low value for the deadline parameter. I put 0.1 as my value, so 100ms. You need to wrap the URLFetch in a try/catch also since the request will timeout.
2
4
0
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
async http request on Google App Engine Python
0
0
1
1,253
5,108,080
2011-02-24T17:18:00.000
0
0
0
0
python,django,django-admin
48,409,460
4
false
1
0
Another option is to add readonly_fields instead of raw_id_fields
1
18
0
By default, Django's admin renders ForeignKey fields in admin as a select field, listing every record in the foreign table as an option. In one admin-accessible model, I'm referencing the User model as a ForeignKey, and since I have thousands of users Django is populating the select with thousands of options. This is c...
Improving Performance of Django ForeignKey Fields in Admin
0
0
0
7,301
5,112,248
2011-02-25T00:26:00.000
1
0
0
0
python,c,rgb
5,112,349
3
false
0
0
One option is to use OpenCV. Their Python bindings are pretty good (although not amazing). The upside is that it is a very powerful library, so this would just be the tip of the iceberg. You could probably also do this very efficiently using numpy.
1
3
1
well i've seen some code to convert RGB to HSL; but how to do it fast in python. Its strange to me, that for example photoshop does this within a second on a image, while in python this often takes forever. Well at least the code i use; so think i'm using wrong code to do it In my case my image is a simple but big raw ...
Python RGB array to HSL and back
0.066568
0
0
6,609
5,113,000
2011-02-25T02:35:00.000
2
0
1
0
python,dictionary,set
5,113,019
1
true
0
0
There seems to be no way to force a dictionary to pre-allocate. It might not be dictionary re-hashing, it could be the garbage collector. There are functions in the gc module that you might be able to use to control or at least observe the collector behavior.
1
1
0
I've got a script that performs a large AI computation using sets and dictionaries, outputting a line every thousand states, and it has the tendency to stutter. The larger the searched space, the longer the stuttering, so I'm thinking it's probably the sets and dictionaries being rehashed. Is there anyway that I can ma...
My set/dictionary-based script is stuttering...dictionary rehashing?
1.2
0
0
115
5,113,791
2011-02-25T04:57:00.000
1
0
0
1
python,windows,winapi,pywin32
5,114,093
3
true
0
0
win32api.TerminateProcess(handle, 0) works, but i'm concerned it may cause memory leaks because i won't have the opportunity to close the handle (program immediately stops after calling TerminateProcess). note: Yup, I am force quitting it so there are bound to be some unfreed resources, but I want to mi...
2
1
0
Edit: Looks like a duplicate, but I assure you, it's not. I'm looking to kill the current running process cleanly, not to kill a separate process. The problem is the process I'm killing isn't spawned by subprocess or exec. It's basically trying to kill itself. Here's the scenario: The program does cleanup on exit, but ...
In Windows using Python, how do I kill my process?
1.2
0
0
2,588
5,113,791
2011-02-25T04:57:00.000
1
0
0
1
python,windows,winapi,pywin32
14,405,624
3
false
0
0
TerminateProcess and taskkill /f do not free resources and will result in memory leaks. Here is the MS quote on terminateProcess: { ... Terminating a process does not cause child processes to be terminated. Terminating a process does not necessarily remove the process object from the system. A process object is delete...
2
1
0
Edit: Looks like a duplicate, but I assure you, it's not. I'm looking to kill the current running process cleanly, not to kill a separate process. The problem is the process I'm killing isn't spawned by subprocess or exec. It's basically trying to kill itself. Here's the scenario: The program does cleanup on exit, but ...
In Windows using Python, how do I kill my process?
0.066568
0
0
2,588
5,118,178
2011-02-25T14:08:00.000
2
0
0
0
python,http,curl,urllib2,urllib
9,482,535
4
false
0
0
Unfortunately, the Python SDK is discontinued now. Will not work. Need to use Javascript / PHP / iOS / Android APIs
1
6
0
How can I post an image to Facebook using Python?
Post picture to Facebook using Python
0.099668
0
1
7,965
5,119,269
2011-02-25T15:46:00.000
2
0
0
1
python,google-app-engine
5,119,334
2
false
1
0
You'd need to deploy the module with your code by including it in your application's directory when deploying, but it does appear to be a pure python module and looking through the source I see no reason why it wouldn't work just fine in App Engine. The only modules that won't work are those that use C extensions or ma...
1
0
0
Does poster.encode module supported in python appengine ?? if No , whats is the possible alternatives ?
Does poster.encode module supported in python appengine?
0.197375
0
0
937
5,120,129
2011-02-25T16:54:00.000
2
0
1
0
python,html,parsing
5,120,192
3
false
0
0
BeautifulSoup or lxml are decent HTML parsers. BeautifulSoup is a bit more handy but has some odds and ends.
1
1
0
I need to parse html emails that will be similar but not exactly the same. I will be looking for things like dates, amounts, vendors, ect., but depending on who the email came from, the markup will be different. How could I parse out those common things from lots of different html markup in python? Thanks for your sugg...
Python html parsing
0.132549
0
1
6,334
5,120,558
2011-02-25T17:31:00.000
0
1
0
0
python,mime,zip
5,120,702
2
false
0
0
This question does not make any sense. Files are stored as binary content inside the ZIP archive together with the filesize (and flags afaik). But there is absolutely no mimetype information involved here.
2
0
0
When creating zip archive using python ZipFile, how can i set file mime types?
Set ZipInfo mime type
0
0
0
1,396
5,120,558
2011-02-25T17:31:00.000
3
1
0
0
python,mime,zip
5,120,648
2
true
0
0
The ZIP format doesn't carry MIME content-type for the individual files contained in the archive, though the ZIP format itself has a MIME content-type: application\zip. The only way you've got to determine the appropriate MIME content-type for a file contained in a ZIP archive is by examination of the file name and usi...
2
0
0
When creating zip archive using python ZipFile, how can i set file mime types?
Set ZipInfo mime type
1.2
0
0
1,396
5,120,733
2011-02-25T17:48:00.000
0
0
1
0
python
5,120,858
2
false
0
0
If your data set is fairly large then a MapReduce job may be the way to go. This can be run on amazons EC2 network. MapReduce is a distributed approach to data processing. You write a mapper(In your case this will parse the file/s and extract the date as the key value and any other field you like as the value) and a re...
1
0
0
I've got a syslog file named auth and I would like to print out the number of times an attack has occurred each day. I'm under the impression that the date is the key to achieving this. I'm considering inserting one date (Jan 08) for each time an attack has occurred on that day into the dictionary and then repeating th...
printing the number of times an attack occured each day from a syslog file using python
0
0
0
108