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

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: 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

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

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

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? > > > > > >

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: 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] > > >

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

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

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

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

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

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

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

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

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

Re: Reg: Installation problems in psycopg2

2008-10-14 Thread raj . indian . 08
Hi Philip, Thank you. I have posted the same in psycopg mailing list too. I had setup the pg_config value too, but even then the error was coming. Hi Dave, Thank you for the quick reply. Regards Raj K -- http://mail.python.org/mailman/listinfo/python-list

Reg: Installation problems in psycopg2

2008-10-13 Thread raj . indian . 08
nd now I cannot see any further way out. Regards, Raj *p.s -> I did find one binary in http://www.stickpeople.com/projects/python/win-psycopg/index.html#Version2. But the licensing is GPL and I wont be able to use it (I am doing coding for proprietary systems) -- http://mail.python.org/mailm

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

Re: Modifying the system menu

2008-09-24 Thread raj . indian . 08
I am creating the window manager for multiple desktops :) Anyways, i got one answer in nabble which I feel is the best option - even though I am just investigating on how to do it. Please find below - James Matthews wrote: > > Hi all, >I am trying to modify the system menu of all the applicati

Re: Modifying the system menu

2008-09-18 Thread raj . indian . 08
On Sep 18, 6:39 am, [EMAIL PROTECTED] wrote: > I tested it again and found that the behaviour is a little different > from what I mentioned previously in the mailchain. > The item is working perfectly the first time around. Now if I close > the application and run it again (which was what I did ear

Re: Modifying the system menu

2008-09-17 Thread raj . indian . 08
I tested it again and found that the behaviour is a little different from what I mentioned previously in the mailchain. The item is working perfectly the first time around. Now if I close the application and run it again (which was what I did earlier), if that application system menu is already mod

Modifying the system menu

2008-09-16 Thread raj . indian . 08
Hi all, I am trying to modify the system menu of all the applications in my machine. For example say - I am creating multiple desktops for windows - and I want to give every application the capability to be moved across different desktops. So I wanted to modify the basic system menu list t

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

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

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

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

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

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

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

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

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/

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

Re: Module imports during object instantiation

2007-08-16 Thread Ritesh Raj Sarraf
Steve Holden wrote: > Ritesh Raj Sarraf wrote: >> On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: >>> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> > [...] >> Oops!!! Looks like I completely missed this. It _did_

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

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
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-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-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-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-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
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-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

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

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

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

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

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

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

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-07 Thread Ritesh Raj Sarraf
ompletion or thread debugging, all is supported. For multithreaded applications, in PyDev, you'll see all the threads listed. Then you can use each thread and proceed with debugging the code. Learning Eclipse might take some time but that's worth it. HTH, Ritesh -- Ritesh Raj S

Re: lock problem

2007-03-17 Thread Ritesh Raj Sarraf
And that I do is because the output can be huge and useless. Then I do some pattern matching on that file and filter my data and then delete it. If you think I still am missing something important, request you to describe it. Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.r

Re: lock problem

2007-03-17 Thread Ritesh Raj Sarraf
it out. 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 impossible, the petty are those who cannot -

Re: lock problem

2007-03-16 Thread Ritesh Raj Sarraf
27;t think the environment variable is going to be the same. 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 w

Re: lock problem

2007-03-16 Thread Ritesh Raj Sarraf
Gabriel Genellina wrote: > En Thu, 15 Mar 2007 18:31:29 -0300, Ritesh Raj Sarraf <[EMAIL PROTECTED]> > escribió: > >> I'm not sure if there's something wrong in the code mentioned above or >> is it >> really a lock problem. > > Try to break

lock problem

2007-03-15 Thread Ritesh Raj Sarraf
e above code, "aa" is the first string which will be executed in Thread-1. In my query to the ldap server, I am getting a record which matches the "aa" string. I've verified it by putting a breakpoint and checking the value. The problem is that when I run the program manua

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

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

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

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

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

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

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

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

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

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: 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

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-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-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
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-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-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-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-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-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
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-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

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: 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

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

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: 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 >

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-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=&#

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

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

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. > >

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

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: 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

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

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")

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

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

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: 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: Python Debugger / IDE ??

2006-03-16 Thread Ritesh Raj Sarraf
Can you please point some good documents (need not be Python specific) on best practices with writing code this way ? Thanks, Ritesh -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >