« first day (12 days earlier)      last day (22 days later) » 

12:25 AM
0
Q: jira SOAP and XMLRPC

garbagecollectorI was wondering if there are urls for the various calls that can be made to jira. get issues, get users. what format are they in xml? json? I want to write a wrapper class in python. I see the SOAP api exsists but no methods definitions in python anywhere I can find. I found the java o...

 
12:41 AM
0
Q: python receiving from a socket

FalmarriSo I have a simple socket server on an android emulator. When I'm only sending data to it, it works just fine. But then if I want to echo that data back to the python script, it doesn't work at all. Here's the code that works: android: try { serverSoc...

 
1:09 AM
0
Q: Product code looks like abcd2343, what to split by letters and numbers

BlankmanI have a list of product codes in a text file, on each like is the product code that looks like: abcd2343 abw34324 abc3243-23A So it is letters followed by numbers and other characters. I want to split on the first occurrence of a number.

 
1:30 AM
0
Q: when download an image, does urllib have a return code if its sucessful or not?

BlankmanI want to download an image file from potentially 5 sites. Meaning that if the image wasn't found in site#1, try site#2, etc. How can I test if the file was downloaded?

 
1:41 AM
0
Q: post to page to login using beautiful soup

BlankmanI'm using python and beautifulsoup (new to both!), and I want to login to a suppliers website. So their form looks like (simplified): <form name=loginform action=/index.html method="post"> <input name=user> <input name=pass"> </form>

 
2:19 AM
0
Q: with beautifulsoup, how to reference the first table after a given form

BlankmanI want to drill down into my html, specifically I want to get the first html table that is AFTER a form that looks like: <form method="POST" action="/parts.html"> .. <table ...> ... </table> .. </form> So this table has <t...

0
Q: Is it possible to have python open a terminal and write to it?

Mark KleinFor example, if I have this code: subprocess.call(['gnome-terminal']) Is it possible to have python output strings to that specific terminal that was just opened? Thanks!

 
 
1 hour later…
3:25 AM
0
Q: WTForms... html, autofocus?

Lee OlayvarIs it possible to have some of the new attribute only attributes used in HTML5, inside of WTForms? Eg, say you want to create a TextField with placeholder="foo", required, and autofocus attributes. How would this be done in WTForms? In html it would look like this: <in...

0
Q: Why tuple is faster than list?

Vimvq1987Sorry because this is a noob question. I'm reading Dive into Python, and just read "tuple is faster than list". Tuple is immutable, and list is mutable, but I don't quite understand why tuple is faster. Anyone did a performance test on this? Thanks.

 
3:58 AM
0
Q: GUI's Over Running Programs in python

JoshkunzJust wondering if there is any kind of framework or method of making a Gui that will override (Stay on top of) all other windows in python. Including Games or other programs that seem to "Take over" the computers Graphical processes. Any point in the right direction would be much appreciated.....

 
4:25 AM
2
Q: Python3.0 TypeError

zubin71Usually one comes across this problem in python3.0 while attempting a split() method on a bytes type object. TypeError: Type str does'nt support the buffer API This issue can be resolved by using the split method after decoding the bytes type object...

0
Q: Python OpenGL module - can't render basic triangle

Dominic Bou-SamraI'm trying to use the OpenGL module with Python. Here is my source: pygame.init() screen = pygame.display.set_mode((800, 600), HWSURFACE|OPENGL|DOUBLEBUF) def init(): glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) glClearColor(1.0, 1.0, 1.0, 0....

0
Q: Can I recursively create a path in Zookeeper?

Nicholas KnightI'm pulling ZooKeeper into a project for some concurrency management, and the first thing I tried was something that, to me, was quite obvious (using the zkpython binding): zh = zookeeper.init('l...

0
Q: What's wrong with my Python installation, or I just was too dumb?

Vimvq1987I downloaded and installed Python 3.1.2 on Windows 7 x64. But it seems that it's not working as expected, for example: Please help me figure out, what's wrong here?

1
Q: how to setup "ip address","DNS", "hostname","MAC address" in python?

Registered User KCDear All, I want to write a script for network security IP scan porpose, such a tool may need spoofing it's host NIC status for testing purpose, for example, to setup NIC's ip address, to setup DNS address, while to setup hostname, MAC address and enable/disable the NICs adapter.

0
Q: saving data and calling data python

babikarsay i want to ask the many users to give me their ID number and their name, than save it. and than i can call any ID and get the age. can someone tell me how i can do that?

 
5:08 AM
0
Q: Python vs F#: which language I should learn

