Need 4 Python Developer // Times Sq - New York // 15+ Months Contract.

2012-10-31 Thread raj
Hi Friends, Hope you are doing great. This is Rajesh from NYTP. I wanted to let you know about New Job opening in Times Sq - New York. It is a 15+ months Contract. Role : Python Developer Location : Times Sq - New York Duration : 15+ Months Contract Pos

How to write Smart Python programs?

2006-10-10 Thread Raj
need help asap as the deadlines are very very short. Thanks, Raj. -- http://mail.python.org/mailman/listinfo/python-list

Post data using the libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

Post data using the libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

Post data to http server using libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

seperating directories from files

2006-01-30 Thread raj
i'm surely a newbie in python and on the go, I just tried to write a small app to change the gnome desktop background daily. It's working now making use of listdir() to find the contents of each dir I encounter. But I'm sure that my code won't go that smooth forever. How can I find if the content

Re: seperating directories from files

2006-01-30 Thread raj
Thanx adam 'n' fuzzyman! got that 'isdir'. But how the other thing? Can't find anything suitable. I'll be happy on getting atleast something like the file command in Unix -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the 'host' for SMTP?

2006-05-02 Thread raj
If you've a gmail account, you can set it as smtp.gmail.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with sorting

2008-03-28 Thread raj
To ankit: Well, sort() doesn't return the sorted list. It returns None. Why not this straightforward way? dvals = dict.values() dvals.sort() print dvals -- http://mail.python.org/mailman/listinfo/python-list

cresitrepair

2008-08-09 Thread raj
hi guys you can download the softwares and can get the latest tips and tricks about computers in this blog so just visit hte site and enjoy. If you don't gat what you want try the ads given there and son't forger to search in google search box what you want. the site is www.creditrepairs

Reportlab - Splitting table by column

2008-09-28 Thread raj
My Zope based application for a client has to generate annual audit reports with too wide tables of account-wise payment details. I turned to reportlab when HTML formatting became a headache for me. Reportlab doc claims it can split by row as well as column but doesn't explain how to. Then I came t

Some interactive Python tutorials on basic stats, possibly useful for teaching

2011-02-14 Thread Raj
shown in the figure change accordingly. http://www.dartmouth.edu/~raj/intro-stats.html The code has lots of comments in it, which attempt to explain the concepts as explicitly as possible. No prior knowledge of Python or statistics is assumed. These programs require the SciPy and Matplotlib modules

Python 3.1.2 and marshal

2010-07-17 Thread raj
rshaltest.py Traceback (most recent call last): File "marshaltest.py", line 13, in value2 = marshal.load(tmpstream) EOFError: EOF read where object expected Interestingly the file created by using Python 3.1 is readable by both Python 2.7 as well as Python 2.6 and both objects are suc

Re: Python 3.1.2 and marshal

2010-07-17 Thread raj
that makes even a noticeable difference for my use case. Thanks. raj -- http://mail.python.org/mailman/listinfo/python-list

Append to python List

2013-05-08 Thread RAHUL RAJ
Checkout the following code: sample2 = [x+y for x in range(1,10) for y in range(1,10) if x!=y] output=[] output=[x for x in sample2 if x not in output] the output I get is 3 4 5 6 7 8 9 10 3 5 6 7 8 9 10 11 4 5 7 8 9 10 11 12 5 6 7 9 10 11 12 13 6 7 8 9 11 12 13 14 7 8 9 10 11 13 14 15 8 9 10

Re: Append to python List

2013-05-09 Thread RAHUL RAJ
HUL RAJ wrote: > > > Checkout the following code: > > > > > > sample2 = [x+y for x in range(1,10) for y in range(1,10) if x!=y] > > > output=[] > > > > > output=[x for x in sample2 if x not in output] > > This statement is not do

Re: Append to python List

