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,882,362 | 2011-05-04T11:01:00.000 | 12 | 0 | 1 | 0 | python,multithreading,new-operator | 5,882,469 | 2 | true | 0 | 0 | The thread module is the low-level threading API of Python. Its direct usage isn't recommended, unless you really need to. The threading module is a high-level API, built on top of thread. The Thread.start method is actually implemented using thread.start_new_thread.
The daemon attribute of Thread must be set before ca... | 1 | 9 | 0 | What is the difference between thread.start_new_thread and threading.Thread.start in python?
I have noticed that when start_new_thread is called, the new thread terminates as soon as the calling thread terminates. threading.Thread.start is the opposite: the calling thread waits for other threads to terminate. | thread.start_new_thread vs threading.Thread.start | 1.2 | 0 | 0 | 5,456 |
5,884,037 | 2011-05-04T13:17:00.000 | 0 | 0 | 1 | 1 | python,windows,py2exe | 5,884,122 | 2 | false | 0 | 0 | A Python program - regardless of whether iterpreted by the Python executable or in py2exe form - can do the same as any other program. That means that it should not be able to freeze a modern operating system unless it is run with superuser rights. However, programs (especially malicious and badly written ones) can sig... | 2 | 1 | 0 | I am using py2exe to compiling python scripts in executable files on Windows Xp/7/2000.
I am wondering if such executable scripts could freeze the operating system, and I have to reboot Windows.
I suppose such problems could occur if I try to manage driver library.
What do you think about? | Python: could a script compiled with py2exe freeze the operating system? | 0 | 0 | 0 | 263 |
5,884,037 | 2011-05-04T13:17:00.000 | 3 | 0 | 1 | 1 | python,windows,py2exe | 5,884,075 | 2 | true | 0 | 0 | Theoretically, yes. Windows is not the most stable OS out there, and programs sometime "freeze" it even without mucking with drivers and kernel-mode code. Python programs aren't any different in this respect, whether packed with py2exe or not, since Python programs on Windows easily have access to the same Windows APIs... | 2 | 1 | 0 | I am using py2exe to compiling python scripts in executable files on Windows Xp/7/2000.
I am wondering if such executable scripts could freeze the operating system, and I have to reboot Windows.
I suppose such problems could occur if I try to manage driver library.
What do you think about? | Python: could a script compiled with py2exe freeze the operating system? | 1.2 | 0 | 0 | 263 |
5,888,515 | 2011-05-04T18:59:00.000 | 1 | 0 | 0 | 0 | python,jasper-reports | 5,889,020 | 3 | true | 1 | 0 | Is this scenario plausible with current jasper reports software (open source or similar),
Yes.
could it be done
Yes.
and what would be steps in the right direction ?
Write a web server in Python. Your web server will allow a user to enter information on a web site and after submitting, data would be transfered... | 1 | 2 | 0 | I would like to generate reports in pdf format with following scenario: people would enter information on a web site and after submitting, data would be transfered to jasper reports server and pdf would be created.
Python would be language of choice for my task.
Is this scenario plausible with current jasper reports so... | jasper reports server? | 1.2 | 0 | 0 | 2,934 |
5,888,854 | 2011-05-04T19:30:00.000 | 1 | 0 | 0 | 0 | python,database,mobile,windows-mobile,berkeley-db | 5,888,966 | 1 | true | 0 | 0 | Berkeley DB is a library that needs to be available. What you may have is Python bindings to Berkeley DB. If the library is not present, having Python will not help.
Look for SQLite, which may be present (it is for iPhone) as it has SQL support and its library size is smaller than Berkeley DB, which makes it better sui... | 1 | 0 | 0 | Can i use Berkeley DB python classes in mobile phone directly , i mean Do DB python classes and methods are ready to be used in any common mobile phone like Nokia,Samsong (windows mobile)..etc.
If a phone system supports python language, does that mean that it is easy and straightforward to use Berkeley DB on it... | Can use Berkeley DB in mobile phone | 1.2 | 1 | 0 | 159 |
5,889,111 | 2011-05-04T19:53:00.000 | 0 | 0 | 1 | 0 | python,regex,perl | 5,889,138 | 3 | false | 0 | 0 | Replace using regular expression \,\s*FROM and replace with FROM. | 1 | 2 | 0 | I have a string
"THIS IS, A STRING, FROM"
How can I remove a comma before the FROM statement? | Regexp beginner: how to remove comma before a keyword? | 0 | 0 | 0 | 411 |
5,890,023 | 2011-05-04T21:21:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore,duplicates | 5,890,205 | 1 | true | 1 | 0 | Quick? Probably not.
If you did want to delete dupes, my approach would be to write a remote_api script. Query the model for all entities, sort by title, and fetch batches of 100. Keep a local Python dictionary of titles. If you encounter a new title, add it to the dictionary. If you encounter a known title, add the en... | 1 | 4 | 0 | I have two Google App Engine Models. I ran my cron's a few times and now there are duplicate entries in my datastore. If it was easy to just delete my entire datastore and upload my data again I would. BUT it took 4 hours to upload last time so I am wondering is there a quick way of deleting entries with duplicate n... | Delete duplicates from GoogleAppEngine Model? | 1.2 | 0 | 0 | 453 |
5,890,304 | 2011-05-04T21:53:00.000 | 9 | 0 | 1 | 0 | python,time | 14,132,794 | 10 | false | 0 | 1 | Using time.time()/datetime.datetime.now() will break if the system time is changed (the user changes the time, it is corrected by a timesyncing services such as NTP or switching from/to dayligt saving time!).
time.monotonic() or time.perf_counter() seems to be the correct way to go, however they are only available from... | 1 | 43 | 0 | I'm trying to create a simple game where the point is to collect as many blocks as you can in a certain amount of time, say 10 seconds. How can I get a timer to begin ticking at the start of the program and when it reaches 10 seconds, do something (in this case, exit a loop)? | Timer for Python game | 1 | 0 | 0 | 148,808 |
5,890,777 | 2011-05-04T22:51:00.000 | 1 | 0 | 0 | 0 | python,module,import,timeout,scipy | 5,890,806 | 1 | false | 0 | 0 | Sounds like the module isn't installed in the PYTHONPATH and/or mod_wsgi is compiled against a different Python interpreter than the one you're using from the command-line. Double check! | 1 | 0 | 0 | I can import sympy without a problem, but when I from sympy import linalg or import scipy.linalg, the request hangs out. I can't seem to find anything in the server logs about it either, and curl times out.
Any ideas on what could be going wrong will be greatly appreciated. If I comment out that single line, my program... | Python (mod-wsgi) hangs when importing from SymPy | 0.197375 | 0 | 0 | 126 |
5,890,802 | 2011-05-04T22:54:00.000 | 1 | 1 | 1 | 0 | python,linux,ubuntu,build,installation | 5,890,850 | 2 | false | 0 | 0 | Go back to the PyMouse Github page, click on "Downloads", pick one of the options from the window that pops up, extract the archive to your hard drive, and try again. | 1 | 0 | 0 | So, I created a Directory in Ubuntu called Pymouse and I put all the related Pymouse files from Github in there including setup.py. When I go to terminal I cd the directory and then once i have done that I type python setup.py install or python setup.py build and each time I enter that command I receive the following i... | Trying to install the Pymouse module on Ubuntu and receiving an error message | 0.099668 | 0 | 0 | 3,996 |
5,890,935 | 2011-05-04T23:13:00.000 | 2 | 0 | 0 | 0 | python,dataset,visualization,data-visualization | 5,891,605 | 4 | false | 0 | 0 | If you are looking for visualization rather than data mining and analysis, The Visual Display of Quantitative Information by Edward Tufte is considered one of the best books in the field. | 2 | 11 | 1 | I'm looking for a way to learn to be comfortable with large data sets. I'm a university student, so everything I do is of "nice" size and complexity. Working on a research project with a professor this semester, and I've had to visualize relationships between a somewhat large (in my experience) data set. It was a 15... | Acquiring basic skills working with visualizing/analyzing large data sets | 0.099668 | 0 | 0 | 2,645 |
5,890,935 | 2011-05-04T23:13:00.000 | 1 | 0 | 0 | 0 | python,dataset,visualization,data-visualization | 5,908,938 | 4 | false | 0 | 0 | I like the book Data Analysis with Open Source Tools by Janert. It is a pretty broad survey of data analysis methods, focusing on how to understand the system that produced the data, rather than on sophisticated statistical methods. One caveat: while the mathematics used isn't especially advanced, I do think you will n... | 2 | 11 | 1 | I'm looking for a way to learn to be comfortable with large data sets. I'm a university student, so everything I do is of "nice" size and complexity. Working on a research project with a professor this semester, and I've had to visualize relationships between a somewhat large (in my experience) data set. It was a 15... | Acquiring basic skills working with visualizing/analyzing large data sets | 0.049958 | 0 | 0 | 2,645 |
5,891,359 | 2011-05-05T00:26:00.000 | 2 | 0 | 0 | 0 | python,linux,ms-access | 5,925,032 | 8 | false | 0 | 0 | The various answers to the duplicate question suggest that your "primary goal" of creating an MS Access database on a linux server is not attainable.
Of course, such a goal is of itself not worthwhile at all. If you tell us what the users/consumers of the Access db are expected to do with it, maybe we can help you. Pos... | 4 | 7 | 0 | A primary goal of a project I plan to bid on involves creating a Microsoft Access database using python. The main DB backend will be postgres, but the plan is to export an Access image.
This will be a web app that'll take input from the user and go through a black box and output the results as an access db. The web app... | Building an MS Access database using python | 0.049958 | 1 | 0 | 3,427 |
5,891,359 | 2011-05-05T00:26:00.000 | 0 | 0 | 0 | 0 | python,linux,ms-access | 5,954,299 | 8 | false | 0 | 0 | Could you create a self-extracting file to send to the Windows user who has Microsoft Access installed?
Include a blank .mdb file.
dynamically build xml documents with tables, schema
and data
Include an import executable that will take
all of the xml docs and import into
the Access .mdb file.
It's an extra step for t... | 4 | 7 | 0 | A primary goal of a project I plan to bid on involves creating a Microsoft Access database using python. The main DB backend will be postgres, but the plan is to export an Access image.
This will be a web app that'll take input from the user and go through a black box and output the results as an access db. The web app... | Building an MS Access database using python | 0 | 1 | 0 | 3,427 |
5,891,359 | 2011-05-05T00:26:00.000 | 2 | 0 | 0 | 0 | python,linux,ms-access | 5,964,496 | 8 | false | 0 | 0 | If you know this well enough:
Python, it's database modules, and ODBC configuration
then you should know how to do this:
open a database, read some data, insert it in to a different database
If so, then you are very close to your required solution. The trick is, you can open an MDB file as an ODBC datasource. Now:... | 4 | 7 | 0 | A primary goal of a project I plan to bid on involves creating a Microsoft Access database using python. The main DB backend will be postgres, but the plan is to export an Access image.
This will be a web app that'll take input from the user and go through a black box and output the results as an access db. The web app... | Building an MS Access database using python | 0.049958 | 1 | 0 | 3,427 |
5,891,359 | 2011-05-05T00:26:00.000 | 0 | 0 | 0 | 0 | python,linux,ms-access | 5,972,450 | 8 | false | 0 | 0 | Well, looks to me like you need a copy of vmware server on the linux box running windows, a web service in the vm to write to access, and communications to it from the main linux box. You aren't going to find a means of creating an access db on Linux. Calling it a requirement isn't going to make it technically possible... | 4 | 7 | 0 | A primary goal of a project I plan to bid on involves creating a Microsoft Access database using python. The main DB backend will be postgres, but the plan is to export an Access image.
This will be a web app that'll take input from the user and go through a black box and output the results as an access db. The web app... | Building an MS Access database using python | 0 | 1 | 0 | 3,427 |
5,895,707 | 2011-05-05T09:50:00.000 | 1 | 0 | 0 | 0 | python,django,wordpress | 5,914,160 | 4 | false | 1 | 0 | If you can get away with running Django and Wordpress as separate apps, you can just use nginx to handle which requests go to which app.
For example, if the CMS portion you'd like Wordpress for is only a blog, you could have nginx send example.com/blog/ to wordpress, and anything else to django. | 1 | 1 | 0 | now I have a site which based on django(the python framework) which can run stable.
in this site we need to use wordpress as a cms.
the server config on ubuntu and nginx,
but i don't know how to combine the django and wordpress
together.any tips is wonderful.
thanks in advance! | how to combine django and wordpress based on ubuntu and nginx | 0.049958 | 0 | 0 | 1,879 |
5,901,136 | 2011-05-05T16:30:00.000 | 2 | 0 | 0 | 0 | python,algorithm,fractals,mandelbrot,color-palette | 5,901,301 | 3 | true | 0 | 0 | Convert your RGB coordinates to HSL or HSV and step through them, converting back to RGB along the way. | 1 | 6 | 0 | My goal with this algorithm I'm working on is to output a color progression out of some provided colors. By color progression I mean creating the "fade" effect between two colors (color A, color B) and store every color value ((R,G,B) tuple) in between.
For example, if what is provided is total black A = (0,0,0) and t... | How to make a color progression out of a color palette | 1.2 | 0 | 0 | 2,337 |
5,902,379 | 2011-05-05T18:20:00.000 | 0 | 0 | 1 | 0 | python,gdb,segmentation-fault,pyqt4 | 5,913,587 | 1 | false | 0 | 1 | If I remember correctly, you will also need at least libqt4-dbg and python-dbg, maybe a few others.. | 1 | 0 | 0 | I have a bug in my python script that is using PyQt4 that causes a segmentation fault.
I could not find the bug using pdb, so now I wanna try it with gdb.
The core file is written and when I open it and type where, I just get memory addresses and only question marks as function names.
I already installed the python-qt4... | Debugging PyQt4 using a core file | 0 | 0 | 0 | 407 |
5,902,485 | 2011-05-05T18:30:00.000 | 2 | 0 | 1 | 1 | python,subprocess | 5,902,554 | 5 | false | 0 | 0 | subprocess.call() takes the same arguments as subprocess.Popen(), which includes the stdout and stderr arguments. See the docs for details. | 1 | 22 | 0 | I want to do subprocess.call, and get the output of the call into a string. Can I do this directly, or do I need to pipe it to a file, and then read from it?
In other words, can I somehow redirect stdout and stderr into a string? | Can I have subprocess.call write the output of the call to a string? | 0.07983 | 0 | 0 | 24,472 |
5,902,914 | 2011-05-05T19:12:00.000 | 2 | 0 | 0 | 0 | python,mysql,encoding,urllib2,beautifulsoup | 5,903,100 | 2 | false | 1 | 0 | BeautifulSoup returns all data as unicode strings. First triple check that the unicode strings are ccorrect. If not then there is some issue with the encoding of the input data. | 1 | 2 | 0 | I'm working with the BeautifulSoup python library.
I used the urllib2 library to download the HTML code from a page, and then I have parsed it with BeautifulSoup.
I want to save some of the HTML content into a MySql table, but I'm having some problems with the encoding. The MySql table is encoded with 'utf-8' charset.
... | Wrong encoding with Python BeautifulSoup + MySql | 0.197375 | 1 | 0 | 693 |
5,905,574 | 2011-05-06T00:25:00.000 | 1 | 0 | 1 | 1 | python,environment-variables,subprocess | 5,905,589 | 5 | true | 0 | 0 | Can you print them out in the first subprocess and deal with that string in python? | 1 | 4 | 0 | I'm looking for a way to do this, so that I can pass it to the environment of another subprocess. | How to get the environment variables of a subprocess after it finishes running? | 1.2 | 0 | 0 | 5,121 |
5,907,312 | 2011-05-06T05:51:00.000 | 1 | 0 | 0 | 0 | django,apache,apache2,mod-python | 5,907,442 | 1 | true | 1 | 0 | If you only have user level access to the machine (ie: you don't have root), then you won't be able to control what web server runs and you can only control its settings to a limited regard. You will have to consider contacting your provider or looking for a different hosting package if the server doesn't meet you need... | 1 | 1 | 0 | I have developed a web application in Django and would like to go online i have an FTP access to the hosting server I am a beginner to "setting up a website" i would like to know how to install apache on that server and have my application working
Kindly provide detailed info as i am newbie, any links or tutorials woul... | How to set up Apache server via an FTP account | 1.2 | 0 | 0 | 347 |
5,910,379 | 2011-05-06T10:58:00.000 | 6 | 0 | 1 | 0 | python,module,import | 5,910,441 | 4 | false | 0 | 0 | Yes, this works, as you can tell. The reason for the empty __init__.py file is to mark sub-folders as folders containing modules.
So a folder in PYTHONPATH is ok to have modules in it, but any subfolders of those folders have to have a __init__.py file in them to be able to import modules from them. | 1 | 28 | 0 | I have been reading about the function of __init__.py file. It is said that we need an empty __init__.py file in the folder which contains modules, so that these modules can be imported. However, I tried adding a folder path to PYTHONPATH (Environment Variable in Windows 7). Although this folder does not contain an __i... | Importing modules in Python and __init__.py | 1 | 0 | 0 | 32,177 |
5,911,382 | 2011-05-06T12:25:00.000 | 1 | 0 | 1 | 0 | python,exception,video-capture | 24,388,352 | 2 | false | 0 | 0 | I know this is a really old thread. I kept getting this error after instantiating the Device a second time. Moving the code to the main thread fixed the problem for me. | 1 | 1 | 0 | I use the Python (2.7) package VideoCapture. When I try to instantiate the Device, I get an Exception:
Error: Capture Graph could not be created.
I use cam = Device(), so nothing special there. I have one laptop where this works without a problem, and another where I get the Exception. They are different, but both ha... | VideoCapture: Capture Graph Error | 0.099668 | 0 | 0 | 1,280 |
5,911,445 | 2011-05-06T12:30:00.000 | 0 | 0 | 0 | 1 | python,linux,usb,removable-storage | 70,601,544 | 5 | false | 0 | 0 | This is what I use from bash:
lsblk --pairs --nodeps | grep 'RM="1"'
Sample output:
NAME="sda" MAJ:MIN="8:0" RM="1" SIZE="59.5G" RO="0" TYPE="disk" MOUNTPOINT=""
Note it is listing the devices, not its partitions. If you like to see the partitions also,
lsblk --pairs | grep 'RM="1"' | 1 | 9 | 0 | How can I get a list of removable drives (plugged into USB) in Linux? I'm fine with using KDE, GNOME or other DE libraries if it would make things easier. | Listing all USB drives in Linux | 0 | 0 | 0 | 5,051 |
5,913,049 | 2011-05-06T14:44:00.000 | 1 | 0 | 1 | 0 | python,timezone | 5,913,087 | 5 | false | 0 | 0 | call datetime.now() with the time zone (as a tzinfo object) as an argument. | 1 | 0 | 0 | I have countrynames and utcoffset of that country
How to find out out local time in that country using utcoffset? | how to findout local time using utcoffset and countryname in python | 0.039979 | 0 | 0 | 1,509 |
5,914,506 | 2011-05-06T16:40:00.000 | 0 | 0 | 0 | 1 | python,networking,keyboard,python-idle | 5,914,591 | 5 | false | 0 | 0 | Stick a webcam on your computer that grabs an image every five seconds, then there's some python modules for image analysis that can check if you are still sitting in your seat.
Or get a microswitch wired into your chair, connect that to your PC serial port (or one of those modern USB ports) and read that from Python..... | 1 | 8 | 0 | I would like to write a script to do an heavy network upload, in the background.
However, I would like it to pause when I am using my computer (either by detecting network activity or keyboard activity or that I am not idle).
What is the best way to detect that I am using the computer, on Python on Unix? | In Python on Unix, determine if I am using my computer? or idle? | 0 | 0 | 1 | 2,328 |
5,915,151 | 2011-05-06T17:52:00.000 | 4 | 0 | 0 | 1 | python,cx-freeze | 5,915,297 | 1 | false | 0 | 0 | You can do that.... but you'll have to install Wine (apt-get install wine) and then install in Wine the windows version of Python and all the python libraries your application needs, and then you'll be able to freeze your script into an exe for windows in your ubuntu box. | 1 | 6 | 0 | When I use cxfreeze in Ubuntu, it automatically compiles the python script to a Linux executable. I've looked through the documentation extensively, and I can't find a way to freeze the script into a .exe for the purposes of running the program on a Windows machine. Can this be done-? | Can cx-freeze be used in Ubuntu to freeze a python script to a Windows executable? | 0.664037 | 0 | 0 | 1,065 |
5,916,097 | 2011-05-06T19:24:00.000 | 1 | 0 | 1 | 0 | python,loops | 5,916,133 | 6 | false | 0 | 0 | You have to problems. Solve the separately.
Finding matching names. Use a collections.defaultict
Creating tar files after you find the matching names. You've got that pretty well covered.
So. Solve problem 1 first.
Use glob to get all the names. Use os.path.basename to split the path and basename. Use os.path.s... | 1 | 3 | 0 | I need to iterate through a folder and find every instance where the filenames are identical (except for extension) and then zip (preferably using tarfile) each of these into one file.
So I have 5 files named: "example1" each with different file extensions. I need to zip them up together and output them as "example1.t... | Iterate within directory to zip files with python | 0.033321 | 0 | 0 | 3,325 |
5,918,532 | 2011-05-07T01:20:00.000 | 1 | 0 | 1 | 0 | python,unix,path,makefile | 5,918,550 | 2 | true | 0 | 0 | Typically python is the name of the system's default Python version, but all installed versions are also available with names like python2.7 or python3.2. You can use those names in a command in a Makefile, or you can put them on the #! line of a Python script if you want to invoke it that way. | 2 | 1 | 0 | How do I specify which version of python I want to use with make? | How do I specify which version of python I want to use with make? | 1.2 | 0 | 0 | 121 |
5,918,532 | 2011-05-07T01:20:00.000 | 1 | 0 | 1 | 0 | python,unix,path,makefile | 5,918,579 | 2 | false | 0 | 0 | A makefile just calls a command, you can check what python version is using calling whereis python (on UNIX) or checking the PATH environment (Windows). To override the default python you can make the call with the absolute path... just guessing anyway. | 2 | 1 | 0 | How do I specify which version of python I want to use with make? | How do I specify which version of python I want to use with make? | 0.099668 | 0 | 0 | 121 |
5,918,633 | 2011-05-07T01:52:00.000 | 0 | 0 | 1 | 0 | python,google-app-engine,ssl | 5,918,933 | 2 | false | 0 | 0 | You are able to install this by using pip. It's very easy, just go to a terminal and type, pip install ssl, which will automatically install the SSL module. You may need root privileges, however. | 1 | 4 | 0 | I noticed I have this warning:
WARNING 2011-05-07 00:50:51,371 urlfetch_stub.py:106] No ssl package found. urlfetch will not be able to validate SSL certificates.
So I downloaded the ssl 1.15 library.
Tried to install using setup.py and got this:
error: package directory 'ssl' does not exist
Update:
I added python to ... | Problems with installing ssl package in python 2.5 | 0 | 0 | 0 | 2,290 |
5,919,819 | 2011-05-07T07:56:00.000 | 3 | 0 | 1 | 0 | python,database,security,encryption | 5,919,875 | 4 | false | 0 | 0 | Data encrypted with AES has the same length as the plain data (give or take some block padding), so giving original length away doesn't harm security. SHA512 is a strong cryptographic hash designed to provide minimal information about the original content, so I don't see a problem here either.
Therefore, I think your s... | 3 | 3 | 0 | I'm using PyCrypto to store some files inside a SQLITE database.
I'm using 4 fields :
the name of the file,
the length of the file (in bytes)
the SHA512 hash of the file
the encrypted file (with AES and then base64 to ASCII).
I need all the fields to show some info about the file without decrypting it.
The question is ... | Storing encrypted files inside a database | 0.148885 | 1 | 0 | 484 |
5,919,819 | 2011-05-07T07:56:00.000 | 1 | 0 | 1 | 0 | python,database,security,encryption | 5,920,346 | 4 | true | 0 | 0 | To avoid any problems concerning the first few bytes being the same, you should use AES in Block Cipher mode with a random IV. This ensures that even if the first block (length depends on the key size) of two encrypted files is exactly the same, the cipher text will be different.
If you do that, I see no problem with y... | 3 | 3 | 0 | I'm using PyCrypto to store some files inside a SQLITE database.
I'm using 4 fields :
the name of the file,
the length of the file (in bytes)
the SHA512 hash of the file
the encrypted file (with AES and then base64 to ASCII).
I need all the fields to show some info about the file without decrypting it.
The question is ... | Storing encrypted files inside a database | 1.2 | 1 | 0 | 484 |
5,919,819 | 2011-05-07T07:56:00.000 | 0 | 0 | 1 | 0 | python,database,security,encryption | 5,933,351 | 4 | false | 0 | 0 | You really need to think about what attacks you want to protect against, and the resources of the possible attackers.
In general, storing some data encrypted is only useful if it satisfies your exact requirements. In particular, if there is a way an attacker could compromise the key at the same time as the data, then t... | 3 | 3 | 0 | I'm using PyCrypto to store some files inside a SQLITE database.
I'm using 4 fields :
the name of the file,
the length of the file (in bytes)
the SHA512 hash of the file
the encrypted file (with AES and then base64 to ASCII).
I need all the fields to show some info about the file without decrypting it.
The question is ... | Storing encrypted files inside a database | 0 | 1 | 0 | 484 |
5,920,764 | 2011-05-07T11:33:00.000 | 8 | 0 | 0 | 1 | python,macos,wxpython,uninstallation | 5,922,093 | 1 | false | 0 | 1 | If you look in the .dmg for wxPython, there is an uninstall_wxPython.py unininstall script. Just drag it to your desktop and run python ~/Desktop/uninstall_wxPython.py in a terminal. | 1 | 5 | 0 | Some details of my machine and installed packages before proceeding further:
Mac OSX version: 10.6.6
Python version: Activestate Python 2.7.1
wxpython version: wxpython 2.8 (uses Carbon API hence limited to 32-bit mode arch only)
I installed wxPython2.8-osx-unicode-py2.7 from wxpython website using their .dmg installer... | How to uninstall wxpython 2.8 on Mac OSX 10.6 | 1 | 0 | 0 | 4,762 |
5,921,947 | 2011-05-07T15:17:00.000 | 42 | 0 | 0 | 1 | python,linux,gcc,pyaudio | 5,922,091 | 10 | false | 0 | 0 | Well, I solved the problem by using the package manager,
$ sudo apt-get install python-pyaudio
Although still has no clue why easy_install fails. | 5 | 64 | 0 | I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio ... | Pyaudio installation error - 'command 'gcc' failed with exit status 1' | 1 | 0 | 0 | 61,454 |
5,921,947 | 2011-05-07T15:17:00.000 | 27 | 0 | 0 | 1 | python,linux,gcc,pyaudio | 44,772,116 | 10 | false | 0 | 0 | I install in my virtualenv. pyaudio (0.2.11)
pip install pyaudio -> error
sudo apt-get install portaudio19-dev -> success
pip install pyaudio -> success | 5 | 64 | 0 | I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio ... | Pyaudio installation error - 'command 'gcc' failed with exit status 1' | 1 | 0 | 0 | 61,454 |
5,921,947 | 2011-05-07T15:17:00.000 | 1 | 0 | 0 | 1 | python,linux,gcc,pyaudio | 35,901,952 | 10 | false | 0 | 0 | I found this question after experiencing a similar error on OpenSuse (13.2). So I figured I'd post my solution as well, in case other people find this via Google.
Although libportaudio2 is the package containing the libs, you need portaudio-devel as well to make the installation work. | 5 | 64 | 0 | I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio ... | Pyaudio installation error - 'command 'gcc' failed with exit status 1' | 0.019997 | 0 | 0 | 61,454 |
5,921,947 | 2011-05-07T15:17:00.000 | 5 | 0 | 0 | 1 | python,linux,gcc,pyaudio | 41,717,929 | 10 | false | 0 | 0 | This is how I get it work:
brew update (you can ignore this step if your brew is up to date)
brew install portaudio
brew link --overwrite portaudio
sudo python2.7 -m pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio | 5 | 64 | 0 | I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio ... | Pyaudio installation error - 'command 'gcc' failed with exit status 1' | 0.099668 | 0 | 0 | 61,454 |
5,921,947 | 2011-05-07T15:17:00.000 | 2 | 0 | 0 | 1 | python,linux,gcc,pyaudio | 64,455,416 | 10 | false | 0 | 0 | Had the same problem too. I'm working on a MAC and solved the issue by running these lines of code.
brew install portaudio
pip install pyaudio | 5 | 64 | 0 | I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio ... | Pyaudio installation error - 'command 'gcc' failed with exit status 1' | 0.039979 | 0 | 0 | 61,454 |
5,922,032 | 2011-05-07T15:29:00.000 | 0 | 0 | 0 | 0 | javascript,python | 5,922,070 | 1 | true | 1 | 0 | It's very unclear what you are looking for. If the question is about server push keywords are WebSockets,Socket.io,Ajax,Comet,Bayeux to start with | 1 | 1 | 0 | The original framework of my app (using Python) is below:
user key in keywords in forms.
App use the data in forms as parameter to get some results from third-party website.
The result which is from third-party website will be analyzed in my app.
Then show the result of analyze to user.
But there are some problems be... | Load form data in JavaScript and run something client side | 1.2 | 0 | 0 | 248 |
5,922,590 | 2011-05-07T16:52:00.000 | 1 | 0 | 1 | 1 | python,shell | 27,853,231 | 4 | false | 0 | 0 | subprocess.check_output appears to be the canonical convenience function in Python 2.4+ for executing a command and inspecting the output. It also raises an error if the command returns a non-zero value (indicating an error).
Like subprocess.call, check_output is a convenience wrapper around subprocess.Popen, so you m... | 1 | 6 | 0 | I am new to Python programming. I want to execute a shell command "at" from a Python program. Can any one of the Python gurus help me out? Thanks in advance. | How to execute a shell command through Python | 0.049958 | 0 | 0 | 8,218 |
5,926,773 | 2011-05-08T10:03:00.000 | 2 | 0 | 0 | 0 | python,networking,network-programming | 5,926,779 | 2 | false | 0 | 0 | Do you know the IP for your server computer? Just making sure you know that 127.0.0.1 (or localhost) no longer works in this setup.
Are your computers behind a NAT?
Can you ping from one computer to another?
Do you have a firewall? | 1 | 0 | 0 | I created a simple server and client using Python. When i run it on my computer i works fine. But if i run the server on my comupter and try to open client on the other computer, it cant find my server.
Thanks for helping. | Python server problems | 0.197375 | 0 | 1 | 55 |
5,926,908 | 2011-05-08T10:34:00.000 | 2 | 0 | 0 | 0 | python,linux,sockets,signals | 5,926,941 | 1 | true | 0 | 0 | Signals exist in their own process: a signal raised in a client process won't be known about by the server process and vice versa. Your options are either to have one process tell the other that it is being terminated, or just wait for the other side to notice that the connection has been dropped (which, if you're usin... | 1 | 1 | 0 | i have a question because i am fairly new to python, socket programming and signals. i have written a python socket server that forks a new process to handle requests for every client that connects to a certain port. I have caught the ctrl+c signal and closed my database connections should the the server get such signa... | python sockets, request.recv and signals | 1.2 | 0 | 1 | 1,001 |
5,927,180 | 2011-05-08T11:36:00.000 | 0 | 0 | 0 | 0 | python,arrays,numpy,filtering | 67,419,895 | 7 | false | 0 | 0 | [i for i in Array if i != 0.0] if the numbers are float
or [i for i in SICER if i != 0] if the numbers are int. | 1 | 51 | 1 | I have a rank-1 numpy.array of which I want to make a boxplot. However, I want to exclude all values equal to zero in the array. Currently, I solved this by looping the array and copy the value to a new array if not equal to zero. However, as the array consists of 86 000 000 values and I have to do this multiple times,... | How do I remove all zero elements from a NumPy array? | 0 | 0 | 0 | 149,688 |
5,928,704 | 2011-05-08T16:26:00.000 | 1 | 0 | 1 | 0 | python,nltk,wordnet | 67,602,947 | 8 | false | 0 | 0 | You can download the word vectors glove.6B.zip from https://github.com/stanfordnlp/GloVe, unzip them and look at the file glove.6B.50d.txt.
There, you will find 400.000 English words, one in each line (plus 50 numbers per word in the same line), lower cased, sorted from most frequent (the) to least frequent. You can cr... | 1 | 19 | 0 | Is there a way to find the frequency of the usage of a word in the English language using WordNet or NLTK using Python?
NOTE: I do not want the frequency count of a word in a given input file. I want the frequency count of a word in general based on the usage in today's time. | How do I find the frequency count of a word in English using WordNet? | 0.024995 | 0 | 0 | 16,516 |
5,930,036 | 2011-05-08T20:11:00.000 | 2 | 0 | 1 | 0 | python | 5,930,076 | 6 | false | 0 | 0 | From the help of the function:
Extension is everything from the last
dot to the end, ignoring leading dots.
So the answer is no, you can't do it with this function. | 1 | 18 | 0 | I'm working in python with os.path.splitext() and curious if it is possible to separate filenames from extensions with multiple "."? e.g. "foobar.aux.xml" using splitext. Filenames vary from [foobar, foobar.xml, foobar.aux.xml]. Is there a better way? | Separating file extensions using python os.path module | 0.066568 | 0 | 1 | 18,511 |
5,930,669 | 2011-05-08T22:04:00.000 | 3 | 0 | 1 | 0 | java,python,programming-languages | 5,930,685 | 3 | true | 0 | 0 | Yes.
Use a language that the people around you use.
You should know about lexing, parsing, symbol tables, abstract syntax trees, optimisation, intermediate languages, stack-based and register-based architectures, code generation, object file formats, linkers, loaders, etc. There are many resources available in other qu... | 2 | 1 | 0 | I have few questions over System side programming.
Can Python be used for both Web and System like perl.
Which language would you prefer me. I have a little knowledge on JavaScript and Java.
If i want to develop a compiler what should i know and where should i start. | System side programming - Which language? | 1.2 | 0 | 0 | 760 |
5,930,669 | 2011-05-08T22:04:00.000 | 1 | 0 | 1 | 0 | java,python,programming-languages | 5,930,756 | 3 | false | 0 | 0 | sure BASH and one full featured scripting language. I prefer Perl, but it is up to you.
for the 3.) You should study bison or yacc, lex, and/or any other grammar-parsers (compiler-compilers). | 2 | 1 | 0 | I have few questions over System side programming.
Can Python be used for both Web and System like perl.
Which language would you prefer me. I have a little knowledge on JavaScript and Java.
If i want to develop a compiler what should i know and where should i start. | System side programming - Which language? | 0.066568 | 0 | 0 | 760 |
5,930,780 | 2011-05-08T22:22:00.000 | 4 | 0 | 0 | 0 | python,geometry,screen,tkinter | 5,932,003 | 1 | true | 0 | 1 | You want to use the winfo_rootx and winfo_rooty methods of a widget. | 1 | 2 | 0 | I would like to know where exactly a widget is on the screen. | Is there any way to get a widgets position relative to the entire screen in Tkinter? | 1.2 | 0 | 0 | 469 |
5,930,982 | 2011-05-08T23:06:00.000 | 1 | 0 | 0 | 1 | python,windows,apache,python-3.x | 5,931,096 | 3 | false | 0 | 0 | Python 3.0 is only supported via CGI. Put your CGI script in cgi-bin\. If you're willing to look at newer versions, preliminary support is available in mod_wsgi (but you'll probably have to build it yourself). | 1 | 3 | 0 | I've searched for ages on how to use Python 3 under Apache. If there is a walkthrough anywhere, it's very well hidden. Thus, hopefully, one of you Python professionals could make a quick 1-2-3 on how it's done!
I'm on Windows 7 using the newest version of XAMPP. | How do I use Python 3.0 under Apache? | 0.066568 | 0 | 0 | 1,328 |
5,931,151 | 2011-05-08T23:41:00.000 | 1 | 0 | 0 | 0 | python,c,data-structures,file-io | 5,931,175 | 3 | true | 0 | 0 | Hash table resizing isn't a concern unless you have a requirement that each insert into the table should take the same amount of time. As long as you always expand the hash table size by a constant factor (e.g. always increasing the size by 50%), the computational cost of adding an extra element is amortized O(1). This... | 1 | 3 | 0 | I have large text files upon which all kinds of operations need to be performed, mostly involving row by row validations. The data are generally of a sales / transaction nature, and thus tend to contain a huge amount of redundant information across rows, such as customer names. Iterating and manipulating this data ha... | BST or Hash Table? | 1.2 | 1 | 0 | 501 |
5,932,111 | 2011-05-09T03:12:00.000 | 0 | 1 | 0 | 0 | python,twitter | 7,361,262 | 2 | false | 0 | 0 | The best way is to use a cron to record the data daily.
However, you can query the mentions using the search api with a untill tag. Which should do the trick. | 2 | 1 | 0 | I am looking to create a simple graph showing 2 numbers of time for my personal twitter. They are:
Number of followers per day
Number of mentions per day
From my research so far, the search API does not provide a date so I am not about to do a GROUP BY. The only way I can have access to dates is through the OAuth Api... | Twitter API: Getting Data for Analytics | 0 | 0 | 1 | 438 |
5,932,111 | 2011-05-09T03:12:00.000 | 0 | 1 | 0 | 0 | python,twitter | 8,756,753 | 2 | false | 0 | 0 | We can although use the search api to fetch mentions but there is a limit in it.
At a given point of time you can only fetch 200 mentions.
Any one knows how to get total mentions count? | 2 | 1 | 0 | I am looking to create a simple graph showing 2 numbers of time for my personal twitter. They are:
Number of followers per day
Number of mentions per day
From my research so far, the search API does not provide a date so I am not about to do a GROUP BY. The only way I can have access to dates is through the OAuth Api... | Twitter API: Getting Data for Analytics | 0 | 0 | 1 | 438 |
5,932,747 | 2011-05-09T05:07:00.000 | 3 | 0 | 0 | 0 | php,python,django,performance,zend-framework | 5,932,770 | 1 | true | 1 | 0 | There is no direct one-to-one step or howto available for migrating PHP+Zend to Python+Django as both are different, different languages and different design models. So, migration is not easy. For other comparison questions you have asked, the answer is it depends upon the use case. But just in case you are comparing ... | 1 | 3 | 0 | when building a web 2.0 application, which one is superior in terms of
performance
availability of features
documentation
ease of use
Python + Django combination or PHP + Zend combination?
Also how easy it is to migrate one to another, so if I have written stuff for PHP + Zend combination how easy is it to move them... | Python + Django or PHP + Zend Framework | 1.2 | 0 | 0 | 3,066 |
5,932,804 | 2011-05-09T05:16:00.000 | -7 | 0 | 0 | 0 | python,setup.py | 5,932,879 | 4 | false | 0 | 0 | Login as root, and in the shell type :
chmod 744 yourfilename | 1 | 10 | 0 | I created a python software install with setup.py . In this software I use data files (XML file) when I install these xml file using setup.py then these files save with other files in /usr/lib/python2.7/site_packages/XYZ . But file permission set to these files (XML Files) rwx------ means only super user(root) can read... | set file permissions in setup.py file | -1 | 0 | 1 | 5,700 |
5,934,326 | 2011-05-09T08:20:00.000 | 2 | 0 | 0 | 0 | javascript,android,python,sl4a | 5,939,196 | 1 | true | 1 | 0 | You'll need to wait for a refresh event (this would be a custom event) in your JavaScript that is waiting for an event posted from your Python script. The only communication layer between JavaScript and Python is via events. | 1 | 1 | 0 | I am writing an Android app using Python and SL4A. The app uses a webview that I wish to refresh. I plan on doing this by utilising javascript location.replace() within a wrapping doRefresh() javascript function. The problem I have is that I do not know how to call the javascript function from within my main event loop... | How to call a javascript method from python on SL4A? | 1.2 | 0 | 0 | 618 |
5,935,404 | 2011-05-09T10:10:00.000 | 1 | 0 | 1 | 1 | python | 5,935,757 | 2 | false | 0 | 0 | If your process sets/updates an environment variable and then calls the Python script, you would see the updated value in your Python script. But if these are parallel processes and the environment variable gets modified when the Python script is running then the updates to the environemnt variable is not seen in the P... | 2 | 2 | 0 | I have a requirement where 1 process sets a value as environment variable and I read that value in python using
os.environ
As per python doc:
This mapping is captured the first
time the os module is imported,
typically during Python startup as
part of processing site.py. Changes to
the environment made afte... | Get Changed Environment Variable in Python | 0.099668 | 0 | 0 | 2,356 |
5,935,404 | 2011-05-09T10:10:00.000 | 3 | 0 | 1 | 1 | python | 5,935,419 | 2 | true | 0 | 0 | I guess you can use os.getenv() to get the value of an environment variable any time, and this will reflect the most up-to-date state.
Update: note that there is no such thing as one "global" environment, at least not on Linux. Quoting Wikipedia:
In all Unix and Unix-like systems, each process has its own private set ... | 2 | 2 | 0 | I have a requirement where 1 process sets a value as environment variable and I read that value in python using
os.environ
As per python doc:
This mapping is captured the first
time the os module is imported,
typically during Python startup as
part of processing site.py. Changes to
the environment made afte... | Get Changed Environment Variable in Python | 1.2 | 0 | 0 | 2,356 |
5,935,910 | 2011-05-09T10:58:00.000 | 0 | 0 | 0 | 1 | python,mysql,macos,osx-snow-leopard,compilation | 5,936,425 | 1 | true | 0 | 0 | Check your environment for CFLAGS or LDFLAGS. Both of these can include the -isysroot argument that influences the SDK selection. The other place to start at is to look at the output of python2.6-config --cflags --ldflags since (I believe) that this influences the Makefile generation. Make sure to run easy_install w... | 1 | 0 | 0 | when I try to install python-mysql today, I got a number of compilation error or complaining /Developer/SDKs/MacOSX10.4u.sdk not found, like the following:
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
running build_ext
building '_mysql' extension
Compiling with ... | mac snow leopard setuptools stick to MacOSX10.4u.sdk when trying to install python-mysql | 1.2 | 1 | 0 | 358 |
5,936,781 | 2011-05-09T12:20:00.000 | 0 | 1 | 0 | 1 | python,perl,ip,mac-address,hostname | 5,936,797 | 2 | false | 0 | 0 | The ethers file on a UNIX system maps Ethernet address to IP-number (or hostname). If your /etc/ethers is properly maintained, you can look it up in there. | 1 | 1 | 0 | I've wrote several perl scripts during my internship, and I would like to simplify the use of them. The scripts asks in arg, a mac address, and returns which switch is connected, speed...etc.
Instead of giving a mac address, I would like to give a host name of a computer. So, how can I resolve the hostname to mac addre... | Resolve mac address by host name | 0 | 0 | 0 | 2,670 |
5,939,078 | 2011-05-09T15:29:00.000 | 0 | 1 | 1 | 0 | python,pyinotify | 5,940,630 | 2 | false | 0 | 0 | you can avoid moving file by simply renaming the file (which is very similar on linux), for example a mv file file.sav && mv file.sav file | 1 | 0 | 0 | I have a python script using Pyinotify that does some stuff on IN_MOVED_TO. What's the easiest way to trigger the script on specific files, using another python script, without actually moving the files out and back in? | Trigger inotify events | 0 | 0 | 0 | 782 |
5,940,520 | 2011-05-09T17:45:00.000 | 3 | 1 | 0 | 0 | python,mechanize,urllib | 5,940,566 | 2 | false | 0 | 0 | Why would mechanize have it? It's already in urllib, which comes with Python. | 2 | 0 | 0 | urllib.urlencode could encode url's params. It seems no likely function in Mechanize.
So, I have to use urllib and Mechanize, because I only need urlencode.
Any function could implement the same task like urllib.urlencode in Mechanize | which function of mechanize is equal with urllib.urlencode | 0.291313 | 0 | 1 | 612 |
5,940,520 | 2011-05-09T17:45:00.000 | 0 | 1 | 0 | 0 | python,mechanize,urllib | 5,992,039 | 2 | false | 0 | 0 | mechanize actually uses urllib and urllib2 for most tasks that involve urls.
Since this functionality already exists in urllib/2 (as mentioned by Ignacio Vazquez-Abrams) there's no need for it to be implemented elsewhere. When coding you import all the libraries that have functionality you need to use. | 2 | 0 | 0 | urllib.urlencode could encode url's params. It seems no likely function in Mechanize.
So, I have to use urllib and Mechanize, because I only need urlencode.
Any function could implement the same task like urllib.urlencode in Mechanize | which function of mechanize is equal with urllib.urlencode | 0 | 0 | 1 | 612 |
5,943,249 | 2011-05-09T22:29:00.000 | 2 | 0 | 1 | 0 | python,argparse | 5,943,331 | 8 | false | 0 | 0 | You'd have to tinker. Look at argparse.ArgumentParser.error, which is what gets called internally. Or you could make the arguments non-mandatory, then check and exit outside argparse. | 1 | 56 | 0 | Apart from tinkering with the argparse source, is there any way to control the exit status code should there be a problem when parse_args() is called, for example, a missing required switch? | Python argparse and controlling/overriding the exit status code | 0.049958 | 0 | 0 | 48,960 |
5,944,433 | 2011-05-10T02:07:00.000 | 2 | 0 | 0 | 0 | python,mysql,runtime | 5,944,478 | 2 | true | 0 | 0 | What kind of server? If you're renting a VPS or similar you're contending with other users for CPU time.
What platform is running on both? Tell us more about your situation! | 2 | 2 | 0 | The Facts:
I am working on a NoteBook with Intel Core 2 Duo 2,26 GHz and 4 Gigabyte of Ram.
It has a Apache Server and a MySQL Server running.
My Server (I did lshw | less) shows a 64 Bit CPU with 2,65 GHz and 4 Gigabyte Ram, too. It has the XAMPP-Package running on it.
The Database structures (tables, indices, ...) a... | How do I find why a python scripts runs in significantly different running times on different machines? | 1.2 | 1 | 0 | 101 |
5,944,433 | 2011-05-10T02:07:00.000 | 0 | 0 | 0 | 0 | python,mysql,runtime | 5,956,131 | 2 | false | 0 | 0 | I would check that the databases in question are of similar scope. You say they're the same structure, but are they sized similarly? If your test case only has 100 entries when production has 100000000, that's one huge potential area for performance problems. | 2 | 2 | 0 | The Facts:
I am working on a NoteBook with Intel Core 2 Duo 2,26 GHz and 4 Gigabyte of Ram.
It has a Apache Server and a MySQL Server running.
My Server (I did lshw | less) shows a 64 Bit CPU with 2,65 GHz and 4 Gigabyte Ram, too. It has the XAMPP-Package running on it.
The Database structures (tables, indices, ...) a... | How do I find why a python scripts runs in significantly different running times on different machines? | 0 | 1 | 0 | 101 |
5,944,764 | 2011-05-10T03:14:00.000 | 1 | 0 | 1 | 1 | python,linux,command-line | 5,945,001 | 1 | true | 0 | 0 | What you want to automate depends on what you are doing manually and what your role is ? If you are a system administrator (say) and if you have shell scripts written to automate some of the tasks (like server management, user account creation etc.) you can port them to Python. | 1 | 1 | 0 | Trying to get some initial bearings on useful processes that a basic working knowledge of python can assist with or make less tedious. Specifically, processes that can be executed on the command line in a Linux environment. An example or two of both the tedious process as well as sample code to use as a starting point ... | What are some good examples of processes to automate for a python beginner to start with? | 1.2 | 0 | 0 | 117 |
5,945,408 | 2011-05-10T05:07:00.000 | 9 | 0 | 0 | 1 | python,file,amazon-web-services,amazon-s3 | 5,959,764 | 1 | true | 0 | 0 | Install S3 (http://s3tools.org/download)
Configure it:
s3cmd --configure
Create a bucket: s3cmd mb s3://my-bucket (alternatively, you can do this via a tool like S3Fox)
Sync your local directory with S3: s3cmd sync /path/to/local/dir/ s3://my-bucket | 1 | 3 | 0 | I want my directory, and all its sub directories and files, to go straight to S3. Clone it.
Is there an easy script/program to do that?
I'm on Ubuntu linux. | How do I upload an entire directory to S3? | 1.2 | 0 | 0 | 3,211 |
5,945,764 | 2011-05-10T05:52:00.000 | 6 | 1 | 1 | 0 | python,pdf | 6,460,926 | 3 | false | 0 | 0 | I'm using pdfminer and it is an excellent lib especially if you're comfortable programming in python. It reads PDF and extracts every character, and it provides its bounding box as a tuple (x0,y0,x1,y1). Pdfminer will extract rectangles, lines and some images, and will try to detect words. It has an unpleasant O(N^3) r... | 1 | 11 | 0 | I have found many posts where solutions to read PDFs has been proposed. I want to read a PDF file word by word and do some processing on it. people suggest pdfMiner which converts entire PDF file into text file. But what i want is that to read PDFs word by word. Can anyone suggest a library that does this? | Python to read PDF files | 1 | 0 | 0 | 16,310 |
5,946,170 | 2011-05-10T06:41:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine | 5,989,456 | 4 | true | 1 | 0 | The problem disappear by itself after the 2011-05-10, which is the v1.5 launch date. Not sure this problem is related.
I didn't change any code, as the get_by_id() was fine all the while and on this few days. Beside, I added a cron job to run the get_by_id() every minutes and try to get the instance alive.
From my obse... | 3 | 1 | 0 | By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python? | Google App Engine : alternate method of get_by_id() | 1.2 | 0 | 0 | 814 |
5,946,170 | 2011-05-10T06:41:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine | 5,949,477 | 4 | false | 1 | 0 | If Model.get_by_id(id) returns None, this indicates that you've supplied an invalid ID, not that the method itself is unreliable.
It's not inconceivable that this method could fail in the event of a system outage, but if it did, your call would throw a datastore exception, not return an empty result. | 3 | 1 | 0 | By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python? | Google App Engine : alternate method of get_by_id() | 0.148885 | 0 | 0 | 814 |
5,946,170 | 2011-05-10T06:41:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 5,946,313 | 4 | false | 1 | 0 | get_by_id() always get the object, if the passed object is a valid id of object and if the objects exists in the datastore.
id can be got by object.key.id in the templat
else you always have the object.get(key). | 3 | 1 | 0 | By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python? | Google App Engine : alternate method of get_by_id() | 0 | 0 | 0 | 814 |
5,947,727 | 2011-05-10T09:05:00.000 | 1 | 0 | 0 | 1 | python,apache-flex,google-app-engine,google-cloud-datastore | 5,948,044 | 3 | true | 1 | 0 | Have flex send a request to the Python server. COuld be a form post or JSON data or whatever. | 1 | 0 | 0 | I'm working on a project that runs off Google App Engine (Python) which stores various user details inside GAE's datastore. I have Flex content which users can use and once done the Flex app needs to send data to the Python backend to 'mark' the user off for that task. Any suggestions? | Send Data From Flex to Python (GAE) | 1.2 | 0 | 0 | 181 |
5,947,849 | 2011-05-10T09:16:00.000 | 0 | 1 | 0 | 1 | python,security,web-applications | 5,947,923 | 2 | true | 1 | 0 | Easiest and most secure: Put Apache or Nginx in front of it with an HTTPS proxy.
Update: Or VPN access as suggested by Jakob. Good idea. | 2 | 0 | 0 | i have python web app build on top of BaseHTTPServer, which runs on specyfic port. It runs system commands and shows output. I want do limit access to this app. What are posible ways to do it? Requirements:
it must not be limited to LAN
simple to implement/deploy | Secure python web app | 1.2 | 0 | 0 | 517 |
5,947,849 | 2011-05-10T09:16:00.000 | 0 | 1 | 0 | 1 | python,security,web-applications | 5,947,916 | 2 | false | 1 | 0 | Common methods: VPN access. Firewalls, logging, denyhosts style defences, complicated root passwords, no su, run as its own user.
(if it was my personal server)
Logic bombs | 2 | 0 | 0 | i have python web app build on top of BaseHTTPServer, which runs on specyfic port. It runs system commands and shows output. I want do limit access to this app. What are posible ways to do it? Requirements:
it must not be limited to LAN
simple to implement/deploy | Secure python web app | 0 | 0 | 0 | 517 |
5,949,242 | 2011-05-10T11:22:00.000 | 0 | 1 | 1 | 0 | python | 5,949,332 | 5 | false | 0 | 0 | You can communicate both scripts using sockets | 3 | 4 | 0 | I have a python script which is constantly polling data. The script is constantly running and should never stop.
The script polls data from a track of keywords which are passed to it when the script is first run.
What would be the best way to update this track without stopping the script from another python script?
T... | Python - update configuration while running script | 0 | 0 | 0 | 862 |
5,949,242 | 2011-05-10T11:22:00.000 | 5 | 1 | 1 | 0 | python | 5,949,341 | 5 | true | 0 | 0 | It's better to encapsulate this settings file in a database. A simple SQLite DB file is enough - SQLite support is built-in with Python so no extra effort is required.
The advantage of a DB is that you won't run into race conditions of partially-written files, etc. The "configuration-adding" script adds keywords using ... | 3 | 4 | 0 | I have a python script which is constantly polling data. The script is constantly running and should never stop.
The script polls data from a track of keywords which are passed to it when the script is first run.
What would be the best way to update this track without stopping the script from another python script?
T... | Python - update configuration while running script | 1.2 | 0 | 0 | 862 |
5,949,242 | 2011-05-10T11:22:00.000 | 3 | 1 | 1 | 0 | python | 5,949,274 | 5 | false | 0 | 0 | Polling a configuration-file is not messy, but a very common solution to this problem. You should go with it. | 3 | 4 | 0 | I have a python script which is constantly polling data. The script is constantly running and should never stop.
The script polls data from a track of keywords which are passed to it when the script is first run.
What would be the best way to update this track without stopping the script from another python script?
T... | Python - update configuration while running script | 0.119427 | 0 | 0 | 862 |
5,950,427 | 2011-05-10T13:02:00.000 | 0 | 0 | 0 | 0 | python,multithreading,insert,cassandra | 5,950,881 | 4 | false | 0 | 0 | It's possible you're hitting the python GIL but more likely you're doing something wrong.
For instance, putting 2M rows in a single batch would be Doing It Wrong. | 4 | 0 | 1 | sorry for my English in advance.
I am a beginner with Cassandra and his data model. I am trying to insert one million rows in a cassandra database in local on one node. Each row has 10 columns and I insert those only in one column family.
With one thread, that operation took around 3 min. But I would like do the same ... | Insert performance with Cassandra | 0 | 1 | 0 | 1,686 |
5,950,427 | 2011-05-10T13:02:00.000 | 0 | 0 | 0 | 0 | python,multithreading,insert,cassandra | 5,956,519 | 4 | false | 0 | 0 | Try running multiple clients in multiple processes, NOT threads.
Then experiment with different insert sizes.
1M inserts in 3 mins is about 5500 inserts/sec, which is pretty good for a single local client. On a multi-core machine you should be able to get several times this amount provided that you use multiple client... | 4 | 0 | 1 | sorry for my English in advance.
I am a beginner with Cassandra and his data model. I am trying to insert one million rows in a cassandra database in local on one node. Each row has 10 columns and I insert those only in one column family.
With one thread, that operation took around 3 min. But I would like do the same ... | Insert performance with Cassandra | 0 | 1 | 0 | 1,686 |
5,950,427 | 2011-05-10T13:02:00.000 | 0 | 0 | 0 | 0 | python,multithreading,insert,cassandra | 6,078,703 | 4 | false | 0 | 0 | You might consider Redis. Its single-node throughput is supposed to be faster. It's different from Cassandra though, so whether or not it's an appropriate option would depend on your use case. | 4 | 0 | 1 | sorry for my English in advance.
I am a beginner with Cassandra and his data model. I am trying to insert one million rows in a cassandra database in local on one node. Each row has 10 columns and I insert those only in one column family.
With one thread, that operation took around 3 min. But I would like do the same ... | Insert performance with Cassandra | 0 | 1 | 0 | 1,686 |
5,950,427 | 2011-05-10T13:02:00.000 | 0 | 0 | 0 | 0 | python,multithreading,insert,cassandra | 8,491,215 | 4 | false | 0 | 0 | The time taken doubled because you inserted twice as much data. Is it possible that you are I/O bound? | 4 | 0 | 1 | sorry for my English in advance.
I am a beginner with Cassandra and his data model. I am trying to insert one million rows in a cassandra database in local on one node. Each row has 10 columns and I insert those only in one column family.
With one thread, that operation took around 3 min. But I would like do the same ... | Insert performance with Cassandra | 0 | 1 | 0 | 1,686 |
5,951,035 | 2011-05-10T13:44:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,url | 5,951,213 | 3 | false | 1 | 0 | If by forwarding you mean HTTP redirection, you can check the Referer header.
If you mean DNS resolving (e.g. distinguishing between your application being invoked via your own domain and .appspot.com one), there is SERVER_NAME environment variable (os.environ["SERVER_NAME"]) that stores the domain (e.g. www.example.co... | 1 | 1 | 0 | I have a series of different domain names that I would like to all point (via URL forwarding from my domain host) to a google app engine application that reads what the forwarding URL is. So if the domain typed in was original XYZ.com, then when I am forwarded to my application, I can return what that original domain n... | determining URL that forwarded | 0.066568 | 0 | 0 | 199 |
5,951,930 | 2011-05-10T14:49:00.000 | 3 | 1 | 0 | 1 | python,debian,centos,yum,apt | 5,952,044 | 2 | false | 0 | 0 | If you just need to know whether to use yum or apt, one approach is simply to pick one of those commands and try it. If it works, it works; if not, catch the exception and try the other command. | 1 | 6 | 0 | I want to write some install scripts by python, it should know the OS to choose either apt command or yum command.
It seems sys.platform can tell 'win32' or the others, but how to know it is working on Debian or CentOS in Python? | How to know the system is Debian or CentOS in Python? | 0.291313 | 0 | 0 | 1,337 |
5,953,205 | 2011-05-10T16:24:00.000 | 89 | 0 | 1 | 0 | python,language-design,sortedset,sortedmap | 5,958,960 | 6 | true | 0 | 0 | It's a conscious design decision on Guido's part (he was even somewhat reluctant regarding the addition of the collections module). His goal is to preserve "one obvious way to do it" when it comes to the selection of data types for applications.
The basic concept is that if a user is sophisticated enough to realise tha... | 1 | 95 | 0 | Is there a Python design decision (PEP) that precludes a sorted container from being added to Python?
(OrderedDict is not a sorted container since it is ordered by insertion order.) | Why are there no sorted containers in Python's standard libraries? | 1.2 | 0 | 0 | 56,419 |
5,953,371 | 2011-05-10T16:37:00.000 | 0 | 0 | 0 | 0 | python,scapy | 51,267,747 | 5 | false | 0 | 0 | Indeed, the show2() function calculates the checksum for you, but it also prints the contents of the packet once it is finished with its work. However, show2() has a helpful little parameter named dump. The source describes it as such:
:param dump: determine if it prints or returns the string value
So by setting dum... | 1 | 22 | 0 | I'm using scapy, and I want to create a packet and calculate its' checksum without sending it. Is there a way to do it?
Thanks. | How to calculate a packet checksum without sending it? | 0 | 0 | 0 | 19,066 |
5,953,657 | 2011-05-10T17:02:00.000 | 0 | 1 | 1 | 0 | python | 5,953,799 | 4 | false | 0 | 0 | You can tell your friend to make *.py files to be executed by the interpreter. Change it from Explorer:Tools:Folder Options:File Types. | 3 | 2 | 0 | how can i run my program using test files on my desktop without typing in the specific pathname. I just want to be able to type the file name and continue on with my program. Since i want to be able to send it to a friend and not needing for him to change the path rather just read the exact same file that he has on his... | Python path help | 0 | 0 | 0 | 312 |
5,953,657 | 2011-05-10T17:02:00.000 | 1 | 1 | 1 | 0 | python | 5,953,805 | 4 | true | 0 | 0 | f = open(os.path.join(os.environ['USERPROFILE'], 'DESKTOP', my_filename)) | 3 | 2 | 0 | how can i run my program using test files on my desktop without typing in the specific pathname. I just want to be able to type the file name and continue on with my program. Since i want to be able to send it to a friend and not needing for him to change the path rather just read the exact same file that he has on his... | Python path help | 1.2 | 0 | 0 | 312 |
5,953,657 | 2011-05-10T17:02:00.000 | 0 | 1 | 1 | 0 | python | 5,953,763 | 4 | false | 0 | 0 | If you place your Python script in the same directory as the files your script is going to open, then you don't need to specify any paths. Be sure to allow the Python installer to "Register Extensions", so Python is called when you double-click on a Python script. | 3 | 2 | 0 | how can i run my program using test files on my desktop without typing in the specific pathname. I just want to be able to type the file name and continue on with my program. Since i want to be able to send it to a friend and not needing for him to change the path rather just read the exact same file that he has on his... | Python path help | 0 | 0 | 0 | 312 |
5,953,949 | 2011-05-10T17:27:00.000 | 2 | 0 | 1 | 0 | python | 5,954,080 | 6 | false | 0 | 0 | Why don't you just read the file char by char using file.read(1)?
Then, you could - in each iteration - check whether you arrived at the char 1. Then you have to make sure that storing the string is fast. | 2 | 4 | 0 | Hey there, I have a rather large file that I want to process using Python and I'm kind of stuck as to how to do it.
The format of my file is like this:
0 xxx xxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | Python: Read large file in chunks | 0.066568 | 0 | 0 | 8,205 |
5,953,949 | 2011-05-10T17:27:00.000 | 0 | 0 | 1 | 0 | python | 5,954,012 | 6 | false | 0 | 0 | If the format is fixed, why not just read 3 lines at a time with readline() | 2 | 4 | 0 | Hey there, I have a rather large file that I want to process using Python and I'm kind of stuck as to how to do it.
The format of my file is like this:
0 xxx xxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | Python: Read large file in chunks | 0 | 0 | 0 | 8,205 |
5,957,110 | 2011-05-10T22:10:00.000 | 0 | 0 | 1 | 0 | iphone,python,scripting,compiler-construction | 5,957,143 | 2 | false | 0 | 0 | For security reasons, the app store does not allow apps containing programming languages capable of executing arbitrary code on the phone, so your app's market would be limited to users willing to jailbreak their phones to circumvent this restriction.
You could, depending on what you want to do, look at using the brows... | 2 | 0 | 0 | I have an application to develop but the problem is that is must download part of behavior as a list of instructions from a server.
Ideally it will download scripting code and execute it. The question is if there are any libraries to make it? For example, I have python script and I want to to execute it on device...
An... | iphone python or perl processor, or similar | 0 | 0 | 0 | 71 |
5,957,110 | 2011-05-10T22:10:00.000 | 1 | 0 | 1 | 0 | iphone,python,scripting,compiler-construction | 5,957,174 | 2 | false | 0 | 0 | Lua is very popular for games. You can embed Python, too. Apple won't enforce the "Objective-C only" clause unless you make it obvious that you use Python to script behavior. Do you think all the games on the store are scripted in Objective-C? No way. Just don't make your transgressions obvious and you'll be fine. | 2 | 0 | 0 | I have an application to develop but the problem is that is must download part of behavior as a list of instructions from a server.
Ideally it will download scripting code and execute it. The question is if there are any libraries to make it? For example, I have python script and I want to to execute it on device...
An... | iphone python or perl processor, or similar | 0.099668 | 0 | 0 | 71 |
5,958,882 | 2011-05-11T03:23:00.000 | 10 | 0 | 0 | 0 | python,django | 5,958,915 | 1 | true | 1 | 0 | yes.
INSTALLED_APPS helps django to sync the database, run tests, get the urls to work and more related issues.
Maybe your installed apps still works because the main one calls the others with imports, a django app is nothing more that a simple python module that is imported when called in the settings file, that's why... | 1 | 8 | 0 | What does this actually do? I recently branched out my project from 1 app into 6 different apps and forgot to update the INSTALLED_APPS part of my settings file. Everything still works even though I didn't list the new apps in. Is that supposed to happen? Do I need to include all my apps in INSTALLED_APPS? | What does INSTALLED_APPS setting in Django actually do? | 1.2 | 0 | 0 | 7,298 |
5,958,929 | 2011-05-11T03:33:00.000 | 0 | 0 | 1 | 0 | python,list,methods,naming | 5,958,974 | 5 | false | 0 | 0 | Append is for a single element at the end. Won't raise any exception if you add a list, because in python you can add almost all to a list.
Extend adds a list to a list, more like a concatenation. This one will raise an exception if you add a single element. I bet that you'll learn with it ;-) | 4 | 1 | 0 | In Python, lists have two methods for adding elements to the end: "append" and "extend". One of them adds a single element to the list, and the other adds every element from an iterable to the end of the list. Do you know which is which? Did you know without having to look it up? If so, could you please share your secr... | How can I remember which of list.append and list.extend is which in Python? | 0 | 0 | 0 | 121 |
5,958,929 | 2011-05-11T03:33:00.000 | 6 | 0 | 1 | 0 | python,list,methods,naming | 5,959,064 | 5 | true | 0 | 0 | At least for me their literal meaning itself is clear enough to make the distinction between them.
One of the dictionary definition for append : Add to the very end
One of the dictionary definition for extend : Stretch out over a distance, space, time, or scope; run or extend between two points or beyond a certain poi... | 4 | 1 | 0 | In Python, lists have two methods for adding elements to the end: "append" and "extend". One of them adds a single element to the list, and the other adds every element from an iterable to the end of the list. Do you know which is which? Did you know without having to look it up? If so, could you please share your secr... | How can I remember which of list.append and list.extend is which in Python? | 1.2 | 0 | 0 | 121 |
5,958,929 | 2011-05-11T03:33:00.000 | 0 | 0 | 1 | 0 | python,list,methods,naming | 5,967,698 | 5 | false | 0 | 0 | Use a mantra:
You append to a list - another element.
You extend a list - with another. | 4 | 1 | 0 | In Python, lists have two methods for adding elements to the end: "append" and "extend". One of them adds a single element to the list, and the other adds every element from an iterable to the end of the list. Do you know which is which? Did you know without having to look it up? If so, could you please share your secr... | How can I remember which of list.append and list.extend is which in Python? | 0 | 0 | 0 | 121 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.