Vimvq1987Hey, I know this is an subjective question, but please don't vote to close it before I get the acceptable answer. I'm a .NET programmer (somewhat experienced), and really want to learn a functional language. My preferred choices are F# and Python, and I really doubt about which one to ...

 
5:24 AM
0
Q: Prototyping a filesystem

Matt JoinerWhat are some best practises for prototyping a filesystem? I've had an attempt in Python using fusepy, and now I'm curious: In the long run, should any respectable filesystem implementation be in C? Will not be...

 
6:13 AM
0
Q: Filtering in Python/Django based on date, ignoring time

Michael MorisyI'd like to filter objects to the day with datetime, but can't find examples on how to do this anywhere. This, for example, works perfectly in pulling together all following events: @login_required def invoice_picker(request): """Grab a date from the URL and show al...

 
6:57 AM
0
Q: Python SESSION (like php) class

tsurahmanHi All, is there any class to handle a SESSION (like php) in Python? not in django, but I want to use it with PyQt thank you

 
7:24 AM
0
Q: python FLV checker

Dantarioi need a simple python lib that check the uploaded files to my webserver are flash media (FLV), by reading the flv header (metadata) and not the mimetype extension.

 
7:35 AM
0
Q: mod_wsgi + apache not multithreaded, why?

zoxWSGI application # coding: utf-8 import time def application(environ, start_response): status = '200 OK' output = str(time.time()) time.sleep(5) output += ' -> ' + str(time.time()) response_headers = [('Content-type', 'text/html; charset=utf-8'), ...

0
Q: Extract a specific portion of connection string

AlixHello, Any way to extract what's after the @ and before the next . (if any)? user@host first.last@host first.last@host.domain.com first@host.domain.com I need to get host in a variable. Suggestions in Pyth...

 
8:19 AM
0
Q: How can I use decorators in Python to specify and document repeated used arguments of methods?

Philipp der RautenbergOne of my classes has a logical numpy array as parameter in many methods repeated (idx_vector=None). How can I use a decorator to: automatically specify idx_vector automatically insert the description into the docstring

 
8:41 AM
0
Q: how to upload python application with google apps???

Keyur ShahHey I developed one application and upload on example.appspot.com now i want to upload it on www.example.com what to do??? pls reply fast...

 
8:52 AM
0
Q: Google app engine handle html form post array

PeteMy HTML code as following: <INPUT type="text" name="txt[]"> <INPUT type="checkbox" name="chk[]"/> I get the value in PHP by <?php $chkbox = $_POST['chk']; $txtbox = $_POST['txt']; foreach($txtbox as $a => $b) echo "$chkbox[...

 
9:19 AM
0
Q: Is it possible to run doctests using unit2

Chris089I recently switched from nose to the new unittest2 package for my python unit testing needs. It does everything I want, except from the fact that I can't get its "discover" command to recognize the doctests in my code - I still have to use nose to run them. Is this not implemented or is there ...

1
Q: passing C++ classes instances to python with boost::python

happy_emiI have a library which creates objects (instances of class A) and pass them to a python program which should be able to call their methods. Basically I have C++ class instances and I want to use them from python. Occasionally that object should be passed back to C++ for some manipulati...

 
 
1 hour later…
10:35 AM
0
Q: I want one backslash - not two

Carolus89I have a string that after print is like this: \x4d\xff\xfd\x00\x02\x8f\x0e\x80\x66\x48\x71 But I want to change this string to "\x4d\xff\xfd\x00\x02\x8f\x0e\x80\x66\x48\x71" which is not printable (it is necessary to write to serial port). I know that it ist ...

 
10:46 AM
0
Q: How can I make pybluez return a list of discovered devices every X seconds and then repeat?

GregI've been trying to figure out how I can use pybluez to monitor nearby devices... I want to be able to run my program and have it search for devices every 20 seconds. The problem is, how do I get pybluez to place nicely? :/...

 
11:08 AM
newest questions tagged python - Stack Overflow stackoverflow.com/questions/3342942/…
 
11:25 AM
0
Q: What are the major cmponents of an affiliate marketing system?

takashiI am thinking of "rolling my own" Affiliate marketing system - using either PHP (or more preferably, Python). I am relatively new to Affiliate marketing, so before I get started though I wanted to make sure that I had covered all bases, and was also not reinventing the wheel (in terms of there...

0
Q: Does XML-RPC in general allows to call few functions at once?

jkjk90Can I ask for few question in one post to XML-RPC server? If yes, how can I do it in python and xmlrpclib? I'm using XML-RPC server on slow connection, so I would like to call few functions at once, because each call costs me 700ms.

0
Q: I'm trying to make a wx.Frame with variable transparancy (based on the png mapped in the erase bk event)

PaulHello, I'm trying to make a special splash screen that is displayed while the application is loading, it outputs messages of the various components loading and features a progress bar. The first job I am tackling is mapping a .png image to the frame that will host the splash sc...

 
11:46 AM
0
Q: How to use py.test from Python?

nikowI'm working in a project that recently switched to the py.test unittest framework. I was used to call my tests from Eclipse, so that I can use the debugger (e.g. placing breakpoints to analyze how a test failure develops). Now thi...

0
Q: What gui toolkit should I use with Pygame?

NathonI'm making a game that needs to be able to pop up gui elements within a pygame surface. This question isn't what I want because wxPython goes around the SDL surface, not inside it. ...

 
12:30 PM
0
Q: Sqlite db, multiple row updates: handling text and floats

flyingcrabHi, I have a large sqlite database with a mix of text and lots of other cols var1 ... var 50, most of these are numeric, though some are text based. I am trying to extract data from the database, process it in python and write it back - need to do this...

 
12:46 PM
0
Q: Django: construct form without validating fields?

kdtHi, I have a form MyForm which I update using ajax as the user fills it out. I have a view method which updates the form by constructing a MyForm from request.POST and feeding it back. def update_form(request): if request.meth...

0
Q: Django - complex forms with multiple models

ccrewsonDjango 1.1 models.py: class Property(models.Model): name = models.CharField() addr = models.CharField() phone = models.CharField() etc.... class PropertyComment(models.Model): user = models.ForeignKey(User) prop = models.ForeignKey(Property) ...

0
Q: Merging two datasets in Python efficiently

Tom WernerWhat would anyone consider the most efficient way to merge two datasets using Python? A little background - this code will take 100K+ records in the following format: {user: myUser, transaction: myTransactionNumber}, ... and using the following data

0
Q: Starting a GUI process from a Python Windows Service

psicopooI have the following generic Windows service class defined in Python. I am creating a subclass that will eventually display a Window when certain conditions are met. Since (as I understand it) services cannot have GUIs, I'm trying to start up a GUI in a seperate process (using subprocess...

 
1:30 PM
0
Q: encode python code ?![ python ]

str1k3rhello everyone am looking up for how to encode my python codes print "hello World !" that example how to encode it to be unknown for human so guys tell me use base64 but how to use it ... so please tell me how to encode python codes { i wana encode around 30...

 
1:41 PM
0
Q: Why does the istitle() string method return false if the string is clearly in title-case?

Geoffrey van WykOf the istitle() string method, the Python 2.6.5 manual reads: Return true if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return false...

 
2:24 PM
0
Q: sqlalchemy in a single python script file

BlankmanI've read about using sqlalchemywithin the pylons framework. How will things work if I need it for a simple script file? I have like importer.py that is spidering a site and I want to save to mysql. If things are in a single file, can I still using sqlalchemy?

0
Q: Hiding the time in a datetime model field in Django?

Michael MorisyI'm using Thauber's lovely Django schedule app, but have run into a problem: I can't figure out how to exclude the time portion of the datetime field. My form class and lame exclusion attempt looks like this:

 
2:40 PM
0
Q: Geopy in Django: JSONDecodeError

wenbertHello, I have followed the tutorials in http://code.google.com/p/geopy/wiki/GettingStarted This works fine: g = geocoders.Google(resource='maps') I want to use json as the...

 
3:13 PM
0
Q: Splitting a string separated by "\r\n" into a list of lines?

ahhtwerI am reading in some data from the subprocess module's communicate method. It is coming in as a large string separated by "\r\n"s. I want to split this into a list of lines. How is this performed in python?

 
3:30 PM
0
Q: multicpu bzip2 using a python script

harijayI want to quickly bzip2 compress several hundred gigabytes of data using my 8 core , 16 GB ram workstation. Currently I am using a simple python script to compress a whole directory tree using bzip2 and an os.system call coupled to an os.walk call. I see that the bzip2 only uses a sing...

1
Q: python: getting user input

I__i am running this: import csv import sys reader = csv.reader(open(sys.argv[0], "rb")) for row in reader: print row and i get this in response: ['import csv'] ['import sys'] ['reader = csv.reader(open(sys.argv[0]', ' "rb"))'] ['for row in re...

 
3:41 PM
0
Q: python csv: save results to csv file

I__import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[0]] += 1 for row in data: if counter[row[0]] >= 4: print row how do i save results...

 
4:03 PM
0
Q: Python: drawbacks to using `signal.alert` to timeout I/O?

David WoleverWhat are the disadvantages to using signal.alert to timeout Python I/O? I ask because I have found that socket.settimeout isn't entirely reliable[0] and I'd like finer...

0
Q: [python] Create Excel XML files from Python

AymanI need to create Excel XML files from Python. The Excel XML format is fairly simple. I looked at a a sample xml file saved from Excel 2003 and it is fairly simple. I'm looking for a a Pythonic, ready made library to create such xml files instead of reinventing one. S...

0
Q: UUID returning as bytes_le from SqlAlchemy

Jimmy McCarthyI'm querying a table from my Django app, but whenever I do a query on one specific table, I am getting the UUID column returned as a bytes_le style UUID instead of a workable string representation. Now, I know I convert it using uuid.UUID(bytes_le=value), but I'm using this query to populate ...

 
4:14 PM
0
Q: Python urllib2: How to ignore HTTPError 401

QoeHello, I want to access a web page with urllib2 and I keep getting an HTTP Error 401: Unauthorized. Now, my problem is that this page doesn't need any authentication when using browsers like Firefox. Only when I use Google Chrome an authentication dialog pops up. Though this ha...

0
Q: Change skin colour programmatically

betamaxDoes anyone have any information or advice about adjusting one image so that the skin tones in it will match that of another image? It is a bit of an obscure question but I was hoping there would be someone that has come across this problem before! The purpose of me doing this is so th...

 
4:36 PM
1
Q: Getting number of elements in an iterator in Python

user248237Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? thanks.

 
4:53 PM
0
Q: Big picture questions regarding Django, Java, Python, HTML and web-site development in general

MarkI am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature o...

0
Q: Python: Deleting files of a certain age

PhilSo at the moment i'm trying to delete files listed in the directory that are 1 minute old, I will change that value once I have the script working. The code below returns the error: AttributeError: 'str' object has no attribute 'mtime' import time import os #from path impo...

0
Q: Efficient way of adding one character at a time from one string to another in Python

BushmanI'm currently making a function using pygame that draws a message on the screen, adding one character each frame (i.e. The Hunt for Red October). I know that I could simply copy (or pass) gradually bigger slices from the original string, but I know that it would be very resource-inte...

 
5:14 PM
0
Q: python -- re.match vs. re.search

garbagecollectorI have recently been jumping into understanding regex with python. I have been looking at the api; I can't seem to understand the difference between: re.match vs. re.search when is it best to use each of these? pros? cons? Please and thank you.

0
Q: How do I force Django to ignore any caches and reload data?

scippyI'm using the Django database models from a process that's not called from an HTTP request. The process is supposed to poll for new data every few seconds and do some processing on it. I have a loop that sleeps for a few seconds and then gets all unhandled data from the database. Wh...

 
5:31 PM
0
Q: Wrap long lines in Python

PulpFictionHow do I wrap long lines in Python without sacrificing on the indentation part? For example, consider this: >>> def fun(): print '{0} Here is a really long sentence with {1}'.format(3, 5) Suppose that this goes over the 79 character reco...

0
Q: Python: Metaclasses all the way down

Dan MenesI have an esoteric question involving Python metaclasses. I am creating a Python package for web-server-side code that will make it easy to access arbitrary Python classes via client-side proxies. My proxy-generating code needs a catalog of all of the Python classes that I want to include in...

 
5:47 PM
0
Q: Custom user authentication. How is it done, with the best practices?

TottyI'm using Google Engine App with Python. I want to add custom user authentication. How is it done, with the best practices? I want custom authentication because the app is built in Flex and I don't want to redirect to an HTML page. The user value object is like this: ...

0
Q: Set custom 'name' attribute for RadioSelect in Django

Marcin CylkeHi I'm trying to set custom 'name' attribute in django form. I've been trying this kind of approach: class BaseQuestionForm(forms.Form): question_id = forms.CharField(widget=forms.HiddenInput) answer = forms.ChoiceField(choices = [ ... ], widget=forms.RadioS...

0
Q: most efficient way to get first and last line of file python

pasbinoI have a text file which contains a time stamp on each line. My goal is to find the time range. All the times are in order so the first line will be the earliest time and the last line will be the latest time. I only need the very first and very last line. What would be the most efficient way ...

 
6:09 PM
0
Q: PYTHONPATH hell with overlapping package structures

UriI'm having problems with my PythonPath on windows XP, and I'm wondering if I'm doing something wrong. Say that I have a project (created with Pydev) that has an src directory. Under src I have a single package, named common, and in it a single cla...

0
Q: How to pass argument with exclamation mark on linux?

salafekI have simple python script that receive username and password as argument. But my password contains two exclamation marks.When i call script: salafek@dellboy:~/Desktop/$ emailsender.py -u username -p pass!! command that I enter earlier replace exclamation marks s...

0
Q: soaplib problems with XML characters in string payload

bennylopeI've created a simple SOAP web service using soaplib and run into an issue in which SOAP parameters sent including ampersands or angle brackets are ignored, even when escaped. Whether the method is set up to accept a primitive string or a primitive of type 'any', any of those character...

 
6:31 PM
0
Q: python - why is it not safe to modify sequence being iterated on?

I__ It is not safe to modify the sequence being iterated over in the loop (this can only happen for mutable sequence types, such as lists). If you need to modify the list you are iterating over (for example, to duplicate selected items) you must iterate over a copy. The slice notati...

 
6:47 PM
0
Q: Python Base64 print problem

NightRangerHi all, I have a base64 encoded string When I decode the string this way: >>> import base64 >>> base64.b64decode("XH13fXM=") '\\}w}s' The output is fine. But when i use it like this: ...

0
Q: Python Web Server - Getting it to do other tasks

William T WildHi guys. Using the following example I can get a basic web server running but my problem is that the handle_request() blocks the do_something_else() until a request comes in. Is there any way around this to have the web server do other back ground tasks? def run_while_true(serv...

0
Q: python -- callable iterator

garbagecollectorI am looking for a particular pattern in a commit-msg. I want it to verify with jira if it finds the correct issue code. if there is no issue code, in the commit message to quit. and says there is no reference issue code. def findpattern(commit_msg): pattern = re.co...

 
7:04 PM
0
Q: Using urllib2 for posting data, following redirects and maintaining cookies

Pablo Santa CruzI am using urllib2 in Python to post login data to a web site. After successful login, the site redirects my request to another page. Can someone provide a simple code sample on how to do this in Python with urllib2? I guess I will need cookie...

1
Q: Starting with Android: Java or Python (SL4A)

FabianI just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE). I tend to Python, as I know it much better than Java, but I'm wondering what I would be...

0
Q: How do the PIL ImageFilter enhancement filters work?

JohnnyWhere can I find information on what algorithms the PIL ImageFilter functions use? Like how does edge_enhance work?

0
Q: Python: Email problem

PhilI'm using the script below to send an email to myself, the script runs fine with no errors but I don't physically receive an email. import smtplib sender = 'foo@hotmail.com' receivers = ['foo@hotmail.com'] message = """From: From Person <foo@hotmail.com> To: To Person &...