2013-05-09 Thread RAHUL RAJ
I'm getting same output for both code parts, why not for th code parts in question? On Thursday, May 9, 2013 1:48:51 PM UTC+5:30, RAHUL RAJ wrote: > Then what about this code part? > > > > [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y] > > >

MySQL dymanic query in Python

2013-05-29 Thread RAHUL RAJ
Can anyone tell me the proper way in which I can execute dynamic MySQL queries in Python? I want to do dynamic queries for both CREATE and INSERT statement. Here is my attempted code: sql="create table %s (%%s, %%s, %%s ... )" % (tablename,''.join(fields)+' '.join(types)) cur.execute(sql)

Re: MySQL dymanic query in Python

2013-05-30 Thread RAHUL RAJ
On Wednesday, May 29, 2013 3:32:51 PM UTC+5:30, Fábio Santos wrote: > On 29 May 2013 10:13, "RAHUL RAJ" wrote: > > > > > > Can anyone tell me the proper way in which I can execute dynamic MySQL > > queries in Python? > > > > > >

join this group

2011-05-28 Thread YUVI RAJ
http://123maza.com/65/Cape201/ -- http://mail.python.org/mailman/listinfo/python-list

join this group

2011-05-28 Thread YUVI RAJ
http://123maza.com/65/Cape201/ -- http://mail.python.org/mailman/listinfo/python-list

Problem using pip

2020-01-13 Thread proplayer raj
dear team I have encountered a problem while using pip , that it did not allowed to install webbrowsing and OS module it show the error that it does not found any matching distributor and does not fount the version which can fulfill the requirement. .So , I want to ask you what I can do to solve th

Re: Problem using pip

2020-01-14 Thread proplayer raj
Yes, that's it. Thanks for your help On Tue, Jan 14, 2020, 7:47 PM Jerry Hill wrote: > On Tue, Jan 14, 2020 at 2:18 AM proplayer raj > wrote: > > > > dear team > > I have encountered a problem while using pip , that it did not allowed to > > install webbrows

About some problem

2014-01-02 Thread raj kumar
Hello, I am beginner to python and i am writing following code from pytesser import * and i am getting an error as follow Traceback (most recent call last): File "", line 1, in File "C:\Python33\lib\site-packages\pytesser.py", line 61 print text ^ SyntaxError: invalid synta

Problem with using ConfigParser.py

2007-06-21 Thread Anthony Raj
Hi Folks, Having a very strange problem in using python with apache/mod_python. [conf.py attached] >>> from ast.conf import conf >>> c = conf() >>> a = c.readPath('sandbox') >>> len (a) >>> 30 The same code when run thru the a web script gives following error - [Errno 13] P

New-style classes and special methods

2007-05-30 Thread Raj B
>tp_call'. Does this that somehow the '__call__' method defined in C above is assigned to the 'tp_call' slot in the object representing the class C, instead of it just being stored in the dictionary like a normal attribute? Where and how does this magic happen exac

Re: New-style classes and special methods

2007-05-30 Thread Raj B
l slot? I'm sure I'll eventually figure it out if I stare at the code hard enough, but would totally appreciate any help I can get :) Thanks again! Raj -- http://mail.python.org/mailman/listinfo/python-list

Representation of new-style instance

2007-08-01 Thread Raj B
nary is stored. Could anyone please clarify? Thanks Raj -- http://mail.python.org/mailman/listinfo/python-list

How to know the starting point

2007-09-19 Thread Raj kumar
Hi, I need help regarding the starting point in python project, As we can find main() function in java class to know the starting class in java, what is the starting point in python project? How to find the starting point. Thank you - Get the freedom to save

Microdom xml file

2007-10-03 Thread Raj kumar
Hi every one, Can any one send me the sample code/links for creating a XML file and adding a tag by using microdom in twisted python. Thank you in advanced. - Now you can chat without downloading messenger. Click here to know how.-- http://mail.python.org/

Regarding Python.h

