what is the 'wb' mean in this code.. using python
code: file('pinax/media/a.jpg', 'wb') thanks ...
code: file('pinax/media/a.jpg', 'wb') thanks ...
Hi all, I have googled an example for converting Word to Html. import win32com from win32com.client import Dispatch, constants w = win32com.client.Dispatch('Word.Application') w = win32com.client.DispatchEx('Word.Application') '''skip some code here''' wc = win32com.client.constants w.ActiveDocument.SaveAs( FileName = filenameou...
How do I store a photo on the server. I store them in a directory - "D:\zjm_code\basic_project\pinax\media\default\pinax\images\upload" but this now a lot of images. Is there another simple way? Thanks ...
Hi Every One, I am developing an application on fireeagle, there i need to update the users exact location, with out asking any information from the user (i.e) lat, long e.t.c., If it is not possible using yahoo fireeagle, please let me know if there exists any other api's other than yahoo fireeagle. If they can get the exact location ...
I want to generate a tuple of tuple in form of ((x1,y1,x2,y2),...(x1,y1,x2,y2)) where x1,y1,x2,y2 are all in range of (0,8). Is there any other way rather than the following? S = list() for x1 in range(0, 8): for y1 in range(0, 8): for x2 in range(0, 8): for y2 in range(0, 8): S.append([x1,y1,x2,...
Hi folks! I tried everything! I cannot find a way to install pyCurl on my Windows 7 machine! I found these binaries link... BUT there are no binaries for 2.6. : ( Help would be great. : ) ...
I want to find all nodes in a xml file that have a certain tag-name, lets say "foo". If those foo-tags have them thelves child nodes with node-name "bar", then I want to remove those nodes. The result should be written to a file. <myDoc> <foo> <bar/> // remove this one </foo> <foo> <anyThing> <bar/> // don't remove t...
def merge(l1,l2): i=0; while((l1[i]!=none)||(l2[i]!=none)): SyntaxError: invalid syntax being a newbie i can't figure out whats wrong with the abouve code. ...
>>> def merge(l1,l2): top1=0 top2=0 while l1[top1]!=None or l2[top2]!=None: if l1[top1]>l2[top2]: l.append(11[top1]) top1=top1+1 print "added"+l1[top1] else: l.append(l2[top2]) top2=top2+1 print...
Hi, I am creating a CSV from a list of values. CSV File gets created but the csv is formed as a single column. Actually it should be multiple rows with multiple columns, instead it forms as a multiple rows with a single column. I am using the following code from random import choice import csv fileObject = csv.writer(open('Insurance....
This is more of a thought i had awhile rather than an actual problem to solve, maybe more a discussion, but i was wondering if it would be possible to design the game of solitaire and be abkle to play it in the python GUI or some other form of iterface? I know you can get a deck of cards fairly easily and i know yuo can play simple games...
It is PythonQt : pythonqt.sourceforge.net. I am using PythonQt-1.1 . Qt version 4.6.2 and Python 2.6.4.10 . Visual studio 2008 From instruction: cd PythonQtRoot vcvars32 qmake nmake after I typed qmake, it generated makefile, then I entered nmake but it said "makefile(22) :fatal error U1000: syntax error: ')' missing in macro i...
hello all, I am working on Vista, and using Python 2.6.4. I am using a software which uses a Python script. but then I bumped into the message: cannot find vcvarsall.bat So I installed visual c++ 2010. Still the file is not found though it is there. My guess (a very uneducated one...) is that somewhere the path is wrong, because I al...
Hi, I want to write the bulk of data into xml file ,the data coming from the backend(mysql) using cgi by httpservice, read the xml file and bind it into list... can anyone send the sample code for this? Thank's in advance.. ...
I have an image. I want to resize it using PIL, but it comes out like this. Even without a resize, it still messes up the colour. Minimal code: from PIL import Image import os import urllib import webbrowser orig_url = 'http://mercedesclub.org.uk/images/stackoverflow-question/least-popular-colours-_-500-x-500.jpg' temp_fn, _ = url...
I have a cURL call that I use in PHP: curl -i -H 'Accept: application/xml' -u login:key "https://app.streamsend.com/emails" I need a way to do the same thing in Python. Is there an alternative to cURL in Python. I know of urllib but I'm a Python noob and have no idea how to use it. ...
Hi, reading pylons documentations I did understand that websetup:setup_app is only called when the application is setup at first time by paster script. But, I found now, setup_app is call every time that application starts. Debugging the code, this behaviour seems right beacuse in appinstall.setup_config the module is loaded (as PRJ.web...
I have a non-computer related data logger, that collects data from the field. This data is stored as text files, and I manually lump the files together and organize them. The current format is through a csv file per year per logger. Each file is around 4,000,000 lines x 7 loggers x 5 years = a lot of data. some of the data is organized a...
Hello, Have a look a this simple example. I don't quite understand why o1 prints "Hello Alex" twice. I would think that because of the default self.a is always reset to the empty list. Could someone explain to me what's the rationale here? Thank you so much. class A(object): def __init__(self, a=[]): self.a = a o =...
Hi, I have an executable that run time should take configuration parameters from a script file. This way I dont need to re-compile the code for every configuration change. Right now I have all the configuration values in a .h file. Everytime I change it i need to re-compile. The platform is C, gcc under Linux. What is the best soluti...