0
Q: How can one use the logging module in python with the unittest module?

user197674I would like to use the python logging module to log all of the output from unittest so that I can incorporate it into a testing framework I am trying to write. The goal of this is to run the tests with 2 sets of output, one with simple output that tells the test case steps and a more debug l...

 
7:26 PM
0
Q: python -- callable iterator size?

garbagecollectorI am looking through some text file for a certain string with the method. re.finditer(pattern,text) I would like to know when this returns nothing. meaning that it could find nothing in the passed text. I know that callable iterators, have next() and iter ...

0
Q: Things to avoid in Python

PeterKHello all, inspired by this question Fastest way to learn Python? I've read the Dive ...

 
8:31 PM
0
Q: Error when trying make cleaned_data()! Djanog.

PolMust be simple solution. But I do not see it. Please help me. KeyError at /ticket/ 'gorod' Request Method: POST Request URL: http://localhost:8000/ticket/ Exception Type: KeyError Exception Value: 'gorod' Exception Location: C:\Documents and Settings\POLI...

0
Q: python -- for with an if statement

garbagecollectorI dont understand why, when i run my code the for each loop under the if statement isn't run. Even when the number of found is greater than 0! def findpattern(commit_msg): pattern = re.compile("\w\w*-\d\d*") group = pattern.finditer(commit_msg) found = getIterLengt...