2008-02-15 Thread Raj kumar
Hi to all, I'm new to Python. I am using python2.4. I have one application written in c language in which it includes python like #include "Python.h" But when i try to install it, i'm getting an error like Python.h: No such file or directory I feel gcc is unable to get the path for Python.h What

check a directory

2008-02-25 Thread Raj kumar
Hi all, I'm using following code... for x in listdir(path) some code. but how i can check whether x is a directory or not? Because listdir() is giving all the files present in that path Thanks in advance. Did you know? You can CHAT without downloading messenger. Go to http

library

2008-02-26 Thread Raj kumar
hi, how to open python api documetation in linux machine? i think there should be a way to open installed library as a HTML pages. Thanks in advance. Did you know? You can CHAT without downloading messenger. Go to http://in.messenger.yahoo.com/webmessengerpromo.php/ -- http://mail.py

Inconsistency in retrieving exceptions via sys module

2008-05-12 Thread Raj Bandyopadhyay
type1); printf("PyErr_Occurred() : "); OPRINT(etype2); } The output sys.exc_type : None PyErr_Occurred() : Thank you Raj -- http://mail.python.org/mailman/listinfo/python-list

regarding xml elements

2008-03-29 Thread Raj kumar
some other parameters like. and i have m and n values as strings with me. can anybody help me to create this element and write it to the existing xml file as a child of an existing element? Thanks in advance.. Raj.. Forgot the famous last words? Access your messa

Question about overloading of binary operators

2008-03-31 Thread Raj Bandyopadhyay
nd order. However, in one case the subclass's function is used and not in the other case. What am I missing here? Thanks Raj -- http://mail.python.org/mailman/listinfo/python-list

Free chat for u.....hot.hot.....hot..............

2010-02-21 Thread sk raj
http://chattingfree.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

MAKE UPTO $5000 PER MONTH! $2000 IN FIRST 30 DAYS!

2010-06-19 Thread benadict raj
MAKE UPTO $5000 PER MONTH! $2000 IN FIRST 30 DAYS! Generate $50 to $100 whenever you have a couple of hours free time tospare. You could make $50 or more in the next 2 hours. Starting right Now! Today! Awesome earnings get paid for your honest work Join as a free member and get paid to your bank a

option argument length

2005-12-04 Thread Ritesh Raj Sarraf
nts". Something like: (options,args) = parser.parse_args() len(options) != 1 or len(options) > 2: print "Incorrect number of arguments passed." How do I accomplish it ? Regards, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com "Stealing logics from o

Re: option argument length

2005-12-05 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marc 'BlackJack' Rintsch on Monday December 5 2005 03:24 wrote: > In <[EMAIL PROTECTED]>, Ritesh Raj > Sarraf wrote: > >> My program uses mostly "option arguments" hence my len(args) value is >> alwa

Re: option argument length

2005-12-05 Thread Ritesh Raj Sarraf
fetch-update" option, it should execute the required code. Now how do I check if at least one option has been passed at the command-line ? I have multiple options but I have parser.set_defaults() for each of them. Regards, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.c

Re: option argument length

2005-12-07 Thread Ritesh Raj Sarraf
On Tue, 6 Dec 2005, Peter Otten wrote: > Ritesh Raj Sarraf wrote: > >> I'm using this for "option arguments" which are mutually inclusive. >> But I want the user to pass atleast one "option argument" for the program >> to function properly. &g

Re: option argument length

2005-12-07 Thread Ritesh Raj Sarraf
imal or full or blah. For this I think this should be enough: if not options.set_upgrade and options.upgrade_type: parser.error("They are mutually inclusive options") But my main concern is what if the user doesn't pass any arguemtns. Every option I have has a default

urllib.urlretireve problem

2005-03-26 Thread Ritesh Raj Sarraf
here is no package named libparl5.6 Please Help! rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC "Stealing logic from one person is plagiarism, stealing from many is research". -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) i

Re: urllib.urlretireve problem

