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
2,022,067
2010-01-07T17:01:00.000
4
0
0
0
python,payment-gateway,payment
2,258,716
5
true
1
0
You might want to take a look at Adyen (www.adyen.com). They are European and provide a whole lot of features and a very friendly interface. They don't charge a monthly or set up fee and seem to be reasonably priced per transaction. Their hosted payments page can be completely customised which was an amazing improvemen...
3
9
0
I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money. It needs to support the following flow: User performs actio...
Looking for a payment gateway
1.2
0
1
3,656
2,022,067
2010-01-07T17:01:00.000
2
0
0
0
python,payment-gateway,payment
2,023,033
5
false
1
0
I just finished something exactly like this using First Data Global Gateway (don't really want to provide a link, can find with Google). There's no Python API because their interface is nothing but http POST. You have the choice of gathering credit card info yourself before posting the form to their server, as long as...
3
9
0
I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money. It needs to support the following flow: User performs actio...
Looking for a payment gateway
0.07983
0
1
3,656
2,022,178
2010-01-07T17:18:00.000
0
0
0
0
python,django,mod-python
2,022,368
3
false
1
0
A user's login status is stored using sessions. As far as I can tell from comparing trunk to the 0.96 source, the sessions are committed to a cookie the same way, and auth stores the user ID and backend the same way, so as long as the two apps use the same session storage and are on the same domain, it should work. (Ju...
3
0
0
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this ...
Running Different Django Versions But Sharing Authentication
0
0
0
129
2,022,178
2010-01-07T17:18:00.000
1
0
0
0
python,django,mod-python
2,022,407
3
true
1
0
It's possible, but it may be pretty painful to do option #3. How about Option 4: bite the bullet and upgrade to Django 1.1.1. I did this with a couple of 0.97pre sites and it took less time than I thought it would. The biggest pain was dealing with admin stuff. Instead of going with separate admin.py files, we simply p...
3
0
0
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this ...
Running Different Django Versions But Sharing Authentication
1.2
0
0
129
2,022,178
2010-01-07T17:18:00.000
0
0
0
0
python,django,mod-python
2,029,226
3
false
1
0
It's possible to expose Django 0.96 tables to 1.1 - you can use unmanaged models wrapped around database VIEWs. In other words you issue: CREATE VIEW auth_user AS SELECT * from django096db.auth_user; (and similar cmd for other tables) and then you have Django 1.1 synchronized with 0.96 (assuming 0.96 tables are compati...
3
0
0
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this ...
Running Different Django Versions But Sharing Authentication
0
0
0
129
2,022,211
2010-01-07T17:25:00.000
2
1
0
0
python,proxy,smtp,asyncore,smtpd
2,022,273
1
true
0
0
I think it's a fair assumption that given a good C version and a good Python version, the C version will be faster and more scalable but in your case, you might want to run a profiler and see why and where your program is not scaling up as much as the C version. Perhaps you can uncover the tight spots and optimise it t...
1
2
0
i'm stress testing 2 different projects: one is proxsmtpd - smtp proxy written in C And the other one, smtp_proxy.py, which i developed under 1 hour, with use of asyncore and smtpd python modules. I stressed both projects under heavy load, and found out that proxsmtpd is able to hold 400 smtp sessions / sec, while my p...
Python asyncore vs plain old C
1.2
0
0
694
2,022,376
2010-01-07T17:48:00.000
1
0
1
0
python,wxpython,cherrypy
2,022,467
4
false
0
1
One way to decouple them would be to start them up as two separate processes and have them communicate via some kind of IPC mechanism. You might have to write a small adaptor to have them speak a common protocol. Since you're doing CherryPy, you might also be able to expose a control interface via HTTP which the wx GUI...
1
7
0
I'm trying to make a cherrypy application with a wxpython ui. The problem is both libraries use closed loop event handlers. Is there a way for this to work? If I have the wx ui start cherrypy is that going to lock up the ui?
cherrypy and wxpython
0.049958
0
0
1,519
2,022,967
2010-01-07T19:17:00.000
1
0
1
0
python,desktop-application
2,022,996
4
false
0
0
wxPython is a phenomenal GUI toolkit for developing native applications. I highly recommend it. Also, if you combine it with py2exe you can create .exe files for running on Windows.
1
2
0
I'm interested in getting started w/ developing Python based applications for a desktop environment and have a few (seemingly simple) questions: What is the best method for developing GUI applications? I've seen several frameworks but the indexes I've found are a bit convoluted and mix (what seem to be) legacy package...
Getting started w/ Python on the desktop
0.049958
0
0
4,623
2,023,458
2010-01-07T20:37:00.000
0
0
1
0
python,ruby-on-rails,ruby
2,023,828
3
false
1
0
If you're parsing data with python, presumably it's going be put into a database. As long as this is the case you can just run two apps standalone. Saying that, using one language and framework is a better solution, especially when you think that you won't be able reuse any code between the two applications if they are...
3
0
0
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows pyth...
dumb question alert: use *both* ruby on rails and python possible?
0
0
0
184
2,023,458
2010-01-07T20:37:00.000
0
0
1
0
python,ruby-on-rails,ruby
2,023,546
3
false
1
0
Yes, it is possible at some degree using Java. You may use JRuby and Jython in the same app.
3
0
0
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows pyth...
dumb question alert: use *both* ruby on rails and python possible?
0
0
0
184
2,023,458
2010-01-07T20:37:00.000
3
0
1
0
python,ruby-on-rails,ruby
2,023,703
3
true
1
0
It sounds like the only place the two parts will interact is the database: the RoR parts collect data from the user, the python parts collect data from Twitter and elsewhere. As long as your database is supported by both languages, there's no a priori reason why this wouldn't work. Even if you end up needing the two pa...
3
0
0
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows pyth...
dumb question alert: use *both* ruby on rails and python possible?
1.2
0
0
184
2,023,608
2010-01-07T20:57:00.000
3
0
1
0
python,debugging,exception,file
16,674,146
11
false
0
0
There are some limitations to the accepted response, in that it does not seem to count pipes. I had a python script that opened many sub-processes, and was failing to properly close standard input, output, and error pipes, which were used for communication. If I use the accepted response, it will fail to count these op...
3
65
0
I'm getting an error in a program that is supposed to run for a long time that too many files are open. Is there any way I can keep track of which files are open so I can print that list out occasionally and see where the problem is?
check what files are open in Python
0.054491
0
0
54,549
2,023,608
2010-01-07T20:57:00.000
1
0
1
0
python,debugging,exception,file
2,023,659
11
false
0
0
I'd guess that you are leaking file descriptors. You probably want to look through your code to make sure that you are closing all of the files that you open.
3
65
0
I'm getting an error in a program that is supposed to run for a long time that too many files are open. Is there any way I can keep track of which files are open so I can print that list out occasionally and see where the problem is?
check what files are open in Python
0.01818
0
0
54,549
2,023,608
2010-01-07T20:57:00.000
9
0
1
0
python,debugging,exception,file
2,023,691
11
false
0
0
On Linux, you can use lsof to show all files opened by a process.
3
65
0
I'm getting an error in a program that is supposed to run for a long time that too many files are open. Is there any way I can keep track of which files are open so I can print that list out occasionally and see where the problem is?
check what files are open in Python
1
0
0
54,549
2,025,311
2010-01-08T03:31:00.000
0
0
1
0
python
2,025,533
3
false
0
0
Another option is to set up a remote server on Slicehost or Rackspace cloud and SSH in from your friend's machine. You'll have full control over what libraries you want installed.
1
1
0
I'm in an interesting situation. My current computer is going to go in for repairs, and in the meantime I want to get some work done on a friend's computer, but I can't and really don't want to have to set up my development environment on the new PC. Is there a way I can carry around a working Python development enviro...
mobile python 2.6 distribution/development environment?
0
0
0
120
2,025,964
2010-01-08T06:49:00.000
0
1
0
1
python,uri,decode,gstreamer,codec
2,026,830
1
true
0
0
I guess you can try to play it and see if that raises any error - in fact, there's no way to know the set of codecs necessary without opening the file. Some distributions even have hooks in place that ask the user to download the right codec when you start playing something.
1
1
0
I'm trying to write a simple command line audio player using the Python Gstreamer bindings. Is there a function in the gstreamer API that determines in advance whether or not a particular file (URI) can be decoded and played by the currently installed set of codecs?
How do you ask gstreamer if a file can be played?
1.2
0
0
208
2,026,091
2010-01-08T07:28:00.000
1
0
0
1
python,twisted
2,026,161
2
false
1
0
You could write something similar to paster's reloader, that would work like this: start your main function, and before importing / using any twisted code, fork/spawn a subprocess. In the subprocess, run your twisted application. In the main process, run your code which checks for changed files. If code has changed, r...
1
3
0
I've written a specialized JSON-RPC server and just started working my way up into the application logic and finding it is a tad annoying to constantly having to stop/restart the server to make certain changes. Previously I had a handler that ran in intervals to compare module modified time stamps with the past check t...
Strategies or support for making parts of a Twisted application reloadable?
0.099668
0
0
457
2,026,475
2010-01-08T09:05:00.000
4
0
0
0
python,postgresql,sqlalchemy,postgis
2,027,143
1
true
0
0
Table objects in SQLAlchemy have two roles. They can be used to issue DDL commands to create the table in the database. But their main purpose is to describe the columns and types of tabular data that can be selected from and inserted to. If you only want to select, then a view looks to SQLAlchemy exactly like a regula...
1
2
0
Two questions: i want to generate a View in my PostGIS-DB. How do i add this View to my geometry_columns Table? What i have to do, to use a View with SQLAlchemy? Is there a difference between a Table and View to SQLAlchemy or could i use the same way to use a View as i do to use a Table? sorry for my poor english. If...
Work with Postgres/PostGIS View in SQLAlchemy
1.2
1
0
1,758
2,028,025
2010-01-08T14:01:00.000
2
0
1
0
python,image-editor
2,029,356
4
true
0
1
So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k. PIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI. That's where the widget...
2
6
0
I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?
Creating an image editing application in Python
1.2
0
0
8,722
2,028,025
2010-01-08T14:01:00.000
6
0
1
0
python,image-editor
2,028,056
4
false
0
1
You just need a gui toolkit (gtk, qt, wx) a image library (PIL) and 500 hours of free time ...
2
6
0
I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?
Creating an image editing application in Python
1
0
0
8,722
2,028,515
2010-01-08T15:22:00.000
0
0
0
0
python,django,authentication
17,344,403
5
false
1
0
I'm facing the exact same problem and I've been reading a lot (about how to solve that problem in 1.5) and I just thought of a much simpler solution. What if you just add a fixed-length prefix with the organization id to store the username? I.e. Organization id = 115, chosen username = "john" and a fixed length of 6. ...
2
11
0
I'm working on a project in django which calls for having separate groups of users in their own username namespace. So for example, I might have multiple "organizations", and username should only have to be unique within that organization. I know I can do this by using another model that contains a username/organizat...
Django - Allow duplicate usernames
0
0
0
9,747
2,028,515
2010-01-08T15:22:00.000
1
0
0
0
python,django,authentication
2,029,080
5
false
1
0
I have not personally been required to find a solution to this, but one way to tackle this (from an SAAS perspective) would be to prefix the username with an organizational identifier (presuming unique organizations). For example: subdomain.yoursite.com would equate to a user with the username: subdomain_username. You...
2
11
0
I'm working on a project in django which calls for having separate groups of users in their own username namespace. So for example, I might have multiple "organizations", and username should only have to be unique within that organization. I know I can do this by using another model that contains a username/organizat...
Django - Allow duplicate usernames
0.039979
0
0
9,747
2,028,723
2010-01-08T15:50:00.000
2
0
1
0
python,dictionary
2,028,783
6
false
0
0
dicts are for when the order isn't important but you want store values for different names. lists are ordered sequences of objects, usually of the same type and the position doesn't mean anything particular. tuples are ordered sequences of objects, possibly of different types and each different position has a specific ...
1
2
0
I hope somebody can help. I am using Python and I would like to be able to do the following. I have a set of objects (shapes for example) and a series of commands to act on these objects. The commands have the a format of a command string followed by a variable number of parameters which can be strings or integers For ...
Python data structures, dictionary?
0.066568
0
0
2,032
2,031,745
2010-01-09T00:27:00.000
2
0
0
0
python,http,urllib,python-2.6,python-2.x
2,031,786
3
false
0
0
There isn't any way to do that, which is precisely the reason urllib is deprecated in favour of urllib2. So just use urllib2 rather than writing new code to a deprecated interface.
1
0
0
I am trying to make an HTTP request in Python 2.6.4, using the urllib module. Is there any way to set the request headers? I am sure that this is possible using urllib2, but I would prefer to use urllib since it seems simpler.
Any way to set request headers when doing a request using urllib in Python 2.x?
0.132549
0
1
872
2,032,617
2010-01-09T06:49:00.000
2
0
0
1
python,user-interface,pygtk,interactive,spawn
2,032,648
2
false
0
0
Your main GUI thread will freeze if you spawn off a process and wait for it to completely. Often, you can simply use subprocess and poll it now and then for completion rather than waiting for it to finish. This will keep your GUI from freezing.
2
2
0
Python have been really bumpy for me, because the last time I created a GUI client, the client seems to hang when spawning a process, calling a shell script, and calling outside application. This have been my major problem with Python since then, and now I'm in a new project, can someone give me pointers, and a word of...
Interactive Python GUI
0.197375
0
0
1,183
2,032,617
2010-01-09T06:49:00.000
4
0
0
1
python,user-interface,pygtk,interactive,spawn
2,032,635
2
false
0
0
Simplest (not necessarily "best" in an abstract sense): spawn the subprocess in a separate thread, communicating results back to the main thread via a Queue.Queue instance -- the main thread must periodically check that queue to see if the results have arrived yet, but periodic polling isn't hard to arrange in any even...
2
2
0
Python have been really bumpy for me, because the last time I created a GUI client, the client seems to hang when spawning a process, calling a shell script, and calling outside application. This have been my major problem with Python since then, and now I'm in a new project, can someone give me pointers, and a word of...
Interactive Python GUI
0.379949
0
0
1,183
2,034,128
2010-01-09T17:07:00.000
1
1
0
0
python,turbogears
2,035,944
4
false
0
0
Don't quiz. Get some real (possibly broken) code from you vcs. Get them to tell you how they would fix it / add a feature. If they can, ask them to bring some samples of previous work.
2
7
0
If you were looking to hire a web developer who would primarily be working with TurboGears/Python - what sort of questions should you ask them?
Good interview questions for a Python/TurboGears web developer?
0.049958
0
0
2,484
2,034,128
2010-01-09T17:07:00.000
1
1
0
0
python,turbogears
2,034,217
4
false
0
0
Ask him for: Instrospection Model-View-Control design Documenting tools If he know a lot about that, surely know a lot about other issues.
2
7
0
If you were looking to hire a web developer who would primarily be working with TurboGears/Python - what sort of questions should you ask them?
Good interview questions for a Python/TurboGears web developer?
0.049958
0
0
2,484
2,034,373
2010-01-09T18:18:00.000
0
0
0
0
python,firefox,command-line-interface,bookmarks
2,034,590
2
false
0
0
I don't know about all the features you've mentioned but "Organize bookmars" option in the Bookmarks menu is pretty decent with respect to features.
1
1
0
Has anyone done a Python CLI to edit Firefox bookmarks ? My worldview is that of Unix file trees; I want find /re/ in given or all fields in given or all subtrees cd ls with context mv this ../there/ Whether it uses bookamrks.html or places.sqlite is secondary -- whatever's easier. Clarification added: I'd be happy t...
Python CLI to edit Firefox bookmarks?
0
0
1
2,530
2,034,517
2010-01-09T18:57:00.000
6
0
1
0
python,tabs,indentation,spaces
2,034,535
7
false
0
0
Just don't interchange them :) Set your IDE/editor to input 4 spaces upon pressing "tab" and you are good to go.
2
37
0
I decided, that I learn a bit of Python. The first introduction says that it uses indentation to group statements. While the best habit is clearly to use just one of these what happens if I interchange them? How many spaces will be considered equal to one tab? Or will it fail to work at all if tabs and spaces are mixed...
Python's interpretation of tabs and spaces to indent
1
0
0
54,473
2,034,517
2010-01-09T18:57:00.000
2
0
1
0
python,tabs,indentation,spaces
2,034,526
7
false
0
0
Four spaces are one tab (in my setup), but as far as I know, they are not interchanged. You can use either spaces or tabs, not both.
2
37
0
I decided, that I learn a bit of Python. The first introduction says that it uses indentation to group statements. While the best habit is clearly to use just one of these what happens if I interchange them? How many spaces will be considered equal to one tab? Or will it fail to work at all if tabs and spaces are mixed...
Python's interpretation of tabs and spaces to indent
0.057081
0
0
54,473
2,034,584
2010-01-09T19:13:00.000
0
0
1
0
python,database-design,google-app-engine
2,034,622
2
false
1
0
I'm not that familiar with Google App Engine, but here are some thoughts. First is to consider if "tags" are more appropriate than category & sub categories. Will their be a rigid 2 level category scheme? Will all items have a main and subcategory assignment? Rather than having a class for each category, have you c...
1
1
0
I'm creating a Trivia app, and need some help designing my model relationships. This question may get fairly complicated, but I'll try to be concise. Trivia questions will all be part of a particular category. Categories may be a category within another category. If a trivia question is created/removed, I need to ma...
Datastore Design Inquiry
0
0
0
151
2,034,684
2010-01-09T19:46:00.000
1
0
0
1
python,django,google-app-engine
2,428,291
8
false
1
0
I prefer webapp. It scales better according to Google and seems to better integrated with the App Engine infrastructure. Plus it's more lightweight.
3
12
0
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route an...
GAE and Django: What are the benefits?
0.024995
0
0
2,741
2,034,684
2010-01-09T19:46:00.000
2
0
0
1
python,django,google-app-engine
2,035,524
8
false
1
0
GAE is a great tool for new and small projects, that do not require a relational database. I use a range of web hosting solutions. 1) I built www.gaiagps.com on the App Engine, because it was just some brochureware, and a tiny key-value store for the blog part. 2) My colleague also built a web crawler on GAE, because ...
3
12
0
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route an...
GAE and Django: What are the benefits?
0.049958
0
0
2,741
2,034,684
2010-01-09T19:46:00.000
0
0
0
1
python,django,google-app-engine
2,590,020
8
false
1
0
try kay-framework if you are looking for framework specifically designed for google app engine.
3
12
0
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route an...
GAE and Django: What are the benefits?
0
0
0
2,741
2,034,932
2010-01-09T21:00:00.000
0
0
0
0
python
2,035,429
9
false
0
1
A project I wish someone would write: a friendly GUI that wraps around the scanner library and the PDF library, and lets the user easily scan and file documents. It would have a toolbar with big buttons: "scan letter", "scan brochure", "scan photo". These would respectively choose high-resolution black-and-white, medi...
4
7
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
What are some good projects to make for a newbie Python (but not new to programming) developer?
0
0
0
44,661
2,034,932
2010-01-09T21:00:00.000
3
0
0
0
python
2,035,296
9
false
0
1
Do the next project you intended to program with your prefered language with Python.
4
7
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
What are some good projects to make for a newbie Python (but not new to programming) developer?
0.066568
0
0
44,661
2,034,932
2010-01-09T21:00:00.000
1
0
0
0
python
2,035,019
9
false
0
1
Write a simple Text Editor. That was one of the projects i started when i first learned python. It gets you used to the GUI framework, file IO, many types, OOP, lots... It's something that you can grow over time as your confidence builds and it's cross platform so it's handy.
4
7
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
What are some good projects to make for a newbie Python (but not new to programming) developer?
0.022219
0
0
44,661
2,034,932
2010-01-09T21:00:00.000
1
0
0
0
python
2,034,997
9
false
0
1
If you are new to python, why not start with some simpler command line projects? I know you said you are not new to development, but maybe you should spend some time with the core python stuff before tacking on a GUI framework. Just a suggestion. Also, I would point out that Python 3+ code looks a bit different tha...
4
7
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
What are some good projects to make for a newbie Python (but not new to programming) developer?
0.022219
0
0
44,661
2,035,249
2010-01-09T22:40:00.000
5
0
0
1
python,qt,cross-platform
2,040,550
6
false
0
1
As other posters mentioned, the key issue is making sure you never touch a different non-Qt non-cross-platform API. Or really even a different non-Qt crossplatform API, if you use Qt you kind of need to commit to it, it's a comprehensive framework and for the most part sticking with Qt is easier than going to anything...
5
5
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0.16514
0
0
1,271
2,035,249
2010-01-09T22:40:00.000
1
0
0
1
python,qt,cross-platform
2,035,284
6
false
0
1
Generally - as long as you don't use code that is not covered by Qt classes - yes. I have several time just recompiled applications I wrote in Linux(64bit) under Windows, and the other way arround. It works for me every time. Depends on your needs, you might also find compiler problems, but I am sure you will know how ...
5
5
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0.033321
0
0
1,271
2,035,249
2010-01-09T22:40:00.000
0
0
0
1
python,qt,cross-platform
2,035,265
6
false
0
1
It might run well, but it will take some testing, and of course Qt only handles the GUI portability, not the myriad of other things that might cause portability problems. Qt apps generally don't fit in very well on MacOS because they don't have Applescript support by default and don't necessarily have the right keybind...
5
5
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
0
0
1,271
2,035,249
2010-01-09T22:40:00.000
8
0
0
1
python,qt,cross-platform
2,035,272
6
true
0
1
Yes. No. Maybe. See also: Java and "write once, run anywhere". Filesystem layout, external utilities, anything you might do with things like dock icons, character encoding behaviors, these and more are areas you might run into some trouble. Using Qt and Python, and strenuously avoiding anything that seems tied to Windo...
5
5
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
1.2
0
0
1,271
2,035,249
2010-01-09T22:40:00.000
0
0
0
1
python,qt,cross-platform
2,035,601
6
false
0
1
As the others said, everything which is done using Qt-Functionality will most likely run quite flawlessly, WHEN you dont use platform specific functionality of qt. There isnt that much (most of it has to do with window-manager stuff) , but some things might not work on other systems. But such things are surely mention...
5
5
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
0
0
1,271
2,035,285
2010-01-09T22:52:00.000
2
0
1
0
python,file,merge,sorting
2,035,315
5
false
0
0
im thinking importing it into a db (mysql, sqlite, etc) will give better performance than merging it in script. the db typically has optimized routines for loading csv and the join will be probably be as fast or much faster than merging 2 dicts (one being very large) in python.
3
4
0
I have two groups of files that contain data in CSV format with a common key (Timestamp) - I need to walk through all the records chronologically. Group A: 'Environmental Data' Filenames are in format A_0001.csv, A_0002.csv, etc. Pre-sorted ascending Key is Timestamp, i.e.YYYY-MM-DD HH:MM:SS Contains environmental d...
Python synchronised reading of sorted files
0.07983
0
0
380
2,035,285
2010-01-09T22:52:00.000
1
0
1
0
python,file,merge,sorting
2,035,600
5
false
0
0
This is a similar to a relational join. Since your timestamps don't have to match, it's called a non-equijoin. Sort-Merge is one of several popular algorithms. For non-equijoins, it works well. I think this would be what you're called "pre-merge". I don't know what you mean by "merge in real time", but I suspect it...
3
4
0
I have two groups of files that contain data in CSV format with a common key (Timestamp) - I need to walk through all the records chronologically. Group A: 'Environmental Data' Filenames are in format A_0001.csv, A_0002.csv, etc. Pre-sorted ascending Key is Timestamp, i.e.YYYY-MM-DD HH:MM:SS Contains environmental d...
Python synchronised reading of sorted files
0.039979
0
0
380
2,035,285
2010-01-09T22:52:00.000
0
0
1
0
python,file,merge,sorting
2,035,309
5
true
0
0
I would suggest pre-merge. Reading a file takes a lot of processor time. Reading two files, twice as much. Since your program will be dealing with a large input (lots of files, esp in Group A), I think it would be better to get it over with in one file read, and have all your relevant data in that one file. It would al...
3
4
0
I have two groups of files that contain data in CSV format with a common key (Timestamp) - I need to walk through all the records chronologically. Group A: 'Environmental Data' Filenames are in format A_0001.csv, A_0002.csv, etc. Pre-sorted ascending Key is Timestamp, i.e.YYYY-MM-DD HH:MM:SS Contains environmental d...
Python synchronised reading of sorted files
1.2
0
0
380
2,035,657
2010-01-10T01:06:00.000
4
0
0
1
python,linux,environment
2,035,693
4
false
0
0
Sometimes people run a mix of desktop environments. Make your app desktop-agnostic using xdg-utils; that means using xdg-open to open a file or url, using xdg-user-dir DOCUMENTS to find the docs folder, xdg-email to send e-mail, and so on.
1
6
0
How can I get to know what my desktop environment is using Python? I like the result to be gnome or KDE or else.
What is my current desktop environment?
0.197375
0
0
4,870
2,036,987
2010-01-10T12:25:00.000
2
1
0
0
python,testing,ide
10,032,718
15
false
0
0
Repl.it has a python interpreter and terminal among others. It may not be a full-fledged IDE. I'm not sure how you define that.
2
30
0
Is there any web-based IDE that I can use to run quick tests? There're a dozen for PHP and some for even Java but I haven't found yet that runs Python. If there's an open-source IDE available that I can host and run myself, that'd be better. Thanks
Online IDE for Python
0.02666
0
0
30,513
2,036,987
2010-01-10T12:25:00.000
1
1
0
0
python,testing,ide
2,037,081
15
false
0
0
I'm pretty sure that IDE's are the last kind of programs that will ever go web based, because a good IDE needs to be so extremely interactive if it wants to be good. I really don't see a reason for this and others seem to agree because there isn't any. And no, an interactive web shell or compiler has nothing to do with...
2
30
0
Is there any web-based IDE that I can use to run quick tests? There're a dozen for PHP and some for even Java but I haven't found yet that runs Python. If there's an open-source IDE available that I can host and run myself, that'd be better. Thanks
Online IDE for Python
0.013333
0
0
30,513
2,036,996
2010-01-10T12:28:00.000
0
0
0
0
python,sqlalchemy
2,037,291
2
true
0
0
I've found its a bug in sa, this happens only for string fields, they dont get server_default property for some unknow reason, filed a ticket for this already
1
0
0
hmm, is there any reason why sa tries to add Nones to for varchar columns that have defaults set in in database schema ?, it doesnt do that for floats or ints (im using reflection). so when i try to add new row : like u = User() u.foo = 'a' u.bar = 'b' sa issues a query that has a lot more cols with None values assigne...
Problem with sqlalchemy, reflected table and defaults for string fields
1.2
1
0
900
2,037,290
2010-01-10T14:35:00.000
1
0
1
0
python,buildout
2,037,871
2
false
0
0
It is not the prettiest list, but you can look at .installed.cfg in your buildout's directory. For every part, it shows which options it knows about. (For some reason several parts are often shown multiple times).
1
6
0
I'd like to find out, exactly what variables are available when using zc.buildout. I can always look at the source, but ideally I'd find a list somewhere, or be able to query buildout to find out what it thinks are the variables available at any one time. Is this possible?
Listing buildout configuration variables
0.099668
0
0
1,096
2,040,769
2010-01-11T09:05:00.000
2
0
0
0
c++,python,qt,gnuradio
2,040,813
3
false
0
1
Spawn python script as a new process using fork() and execv(). execv() (or any other function of the exec family) lets you pass arguments to the Python script. Use the child process ID to send a kill signal when you are done with the Python script.
1
3
0
I try to explain the situation: I have a QT application written in C++ and QT. This QT application starts a separate console C++ application that runs in the background. These two communicate using perhaps sockets, don't know yet. Console C++ application needs to start and stop my gnuradio python script. Also it needs...
Best way to start, stop and send parameters to separate Python script from C++ application?
0.132549
0
0
903
2,041,352
2010-01-11T11:02:00.000
2
0
1
0
python,usb,voice
2,041,675
3
false
0
0
I think the smart way is to leave it a professional Voice/IP app such as ribbit or Twilio. I would personally recommend twilio which has Python libraries
1
4
0
I'm writting a small python program to send voice file to other telephone. The phone is connected to pc over usb. How to make phone calls using Python?
How to make phone calls using Python?
0.132549
0
0
4,270
2,042,133
2010-01-11T13:37:00.000
1
0
0
0
python,sockets,protocols
2,042,187
4
false
0
0
Read some protocols, and try to find one that looks like what you need. Does it need to be message-oriented or stream-oriented? Does it need request order to be preserved, does it need requests to be paired with responses? Do you need message identifiers? Retries, back-off? Is it an RPC protocol, a message queue protoc...
1
3
0
I have built a Python server to which various clients can connect, and I need to set a predefined series of messages from clients to the server - For example the client passes in a name to the server when it first connects. I was wondering what the best way to approach this is? How should I build a simple protocol for...
Python Sockets - Creating a message format
0.049958
0
1
2,451
2,042,426
2010-01-11T14:34:00.000
4
0
1
1
python
2,042,452
6
false
0
0
$ python -c "import py_compile; py_compile.compile('yourfile.py')" or $ python -c "import py_compile; py_compile.compileall('dir')"
1
53
0
Is there a way to compile a Python .py file from the command-line without executing it? I am working with an application that stores its python extensions in a non-standard path with limited permissions and I'd like to compile the files during installation. I don't need the overhead of Distutils.
compile python .py file without executing
0.132549
0
0
87,360
2,043,058
2010-01-11T16:15:00.000
0
1
0
0
python,ruby,perl,http,scripting
2,043,069
12
false
1
0
What about using PHP+Curl, or just bash?
1
8
0
Often times I want to automate http queries. I currently use Java(and commons http client), but would probably prefer a scripting based approach. Something really quick and simple. Where I can set a header, go to a page and not worry about setting up the entire OO lifecycle, setting each header, calling up an html pars...
Scripting HTTP more effeciently
0
0
1
4,483
2,043,138
2010-01-11T16:26:00.000
1
0
0
0
javascript,python,django,cookies
2,043,172
2
false
1
0
The cookie was probably set with 'domain' parameter. Set the cookie to be accessible from all the subdomains of the domain the cookie is being set in. I'm not the python guy, but my knowledge of http protocol shows that this might be the problem.
2
2
0
I need to remove a cookie that was previously set for parent domain while browsing host at subdomain of the parent. I.e., a cookie "xyz" was set for example.com, and I am trying to remove it on subdomain.example.com, using Django backend. The request.COOKIES given to the view does not contain any cookies except those f...
Could not get cookie from another (parent) domain in Django
0.099668
0
0
2,034
2,043,138
2010-01-11T16:26:00.000
0
0
0
0
javascript,python,django,cookies
2,043,336
2
false
1
0
You can attempt to call delete_cookie even for a cookie you haven't been able to read. Django will output the relevant Set-Cookie headers to delete the cookie regardless. Naturally the domain and path you pass to delete_cookie must match the cookie you intend to delete. However, if you haven't been able to read the coo...
2
2
0
I need to remove a cookie that was previously set for parent domain while browsing host at subdomain of the parent. I.e., a cookie "xyz" was set for example.com, and I am trying to remove it on subdomain.example.com, using Django backend. The request.COOKIES given to the view does not contain any cookies except those f...
Could not get cookie from another (parent) domain in Django
0
0
0
2,034
2,044,364
2010-01-11T19:33:00.000
0
0
1
0
python,netbeans
2,044,412
2
false
0
0
added solution is debugging if don't have any compiling error
1
0
0
When I run some python code in NetBeans, which raises an error, the output in NetBeans just gives an error message and no further information, such as line number. Is there any way to fix that?
NetBeans and Python
0
0
0
451
2,045,131
2010-01-11T21:36:00.000
2
1
0
0
php,python,session
2,045,154
1
true
1
0
In PHP, store the session information in a database, encoded in JSON. In Python, pull the session ID from the cookie and look up the session information in the database.
1
2
0
I have a sign up process that is in a legacy framework and we are trying to switch to a new framework...in fact a different language. So let's say that there are 3 steps in the sign up process and each of those 3 steps has it's own file(step1.php, step2.php, step3.php). Now if I want to change page2.php to a python fil...
Pass session information from php to python securely? (in agile)
1.2
0
0
575
2,045,175
2010-01-11T21:46:00.000
0
0
1
0
python,regex
2,045,196
8
false
0
0
A* means match "A" zero or more times. For an even number of "A", try: (AA)+
2
19
0
I need to match an expression in Python with regular expressions that only matches even number of letter occurrences. For example: AAA # no match AA # match fsfaAAasdf # match sAfA # match sdAAewAsA # match AeAiA # no match An even number of As SHOULD match.
Regex match even number of letters
0
0
0
30,176
2,045,175
2010-01-11T21:46:00.000
0
0
1
0
python,regex
2,045,190
8
false
0
0
First of all, note that /A*/ matches the empty string. Secondly, there are some things that you just can't do with regular expressions. This'll be a lot easier if you just walk through the string and count up all occurences of the letter you're looking for.
2
19
0
I need to match an expression in Python with regular expressions that only matches even number of letter occurrences. For example: AAA # no match AA # match fsfaAAasdf # match sAfA # match sdAAewAsA # match AeAiA # no match An even number of As SHOULD match.
Regex match even number of letters
0
0
0
30,176
2,046,727
2010-01-12T04:28:00.000
2
0
0
0
python,sockets
2,046,760
1
true
0
0
You should have your User class implement a fileno(self) method which returns self.thesocket.fileno() -- that's the way to make select work on your own classes (sockets only on windows, arbitrary files on Unix-like systems). Not sure what switch is supposed to me -- don't recognize it as a standard library (or built-i...
1
1
0
I more or less know how to use select() to take a list of sockets, and only return the ones that are ready to read/write something. The project I'm working on now has a class called 'user'. Each 'user' object contains its own socket. What I would like to do is pass a list of users to a select(), and get back a list ...
Creating waitable objects in Python
1.2
0
1
547
2,046,887
2010-01-12T05:25:00.000
0
0
0
0
python,django,geodjango
7,258,668
2
false
1
0
I am going to try something similar soon... I have a small database of about 40 locations, and I want the user to be able to filter these 40 locations by entering any zip code or city name, using a function that will return a list of location that are within a 5, 10, 15, 20, etc radius distance. I am thinking of using ...
1
0
0
How can I use geodjango to search by city and state or zip code in my django application? I am very new to geodjango and just trying to wrap my head around what would be involved in this. Also, does anyone know of an app that already implements this functionality?
geodjango - search by city, state or zip code
0
0
0
2,044
2,048,041
2010-01-12T10:02:00.000
2
0
1
0
python,matplotlib
10,303,500
4
false
0
0
There is a very good book: Sandro Tosi, Matplotlib for Python Developers, Packt Pub., 2009.
1
6
1
I have installed Matplotlib, and I have created two lists, x and y. I want the x-axis to have values from 0 to 100 in steps of 10 and the y-axis to have values from 0 to 1 in steps of 0.1. How do I plot this graph?
How do I plot a graph in Python?
0.099668
0
0
5,478
2,048,345
2010-01-12T10:57:00.000
0
0
0
1
python,open-source,development-environment
2,048,362
4
false
0
0
Install any of the Linux distributions on your computer. If you have a preference, great. If not, try Ubuntu, Fedora, Debian. Any of them is pretty user and developer friendly too. IDE, well I don't use one. But you may try NetBeans with Python support or Eclipse (with PyDev). Code style- well, try and learn to be pyt...
1
2
0
How to setup a Linux/Unix machine for python development? Which Linux/Unix version should I use? What IDE should be used? What development plugins should I have? What code style should would be THE BEST? All above, a great development machine for open source (python developers) development? Can i ask for screenshot of ...
Can I ask for screenshot of some great personalized IDE for python?
0
0
0
266
2,048,874
2010-01-12T12:30:00.000
3
0
1
0
python,coding-style,copyright-display
2,049,123
4
false
0
0
As I know, there is currently no standard way. Each company/organization will have their own template to doc the copyright information. If this is your personal project, then just feel free to doc it in the way you feel most comforable. Adding a LICENSE file is a very common way for projects with many source files. Eve...
1
39
0
What is the standard way of writing "copyright information" in python code? Should it be inside docstring or in block comments? I could not find it in PEPs.
Writing copyright information in python code
0.148885
0
0
32,264
2,049,247
2010-01-12T13:36:00.000
2
1
0
1
java,python,file,file-io
4,406,823
7
false
0
0
In Linux, Solaris, Unix this is easy. Just use rename() from your program or mv. The files need to be on the same filesystem. On Windows, this is possible if you can control both programs. LockFileEx. For reads, open a shared lock on the lockfile. For writes, open an exclusive lock on the lockfile. Locking is weird in ...
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
0.057081
0
0
15,100
2,049,247
2010-01-12T13:36:00.000
13
1
0
1
java,python,file,file-io
2,049,282
7
true
0
0
AFAIK no. And the reason is that for such an atomic operation to be possible, there has to be OS support in the form of a transactional file system. And none of the mainstream operating system offer a transactional file system. EDIT - I'm wrong for POSIX-compliant systems at least. The POSIX rename syscall performs...
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
1.2
0
0
15,100
2,049,247
2010-01-12T13:36:00.000
6
1
0
1
java,python,file,file-io
2,049,334
7
false
0
0
At least on POSIX platforms, leave out step 3 (delete old file). In POSIX, rename within a filesystem is guaranteed to be atomic, and renaming on top of an existing file replaces it atomically.
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
1
0
0
15,100
2,049,247
2010-01-12T13:36:00.000
1
1
0
1
java,python,file,file-io
2,049,333
7
false
0
0
You could try and use an extra file to act as a lock, but I'm not sure if that will work out ok. (It would force you to create lock-checking and retry logic at both sides, java and python) Another solution might be to not create files at all, maybe you could make your java process listen on a port and serve data from t...
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
0.028564
0
0
15,100
2,049,247
2010-01-12T13:36:00.000
3
1
0
1
java,python,file,file-io
2,049,395
7
false
0
0
It's a classic producer/consumer problem. You should be able to solve this by using file renaming, which is atomic on POSIX systems.
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
0.085505
0
0
15,100
2,049,247
2010-01-12T13:36:00.000
1
1
0
1
java,python,file,file-io
2,049,386
7
false
0
0
Have the python scripts request permission from the service. While the service is writing it would place a lock on the file. If the lock exists, the service would reject the python request.
6
31
0
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts. For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes. Right now my approach is: Write file contents to a te...
Atomic file write operations (cross platform)
0.028564
0
0
15,100
2,049,467
2010-01-12T14:08:00.000
1
0
1
0
python,dll,ipc,code-injection
4,621,980
2
false
0
0
If you don't care about realtime, then you can use the file system for communication: a log file for the DLL's output, and a config file that is read every now and then to change the DLLs behavior.
1
5
0
Hello stack overflow: Sometimes reader, first time poster. Background: Windows box running XP SP3, soon to be upgraded to Windows Seven (MSDNAA <3) I have an injected DLL which gets cycles by hooking a function that is called thousands of times a second. I would like to communicate/control this DLL via a python app. ...
IPC between python app and injected DLL
0.099668
0
0
745
2,050,256
2010-01-12T15:57:00.000
0
0
0
1
python,google-app-engine,proxy
2,218,463
5
false
1
0
I'm currently having the same problem and i was thinking about this solution (not yet tried) : -> develop an app that fetch what you want -> run it locally -> fetch your local server from your initial so the proxy is your computer which you know as not blocked Let me know if it's works !
3
4
0
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free ...
AppEngine fetch through a free proxy
0
0
0
888
2,050,256
2010-01-12T15:57:00.000
2
0
0
1
python,google-app-engine,proxy
2,050,288
5
false
1
0
Probably the correct approach is to request permission from the owners of the site you are scraping. Even if you use a proxy, there is still a big chance that requests coming through the proxy will end up blocked as well.
3
4
0
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free ...
AppEngine fetch through a free proxy
0.07983
0
0
888
2,050,256
2010-01-12T15:57:00.000
0
0
0
1
python,google-app-engine,proxy
3,731,700
5
false
1
0
Well to be fair, if they don't want you doing that then you probably shouldn't. It's not nice to be mean. But if you really want to do it, the best approach would be creating a simple proxy script and running it on a VPS or some computer with a decent enough connection. Basically you expose a REST API from your server ...
3
4
0
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free ...
AppEngine fetch through a free proxy
0
0
0
888
2,053,857
2010-01-13T01:47:00.000
0
0
1
0
python,svn,multiprocessing
2,053,972
2
false
0
0
You can keep polling the stdout of the svn process, and test how often you get new files. If you don't get a new file within x seconds, bounce the process. Launch svn using subprocess from within your master script, and poll stdout while waiting for the process to complete.
1
1
0
I have a python script to download source code from a list of repositories, some of them are big. Sometimes, svn hangs in the middle of a check out. Is there a way to watch over svn process, and so I know it is hang or not?
Watch over another process (svn)
0
0
0
695
2,053,949
2010-01-13T02:16:00.000
0
0
0
0
python,qt,pyqt4
2,060,398
1
false
0
1
Looking in Qt's source code, in the file src/gui/kernel/qwindowdefs.h, you'll find that WId is typedef'd to long for 64-bits OSX (it's int for 32-bits OSX). A long on 64-bits OSX is 8 bytes long (or 64 bits), and therefore 4318283408 is a valid value. If you want to force winId() to return a 32 bits value, you will nee...
1
0
0
Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error. Inspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i ha...
Qt winId() forcing 32bit values
0
0
0
394
2,054,422
2010-01-13T04:32:00.000
1
0
1
0
python,regex,string
2,054,457
5
false
0
0
I would use ([^\d]+)?(\d{5})? as my regular expression, and use match so it only matches the beginning of the string. This way it won't fail on bad input and will make its best guess as to what was intended. Then you can split the first capture group on ",".
2
2
0
I'd like to be able to parse out the city, state or zip from a string in python. So, if I entered Boulder, Co 80303 Boulder, Colorado Boulder, Co 80303 ... any variation of these it would return the city, state or zip. This is all going to be user inputted data and inputted in one text field.
get city, state or zip from a string in python
0.039979
0
0
6,305
2,054,422
2010-01-13T04:32:00.000
3
0
1
0
python,regex,string
2,054,463
5
false
0
0
Just ask for their zip only, then give a (short) list of applicable cities by using a geocode database. That way you get nice clean 5-digit input, they save time, and you all go home happy. If you already have the data, look just for the zip, find a list of possible cities (there will only be one applicable state) and ...
2
2
0
I'd like to be able to parse out the city, state or zip from a string in python. So, if I entered Boulder, Co 80303 Boulder, Colorado Boulder, Co 80303 ... any variation of these it would return the city, state or zip. This is all going to be user inputted data and inputted in one text field.
get city, state or zip from a string in python
0.119427
0
0
6,305
2,054,626
2010-01-13T05:21:00.000
2
1
0
1
python,unix,signals,curses
2,054,648
2
true
0
0
See the termios module, and the termios(3) man page.
1
3
0
I'm writing a curses application in Python under UNIX. I want to enable the user to use C-Y to yank from a kill ring a la Emacs. The trouble is, of course, that C-Y is caught by my shell which then sends SIGTSTP to my process. In addition, C-Z also results in SIGTSTP being sent, so catching the signal means that C-Y an...
How to disable shell interception of control characters?
1.2
0
0
543
2,055,355
2010-01-13T08:30:00.000
5
1
1
0
python,c,compilation,bytecode
2,055,381
5
true
0
0
I did it by creating .py library and simple .py program that uses that library. Then I compiled library to .pyc and distributed: program as .py source and library as compiled .pyc.
2
10
0
Is it possible to distribute only the bytecode version (.pyc file) of a Python script instead of the original .py file? My app embeds the Python interpreter and calls PyImport_Import to load a script. How can I tell it to look for a .pyc file and import that?
How to protect Python source code?
1.2
0
0
15,521
2,055,355
2010-01-13T08:30:00.000
5
1
1
0
python,c,compilation,bytecode
2,056,647
5
false
0
0
Since you are writing your main program in C++, you can do whatever you want to protect your Python files. You could encrypt them for distribution, then decrypt them just in time to import them into the Python interpreter, for example. Since you are using PyImport_Import, you can write your own __import__ hook to impo...
2
10
0
Is it possible to distribute only the bytecode version (.pyc file) of a Python script instead of the original .py file? My app embeds the Python interpreter and calls PyImport_Import to load a script. How can I tell it to look for a .pyc file and import that?
How to protect Python source code?
0.197375
0
0
15,521
2,055,738
2010-01-13T09:51:00.000
1
0
1
0
python,string
2,055,750
7
false
0
0
Open the file Read each line and parse the line via line.split( )
1
1
0
I have a program which reads commands from a text file for example, the command syntax will be as follows and is a string 'index command param1 param2 param3' The number of parameters is variable from 0 up to 3 index is an integer command is a string all the params are integers I would like to split them so that I hav...
Help with Python strings
0.028564
0
0
203
2,056,594
2010-01-13T12:33:00.000
3
0
0
1
python,popen
2,056,745
3
true
0
0
The Popen object is effectively just a wrapper for the child processes PID, stdin, stdout, and stderr, plus some convenience functions for using those. So the question is why do you need access to the Popen object? Do you want to communicate with the child, terminate it, or check whether it's still running? In any case...
2
2
0
I have a python program that uses subprocess.Popen to launch another process (python process or whatever), and after launching it I save the child's PID to a file. Let's suppose that suddenly the parent process dies (because of an exception or whatever). Is there any way to access again to the object returned by Popen?...
Recover process with subprocess.Popen?
1.2
0
0
1,293
2,056,594
2010-01-13T12:33:00.000
1
0
0
1
python,popen
2,056,808
3
false
0
0
If a process dies, all its open file handles are closed. This includes any unnamed pipes created by popen(). So, no, there's no way to recover a Popen object from just a PID. The OS won't even consider your new process the parent, so you won't even get SIGCHLD signals (though waitpid() might still work). I'm not sur...
2
2
0
I have a python program that uses subprocess.Popen to launch another process (python process or whatever), and after launching it I save the child's PID to a file. Let's suppose that suddenly the parent process dies (because of an exception or whatever). Is there any way to access again to the object returned by Popen?...
Recover process with subprocess.Popen?
0.066568
0
0
1,293
2,056,752
2010-01-13T13:03:00.000
0
1
1
0
java,python,properties
2,056,762
6
false
1
0
Do you want to create new fields/getters/setters in the class? If you want to do this in runtime, you have to create completely new class with your fields and methods, and load it into the JVM. To create new class you can use library like ASM or CGLib, but if you're new to Java, this isn't something you want to start w...
2
10
0
I'm new to Java, and I'd like to create some class variables that are dynamically calculated when accessed, as you can do in Python by using the property() method. However, I'm not really sure how to describe this, so Googling shows me lots about the Java "Property" class, but this doesn't appear to be the same thing. ...
What is the Java Equivalent of Python's property()?
0
0
0
3,624
2,056,752
2010-01-13T13:03:00.000
2
1
1
0
java,python,properties
2,056,814
6
false
1
0
They don't really exist. In Java it's common practice to declare members as private or protected and only allow access to them via methods. Often this leads to lots of small getFoo() and setFoo(newFoo) methods. Python doesn't really have private and protected and it's more common to allow direct access to members.
2
10
0
I'm new to Java, and I'd like to create some class variables that are dynamically calculated when accessed, as you can do in Python by using the property() method. However, I'm not really sure how to describe this, so Googling shows me lots about the Java "Property" class, but this doesn't appear to be the same thing. ...
What is the Java Equivalent of Python's property()?
0.066568
0
0
3,624
2,058,492
2010-01-13T16:45:00.000
8
0
0
0
c++,python,qt,pyqt,pyside
2,058,512
3
true
0
1
We were recently thinking about using PySide, but we haven't found any information about whether it is supported by py2exe. That's why we kept to PyQt. If you need to develop for Windows, it's safer to use good ol' PyQt :-)
3
18
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone ...
PyQt vs PySide comparison
1.2
0
0
9,387
2,058,492
2010-01-13T16:45:00.000
-1
0
0
0
c++,python,qt,pyqt,pyside
2,058,548
3
false
0
1
PySide currently does not run on Windows, which limits your capability. If you were developing on Linux and needed to avoid pure GPL, then PySide is a candidate. From an API standpoint, I find the signal/slots capability feels more "Pythonic".
3
18
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone ...
PyQt vs PySide comparison
-0.066568
0
0
9,387
2,058,492
2010-01-13T16:45:00.000
0
0
0
0
c++,python,qt,pyqt,pyside
4,828,827
3
false
0
1
As of PySide 1.0 beta (Qt 4.7.1), there is an official Windows installer that works. It doesn't include QtDesigner and other tools, only uic.
3
18
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone ...
PyQt vs PySide comparison
0
0
0
9,387
2,058,532
2010-01-13T16:50:00.000
3
0
0
0
python,django
3,299,378
10
false
1
0
My worst mistake was using absolute imports like <project_name>.<app_name>.models rather than <app_name>.models. This way when I made a branch and wanted to check it out in different directory (like having and -stable of my project), it wouldn't run. I managed to revert in one project and use only relative imports in ...
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
0.059928
0
0
2,848
2,058,532
2010-01-13T16:50:00.000
5
0
0
0
python,django
2,060,365
10
false
1
0
Monkeying around with pre-save and post-save events. If you can't simply do it in save, you should probably rethink what you're trying to do. After all, it's just a relational database under the hood. If what you're doing gets too complex, you'll have ORM mapping issues. Trying to write uber-generic -- one view does ...
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
0.099668
0
0
2,848
2,058,532
2010-01-13T16:50:00.000
5
0
0
0
python,django
3,496,620
10
false
1
0
Not using raw_id fields for a key to 10000+ objects, then wondering why visiting the Admin brings a server to its knees
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
0.099668
0
0
2,848
2,058,532
2010-01-13T16:50:00.000
9
0
0
0
python,django
2,058,929
10
false
1
0
I think the biggest problem is that people try to code as if this were Java/C: They try to create overly generic applications that need never be changed when future requirements change (which is necessary for Java/C because those apps aren't so easy to change/redesign). What results is a hideously complicated applicati...
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
1
0
0
2,848
2,058,532
2010-01-13T16:50:00.000
12
0
0
0
python,django
2,058,590
10
false
1
0
Not splitting stuff up into multiple applications. It's not so much about reusability as it is about having a dozen models, and over 100 views in one app, it's damned unreadable. Plus I like to be able to scan my urls.py file easily to see where a URL points, when I have 100 URLs that gets harder.
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
1
0
0
2,848
2,058,532
2010-01-13T16:50:00.000
27
0
0
0
python,django
2,060,303
10
false
1
0
Too much logic in views. I used to write views that would struggle to fit in 40 lines. Now I consider more than 2-3 indentation levels, 10 or so LOC or a handful of inline comments in a view to be code smells. The temptation is to write minimal models, figure out your url routing, then do everything else in the view. ...
6
23
0
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
1
0
0
2,848
2,059,337
2010-01-13T18:52:00.000
3
1
0
1
python,ruby,linux,scripting,release
2,059,364
4
true
1
0
I would create a branch in SVN for every release of web application and when the release is ready there, I would check it out on the server and set to be run or move it into the place of the old version.
3
1
0
I am purely a windows programmer and spend all my time hacking VC++. Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux. The RELEASE procedures and check list we followed...
Practices while releasing the python/ruby/script based web applications on production
1.2
0
0
242