0
Q: Referencing further pages with ReportLab

THI'm using ReportLab to create long questionnaires and I need to create text like If you do not have allergies, proceed to page 168 Does ReportLab present some feature that can help me with this referencing task? I understand that ...

0
Q: Gmail SMTP + XOAuth mystery

PanosJeeHi everyone, I am using python smtplib and xoauth and I am trying to send an email. I am using the code posted by Google: http://code.google.com/p/google-mail-xoauth-tools/source/bro...

0
Q: python csv: writing puts extra line

I__import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[11]] += 1 writer = csv.writer(open('/pythonwork/thefile_subset1.csv', 'w')) for row in data: if counter[row[11]...

0
Q: python csv - not closing file

I__im reading a csv file and then writing a new one: import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[11]] += 1 writer = csv.writer(open('/pythonwork/thefile_s...

 
8:53 PM
0
Q: confusing python urlencode order

Neil Turleyokay, so according to http://docs.python.org/library/urllib.html "The order of parameters in the encoded string will match the order of parameter tuples in the sequence." except when I try to run this code:...

 
9:15 PM
0
Q: script as module and executable

Austin I have a script in python that can be invoked from the command-line and uses optparse. script -i arg1 -j arg2 In this case I use (options, args) = parser.parse_args() to create options then use options.arg1...

0
Q: py2exe on PIL ImageStat.Stat throws Exception: argument 2 must be ImagingCore, not ImagingCore

user403875I'm trying to create a .exe from a python program using py2exe, but when I run the .exe I get a log file with Exception in thread Thread-1: Traceback (most recent call last): File "threading.pyc", line 532, in __bootstrap_inner File "threading.pyc", line 484, in run File ...

 
9:42 PM
0
Q: python csv: working with collections

I__import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[11]] += 1 with open('/pythonwork/thefile_subset10.csv', 'w') as outfile: writer = csv.writer(outfile) for r...

 
10:14 PM
0
Q: python : getting rid of extra line:

I__import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[10]] += 1 with open('/pythonwork/thefile_subset11.csv', 'w') as outfile: writer = csv.writer(outfile...

 
10:31 PM
0
Q: Wrong ELF class - Pyhon

RadiantHexHi folks, I'm trying to install this library for LZJB compression. PyLZJB LINK The library is a binding for a C library, the file is located here

 
10:42 PM
0
Q: python: inserting a whole line into a list

I__import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[10]] += 1 with open('/pythonwork/thefile_subset11.csv', 'w') as outfile: writer = csv.writer(outfile...

1
Q: Cleanest way of choosing between two values in Python

Goose BumperDicts in Python have a very nice method get: # m is some dict m.get(k,v) # if m[k] exists, returns that, otherwise returns v Is there some way to do this for any value? For example, in Perl I could do this: return $some_var or "so...

 
10:58 PM
0
Q: persistant TCP connection in Django

virtuallightHi, I have a Django application which sometimes needs to send some data through TCP and I want this connection to be persistant. The way I wanted to do it was to create a simple Twisted TCP server (I'm the one who will be waiting for the initial connection) and somehow call it...

 
11:09 PM
-1
Q: Python bindings for C library - How do I build this? - Python

RadiantHexHi folks, I cannot figure out how to build this library for my system. I'm running Ubuntu 64bit, and here is the library PyLZJB Thanks guys!

 
11:20 PM
0
Q: Python search file using wildcard

StanIf I want get a list of filenames with a search pattern with wildcard. Like: getFilenames.py c:\PathToFolder\* getFilenames.py c:\PathToFolder\FileType*.txt getFilenames.py c:\PathToFolder\FileTypeA.txt How to do this? Thanks.

3
Q: How to make tkinter repond events while waiting socket data?

Sanjana HasanthiI'm trying to make the app read data from a socket, but it takes some time and locks the interface, how do I make it respond to tk events while waiting?

 
11:42 PM
0
Q: How to round integers in python

tablo_anHi, I am trying to round integers in python. I looked at the built-in round() function but it seems that that rounds floats. My goal is to round integers to the closest multiple of 10. i.e.: 5-> 10, 4-> 0, 95->100, etc. 5 and higher should round up, 4 and lower should round do...

 
11:58 PM
0
Q: Deploying cx_Oracle onto various versions of Oracle Client

cecilkorikI have some small python apps that use cx_Oracle to connect to an Oracle database. I deploy these apps by compiling them with py2exe, which works fine in many cases. The problem is, there is no standard Oracle Client version (9i and 10g for example) across the many people who need to i...

 

« first day (12 days earlier)      last day (22 days later) »