2005-03-30 Thread Ritesh Raj Sarraf
he desired file. I think my problem is fixable in urllib.urlopen, I just find urllib.urlretrieve more convenient and want to know if it can be done with it. Thanks for responding. rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC "Stealing logic from o

Re: urllib.urlretireve problem

2005-03-31 Thread Ritesh Raj Sarraf
Windows/Mac OSX/Linux et cetera. That is why I'm sticking strictly to python libraries. The second suggestion sounds good. I'll look into that. Thanks, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC "Stealing logic from one person is plagia

A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Aditya Raj Bhatt
I always do single line comments with # but just for the sake of it I tried it with ''' ''' and it gives me a syntax error. In both the interpreter, and the source code text file, doing - a = 5 '''a comment''' results in a syntax error, with the very last quote at the end of the line highlighted

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Aditya Raj Bhatt
On Wednesday, March 18, 2015 at 1:04:39 PM UTC-5, Laurent Pointal wrote: > > Can someone also provide a sort of a 'guide' to triple-quoted comments > > in general? > > A triple ' or " string is a Python string, allowing line-return in string. What do you mean by line-return in string? Is it newli

urllib2.urlopen Progress bar

2006-01-14 Thread Ritesh Raj Sarraf
pm" sUrl="http://localhost/new.rpm"; urllib.urlretrieve(sUrl, sFile, reporthook=myReportHook) print "\n\n" #temp = urllib2.urlopen(sUrl) #lastval = int(temp.headers['Content-Length']) #prog = progressBar(0, lastval, 77) # #for x in range(101): #prog.updateAm

[FIXED] Re: urllib2.urlopen Progress bar

2006-01-15 Thread Ritesh Raj Sarraf
"\n" data.close() temp.close() Thanks, Ritesh Ritesh Raj Sarraf on Sunday 15 Jan 2006 12:55 wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > In urllib.urlretrieve I can use reporthook to implement a progress bar. > > But in

python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
amHandler(sys.stdout) console.setLevel(logging.INFO) console_formatter = logging.Formatter('%(message)s') console.setFormatter(console_formatter) logger.addHandler(conerr) logger.addHandler(console) logger.info("Ritesh Raj Sarraf.\n") logger.warning("Ricky Raj Sarraf.\n") H

Re: python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: > import os, sys, logging > > logger = logging.getLogger("my_app") > I tried this code: import logging, sys # set up logging to file - see previous section for more details logging.basicConfig(level=logging.DEBUG, format=&#

Re: python logging module problem

2006-07-14 Thread Ritesh Raj Sarraf
Vinay Sajip wrote: > > It's usual to rely on logger levels and to set handler levels for > additional refinement of what goes to a particular handler's > destination. > The problem is that for StreamHandler, logging module logs to sys.stderr. I want to use the logging feature for most of the mess

Re: python logging module problem

2006-07-14 Thread Ritesh Raj Sarraf
Peter Otten wrote: > You can achieve the desired behaviour by adding a custom Filter: > > import sys > import logging > > logger = logging.getLogger("my_app") > logger.setLevel(logging.DEBUG) > > class LevelFilter(logging.Filter): > def __init__(self, level): > self.level = level >

class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
Hi, I have a class defined in a file called foo.py In bar.py I've imported foo.py In bar.py's main function, I instantiate the class as follows: log = foo.log(x, y, z) Now in main I'm able to use log.view(), log.error() et cetera. But when I call the same method from some functions which are i

Re: class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
Steve Holden wrote: > Ritesh Raj Sarraf wrote: > > But when I call the same method from some functions which are in > > bar.py, it fails giving me the following error: > > > > NameError: global name 'log' is not defined > > > Well, that's

Re: class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
> > log = foo.log(x, y, z) > > Resulting line is: log = foo.log(x, y, z) global log Making the instance "log" global makes it accessible to all the functions. Now I have only one question, Is this a correct way to do it ? Or are there better way ? Ritesh -- http://mail.python.org/mailman/list

Thread Question

