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,226,208
2011-03-07T22:47:00.000
0
0
1
0
python,regex
5,226,397
3
false
0
0
If the delimiter is always at the end of the string you can user str.rpartition: >>> print u'1\/2/CD'.rpartition('/') (u'1\\/2', u'/', u'CD')
1
1
0
I am trying to split string data using Python which is delimited by the '/' character. The problem is that the string could have multiple occurrence of the '/' character but I want to split it only using '/' and not using '\/' For example, I am trying to split the string '1\/2/CD' into '1\/2' and 'CD'
How to split string on '/' delimiter but prevent splitting when '/ ' occurs just after ' \ '
0
0
0
1,163
5,227,167
2011-03-08T00:59:00.000
1
0
0
1
python,django,google-app-engine
7,540,809
1
false
1
0
ODK Aggregate is written on Java stack. If you want to use python/Django to make it more user friendly and good looking, it is better to rewrite it completely instead of mixing technologies. Several ODK Build alternatives are available, neither one of those was built on top of others, so it is not mandatory what you a...
1
0
0
I'm working on a project where our team is trying to implement Django into the ODK Aggregate platform, we don't quite enjoy their choice of functionality/looks, so we want to create a better template and make it more user-friendly. We've yet to understand how to upload Django onto the Appengine/Appspot, Aggregate was p...
Implementing Django with ODK Aggregate
0.197375
0
0
469
5,227,198
2011-03-08T01:03:00.000
8
1
1
0
python,unit-testing,class,methods
5,227,226
2
true
0
0
Methods (and in fact all attributes) of a class are stored in a dict. There is no limit to the number of items a dict can contain, save that each key must be unique.
1
4
0
I am automatically generating unit tests for some Python code which number in the thousands. The unittest module uses classes to contain the tests however I'm guessing there is an upper limit to the number of methods a class may contain - is this the case?
What is the maximum number of methods on a Python class?
1.2
0
0
1,932
5,228,728
2011-03-08T05:32:00.000
1
0
0
0
python,database,oracle
5,228,737
2
true
0
0
No. There is nothing in the standard library for connecting to database servers.
1
0
0
I'm working on a client machine running suse linux and python 2.4.2. I'm not allowed to dowload anything from the net including any external libraries. So, is there any way I can connect to a database (oracle) using only the default libraries?
Python: Connecting to db without any external libraries
1.2
1
0
360
5,231,627
2011-03-08T11:09:00.000
5
0
0
0
python,n-gram
5,231,844
1
true
0
0
If I'm understanding your problem correctly, you want to compute things like log { P("x1 x2 x3 x4 x5") / P("x1") P("x2") ... P("x5") } where P measures the probability that any given 5-gram or 1-gram is a given thing (and is basically a ratio of counts, perhaps with Laplace-style offsets). So, make a single pass throug...
1
4
1
I have a large corpus of n-grams and several external n-grams. I want to calculate the PMI score of each external n-gram based on this corpus (the counts). Are there any tools to do this or can someone provide me with a piece of code in Python that can do this? The problem is that my n-grams are 2-grams, 3-grams, 4-gr...
Calculating point-wise mutual information (PMI) score for n-grams in Python
1.2
0
0
4,572
5,233,508
2011-03-08T14:04:00.000
0
1
1
0
python,lambda
5,233,599
12
false
0
0
lambda is an anonymous function, usually used for something quick that needs computing. Example (This is used in a LexYacc command parser): assign_command = lambda dictionary, command: lambda command_function: dictionary.setdefault(command, command_function) This is a decorator. Put before a command we'd have from the ...
4
8
0
I want to know what exactly is lambda in python? and where and why it is used. thanks
What exactly is "lambda" in Python?
0
0
0
3,299
5,233,508
2011-03-08T14:04:00.000
5
1
1
0
python,lambda
5,233,898
12
false
0
0
Lambdas are not anonymous functions. Lambdas are anonymous expressions. They're accessed like functions, but they're not the same thing. Functions allow complex tasks: flow control, variable declarations and lists of statements containing expressions. Expressions are merely one part of a function, and that's what la...
4
8
0
I want to know what exactly is lambda in python? and where and why it is used. thanks
What exactly is "lambda" in Python?
0.083141
0
0
3,299
5,233,508
2011-03-08T14:04:00.000
0
1
1
0
python,lambda
5,233,587
12
false
0
0
It's an inline anonymous function.
4
8
0
I want to know what exactly is lambda in python? and where and why it is used. thanks
What exactly is "lambda" in Python?
0
0
0
3,299
5,233,508
2011-03-08T14:04:00.000
0
1
1
0
python,lambda
71,792,193
12
false
0
0
I would like to explain this with a little layman approach in terms of the usage perspective, since all the technical points are already covered. A lambda function is just like any other function, only thing that makes it different (other than the syntax and the fact that it can't be reused), is that it is used when we...
4
8
0
I want to know what exactly is lambda in python? and where and why it is used. thanks
What exactly is "lambda" in Python?
0
0
0
3,299
5,234,639
2011-03-08T15:37:00.000
5
0
1
0
python,encryption,cryptography,des
5,234,695
2
false
0
0
The first rule of cryptography: never ever invent anything yourself! Unless you have a PhD and years of experience, you will end up creating gaping security holes. As a matter of fact, history shows that even people with a PhD and years of experience often make security mistakes. Sure, you can do it for fun and educati...
1
0
0
I'm trying to construct a DES implementation of my own! But i'm not successful with the implementation I use All the tables like Initail permutation, Expansion Permutation table, Permutation function table, PC-1, PC-2 and all the s-boxes of my own random bit positions . Should we use the S-Boxes provided by DES or we c...
Can we make our own S-Boxes, IP, IP~, And other tables in DES? Will it Still Work or should be use what they've provided?
0.462117
0
0
1,330
5,235,527
2011-03-08T16:47:00.000
0
0
1
0
python,loops
5,235,568
3
true
0
0
Your problem is that you are giving raw_input three arguments when it expects one ;) But, seriously: your calls which look like raw_input("is it", guess, "?:") should use Python's string formatting to format the string being passed to raw_input: raw_input("is it %s?" %(guess, )).
1
0
0
I'm learning python with a book that teaches by creating games. I have to write the code so I input a number and the computer makes educated guesses based on higher or lower input. I keep getting an error after inputting my number: Traceback (most recent call last): File "C:\Users\Rayvenx\Desktop\My_programs\Number_...
Problem with creating variable in loop
1.2
0
0
993
5,236,855
2011-03-08T18:45:00.000
1
0
0
0
python,database,django,web-applications
5,236,907
2
false
1
0
My language agnostic recommendation would be to make sure that the database that communicates with the web app is read only; at least for the table(s) that deal with these account balances. So, you process payments, and manage the reduction of account balances in a database that is not accessible to anyone other than y...
2
3
0
So I have a Django web application and I need to add a payment module to it. Basically a user will prepay for a certain amount of service and this will slowly reduce over as the user uses the service. I'm wondering what is the best practice to facilitate this? I can process payments using Satchmo, but then just storing...
Securely storing account balances in a database?
0.099668
1
0
453
5,236,855
2011-03-08T18:45:00.000
6
0
0
0
python,database,django,web-applications
5,236,901
2
true
1
0
I don't know about a "well-tested solution" as you put it, but I would strongly caution against just storing a dollar value in the database and increasing or decreasing that dollar value. Instead, I would advise storing transactions that can be audited if anything goes wrong. Calculate the amount available from the c...
2
3
0
So I have a Django web application and I need to add a payment module to it. Basically a user will prepay for a certain amount of service and this will slowly reduce over as the user uses the service. I'm wondering what is the best practice to facilitate this? I can process payments using Satchmo, but then just storing...
Securely storing account balances in a database?
1.2
1
0
453
5,237,611
2011-03-08T20:00:00.000
17
0
1
0
python-3.x,cycle,next,itertools
5,237,631
2
false
0
0
In Python 3.x, iterators don't have it.next() any more. use next(it) instead, which also works in Python 2.6 or above. Internally, this will call it.next() in Python 2.x and it.__next__() in Python 3.x.
1
47
0
Well, I was using itertools.cycle().next() method with Python 2.6.6, but now that I updated to 3.2 I noticed that itertools.cycle() object has no method next(). I used it to cycle a string in the spin()method of a Spinner class. So if we cycle the tuple ('|', '/', '-', '\\', '|', '/', '-'), it'll print: |, /, -, \ , |,...
itertools.cycle().next()?
1
0
0
30,635
5,239,071
2011-03-08T22:19:00.000
2
0
1
0
python,string,python-3.x
5,239,094
6
false
0
0
You could use the simplest version: String3 = String1 + String2 or the format operator (deprecated in python3): String3 = '%s%s' % (String1, String2)
1
5
0
Is there any way to add one string to the end of another in python? e.g. String1 = 'A' String2 = 'B' and i want String3 == 'AB'
creating one string from two in python
0.066568
0
0
10,860
5,239,342
2011-03-08T22:51:00.000
0
0
0
0
python,testing,emacs,python-mode
5,239,956
3
false
0
0
You could use M-: then at the prompt (my-func arg1 arg2) Or you could put (my-func arg1 arg2) in the buffer somewhere near the function and C-x C-e at the end of it.
2
2
0
I'm writing a script that takes arguments, and I'd like to use emacs-model.el's C-c C-c to execute it while I'm writing it. But this merely runs the script without arguments, which then causes my script to complain. Is there an elegant way around this? My current solution is to hardcode the arguments.
using emacs-mode.el to execute with arguments
0
0
0
931
5,239,342
2011-03-08T22:51:00.000
2
0
0
0
python,testing,emacs,python-mode
5,240,661
3
true
0
0
C-c C-c isn't the right command to run your Python script. It will send your current buffer to the Python interpreter, just as though you had entered it there manually. If you used the recommended if __name__ == '__main__': line in your script, it won't run there anyway. A better way is the command "shell-command", bou...
2
2
0
I'm writing a script that takes arguments, and I'd like to use emacs-model.el's C-c C-c to execute it while I'm writing it. But this merely runs the script without arguments, which then causes my script to complain. Is there an elegant way around this? My current solution is to hardcode the arguments.
using emacs-mode.el to execute with arguments
1.2
0
0
931
5,239,797
2011-03-08T23:51:00.000
0
1
0
0
python,proxy,smtp,smtplib
44,179,874
8
false
0
0
This code has earned from me. 1. The file name must not be email.py Rename file name for example emailSend.py 2. It is necessary to allow Google to send messages from unreliable sources.
1
14
0
I would like to send email through a proxy. My current implementation is as follows: I connect to the smtp server with authentication. After I've successfully logged in, I send an email. It works fine but when I look at the email header I can see my host name. I would like to tunnel it through a proxy instead. Any he...
Python smtplib proxy support
0
0
1
25,028
5,240,646
2011-03-09T02:27:00.000
5
0
0
0
python,web2py
5,240,964
1
true
1
0
Yes, it works fine with svn, hg, whatever source control you need to use. Sometimes people think that you have to code with web2py's admin interface, but that really is not the case, once you realize it can be edited with any of your regular tools, you will see that you don't have to treat it any differently when it c...
1
1
0
I just start to learn python and web2py. Because of web2py's web interface development, I am wondering how can web2py work with svn? If a team wants to build a website,how do they work together? How to control the iteration of source code?
Can web2py work with svn?
1.2
0
1
742
5,240,670
2011-03-09T02:31:00.000
34
0
0
0
python,django,django-models
5,246,846
5
false
1
0
If you save your instance through a form, you can check form.has_changed().
2
21
0
I have a database model that is being updated based on changes in remote data (via an HTML scraper). I want to maintain a field called changed - a timestamp denoting when the last time that model's values changed from what they were previously (note that this is different from auto_now as these fields are updated every...
Detect if a model has changed before calling save in Django
1
0
0
16,703
5,240,670
2011-03-09T02:31:00.000
3
0
0
0
python,django,django-models
5,242,167
5
false
1
0
You might try computing a checksum of the record values when you save them. Then when you read it later, recompute the checksum and see if it has changed. Perhaps the crc32 function in the Python zlib standard module. (I'm not sure what kind of performance this would have. So you may want to investigate that.)
2
21
0
I have a database model that is being updated based on changes in remote data (via an HTML scraper). I want to maintain a field called changed - a timestamp denoting when the last time that model's values changed from what they were previously (note that this is different from auto_now as these fields are updated every...
Detect if a model has changed before calling save in Django
0.119427
0
0
16,703
5,241,445
2011-03-09T04:46:00.000
6
0
1
0
python,background
5,241,473
5
false
0
0
If you're on a Unix-like system (e.g. Mac OSX, Linux), the command is python myscript &, which runs the command in the background. In general, in bash (as well as most other shells) if you append a & to your command it runs the command in the background.
1
9
0
I have a Python program that interfaces with the browser, and now I meed to make that as my background process, so that every time I click the button, the program should start running in the background. Can anyone help me with an easy solution for this?
How to run Python programs in the background?
1
0
0
20,193
5,242,230
2011-03-09T06:37:00.000
0
0
0
0
python,django,web-applications,django-models
5,245,050
2
false
1
0
i think better to use `memcached (http://memcached.org/) in mem cached server and each server see this server also you can serialize your data and send it like udp and other method
2
0
0
I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process. I can modify the TCP server to put the information into SQLite database and have my Django web app take...
django - how to get model objects from another process instead of database
0
0
0
246
5,242,230
2011-03-09T06:37:00.000
1
0
0
0
python,django,web-applications,django-models
5,244,998
2
true
1
0
You may be able to serialise your model and pass the serialised data.
2
0
0
I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process. I can modify the TCP server to put the information into SQLite database and have my Django web app take...
django - how to get model objects from another process instead of database
1.2
0
0
246
5,244,517
2011-03-09T10:36:00.000
4
0
0
0
python,oracle10g,cx-oracle
5,247,755
4
true
0
0
You can retrieve dbms_output with DBMS_OUTPUT.GET_LINE(buffer, status). Status is 0 on success and 1 when there's no more data. You can also use get_lines(lines, numlines). numlines is input-output. You set it to the max number of lines and it is set to the actual number on output. You can call this in a loop and exit ...
1
3
0
Is there a way in cx_Oracle to capture the stdout output from an oracle stored procedure? These show up when using Oracle's SQL Developer or SQL Plus, but there does not seem to be a way to fetch it using the database drivers.
Capturing stdout output from stored procedures with cx_Oracle
1.2
1
0
2,934
5,245,058
2011-03-09T11:22:00.000
1
0
1
0
python,filter,line
5,245,225
5
false
0
0
if "apple" in line: should work.
1
16
0
I want to write a program which filters the lines from my text file which contain the word "apple" and write those lines into a new text file. What I have tried just writes the word "apple" in my new text file, whereas I want whole lines.
Filter lines from a text file which contain a particular word
0.039979
0
0
72,512
5,245,520
2011-03-09T12:07:00.000
0
0
1
1
python,console,minimize,standard-library
5,245,646
3
false
0
0
My first idea would be to have a .pyw-script for that specific task, that is launched in this case. Then only the original script's console pops up for a short time.
2
3
0
I wrote a program that uses the console. Most of the time, the user must see the console informations. For a specific function from command line, I would like to run the script without the console rises. I just don't want see the window but it can be in the task bar. I know I can use extra modules (gui, win32,..) to ...
Is it possible to minimize the console in python with the standard librairy (without extra module)?
0
0
0
6,676
5,245,520
2011-03-09T12:07:00.000
1
0
1
1
python,console,minimize,standard-library
5,245,696
3
false
0
0
on windows there are two python executables in your installation, one is "python.exe", which is the one you typically use. There is another called "pythonw.exe" which is for gui programs. It works just like python.exe, but does not display a console at all.
2
3
0
I wrote a program that uses the console. Most of the time, the user must see the console informations. For a specific function from command line, I would like to run the script without the console rises. I just don't want see the window but it can be in the task bar. I know I can use extra modules (gui, win32,..) to ...
Is it possible to minimize the console in python with the standard librairy (without extra module)?
0.066568
0
0
6,676
5,246,856
2011-03-09T14:01:00.000
0
1
1
0
python,algorithm,math
5,246,963
6
false
0
0
Python uses C math libraries for general cases and its own logic for some of its concepts (such as infinity).
1
56
0
I have to write a program to calculate a**b % c where b and c are both very large numbers. If I just use a**b % c, it's really slow. Then I found that the built-in function pow() can do this really fast by calling pow(a, b, c). I'm curious to know how does Python implement this? Or where could I find the source code f...
How did Python implement the built-in function pow()?
0
0
0
37,922
5,248,958
2011-03-09T16:35:00.000
0
1
1
0
python,file,dictionary,pickle
5,249,005
6
false
0
0
That is a lot of data... What kind of contents has your dictionary? If it is only primitive or fixed datatypes, maybe a real database or a custom file-format is the better option?
2
24
0
I have a relatively large dictionary. How do I know the size? well when I save it using cPickle the size of the file will grow approx. 400Mb. cPickle is supposed to be much faster than pickle but loading and saving this file just takes a lot of time. I have a Dual Core laptop 2.6 Ghz with 4GB RAM on a Linux machine. D...
Fastest way to save and load a large dictionary in Python
0
0
0
25,562
5,248,958
2011-03-09T16:35:00.000
2
1
1
0
python,file,dictionary,pickle
58,051,642
6
false
0
0
I have tried this for many projects and concluded that shelve is faster than pickle in saving data. Both perform the same at loading data. Shelve is in fact a dirty solution. That is because you have to be very careful with it. If you do not close a shelve file after opening it, or due to any reason some interruption...
2
24
0
I have a relatively large dictionary. How do I know the size? well when I save it using cPickle the size of the file will grow approx. 400Mb. cPickle is supposed to be much faster than pickle but loading and saving this file just takes a lot of time. I have a Dual Core laptop 2.6 Ghz with 4GB RAM on a Linux machine. D...
Fastest way to save and load a large dictionary in Python
0.066568
0
0
25,562
5,250,236
2011-03-09T18:11:00.000
0
0
0
1
python,google-app-engine,model,transactions,google-cloud-datastore
5,251,064
2
false
1
0
There's no reason to shard a model. There's no limit on the number of entities you can have with a given kind name - they're all stored in the same Bigtable anyway! It's not clear what you're trying to do that requires filtering on a list. Can you clarify? What sort of query do you want to perform?
2
1
0
I want to log analytics data (when someone loads page X, loads a js plugin, cancels a transaction) for my AppEngine app. I'm going to set it up as follows: 1. Event X occurs. 2. Add to taskqueue to put this event in the datastore. 3. Filter over datastore to graph and analyze usage data. So here's the issue: I'd like...
AppEngine Analytics Model with Lists of Times
0
0
0
175
5,250,236
2011-03-09T18:11:00.000
0
0
0
1
python,google-app-engine,model,transactions,google-cloud-datastore
5,360,121
2
false
1
0
Instead of logging this data inside your app, have you considered imbedding a proper analytics software, such as Google Analytics in your app? Your app is not really all that different from a normal website, even if you require logins. Google Analytics will provide you a much better reporting suit than just putting dat...
2
1
0
I want to log analytics data (when someone loads page X, loads a js plugin, cancels a transaction) for my AppEngine app. I'm going to set it up as follows: 1. Event X occurs. 2. Add to taskqueue to put this event in the datastore. 3. Filter over datastore to graph and analyze usage data. So here's the issue: I'd like...
AppEngine Analytics Model with Lists of Times
0
0
0
175
5,251,429
2011-03-09T19:58:00.000
3
0
1
0
python,list,duplicates,tuples
5,251,459
6
true
0
0
Put them in a dict using the first element as the key. If you check before adding then you'll get the first item with that key, otherwise you'll get the last.
1
2
0
In an array I have the following tuples: ('0000233/02', 50.0, None, None, None, None, 'Yes') ('0000233/02', 200.0, None, None, None, None, 'Yes') if im iterating through the list, how could I eliminate duplicates based solely on the first element?
python removing duplicates
1.2
0
0
966
5,251,771
2011-03-09T20:30:00.000
4
0
1
1
python,exception,command-line,exception-handling,operating-system
5,251,897
4
false
0
0
os.system throws a TypeError if there is not exactly one string argument. If the fork fails due to resource or ulimit restrictions, it will return -1. If the argument is not valid in some way (like non-existing command), it will return a high error code. Apart from the aforementioned TypeError, os.system does not throw...
2
11
0
Might the esteemed os.system of Python fame throw an exception? If so, which ones?
Does python's `os.system` ever throw an exception?
0.197375
0
0
11,902
5,251,771
2011-03-09T20:30:00.000
2
0
1
1
python,exception,command-line,exception-handling,operating-system
5,252,355
4
false
0
0
If you're asking whether it throws an exception when the process you're calling ends with an error, the answer is no, you can call a program with os.system(), have it error out, and you will never know. That's why you should use the subprocess module.
2
11
0
Might the esteemed os.system of Python fame throw an exception? If so, which ones?
Does python's `os.system` ever throw an exception?
0.099668
0
0
11,902
5,252,192
2011-03-09T21:10:00.000
0
0
1
0
python,pdf,pdf-generation
39,031,842
2
false
0
0
PDFsam will merge PDFs and create an index with links based on each individual PDF file name or title. I initially downloaded PDFsam Basic because it will auto organize the PDFs to be merged in order of folder structure instead of only alphabetically. To add multiple PDFs from various folders I go to a directory, sear...
1
3
0
I have a python script that exports 772 pdfs and combines them into a multi-page pdf binder. While exporting each PDF, it also adds the name of the current pdf as an entry in a text file. After the whole binder is created, the text file has an entry for each PDF page in the same order as the PDF binder. I need to use t...
How to generate a PDF index page?
0
0
0
1,784
5,252,477
2011-03-09T21:37:00.000
0
0
0
1
python,google-app-engine
5,252,580
6
false
1
0
You mean you used GQL in the datastore admin? Like, delete from x...? And that was too expensive? Hmmm... Well, you might save some money if you integrate deleting into your runtime code. ie, if a user is logged in, you're already accessing the db, presumably with the same indicies, so why not delete it then? You would...
4
8
0
I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them. I started using the "datastore admin" for this. In...
Economically deleting data from app engine
0
0
0
524
5,252,477
2011-03-09T21:37:00.000
0
0
0
1
python,google-app-engine
5,257,085
6
false
1
0
Questions. - Are your Event entities grouped in entity groups? - How many indexes do you have? Any composite ones? - How many properties that are not indexed=False? Just trying to determine the cost of a delete. You may be able have some of your indexes vacuumed before you start deleting the entities.
4
8
0
I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them. I started using the "datastore admin" for this. In...
Economically deleting data from app engine
0
0
0
524
5,252,477
2011-03-09T21:37:00.000
3
0
0
1
python,google-app-engine
5,260,096
6
false
1
0
Presuming your goal is to delete for the cheapest cost, rather than face migration, I would launch a self-scheduling task, that would clean up several hundred/thousand keys in each run, then re-schedules itself. I would purposefully throttle this task on a separate queue so that the task ran only often enough to avoid ...
4
8
0
I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them. I started using the "datastore admin" for this. In...
Economically deleting data from app engine
0.099668
0
0
524
5,252,477
2011-03-09T21:37:00.000
3
0
0
1
python,google-app-engine
5,263,768
6
true
1
0
Removing indexes first will substantially reduce the cost of deleting records. You could also limit your deletion rate to keep under the 6.5 CPU hours per day you're allocated for free, to avoid paying. Regarding doing the deletion yourself, it's unlikely you can do it more efficiently than the datastore admin tool, wh...
4
8
0
I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them. I started using the "datastore admin" for this. In...
Economically deleting data from app engine
1.2
0
0
524
5,253,358
2011-03-09T22:59:00.000
3
0
0
0
python,windows,windows-7
5,253,379
5
false
0
0
go to Start > All programs > Accessories and click on Command Prompt. then drag the python file from the explorer view into this command line and press Enter... now you can watch the output of the script execution !
1
2
0
this is the first time I have used Python. I downloaded the file ActivePython-2.7.1.4-win32-x86 and installed it on my computer; I'm using Win7. So when I tried to run a python program, it appears and disappears very quickly. I don't have enough time to see anything on the screen. I just downloaded the file and double-...
How to launch a Python file on Windows 7?
0.119427
0
0
12,553
5,253,832
2011-03-09T23:53:00.000
0
0
0
0
python,api,virtualbox
28,183,048
2
false
0
1
You need to lock the machine first so that the console object get created for you.
1
3
0
I'm trying to manage some Virtual Machines through the vboxapi provided with the SDK. So far I managed to launch the VM and poweroff it, but I'm not able to restore the snapshot. Looks like the power off procedure locks the virtual machine until the scripts terminates, as a matter of fact this is the error that I get: ...
VirtualBox Python API restoring snapshot
0
0
0
2,664
5,257,456
2011-03-10T09:06:00.000
2
0
0
1
python,google-app-engine
7,766,177
4
false
1
0
I come back to this question after sereval searches. I rode Programming Google App Engine by Dan Sanderson and Using Google App Engine by Charles Severance (both edited O'Reilly and Google Press) and they are pretty good. I recommend it for basic usage.
1
6
0
Can you recommend me book to Google App Engine in Python? English/French books are both accepted.
Looking for a good book for Google App Engine Python
0.099668
0
0
3,027
5,258,623
2011-03-10T10:52:00.000
5
0
1
0
python
5,258,931
3
false
0
0
For example using the encode method: u"Mikael Håfström".encode("ascii", "ignore")
1
10
0
i have a string "Mikael Håfström" which contains some special characters how do i remove this using python?
remove special characters from string
0.321513
0
0
12,590
5,259,329
2011-03-10T12:01:00.000
1
0
1
0
python,mysql
5,259,400
4
false
0
0
Pickle is a binary serialization, that's why you get a byte string. Pros: more compact can express most of Python's objects. Con's: bytes can be harder to handle Python only. JSON is more universal, so you're not tied to reading data with Python. It's also mostly ASCII, so it's easier to handle. the con is that i...
1
3
0
I ´m trying to serialize an array in python to insert it on a database of MySQL... I try with pickle.dump() method but it returns byte... what can I use?? thanks!! (I ´m working in python 3)
Serizalize an array in Python
0.049958
1
0
1,312
5,260,657
2011-03-10T14:01:00.000
3
0
0
0
javascript,python,cookies
5,260,708
3
true
1
0
You should set your cookies wherever it's most convenient. That probably means that some cookies will come from the server and some from the client. Note, however, that, for security reasons, high-risk cookies (such as a login token) should be HTTP-Only so that they cannot be accessed from Javascript. (It goes without ...
3
2
0
I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p...
How to manage cookies - with JavaScript or with HTTP Set-Cookie?
1.2
0
0
618
5,260,657
2011-03-10T14:01:00.000
1
0
0
0
javascript,python,cookies
5,260,766
3
false
1
0
Cookies are always bundled with the HTTP header, so there is no 'improvement' in reading via JavaScript and sending them via AJAX to the server. For example, display-related settings such as font-size or website language are usually only relevant for the client-side, so I'd simply use JavaScript to set and retrieve su...
3
2
0
I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p...
How to manage cookies - with JavaScript or with HTTP Set-Cookie?
0.066568
0
0
618
5,260,657
2011-03-10T14:01:00.000
0
0
0
0
javascript,python,cookies
5,261,401
3
false
1
0
When you set cookies using headers you have the option of setting the HTTP only (i.e. no javascript access) and SSL - only. Enabling these options avoids a lot of security vulnerabilities in your application (note that setting the http only flag just prevents javascript from reading the cookie - it will still be prese...
3
2
0
I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p...
How to manage cookies - with JavaScript or with HTTP Set-Cookie?
0
0
0
618
5,260,675
2011-03-10T14:02:00.000
4
0
1
0
python,delegation
5,260,702
2
true
0
0
Delegation is a powerful mechanism where by you delegate a task away from one class to another. This has the main advantage that changes in one of your classes will not cascade down or into any others. Furthermore, if you are not getting this principle your classes are probably doing more than they should. By this I me...
1
3
0
I have just come across delegation in python and cannot wrap my head around the difference between delegation and inheritance. Why would one want to use delegation rather than inheritance??
delegation vs inheritance python
1.2
0
0
3,122
5,260,801
2011-03-10T14:11:00.000
1
0
0
1
python,django,web-application-project
5,260,848
2
false
1
0
You need Python, Django, a WSGI container (e.g. mod_wsgi, uWSGI, Paste Deploy), and a database server. You make the Django project available as a WSGI app, bound to the appropriate interface on the machine.
1
4
0
What I want to know are actually 2 things. Part 1: I have a developed source code for an application in python that uses Django framework. What I want is to be able to run the code on a developer machine and see the result. What do I need for it? (my guesses): Python development enironment (Eclipse/PyDev/Aptana Studio...
A list of everything I need for running my app on a web server
0.099668
0
0
159
5,262,235
2011-03-10T15:57:00.000
5
0
1
0
python
5,262,315
4
false
0
0
Any object with an __iter__() method is considered an iterable. Additionally, any sequence (objects that have an __getitem__() method) could return an iterator. An iterator is an object with a __next__() method that returns the next object in the sequence and throws a StopIteration exception.
1
50
0
What makes something iterable in Python? ie. can loop over it with for Is it possible for me to create an iterable class in Python? If so, how?
What makes something iterable in python
0.244919
0
0
37,716
5,262,387
2011-03-10T16:08:00.000
1
0
0
0
python,ms-access,orm
5,262,564
2
true
1
0
Web2py recently updated their DAL making it much easier to add support for new db engines. I don't believe there is currently native Jet (MS Access) support, but the existing SQL Server support could probably be modified without much effort to provide MS Access support. The latest version of the web2py DAL is a singl...
1
1
0
I need to use a Python ORM with a MS-Access database (in Windows). My first searches are not really succesfull : SQLAlchemy : no MS Access support in the two last versions. DAL from Web2Py : no Access (??) Storm : no MS Access sqlobject: no MS Access dejavu : seems OK for MS Access but is the project alive ? Any ide...
Python ORM for MS-Access
1.2
1
0
1,062
5,262,406
2011-03-10T16:10:00.000
2
1
1
0
python,function,class,import
5,262,474
6
false
0
0
I believe that it's best practice (according to some PEP's) that you keep import statements at the beginning of a module. You can add import statements to an __init__.py file, which will import those module to all modules inside the package. So...it's certainly something you can do the way you're doing it, but it's dis...
3
58
0
I created a module named util that provides classes and functions I often use in Python. Some of them need imported features. What are the pros and the cons of importing needed things inside class/function definition? Is it better than import at the beginning of a module file? Is it a good idea?
Import statement inside class/function definition - is it a good idea?
0.066568
0
0
54,351
5,262,406
2011-03-10T16:10:00.000
4
1
1
0
python,function,class,import
30,221,106
6
false
0
0
Like flying sheep's answer, I agree that the others are right, but I put imports in other places like in __init__() routines and function calls when I am DEVELOPING code. After my class or function has been tested and proven to work with the import inside of it, I normally give it its own module with the import followi...
3
58
0
I created a module named util that provides classes and functions I often use in Python. Some of them need imported features. What are the pros and the cons of importing needed things inside class/function definition? Is it better than import at the beginning of a module file? Is it a good idea?
Import statement inside class/function definition - is it a good idea?
0.132549
0
0
54,351
5,262,406
2011-03-10T16:10:00.000
2
1
1
0
python,function,class,import
5,302,566
6
false
0
0
While the other answers are mostly right, there is a reason why python allows this. It is not smart to import redundant stuff which isn’t needed. So, if you want to e.g. parse XML into an element tree, but don’t want to use the slow builtin XML parser if lxml is available, you would need to check this the moment you ne...
3
58
0
I created a module named util that provides classes and functions I often use in Python. Some of them need imported features. What are the pros and the cons of importing needed things inside class/function definition? Is it better than import at the beginning of a module file? Is it a good idea?
Import statement inside class/function definition - is it a good idea?
0.066568
0
0
54,351
5,262,977
2011-03-10T16:49:00.000
0
1
0
0
python,buildbot
5,692,993
4
false
1
0
Some additional information about configuring abd running buildslave after it's creation. After installing buildbot package int.d script /etc/init.d/buildbot is added to enable running buildbot as a service (starting automatically after system restart and so on). For this script to run successfully you need to edit con...
1
0
0
should be dumb as everybody seems to installed it without trouble. I spent hours within a fresh squeeze and tried different configurations (easy_install, aptitude and from source 0.81p.tar.gz) the best I got is a page from the localhost:9989 without any slave started. Knowing that I made the 2 accounts : buildmaster a...
buildbot from start
0
0
0
1,638
5,264,414
2011-03-10T18:58:00.000
0
0
0
1
python,django,unix,tcp,communication
5,264,700
2
false
0
0
Some general ideas for you: You could have a master-client approach. Requests would be inserted in the master, stored in a database. Master knows the state of each client (same db). Whenever there is a request, the master redirects it to a free client. The client reports back when has finished the task (including answe...
1
0
0
Mornink! I need to design, write and implement wide system consisting of multiple unix servers performing different roles and running different services. The system must be bullet proof, robust and fast. Yeah, I know. ;) Since I dont know how to approach this task, I've decided to ask you for your opinion before I leav...
What is best pythonic way to communicate between spreaded services/unix machines?
0
0
0
219
5,266,425
2011-03-10T21:59:00.000
2
0
0
0
jquery,python,django,forms
5,266,823
3
true
1
0
Create a Django view which renders just the HTML for the form using your preferred template. Then use $.ajax() with dataType: "html" to get the code for the form for use in your overlay.
1
1
0
I've installed the django-newsletter application, and customized the subscribing form. But, right now, I'd like to print it through a Jquery Overlay, instead of a flatpage containing that form. Problem is I don't know how to include this flatpages elements into every page where the link calling the overlay will be pre...
How to call django template in order to use it through Jquery?
1.2
0
0
830
5,268,017
2011-03-11T01:27:00.000
29
1
1
0
python
5,321,733
7
false
0
0
Nobody seems to want to say this, but I'm pretty sure the answer is simply: there's no solid reason for this behavior. All of the reasons given so far are essentially incorrect: There's nothing special about the main file. It's loaded as a module, and shows up in sys.modules like any other module. Running a main scr...
2
44
0
Why does Python compile libraries that are used in a script, but not the script being called itself? For instance, If there is main.py and module.py, and Python is run by doing python main.py, there will be a compiled file module.pyc but not one for main. Why? Edit Adding bounty. I don't think this has been properly a...
Why does Python compile modules but not the script being run?
1
0
0
11,900
5,268,017
2011-03-11T01:27:00.000
1
1
1
0
python
5,268,020
7
false
0
0
Because the script being run may be somewhere where it is inappropriate to generate .pyc files, such as /usr/bin.
2
44
0
Why does Python compile libraries that are used in a script, but not the script being called itself? For instance, If there is main.py and module.py, and Python is run by doing python main.py, there will be a compiled file module.pyc but not one for main. Why? Edit Adding bounty. I don't think this has been properly a...
Why does Python compile modules but not the script being run?
0.028564
0
0
11,900
5,268,391
2011-03-11T02:39:00.000
3
0
0
0
python,linux,ubuntu,numpy,pipe
5,268,722
3
false
0
0
Check out the save and load functions. I don't think they would object to being passed a pipe instead of a file.
2
1
1
Is it possible to pipe numpy data (from one python script ) into the other? suppose that script1.py looks like this: x = np.zeros(3, dtype={'names':['col1', 'col2'], 'formats':['i4','f4']}) print x Suppose that from the linux command, I run the following: python script1.py | script2.py Will script2.py get the piped num...
Pipe numpy data in Linux?
0.197375
0
0
751
5,268,391
2011-03-11T02:39:00.000
2
0
0
0
python,linux,ubuntu,numpy,pipe
5,268,401
3
true
0
0
No, data is passed through a pipe as text. You'll need to serialize the data in script1.py before writing, and deserialize it in script2.py after reading.
2
1
1
Is it possible to pipe numpy data (from one python script ) into the other? suppose that script1.py looks like this: x = np.zeros(3, dtype={'names':['col1', 'col2'], 'formats':['i4','f4']}) print x Suppose that from the linux command, I run the following: python script1.py | script2.py Will script2.py get the piped num...
Pipe numpy data in Linux?
1.2
0
0
751
5,268,588
2011-03-11T03:16:00.000
0
0
0
0
python,django
5,471,733
6
false
1
0
here is something I do in general, configure basic settings configure root url.py configure settings, url.py for static (media) files create model sync db write views (use simple template, if needed) once you are done with back end implementation think about UI prepare styles, scripts start working on template imple...
4
17
0
I'm a beginner to Python and Django. When starting a new project what do you do first before diving into the code? For example, one could take the following steps: Configure the settings.py file first Configure models.py to lay out data structure Create template files Define the views/pages Syncdb etc So my questio...
What is a good Django workflow?
0
0
0
3,676
5,268,588
2011-03-11T03:16:00.000
0
0
0
0
python,django
5,461,948
6
false
1
0
I find that my process varies depending on a lot of variables, mainly whether I know something will work or if I'm experimenting and also whether I'm developing on my production server or in a development environment. For example, I often do my development directly on the deployment server (most of my work is for intra...
4
17
0
I'm a beginner to Python and Django. When starting a new project what do you do first before diving into the code? For example, one could take the following steps: Configure the settings.py file first Configure models.py to lay out data structure Create template files Define the views/pages Syncdb etc So my questio...
What is a good Django workflow?
0
0
0
3,676
5,268,588
2011-03-11T03:16:00.000
2
0
0
0
python,django
5,273,465
6
false
1
0
I personally can't make a template without writing the views (unless it's a photoshop draft) but in general that's the way I go after I have a plan. What's extremely important for me is that I don't dive head-first into the code, and that I spend time mocking up the model structure based on the "screens" or "pages" tha...
4
17
0
I'm a beginner to Python and Django. When starting a new project what do you do first before diving into the code? For example, one could take the following steps: Configure the settings.py file first Configure models.py to lay out data structure Create template files Define the views/pages Syncdb etc So my questio...
What is a good Django workflow?
0.066568
0
0
3,676
5,268,588
2011-03-11T03:16:00.000
8
0
0
0
python,django
5,272,219
6
false
1
0
the required steps for a Django application? There are two required steps. Write the settings. Write the urls.py The rest of the steps are optional. This also serves as a checklist of things to do. Bad policy. You don't need a checklist of Django features. You need a collection of use cases or user stories whic...
4
17
0
I'm a beginner to Python and Django. When starting a new project what do you do first before diving into the code? For example, one could take the following steps: Configure the settings.py file first Configure models.py to lay out data structure Create template files Define the views/pages Syncdb etc So my questio...
What is a good Django workflow?
1
0
0
3,676
5,272,116
2011-03-11T11:05:00.000
1
1
0
1
python,tcl,wincvs
5,296,594
1
true
0
0
The problem is that Tcl's trying to build the standard file descriptors into available-by-default channels (i.e., stdin, stdout and stderr) but this goes wrong when they're not opened by default. That's the case on Windows when running disconnected (which is what happens inside GUI applications on that platform). When ...
1
1
0
I have got a list of files in txt files and I need to check them out in edit mode, and make some changes(there are word documents), and check them back in via WinCVS. I know I can write tcl scripts or macro, or python scripts in wincvs shell but I have some problems with them. I have installed TCL 8.5 and selected tcl ...
WinCVS - Python - TCL
1.2
0
0
2,712
5,274,733
2011-03-11T15:21:00.000
5
0
0
1
python,tornado
5,275,791
4
false
0
0
ioloop.add_callback, Tornado will execute the callback in the next IOLoop iteration.
2
8
0
In a tornado request handler if I have to call function foo() which doesn't affect what's returned to the user, it makes sense to return result to the user first and then call foo(). Is it possible to do this easily in tornado (or with some third-party package)?
Tornado process data in request handler after return
0.244919
0
0
1,965
5,274,733
2011-03-11T15:21:00.000
-2
0
0
1
python,tornado
5,417,646
4
true
0
0
No it's not "easy" out-of-the-box. What you're referring to is "fire and forget". Even if you use a thread pool to farm out the request, that thread pool will belong to the main python process that belongs to Tornado. The best approach is a message queue. Something like Carrot. That way, suppose you have a page where ...
2
8
0
In a tornado request handler if I have to call function foo() which doesn't affect what's returned to the user, it makes sense to return result to the user first and then call foo(). Is it possible to do this easily in tornado (or with some third-party package)?
Tornado process data in request handler after return
1.2
0
0
1,965
5,274,934
2011-03-11T15:35:00.000
13
0
0
1
python,socks,icmp
5,275,216
4
true
0
0
A SOCKS proxy provides a TCP proxy service (SOCKS 5 added UDP Support). You cannot perform an ICMP Echo "via" a SOCKS proxy service. Even if you could, you would be testing ICMP Echo and Echo Reply, and not that your SOCKS server is running fine. If you want to test that your SOCKS server is "running fine" I'd suggest ...
1
6
0
I'd like to periodicity check if my SOCKS server is working fine. In order to do that, I thought of pinging 8.8.8.8 (google DNS server) through the SOCKS server. Is there other recommended way? If it's optimal, how can I ping through SOCKS with python?
Use ping through SOCKS server?
1.2
0
1
18,202
5,275,236
2011-03-11T15:58:00.000
1
0
0
0
python,database,transactions,cursor
5,275,401
1
true
0
0
This will depend a lot on your database as well as your chose python implementation - have you tried profiling a few short test operations?
1
2
0
Is opening/closing db cursor costly operation? What is the best practice, to use a different cursor or to reuse the same cursor between different sql executions? Does it matter if a transaction consists of executions performed on same or different cursors belonging to same connection? Thanks.
db cursor - transaction in python
1.2
1
0
659
5,275,296
2011-03-11T16:03:00.000
7
0
0
0
python,django,web.py
5,285,462
4
false
1
0
Django is actually quite fast. Using caches and multiple DB backends is a doodle - you actually can utilize Django's predefined caching framework for one-line view caching or even template fragment caching. And of course - low-level cache API. And - it's fun! In my experience - deployed under nginx and uWSGI, watched o...
2
14
0
I'd like to use Python to build a website with more than 100,000 PV each day. Now what I concern is to choose which web framework. I know lots of people use Django, and some people use web.py. Django seems powerful, and I also like the simplicity of web.py. Which framework should I use? (Please introduce the performanc...
Django or web.py, which is better to build a large website with Python?
1
0
0
15,107
5,275,296
2011-03-11T16:03:00.000
8
0
0
0
python,django,web.py
5,275,388
4
true
1
0
Django makes building complicated sites really simple. Before Django, I was messing around with PHP, and I was doing a really terrible job putting it together. Django leads you in the right direction with some good practices which makes your site really easy to maintain and update. I really like the ORM and how you ...
2
14
0
I'd like to use Python to build a website with more than 100,000 PV each day. Now what I concern is to choose which web framework. I know lots of people use Django, and some people use web.py. Django seems powerful, and I also like the simplicity of web.py. Which framework should I use? (Please introduce the performanc...
Django or web.py, which is better to build a large website with Python?
1.2
0
0
15,107
5,275,488
2011-03-11T16:21:00.000
0
0
1
1
python,timezone,tornado
5,275,903
3
false
0
0
Pardon my dimness but why do you mean to format the date based on the user in the context of Tornado? Tornado is a server. The user is a client.
1
2
0
How do people handle timezones in Tornado so that users see time formatted relative to their timezone? I know there's locale.format_date which defaults to GMT, but how do I set the right timezone based on the user?
Setting timezone in Tornado
0
0
0
1,179
5,276,837
2011-03-11T18:26:00.000
1
0
1
0
python
5,276,879
4
false
0
0
TextFileData.split(EndOfLine_char) seems to be your solution. If it's not working fast enough, then you should consider using a lower-level programming level.
1
1
0
I need to read lines from a text file but, where the 'end of line' caracter is not always \n or \x or a combination and may be any combination of characters like 'xyz' or '|', but the 'end of line' is always the same and known for each type of file. As the text file may be a big one and I have to keep performances and ...
Special End-line characters/string from lines read from text file, using Python
0.049958
0
0
656
5,276,967
2011-03-11T18:40:00.000
2
0
1
0
python,xcode,xcode7
45,969,622
8
false
0
0
This thread is old, but to chime in for Xcode Version 8.3.3, Tyler Crompton's method in the accepted answer still works (some of the names are very slightly different, but not enough to matter). 2 points where I struggled slightly: Step 16: If the python executable you want is greyed out, right click it and select quic...
2
198
0
How does one create a Python friendly environment in Xcode 4, 5, 6 or 7?
Python in Xcode 4+?
0.049958
0
0
189,740
5,276,967
2011-03-11T18:40:00.000
6
0
1
0
python,xcode,xcode7
5,734,739
8
false
0
0
Another way, which I've been using for awhile in XCode3: See steps 1-15 above. Choose /bin/bash as your executable For the "Debugger" field, select "None". In the "Arguments" tab, click the "Base Expansions On" field and select the target you created earlier. Click the "+" icon under "Arguments Passed On Launch". You ...
2
198
0
How does one create a Python friendly environment in Xcode 4, 5, 6 or 7?
Python in Xcode 4+?
1
0
0
189,740
5,278,044
2011-03-11T20:38:00.000
1
1
0
1
python,linux,bash,shell
5,278,104
5
false
0
0
You can do it on different levels - here are a few options use ssh to pipe myprog | ssh remotemachine myotherprog use nfs (if going to a file use netcat (nc) use something like thrift It depends on how solid & permanent the solution needs to be
1
1
0
I have a python script that output/prints a large array (50MB in size) to the screen. This script is running on machineA. Is it at all possible to 'pipe' this output to machineB, where it will be processed? I know I can save the output in a file on machineA and then send the file to machineB. I was just wondering if it...
Piping output from a python script to a remote machine?
0.039979
0
0
3,563
5,279,102
2011-03-11T22:36:00.000
1
1
0
0
python,cryptography,rsa,m2crypto
5,340,010
1
true
0
0
It sounds like you're looking for a hybrid cryptosystem which takes care of encryption and signature together, using appropriate crypto primitives to allow it to work whatever the size of the data, and encapsulating all the components of the cryptogram in one place. PGP, HTTPS and DHIES are good examples. While it seem...
1
1
0
This might be something obvious that I'm missing. I would like to have my host encrypt a message to a client using the client's public key, and also have that message signed using the hosts private key. It seems like an obvious scenario, but perhaps my concept is simply wrong. I think that you should be able to do wit...
M2Crypto, Encrypt and Sign at once?
1.2
0
0
641
5,280,692
2011-03-12T05:06:00.000
0
0
1
0
python,time
5,280,752
5
false
0
0
In the datetime module, there is an abstract base class called tzinfo which controls how datetime.datetime and datetime.time handle time zones. You basically derive your own class to control the time zone interpretation. I have never personally used it, so I can't say much more about it. Unfortunately, the only tim...
1
17
0
I want to convert the current time to +0900 in Python. What's the appropriate way to do this (assuming in the time module)? I've read this isn't included with Python and you have to use something like pytz. I don't want to change it on a server basis or globally, just in this one instance.
Python: Convert local time to another time zone
0
0
0
34,669
5,281,336
2011-03-12T07:40:00.000
1
0
1
1
python,linux,deployment
5,281,722
4
false
0
0
you can use pyinstaller to create a stand-alone executables see:http://www.pyinstaller.org/
1
5
0
I have written an (obviously) excellent tool in python (under linux) that I would like to share with my co-workers. We work on different machines, but with the same, shared environment. Also, we are users, so there is no way of easily installing dependencies. Now here's the catch: I like python, my users don't care. Th...
How to deploy a simple python application in linux for shared, company environment?
0.049958
0
0
5,427
5,281,589
2011-03-12T08:55:00.000
0
0
1
1
macos,unicode,utf-8,python-3.x
5,281,825
1
false
0
0
str() returns a string yes. And a str will be encoded when written, yes. I'm not entirely sure why the ascii encoding is being used (it is the default encoding in Python 2, but not in Python 3), but I'm even less sure why you do str(sentence). If you want to decode bytes you don' use str() you use .decode(). So start w...
1
0
0
I'm trying something like this: outFile = open("file.txt", "wt",encoding='utf-8') outFile.write(str(sentence)) outFile.close() and getting the error: UnicodeEncodeError: 'ascii' codec can't encode character '/x4e'. why is an ascii encoder being used? Am I right in saying that my string (str(sentence)) is in unicode? ...
UnicodeEncodeError: ascii when wishing to use unicode
0
0
0
180
5,282,612
2011-03-12T12:55:00.000
1
0
1
0
visual-studio-2010,debugging,ironpython
7,354,421
2
false
0
0
Go to the project properties and change the "Launch Mode" to "Standard Python Launcher" (unless you need to debug C# code)
1
4
0
I've installed VS 2010 Shell and IronPython Tools, but I can't get the debugger to show any values via Quick Watch, it says variable is not found in the context. Is it because I don't have VS 2010 itself installed, only the shell? The IronPython Tools Walkthrough document says debugging is so far only supported via C# ...
Debugging with IronPython Tools in Visual Studio Shell: can't watch the variables
0.099668
0
0
1,967
5,282,764
2011-03-12T13:28:00.000
1
0
0
0
java,python,django,single-sign-on,playframework
5,289,431
3
false
1
0
If you use a standard SSO mechanism, it should be managed by the mechanism itself... The webserver (Django or Play) should redirect the user to the authentication page of the SSO server. The SSO server generates a token and sent it back to the client (in a cookie for example) and redirects the client to the webserver (...
2
4
0
How can I create a single sign on application that will let me move from one section of my site to another. One section of my site uses play framework and the other is on django. My SSO know-how is very limited so be nice to me :)
Share Session between Play framework and Django
0.066568
0
0
1,182
5,282,764
2011-03-12T13:28:00.000
1
0
0
0
java,python,django,single-sign-on,playframework
5,282,901
3
false
1
0
A very simple solution would be to use a cookie on your domain that can be read by both Play! and Django. The cookie could hold a temporary token that both apps can check at e.g. a shared DB in case the user is not already logged-in for that app.
2
4
0
How can I create a single sign on application that will let me move from one section of my site to another. One section of my site uses play framework and the other is on django. My SSO know-how is very limited so be nice to me :)
Share Session between Play framework and Django
0.066568
0
0
1,182
5,283,506
2011-03-12T15:44:00.000
0
0
0
1
python,google-app-engine
5,283,536
3
false
1
0
When you log in (the blue box where you enter the email) there is a checkbox to apply the administrator flag to your session.
1
3
0
I want to create an Admin-only page for my GAE application. But I found there's no way to set a Admin user, so I cannot log on the page I created and test the function. I tried the local Admin console, but no luck. How can I do this?
how to set the admin user with GAE dev app server?
0
0
0
924
5,283,995
2011-03-12T17:03:00.000
6
1
1
0
python,interface,abstract-class
5,284,403
2
true
0
0
Personally, I find abstract classes to be most useful when writing libraries or other code which interfaces between one developer and another. One of the advantages of statically-typed languages is that when you use the wrong type, it fails early (often, as early as compile time). ABCs allow Python to gain this same a...
1
12
0
I cannot find much advantage in them besides kind of documentation purpose. Python will warn me if I forget to implement a method I defined in a ABC but since I do not reference my objects by their interfaces I can forget to declare methods in their interfaces and I won't event notice it. Is it common practice to use A...
Is it pythonic to use interfaces / abstract base classes?
1.2
0
0
2,095
5,286,093
2011-03-12T22:52:00.000
9
0
0
0
python,listbox,tkinter
5,290,731
3
false
0
1
One simple solution is to use two listboxes side-by-side. There's no real magic, you just have to do a little bit of extra work to get one scrollbar to control both (easily done) and have the selection in the two sync up (also easily done).
1
20
0
I'm trying to create a Listbox in Tkinter that has columns. I'm returning from a DB query records and would like to display each entry in it's own column for each record. Looking at Listbox, I feel like there should be this functionality there but can't find it. What widget should I be using to do this? I've been sea...
Display Listbox with columns using Tkinter?
1
0
0
62,004
5,286,447
2011-03-12T23:55:00.000
0
0
1
0
python,python-multithreading
5,289,540
2
false
0
0
I am not entirely sure how you terminate your threads, but in the implementation I have in my head, you would be destructing a thread object would you not? In this case you release the lock in the destructor...
1
0
0
I have a multithreaded C extension for Python. It outputs data to the class in Python using 3 threads. I am using PyGILState_Ensure / PyGILState_Release API to sync interpreter calls. There are possible cases in the extension where some threads stuck and get terminated before they call PyGILState_Release. Is there anyw...
Python multithreaded extension - thread lock recovery
0
0
0
289
5,286,738
2011-03-13T01:07:00.000
0
0
0
0
javascript,python,backbone.js,pylons,pyramid
6,868,297
3
false
1
0
Could you elaborate on your question a little bit? What are you looking to do? I have worked with backbone and pylons/pyramid, but they interface with each other and are not integrated. Backbone talks to the API which was built using pyramid.
1
7
0
Does anyone have experience using Backbone.js and Pylons/Pyramid ? any sample to look at ?
Does anyone have experience using Backbone.js and Pylons/Pyramid ? any sample to look at?
0
0
0
1,358
5,287,113
2011-03-13T03:02:00.000
1
1
0
0
python,apache,cgi
5,287,233
1
false
1
0
I think I figured it out. I need to use the environ variable passed to the application function by mod_wsgi. Thanks!
1
0
0
I am trying to get the query string in a CGI python script because for some reason the .FieldStorage and .getvalue functions are returning "None". The query is being generated correctly. I checked it in Wireshark and it is correctly produced. Any ideas on how I can just get the string itself correctly? I was trying to ...
Get the GET query in a Python CGI script (Apache, mod_cgi)
0.197375
0
0
669
5,287,207
2011-03-13T03:28:00.000
0
0
1
0
python,gtk,pygtk,cython
5,467,143
1
false
0
1
Yes it is possible because most of the things that can be done with python can also be done in cython. However, using python extensions or doing anything with python objects (as opposed to statically declared C datatypes) will incur a performance penalty, so Cython will be less of an advantage. Look into cdef classes, ...
1
0
0
Is it possible to use both Cython and pure python extensions together? Say I'd like to have a wrapper for a C function, returning GdkPixbuf pointer. The ultimate goal would be to have that function available in python, returning gtk.gdk.Pixbuf object.
Cython interface with other extensions
0
0
0
272
5,287,253
2011-03-13T03:43:00.000
4
0
1
0
python,decompiling,pyc,compiled
68,492,985
9
false
0
0
I've been at this for a couple hours and finally have a solution using Decompyle++: visit https://cmake.org/download/ and install CMake. visit https://github.com/zrax/pycdc and grab a copy of this repo: pycdc-master. add C:\Program Files\CMake\bin to your system environment variables under PATH. I suggest putting you...
2
223
0
Is it possible to get some information out of the .pyc file that is generated from a .py file?
Is it possible to decompile a compiled .pyc file into a .py file?
0.088656
0
0
397,963
5,287,253
2011-03-13T03:43:00.000
3
0
1
0
python,decompiling,pyc,compiled
51,763,064
9
false
0
0
Install using pip install pycompyle6 pycompyle6 filename.pyc
2
223
0
Is it possible to get some information out of the .pyc file that is generated from a .py file?
Is it possible to decompile a compiled .pyc file into a .py file?
0.066568
0
0
397,963
5,287,516
2011-03-13T04:54:00.000
8
0
1
0
python,computer-science
5,287,550
5
true
0
0
Graph theory is the way to go. A graph is just a bunch of places (vertices) with roads (edges) between them, and in particular we're talking about a directed graph, which means one-way roads. Figuring out dependencies means, basically, finding out all the places that can reach a particular town along the one-way roads...
3
5
0
For those who used apt-get, you know that everytime you install / uninstall something, you get the notificatons saying you need / no longer need certain dependencies. I'm trying to understand the theory behinds this and potentially implement my own version of this. I've done some googling, came up with mostly coupling ...
Dependencies Tree Implementation
1.2
0
0
9,413
5,287,516
2011-03-13T04:54:00.000
0
0
1
0
python,computer-science
5,287,544
5
false
0
0
Walk the old dependency tree. Build a set of all of the elements in it. Walk the new dependency tree. Do the same as before. Subtract the latter set from the former. The result is your answer. Alternatively: Walk the old dependency tree. At each node, store the number of things that depend on (point to) that node. Re...
3
5
0
For those who used apt-get, you know that everytime you install / uninstall something, you get the notificatons saying you need / no longer need certain dependencies. I'm trying to understand the theory behinds this and potentially implement my own version of this. I've done some googling, came up with mostly coupling ...
Dependencies Tree Implementation
0
0
0
9,413
5,287,516
2011-03-13T04:54:00.000
0
0
1
0
python,computer-science
5,289,453
5
false
0
0
I think the step you're looking for is to differentiate between packages you has explicitly installed, and those that are dependencies. Once you have done this you can build dependency trees of all requested packages, and compare the set of these packages with the set of installed packages. XORing these, assuming all r...
3
5
0
For those who used apt-get, you know that everytime you install / uninstall something, you get the notificatons saying you need / no longer need certain dependencies. I'm trying to understand the theory behinds this and potentially implement my own version of this. I've done some googling, came up with mostly coupling ...
Dependencies Tree Implementation
0
0
0
9,413
5,287,575
2011-03-13T05:06:00.000
0
1
0
0
python,modeling,robotics,robot,inverse-kinematics
5,287,632
3
false
0
0
This isn't really a hard problem, is it? Presumably you're working out the math on your own; so if your robotic arm is visualized as, say, a few rectangular solids then all you need is something that will render these at the x,y,z coordinates and with the orientation vector you supply, updating when need be. OpenGL s...
1
2
0
I hope you don't mind if I ask for a bit of advice regarding modelling robotic systems. I've recently become rather interested in using inverse kinematics (IK) to control a 5 dof robotic manipulator. I have a solid foundation in IK but what I'm having trouble with is a way to visualize how the manipulator moves with re...
Modelling a robotic arm motion in 3D, ideas?
0
0
0
2,937
5,291,479
2011-03-13T18:36:00.000
0
0
1
0
python,indentation,prompt
26,475,538
2
false
0
0
I recently observed this behavior too, on Windows, using cmd.exe. It also happens with Console2 - an alternate shell I sometimes use. Though I do always use spaces in normal code in an editor, I had been accustomed to using the Tab key to indent in short multi-line inputs in the interactive python.exe interpreter. Rece...
2
2
0
hi everyone :) my problem is, up until now, i have exclusively used tabs to indent python, as i find it easier than spaces, but for no reason i know, python interactive prompt, the basic python.exe one, suddenly refuses to accept the tab button, all it does is flash the cursor. all i can think of is that my computer in...
indent with 'tab' button in python commandline
0
0
0
5,644