2006-07-27 Thread Ritesh Raj Sarraf
Hi, I have some basic doubts about thread. I have a list which has items in it which need to be downloaded from the internet. Let's say list is: list_items[] which has 100 items in it. I have a function download_from_web() which does the work of downloading the items from the web. It does error

Re: Thread Question

2006-07-27 Thread Ritesh Raj Sarraf
ds[i].start() counter += 1 i += 1 counter = 0 join_i = i - 3 while counter < 3: threads[join_i].join() counter += 1 join_i += 1 Is this correct ? Comments!! Ritesh Duncan Booth wrote: > Ritesh

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
e_response(response) > I guess these would be clear once I'm clear on the first problem. > # and then to shut down the threads when you've finished: > for t in thread_pool: > requestQueue.put(None) > for t in thread_pool: > t.join() Thanks a lot for your replies. Ri

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
And people, Is there any documentation on Python Threads or Threads in general. It'd be of great help to really understand. Ritesh Ritesh Raj Sarraf on Thursday 27 Jul 2006 16:37 wrote: > Is this the correct way of threading applications ? > This is the first time I'd be doing t

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
sing the requestQueue() And in function run(), when the item of lRawData is None, the thread stops. The the cleanup and checks of any remaining threads is done. Is this all correct ? I also do have a couple of questions more which would be related to locks. But I'd post them once I get do

Re: Thread Question

2006-08-02 Thread Ritesh Raj Sarraf
rk ? Thanks, Ritesh Justin Azoff on Thursday 27 Jul 2006 22:33 wrote: > Ritesh Raj Sarraf wrote: > [snip] >> for item in list_items: >> download_from_web(item) >> >> This way, one items is downloaded at a time. >> >> I'm planning to implement thr

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: > > One other question I had, > > If my user passes the --zip option, download_from_web() internally (when the > > download is successful) zips the downloaded data to a zip file. Since in > > case > > of threading there'll be multiple threads, and say if one of the thread > >

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: > > The other threads will just take the next request from the Queue and > process it. They won't "care" what the one thread is doing, > downloading, zipping, whatever. > As I mentioned in my previous post, the other threads will also have to go through the same "zip the file

Re: Thread Question

2006-08-04 Thread Ritesh Raj Sarraf
Gerhard Fiedler wrote: > Rather than downloading and zipping in the same thread, you could run > multiple threads like you're doing that only download files, and one > zip-it-all-up thread. After downloading a file, the download threads place > a message in a queue that indicates the file they hav

Re: Thread Question

2006-08-04 Thread Ritesh Raj Sarraf
Carl Banks wrote: > If you have multiple threads trying to access the same ZIP file at the > same time, whether or not they use the same ZipFile object, you'll have > trouble. You'd have to change download_from_web to protect against > simultaneous use. A simple lock should suffice. Create the

Re: Thread Question

2006-08-04 Thread Ritesh Raj Sarraf
Carl Banks wrote: > > Exactly. Only one thread can hold a lock at a time. If a thread tries > to acquire a lock that some other thread has, it'll wait until the > other thread releases it. You need locks to do this stuff because most > things (such as zipfile objects) don't wait for other threa

Re: Thread Question

2006-08-05 Thread Ritesh Raj Sarraf
finally: ziplock.release() elif exit_status == True: if zip_bool: ziplock.acquire() try: compress_the_file(zip_type_file, sFile, sSourceDir)

Re: Thread Question

2006-08-05 Thread Ritesh Raj Sarraf
y need to be using the same > lock. > > Try moving "ziplock = threading.Lock()" out of the function, so > your code might read, in part: > > > ziplock = threading.Lock() > > def run(request, response, func=copy_first_match): > # And so on... Thank

thread lock question

2006-10-11 Thread Ritesh Raj Sarraf
pping even if that's not true. My question is, in a code example like this which is threaded, does the locking mechanism work correctly ? Or are two different locks being acquired ? Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of i

Re: thread lock question

2006-10-12 Thread Ritesh Raj Sarraf
e a couple of seconds for the zip to complete. During those couple of seconds, if another thread's file (a couple kb) gets downloaded/copied, will it wait for the lock to be released or will it create another lock ? Thanks, Ritesh Dennis Lee Bieber wrote: > On Wed, 11 Oct 2006 18:39:32

determining file type

2006-06-14 Thread Ritesh Raj Sarraf
Hi, I have a funtion named unzipper() which does the work of unzipping the files. Is there a way I can identify what is the type of the file which'll be passed to unzipper(). If yes, I'll be able to make out if it's a zip file or a tar or a bz2 file. Thanks, Ritesh -- http://mail.python.org/ma

Re: determining file type

2006-06-14 Thread Ritesh Raj Sarraf
But isn't there any library function ? Something like XX.filetype(name) Directory File-Tar File-Zip File-MPEG Ritesh Maric Michaud wrote: > Le Mercredi 14 Juin 2006 11:22, Ritesh Raj Sarraf a écrit : > > Hi, > > > > I have a funtion named unzipper() which does

Re: determining file type

2006-06-14 Thread Ritesh Raj Sarraf
Also, f = file ('some_file.jpg') throws an error. "str object is not callable" Ritesh Maric Michaud wrote: > Le Mercredi 14 Juin 2006 11:22, Ritesh Raj Sarraf a écrit : > > Hi, > > > > I have a funtion named unzipper() which does the work of unzipping th

zipfile module doesn't allow append

2006-06-29 Thread Ritesh Raj Sarraf
Hi, I've got a problem here. def compress_the_file(zip_file_name, files_to_compress, sSourceDir): """ Condenses all the files into one single file for easy transfer """ try: import zipfile except ImportError: sys.stderr.write("Ai! module not found.\n")

optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Hi, I'm having some minor problems with optparse. I'm just worried that someone shouldn't say that multiple argument feature isn't implemented in optpartse. How to tackle multiple arguments to an option ? As far as I dug, I've found that >1 arguments are being ignored. parser.add_option("", "--m

Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: > Hi, > > I'm having some minor problems with optparse. I'm just worried that > someone shouldn't say that multiple argument feature isn't implemented > in optpartse. > > How to tackle multiple arguments to an option ? > As fa

FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: > I just noticed that the args variable is holding values b and c. > the args variables comes from: > (options, args) = parser.parse_args() > > I guess I only need to figure out now is why args isn't storing > argument "a" also..

Re: FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Simon Percivall wrote: > > It might do you good to read the documentation instead of blindly > experimenting. > > Anyway, > > parser.add_option("", "--my-option", nargs=3) > > http://docs.python.org/lib/optparse-standard-option-actions.html That won't help because by design of my program, I can't

Re: FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Fredrik Lundh wrote: > Ritesh Raj Sarraf wrote: > > >> http://docs.python.org/lib/optparse-standard-option-actions.html > > > > That won't help because by design of my program, I can't limit the > > number of arguments a user can pass to it. > >

compressed file ended before the logical end-of-stream was detected

2006-07-05 Thread Ritesh Raj Sarraf
Hi, The program downloads the files from the internet and compresses them to a single zip archive using compress_the_file(). Upon running syncer() which calls the decompress_the_file(), the first iteration succeeds. But upon second iteration, I get an IOError exception with the message: "compress

Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
progress bar gets over-written by the download progress of files from other threads. I believe my change has to go into the progress bar class to make it thread aware. Are they any docs/suggestions on how to implement progress bars along with threads ? Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT

Re: Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
ke you only created one progress bar, and each > thread is referencing that single bar. I'd suspect you need to create a > bar for EACH thread you create, and tell the thread which bar to update. Yes, you're correct. That's what I'm also suspecting. I tried to do s

screen output problem

2006-11-25 Thread Ritesh Raj Sarraf
Hi, I have, for very long, been trying to find a consistent solution (which could work across major python platforms - Linux, Windows, Mac OS X) for the following problem. I have a function which downloads files from the web. I've made the function threaded. I'm trying to implement a progress bar

Re: screen output problem

2006-11-28 Thread Ritesh Raj Sarraf
or each separate progress action. Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." "Stealing logic from one person is plagiarism, stealing from many is research." "The great are those who achieve the impo

Re: screen output problem

2006-11-29 Thread Ritesh Raj Sarraf
wnloads on a single line. Probably the apt developers also might have run into the same issue and hence settled down with this workaround. Thanks, Ritesh Dennis Lee Bieber wrote: > On Tue, 28 Nov 2006 15:15:28 +0530, Ritesh Raj Sarraf > <[EMAIL PROTECTED]> declaimed the followi

breaking from loop

2006-02-09 Thread Ritesh Raj Sarraf
Hi, Following is the code: def walk_tree_copy(sRepository, sFile, sSourceDir, bFound = None): try: if sRepository is not None: for name in os.listdir(sRepository): path = os.path.join(sRepository, name) if os.path.isdir(path):

Re: breaking from loop

2006-02-10 Thread Ritesh Raj Sarraf
Thanks to everyone. It is really the best place and the best people to learn from. Here's what I followed from the discussion: def files(root): for path, folders, files in os.walk(root): for file in files: yield path, file def copy_first_match(repository, filename, dest_d

Namespace issue

2007-05-23 Thread Ritesh Raj Sarraf
Hi, I need a little help in understanding how Namespaces and scoping works with Classes/Functions in Python. Here's my code: class FetchData: def __init__(self, dataTypes=["foo", "bar", "spam"], archive=False): self.List = [] self.Types = dataTypes if

Module imports during object instantiation

2007-08-10 Thread Ritesh Raj Sarraf
Hi, I've been very confused about why this doesn't work. I mean I don't see any reason why this has been made not to work. class Log: def __init__(self, verbose, lock = None): if verbose is True: self.VERBOSE = True else: self.VERBOSE = False if lock is

Re: Module imports during object instantiation

2007-08-11 Thread Ritesh Raj Sarraf
On Aug 11, 3:17 am, James Stroud <[EMAIL PROTECTED]> wrote: > You do realize your import statement will only be called for nt and dos > systems don't you? > Yes. I would like to load a Windows Python Module (which is, say a specific implementation for Windows only) in such a condition where I find

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: > Ritesh Raj Sarraf a écrit : >> >> if lock is None or lock != 1: >> self.DispLock = False >> else: >> self.DispLock = threading.Lock() >> self.lock = T

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: > Ritesh Raj Sarraf a écrit : > > The initializer will be called *each time* you instanciate the class. > And nothing prevents client code from calling it explicitelly as many > times as it wants - ok, this would be rather strange, but this is stil

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Steve Holden wrote: > Ritesh Raj Sarraf wrote: >> class Log: >> >> def __init__(self, verbose, lock = None): >> >> if verbose is True: >> self.VERBOSE = True >> else: self.VERBOSE = False >> > Better: >

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: >>> What's leading you to conclude the import isn't being executed? You >>> realise, I trust, that the module's code will only be executed on the >>> first call to __init__()? >>> >> >> Well. Putting it in a "try" inside __init__() doesn't do anything. > > This would b

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: > If you want an import inside an __init__ to run, you must call > the __init__ function that contains it. Doesn't __init__ get called automatically ? I thought __init__ was required to be called explicitly only when you were doing inheritance and wanted to pass separate value

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: >> >> Doesn't __init__ get called automatically ? > > It gets called automatically when you construct an instance of > the class in which it's defined. I am a little confused by your statements now. In my earlier posts in the same thread, I gave some code example which was s

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > > Or am I terribly missing something that you are trying to tell ? > > I didn't see log = Log() in your example. Sorry for the > exc

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > > On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > > > Or am I terribly missing something that you are trying

  1   2   >