Re: UrlLib2 Proxy and Https

2004-12-11 Thread Sandeep
Check out the following link. It helped me achieve the same thing
(access a HTTPS site via a proxy).

http://groups.yahoo.com/group/linux-bangalore-programming/message/4208
Cheers,
Sandeep
http://sandeep.weblogs.us/

-- 
http://mail.python.org/mailman/listinfo/python-list


Running CVSNT commands from python to Automate the job

2009-02-04 Thread sandeep
Hi All,

i want to automate my task for of doing cvs checkout for different
modules. I am on Windows XP and i am using Python 2.6. here is my
attched python code. The thing is when i am running this nothing is
happening. I am not sure at which end the problem is. am i giving
wrong parameters or what? any help or pointers to write directions
will be helpfull.

CVS_PATH='C:\Program Files\CVSNT\cvs.exe'
CVS_PATH=(os.sep).join(CVS_PATH.split('\\'))
BRANCH_NAME='B_PKG14_01'
'''

Filters the directories only from the list of files
and directories excluding the directories starting with name '.'
@param dirList=List of all the files and directories
@param basePath=path where we are doing our filtering

'''
def filterDir(dirList,basePath):
import os
temp=[]
for data in dirList:
#if(data[0]!='.'):
mydir=os.path.join(basePath,data)
flag=os.path.isdir(mydir)
if(flag==True):
temp.append(mydir)
return temp

def main():
import os

curr_dir=os.getcwd()#current working directory
curr_list=os.listdir(curr_dir)#list of all files and directories
in current working directory
global CVS_PATH,BRANCH_NAME
temp=filterDir(curr_list,curr_dir)

for mydir in temp:
dir_name=os.path.split(mydir)[1]
#os.rmdir(mydir)
CVS_COMMAND='checkout -r '+BRANCH_NAME+' -P '+dir_name
print '"'+CVS_PATH+'"'+' -q '+CVS_COMMAND

main()



thanks,
sandeep
--
http://mail.python.org/mailman/listinfo/python-list


python script to windows exe

2008-05-19 Thread sandeep
hi all

i am very much a newbie to python but has some experience of
development.i am trying to write a script which will loop through the
outlook 2003 inbox and save the email data in an simple data.html page
and save all the attachments in a folder name emails.after some
initial struggling i am able to write this script.but now i want to
create the exe file of this script.i have used py2exe for this job and
created the exe. but when i run the exe my program in not behaving as
it supposed to be.its generating some errors.i dont know why this
thing is happening as when i run my script it works fine.can some one
put some light here. i am using python2.5 and is using
py2exe-0.6.6.win32-py2.5.exe of py2exe. My os is windows xp with
service pack2.


thanks and reagrds
sandeep kumar sharma
--
http://mail.python.org/mailman/listinfo/python-list


Re: python script to windows exe

2008-05-19 Thread sandeep
On May 19, 1:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > but when i run the exe my program in not behaving as
> > it supposed to be.its generating some errors.i dont know why this
> > thing is happening as when i run my script it works fine.can some one
> > put some light here.
>
> There is nothing special in executables produced by py2exe. I mean
> that the debugging strategy is as always. A good start might be in
> adding logging\tracing facilities both to script and the executable.
> Comparing two trace files could give you some clue.

hi here is my code.i wont get any errors when i run this script.it may
not be the best pycode as i am very much new to python development.

import win32com,win32com.client
import os,os.path
import codecs
import zipfile

[EMAIL PROTECTED]:::Sandeep Kumar Sharma

#outlook2003 application refrence
outlook_app=0
#outlook ids to access different folders look into msdn for more info.
not a preffered way as i am hardcoding data here
OlDefaultFolders={'olFolderCalendar':9,'olFolderConflicts':
19,'olFolderContacts':10,'olFolderDeletedItems':3,'olFolderDrafts':
16,'olFolderInbox':6,'olFolderJournal':11,'olFolderJunk':
23,'olFolderLocalFailures':21,'olFolderNotes':12,'olFolderOutbox':
4,'olFolderSentMail':5,'olFolderServerFailures':
22,'olFolderSyncIssues':20,'olFolderTasks':
13,'olPublicFoldersAllPublicFolders':18}
#outlook types to save mailItem look into msdn for more info
#although doesnot work for me :-(
OlSaveAsType={'olTXT': 0,'olRTF':1,'olTemplate': 2,'olMSG': 3,'olDoc':
4,'olHTML':5,'olVCard': 6,'olVCal':7,'olICal': 8};

#refrence to content in inbox
inbox_obj=0

#function which will initialise outlook and return its reference
def getAppRef():
temp=win32com.client.Dispatch("OutLook.Application")
return temp.GetNamespace("MAPI")

#function to return the folders in the outlook
def getOutLookFolders(a,b=OlDefaultFolders['olFolderInbox']):
return a.GetDefaultFolder(b)

#function to get email content
def getMailContent(obj):
txt_file=codecs.open('data.html',encoding='utf-8',mode='w')
for kk in range(len(obj.Items),1,-1):
#for kk in range(len(obj.Items-1),0,-1):
#print 'hello'
print 'writting file='+str(kk)
mailItem=obj.Items[kk]
writeData(mailItem,txt_file)

#print mailItem.OlSaveAsType.olMSG
#saveCopy(mailItem)
#print "sender="+mailItem.SenderName+'
SenderEmailId='+str(mailItem.SenderEmailAddress)+'
Time='+str(mailItem.ReceivedTime)
#print 'Subject='+mailItem.Subject+' size='+str(mailItem.Size)

txt_file.close()
'''
file_zip=zipfile.ZipFile(txt_file,"w",zipfile.ZIP_DEFLATED)
file_zip.write('data.log')
file_zip.close()
'''

#function to create a directory
#obviously not a best way :-( but i think can expected this sort of
mistakes from beginners
def createDir():
path=os.path.abspath("\email")
if(os.path.exists(path)):
print "Directory already exists"
else:
os.system("md "+path)

#function to save a copy of email
def writeData(mailItem,file):
data=""
sender='SenderName'+checkStringType(mailItem.SenderName)
time='Time'+checkStringType(str(mailItem.ReceivedTime))
attachment='Attachments Count'+str(len(mailItem.Attachments))
edata='Email Content'+checkStringType(mailItem.Body)+""
dataToWrite=data+sender+time+attachment+edata
getAttachmentInfo(mailItem.Attachments)
file.write(getHTMLString(dataToWrite))
#checkStringType(dataToWrite)

def getAttachmentInfo(atmts):
for kk in range(1,len(atmts)):
atmt=atmts[kk]
#print "File Name="+atmt.FileName+'
DisplayName='+atmt.DisplayName+' PathName='+atmt.PathName+' '
abc=os.path.isdir(os.getcwd()+'\email')

if(abc==True):
print 'directory exists'

else:
os.mkdir(os.getcwd()+'\email')

path=os.path.abspath(os.getcwd()+'\email')
atmt.SaveAsFile(path+"\\"+atmt.DisplayName)



# function to check whether the character encoding is ascii or smthing
else
def checkStringType(a):

if isinstance(a,str):
   b='not a unicode string'

else:
a.encode('utf-8')
#print 'unicode type'

return a

#function to save the coopy of an email
#:-( but smhow it generate error whenever i 

Re: python script to windows exe

2008-05-19 Thread sandeep

hi
the py code that i have written is here.when i run this code i wont
get any errors it just works fine for me.but when i created the exe i
start getting an error in my 'getMailContent' function. The error
description is

TypeError:unsupported operand type(s) for :- 'instance' and 'int'

i dont know why i am start getting this error when i run it through
the exe.


import win32com,win32com.client
import os,os.path
import codecs
import zipfile

[EMAIL PROTECTED]:::Sandeep Kumar Sharma

#outlook application refrence
outlook_app=0
#outlook ids to access different folders look into msdn for more info.
not a preffered way as i am hardcoding data here
OlDefaultFolders={'olFolderCalendar':9,'olFolderConflicts':
19,'olFolderContacts':10,'olFolderDeletedItems':3,'olFolderDrafts':
16,'olFolderInbox':6,'olFolderJournal':11,'olFolderJunk':
23,'olFolderLocalFailures':21,'olFolderNotes':12,'olFolderOutbox':
4,'olFolderSentMail':5,'olFolderServerFailures':
22,'olFolderSyncIssues':20,'olFolderTasks':
13,'olPublicFoldersAllPublicFolders':18}
#outlook types to save mailItem look into msdn for more info
#although doesnot work for me :-(
OlSaveAsType={'olTXT': 0,'olRTF':1,'olTemplate': 2,'olMSG': 3,'olDoc':
4,'olHTML':5,'olVCard': 6,'olVCal':7,'olICal': 8};

#refrence to content in inbox
inbox_obj=0

#function which will initialise outlook and return its reference
def getAppRef():
temp=win32com.client.Dispatch("OutLook.Application")
return temp.GetNamespace("MAPI")

#function to return the folders in the outlook
def getOutLookFolders(a,b=OlDefaultFolders['olFolderInbox']):
return a.GetDefaultFolder(b)

#function to get email content
def getMailContent(obj):
txt_file=codecs.open('data.html',encoding='utf-8',mode='w')
for kk in range(len(obj.Items),1,-1):
#for kk in range(len(obj.Items-1),0,-1):
#print 'hello'
print 'writting file='+str(kk)
mailItem=obj.Items[kk]
writeData(mailItem,txt_file)

#print mailItem.OlSaveAsType.olMSG
#saveCopy(mailItem)
#print "sender="+mailItem.SenderName+'
SenderEmailId='+str(mailItem.SenderEmailAddress)+'
Time='+str(mailItem.ReceivedTime)
#print 'Subject='+mailItem.Subject+' size='+str(mailItem.Size)

txt_file.close()
'''
file_zip=zipfile.ZipFile(txt_file,"w",zipfile.ZIP_DEFLATED)
file_zip.write('data.log')
file_zip.close()
'''

#function to create a directory
#obviously not a best way :-( but i think can expected this sort of
mistakes from beginners
def createDir():
path=os.path.abspath("\email")
if(os.path.exists(path)):
print "Directory already exists"
else:
os.system("md "+path)

#function to save a copy of email
def writeData(mailItem,file):
data=""
sender='SenderName'+checkStringType(mailItem.SenderName)
time='Time'+checkStringType(str(mailItem.ReceivedTime))
attachment='Attachments Count'+str(len(mailItem.Attachments))
edata='Email Content'+checkStringType(mailItem.Body)+""
dataToWrite=data+sender+time+attachment+edata
getAttachmentInfo(mailItem.Attachments)
file.write(getHTMLString(dataToWrite))
#checkStringType(dataToWrite)

def getAttachmentInfo(atmts):
for kk in range(1,len(atmts)):
atmt=atmts[kk]
#print "File Name="+atmt.FileName+'
DisplayName='+atmt.DisplayName+' PathName='+atmt.PathName+' '
abc=os.path.isdir(os.getcwd()+'\email')

if(abc==True):
print 'directory exists'

else:
os.mkdir(os.getcwd()+'\email')

path=os.path.abspath(os.getcwd()+'\email')
atmt.SaveAsFile(path+"\\"+atmt.DisplayName)



# function to check whether the character encoding is ascii or smthing
else
def checkStringType(a):

if isinstance(a,str):
   b='not a unicode string'

else:
a.encode('utf-8')
#print 'unicode type'

return a

#function to save the coopy of an email
#:-( but smhow it generate error whenever i make a call to it
def saveCopy(mailItem):

name="\\"+mailItem.Subject+"__"+str(mailItem.ReceivedTime)
print name
#global outlook_app
try:
mailItem.SaveAs(path+name+".txt",OlSaveAsType['olTXT'])
except BaseException:
print BaseException

def getHTMLString(b):
a='Your Emai

Re: python script to windows exe

2008-05-20 Thread sandeep
hi all

thanks for ur replies. i have a bit closer look at my code and i am
able to fix the problem.now my exe is working fine.the code is bit
more cleaner now as i removed lot of unused function from it and try
to document it also.


import win32com,win32com.client
import os,os.path
import codecs
import zipfile

[EMAIL PROTECTED]:::Sandeep Kumar Sharma

#outlook application refrence
outlook_app=0
#outlook ids to access different folders look into msdn for more info.
not a preffered way as i am hardcoding data here
OlDefaultFolders={'olFolderCalendar':9,'olFolderConflicts':
19,'olFolderContacts':10,'olFolderDeletedItems':3,'olFolderDrafts':
16,'olFolderInbox':6,'olFolderJournal':11,'olFolderJunk':
23,'olFolderLocalFailures':21,'olFolderNotes':12,'olFolderOutbox':
4,'olFolderSentMail':5,'olFolderServerFailures':
22,'olFolderSyncIssues':20,'olFolderTasks':
13,'olPublicFoldersAllPublicFolders':18}
#outlook types to save mailItem look into msdn for more info
#although doesnot work for me :-(
OlSaveAsType={'olTXT': 0,'olRTF':1,'olTemplate': 2,'olMSG': 3,'olDoc':
4,'olHTML':5,'olVCard': 6,'olVCal':7,'olICal': 8};

#refrence to content in inbox
inbox_obj=0

#function which will initialise outlook and return its reference
def getAppRef():
temp=win32com.client.Dispatch("OutLook.Application")
return temp.GetNamespace("MAPI")

#function to return the folders in the outlook
def getOutLookFolders(a,b=OlDefaultFolders['olFolderInbox']):
return a.GetDefaultFolder(b)

#function to get email content
def getMailContent(obj):
txt_file=codecs.open('data.html',encoding='utf-8',mode='w')
emailData=""
for kk in range(len(obj.Items)-1,0,-1):
print 'writting file='+str(kk)
mailItem=obj.Items[kk]
emailData=emailData+getEmailData(mailItem)
saveAttachments(mailItem.Attachments)
txt_file.write(getHTMLString(emailData))
txt_file.close()

#function which will return the emailItem data as form of String
def getEmailData(mailItem):
data=""
sender='SenderName'+checkStringType(mailItem.SenderName)
time='Time'+checkStringType(str(mailItem.ReceivedTime))
attachment='Attachments Count'+str(len(mailItem.Attachments))
edata='Email Content'+checkStringType(mailItem.Body)+""
dataToWrite=data+sender+time+attachment+edata
return dataToWrite

#function for saving the attachment.we are calling attachments
SaveAsFile to save the attachment.
#SaveAsFile is com method.for more info dig into msdn :-)
def saveAttachments(atmts):
for kk in range(1,len(atmts)):
atmt=atmts[kk]
abc=os.path.isdir(os.getcwd()+'\email')
if(abc==True):
print 'directory exists'
else:
os.mkdir(os.getcwd()+'\email')
path=os.path.abspath(os.getcwd()+'\email')
atmt.SaveAsFile(path+"\\"+atmt.DisplayName)

# function to check whether the character encoding is ascii or smthing
else
def checkStringType(a):
if isinstance(a,str):
   b='not a unicode string'
else:
a.encode('utf-8')
#print 'unicode type'
return a

#bit of html stuff so that i can see my output on browsers.
def getHTMLString(emailData):
a='Your Email Data log is here'+emailData+''
return a

#main entrance to the program
def main():
global outlook_app,inbox_obj
outlook_app=getAppRef()
inbox_obj=getOutLookFolders(outlook_app)
getMailContent(inbox_obj)

main()

once again thanks for your help.

thanks and regards
sandeep kumar sharma
--
http://mail.python.org/mailman/listinfo/python-list


python script for tortoise cvs

2008-06-19 Thread sandeep
hi

we are using tortoise cvs and putty. i want to write a python script
to whom i can provide a tag and module.now what this script will do is
look for this specific tag and checks for whether its a individual tag
or its inside a branch.if its inside a branch then find out what is
the branch tag and then check out that branch for me else it checks
out that module with that tag.

Actually the thing is i am not able to find the way how i will do it
and for where i have to look for the info.so any help will be
appreciated.

thanks and regards
sandeep kumar sharma
--
http://mail.python.org/mailman/listinfo/python-list


Re: python script for tortoise cvs

2008-06-24 Thread sandeep
On Jun 20, 2:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 19 Jun 2008 10:26:09 -0300, Simon Brunning <[EMAIL PROTECTED]> 
> escribió:
>
>
>
> > On Thu, Jun 19, 2008 at 2:14 PM, sandeep <[EMAIL PROTECTED]> wrote:
> >> hi
>
> >> we are using tortoise cvs and putty. i want to write a python script
> >> to whom i can provide a tag and module.now what this script will do is
> >> look for this specific tag and checks for whether its a individual tag
> >> or its inside a branch.if its inside a branch then find out what is
> >> the branch tag and then check out that branch for me else it checks
> >> out that module with that tag.
>
> >> Actually the thing is i am not able to find the way how i will do it
> >> and for where i have to look for the info.so any help will be
> >> appreciated.
>
> > I don't know if Tortoise is scriptable, but Subversion certainly is -
> > <http://pysvn.tigris.org/> - and nothing you mention is Tortoise
> > specific.
>
> (Note that he said Tortoise CVS - not Tortoise SVN)
> To Sandeep: You should divide the question in two parts:
> - how to obtain the info you want from cvs. This has nothing to do with 
> Python; better ask in a CVS group related to your server. Suppose the answer 
> is "use the status command with the -lv options", then you'll be able to 
> obtain the info you want "by hand", executing said cvs command from the cmd 
> prompt.
> - the next task is to automate the execution using Python. You have to run 
> the command, capture its output and extract the info you want. How to do that 
> *is* a Python question, but you'll have to formulate it very precisely: "I 
> want to read the output coming from this command, locate the line that 
> contains the word XXX starting at column 12, and take the last word on the 
> third line below it"
> For that second part you can get some help here, but first you have to know 
> *what* to execute and *what* to look for in the output.
>
> (Anyway, I think the question is not well formulated - what is an "individual 
> tag", as opposed to "inside a branch"? Every tag applied on a file marks a 
> certain revision in a certain branch, - if you consider the trunk as a branch 
> too. Do you want to know if the tag was applied directly over a file on the 
> trunk? Or do you want to know if the tag is a "branch tag"?)
>
> --
> Gabriel Genellina


thanks Gabriel

i think ur suggestions do formulate my problem.now since i know some
commands i wanted to know how can i execute cvs commands from python
or we can say how can i capture the output from the cvs command ?.

thanks and regards
sandeep kumar sharma

--
http://mail.python.org/mailman/listinfo/python-list


Need reviews for my book on introductory python

2017-01-25 Thread Sandeep Nagar
Hi,

A few month ago I wrote a book on introductory python based on my experinces 
while teaching python to Bachelor students of engineering. It is now available 
in e-book and paperback format at Amazon. 

https://www.amazon.com/dp/1520153686

The book is written for beginners of python programming language and written in 
learn-by-doing manner. If some group members can review the same, it will be 
useful for myself to come up with an improved version.

Other similar books of mine are based on Octave and Scilab with following links:

https://www.amazon.com/dp/152015111X (Scilab)

https://www.amazon.com/dp/1520158106 (Octave)

If you are interested in open source computing, please have a look. 

Also please do share the link for print books with your colleagues at other 
universities and recommend them for libraries and researchers, if you feel that 
they can be helpful to them.

Regards

Sandeep
-- 
https://mail.python.org/mailman/listinfo/python-list


Getting Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
```
Error code:
--


Traceback (most recent call last):
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", line 
73, in 
from _collections_abc import MutableMapping
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\_collections_abc.py",
 line 58
async def _coro(): pass
^
SyntaxError: invalid syntax
Failed to import the site module


After migrating from python 3.4.1 to python 3.6.1
while Executing my project, I'm facing this issue and not able to resolve it

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Getting Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
On Thursday, December 27, 2018 at 7:49:16 PM UTC+5:30, sandee...@gmail.com 
wrote:
> ```
> Error code:
> --
> 
> 
> Traceback (most recent call last):
>   File 
> "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", 
> line 73, in  import os
>   File 
> "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\os.py", line 
> 652, in 
> from _collections_abc import MutableMapping
>   File 
> "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\_collections_abc.py",
>  line 58
> async def _coro(): pass
> ^
> SyntaxError: invalid syntax
> Failed to import the site module
> 
> 
> After migrating from python 3.4.1 to python 3.6.6
> while Executing my project, I'm facing this issue and not able to resolve it. 
> Can i find any solution for this error?

-- 
https://mail.python.org/mailman/listinfo/python-list


Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6



``` 
Error code: 
-- 


Traceback (most recent call last): 
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", line 
73, in  
from _collections_abc import MutableMapping 
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\_collections_abc.py",
 line 58 
async def _coro(): pass 
^ 
SyntaxError: invalid syntax 
Failed to import the site module 

 
After migrating from python 3.4.1 to python 3.6.6 
while Executing my project, I'm facing this issue and not able to resolve it. 
Can i get any solution for this issue? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-30 Thread sandeep . bayi6
On Friday, December 28, 2018 at 5:41:52 PM UTC+5:30, Piet van Oostrum wrote:
> sandeep.ba...@gmail.com writes:
> 
> > ``` 
> > Error code: 
> > -- 
> >
> >
> > Traceback (most recent call last): 
> >   File 
> > "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", 
> > line 73, in  > import os 
> >   File 
> > "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\os.py", 
> > line 652, in  
> > from _collections_abc import MutableMapping 
> >   File 
> > "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\_collections_abc.py",
> >  line 58 
> > async def _coro(): pass 
> > ^ 
> > SyntaxError: invalid syntax 
> > Failed to import the site module 
> >
> > 
> >  
> > After migrating from python 3.4.1 to python 3.6.6 
> > while Executing my project, I'm facing this issue and not able to
> > resolve it. Can i get any solution for this issue?
> 
> Could it be that your PYTHONPATH environment variable is set to a directory 
> in Python 3.4.1?
> 
> -- 
> Piet van Oostrum 
> WWW: http://piet.vanoostrum.org/
> PGP key: [8DAE142BE17999C4]

Thankyou, but not worked.

Then i tried by removing the python 3.6.6 variables from PYTHONPATH and now , 
it is working fine for me 
-- 
https://mail.python.org/mailman/listinfo/python-list


Error while calling a subprocess and execute another script from one py file

2018-12-30 Thread sandeep . bayi6
Hi all,

==
Error code :
--

Traceback (most recent call last):
  File "E:\ocius_tjb\run.py", line 163, in 
subprocess.check_call(['C:/Python34/python.exe', logxml_parser, '-i', arg1, 
'-o', arg2], cwd=cur_work_dir)
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", 
line 286, in check_call
retcode = call(*popenargs, **kwargs)
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", 
line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", 
line 709, in __init__
restore_signals, start_new_session)
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", 
line 971, in _execute_child
args = list2cmdline(args)
  File 
"C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", 
line 461, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'module' is not iterable

--

> I'm currently facing this error while execute another py_script from one 
> script.
> and i need to execute the program from python 3.6.6 and in  subprocess from 
> python 3.4.1

Can i get a solution for this problem im facing?
-- 
https://mail.python.org/mailman/listinfo/python-list


How to send broadcast message over network and collect all the IP address?

2005-07-15 Thread Sandeep Arya
Hello to all

Well this is my first mail on this list. I am facing a problem associated 
with collecting IP address on my network.

What i thought is to send broadcast packet over the network and then 
recieving back the reply from the computers and bridges connected to my 
network and then adding their IP Address in a list.

How this can be achieved? Say my computer on which application will run's IP 
is 192.168.100.254 and subnetmask is 255.255.255.0

How to do this in core Python?

Sandeep

_
7000 classifieds 
http://www.sulekha.com/classifieds/cllist.aspx?nma=IN&ref=msn -Chennai, 
Mumbai, Hyderabad Bangalore.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to send broadcast message over network and collect all the IP address?

2005-07-18 Thread Sandeep Arya
Hello

I got one reply two days back regarding this from Francesco. Thanks.

I came to know that inorder to run any ARP request one need to be superuser. 
Is this correct? And also I came to know that on some OS like Win XP with 
SP2 does not go for ARP requests. Again Is this correct?

In this case How to effeciently detect computers on my network? The method 
which can be scalable and portable...

I am thinking of one method i.e. sending Broadcast packets on my network. 
But I do not know how can i will get the IP addresses return back. I have 
gone thru socket library. I found one function recvfrom(). Does this will 
help??


Can any body give me an idea how to use this??

Thanking You

Sandeep

>From: Francesco Ciocchetti <[EMAIL PROTECTED]>
>To: Sandeep Arya <[EMAIL PROTECTED]>
>CC: python-list@python.org
>Subject: Re: How to send broadcast message over network and collect all the 
>IP address?
>Date: Fri, 15 Jul 2005 17:49:26 +0200
>
>Sandeep Arya wrote:
>
>>Hello to all
>>
>>Well this is my first mail on this list. I am facing a problem associated 
>>with collecting IP address on my network.
>>
>>What i thought is to send broadcast packet over the network and then 
>>recieving back the reply from the computers and bridges connected to my 
>>network and then adding their IP Address in a list.
>>
>>How this can be achieved? Say my computer on which application will run's 
>>IP is 192.168.100.254 and subnetmask is 255.255.255.0
>>
>>How to do this in core Python?
>>
>>Sandeep
>>
>>_
>>7000 classifieds 
>>http://www.sulekha.com/classifieds/cllist.aspx?nma=IN&ref=msn -Chennai, 
>>Mumbai, Hyderabad Bangalore.
>>
>>
>>
>I'm leaving from office now so i can not give a more complete answer ... i 
>would use an ARP Request to all network address on your network and check 
>who answer. Check out libdnet (http://libdnet.sf.net) for a python module 
>implementing networking funcions.
>
>bye
>Francesco

_
Meet interesting singles like you 
http://match.msn.co.in/match/mt.cfm?pg=channel&tcid=234764 Sign up with 
Match.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Threads: Issue and suggestion required

2005-07-18 Thread Sandeep Arya
Hello

I am developing an application using PyQT.


My application scenario is:: "At any instance one socket is open in my 
application. Now if user wants to execute some command on another machine/IP 
address, then i need to make another socket and execute task."

My query is. Is this possible that my main thread and my newly born thread 
will execute their task simultaneously/parallel. (I read that Python 
interpretor allows only one thread execution at a time. Using its global 
lock. And switch among active thread based on time set by setSwitchTime() 
function.. Is this correct?)

I just wannn know what is lifetime of thread. As I was planning to implement 
one function such that:

1.0 function starts
2.0 create socket
3.0 Open socket
4.0 Do whatever task to do
5.0 Close socket
6.0 Function ends

I wanna know that if i assign such above mentioned function to thread::run 
then will the thread die after step 6.0 above i.e. function ends.


Suggest me.

Thanking You

Sandeep

_
Get faster and relevant results. http://search.msn.co.in Switch to the 
smarter search!

-- 
http://mail.python.org/mailman/listinfo/python-list


Detecting computers on network

2005-07-21 Thread Sandeep Arya
Hello dear

I had sent my earlier queries regarding same topic. However just to be more 
specific this time..

I just wann try to detect that if there are some ip address in a list of 
some ip address alive or not.

How can i do this?

Shall i try to connect them and check that my connection is working or not? 
If working than means alive  (connection based)

SHalle i send some buffer value (whatever) to socket using sendto(...) and 
then checking for return value? (Connectionless)

Well for me it doesnot matter that i should have connection or 
connectionless.. I just wannn  know who are alive in my LAN?

This application will be for my computers in lan. not for maganetwork.

LAN will have just some bridges and computers.

i need to detect tham all..

however i doesnot matter that all of them replies or not. I just wann know 
that atleast some of them reply. Rest i will take care of...


Sandeep

_
NRIs, does your family in India need money urgently? 
http://creative.mediaturf.net/creatives/icicibank/ICICI_NRI_ERA.htm Open an 
ICICI Bank NRI savings A/c

-- 
http://mail.python.org/mailman/listinfo/python-list


Detecting computers on network

2005-07-22 Thread Sandeep Arya
Thanks linuxfreak and sybren  for positive comments

My application will be running on Linux.
How to send ICMP ECHO as broadcast packets. I do not know this. Please tell 
me how to?

Sybren.. Does nmap is available on every systems? I tried on my linux fc4 
machine in user previleage. it was not working. Does this just belongs to 
superuser...

Is there any other way ? Can just socket.connect or sendto help me? I.E. 
their return valuess...

Sandeep


From: Sybren Stuvel <[EMAIL PROTECTED]>
To: python-list@python.org
Subject: Re: Detecting computers on network
Sent: Friday, July 22, 2005 1:59 AM

linuxfreak enlightened us with:
>How about sending an ICMP echo packet to your broadcast address and
>checking which hosts send a reply

Won't work on all boxes. Windows boxes ignore broadcast pings, for
example.

I'd go for a call to "nmap -sP" instead, and filter it's output.

Sybren

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 
http://mail.python.org/mailman/listinfo/python-list


how to use python to checking password on servlet

2007-05-22 Thread sandeep patil
my application design on java servlet i want to check password in
python & return result again servlet to forward to next page.
how to set session in python .get session

-- 
http://mail.python.org/mailman/listinfo/python-list


WEATHER PROGRAMMING IN PYTHON

2007-05-31 Thread sandeep patil
how to diplay the weather condiction on my webpage
suppose i want to read weather from www.bbc.co.uk/weather.html
how i can read it usin program

-- 
http://mail.python.org/mailman/listinfo/python-list


python & java

2007-03-20 Thread sandeep patil
hi

i am fresher i python can any bady tell me who i will use python in
web technologies in java base application.
what it roll

sandeep patil

-- 
http://mail.python.org/mailman/listinfo/python-list


python on window

2007-03-22 Thread sandeep patil
i have install python on window xp os.
C:/program files/python

i have done print program it working but .py can't  working
 help me  to how i will execute this file this file where i will save
it.
path execution how .
tell me about any envorment veriable in python to set before python
editor run,it path. etc


>>> print ' sandeep patil'
 sandeep patil
>>> print ' sandeep "bhagwan " patil ,msc. java j2ee developer"
SyntaxError: EOL while scanning single-quoted string
>>> print ' sandeep "bhagwan " patil ,msc. java j2ee developer'
 sandeep "bhagwan " patil ,msc. java j2ee developer
>>> import posix

Traceback (most recent call last):
  File "", line 1, in 
import posix
ImportError: No module named posix
>>> phonebook = {'sandeep':9325,'amit':9822,'anand':9890}
>>> phonebook = {'titu':9423,'dadu':9422,'giri':9326}
>>> inverted_phonebook=invert(phonebook)

Traceback (most recent call last):
  File "", line 1, in 
inverted_phonebook=invert(phonebook)
NameError: name 'invert' is not defined
>>> def invert(table):
index={}
for key in table.key():
value=table[key]
if not index.has_key(value):
index[value]=[]
index[value].append(key)
return index


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python on window

2007-03-26 Thread sandeep patil
i have written this program but i have gott following error,
in anather proram "indentation error" sir how i will indent in my
editor

#test.py
>>> def invert(table):
index=()
for key in table:
value=table[key]
if not index.has_key(value):
index[value]=[]
index[value].append(key)
return index


>>> phonebook = {'sandeep':9325, 'amit':9822, 'anand':9890, 'titu': 9325}
>>> phonebook
{'titu': 9325, 'amit': 9822, 'anand': 9890, 'sandeep': 9325}
>>> print phonebook
{'titu': 9325, 'amit': 9822, 'anand': 9890, 'sandeep': 9325}
>>> inverted_phonebook = invert(phonebook)

Traceback (most recent call last):
  File "", line 1, in 
inverted_phonebook = invert(phonebook)
  File "", line 5, in invert
if not index.has_key(value):
AttributeError: 'tuple' object has no attribute 'has_key'
>>> interted_phonebook= invert(phonebook)

Traceback (most recent call last):
  File "", line 1, in 
interted_phonebook= invert(phonebook)
  File "", line 5, in invert
if not index.has_key(value):
AttributeError: 'tuple' object has no attribute 'has_key'
>>>

-- 
http://mail.python.org/mailman/listinfo/python-list


Need python script to get last 6 month's monthly billing

2017-08-08 Thread sandeep . gk789
Hi,


I would like to create AWS monthly billing graph using python and python 
flask.so for this i need python script using that i have to get last 6 month's 
monthly bill in AWS.
for this, i have created one virtual environment in my local machine. for 
examplle my ip is: 127.0.0.0:5000.
Here after pull that script, it's automatically connected to AWS and display's 
last 6 month's data. its my requirement.

Thanks in advance.

Thank you,
Sandeep
-- 
https://mail.python.org/mailman/listinfo/python-list


creating csv file from

2005-03-02 Thread Sandeep Avinash Gohad

Please Help me

I wish to download the data from any URL (from any website) and
then want to save into ".csv" format.

In the python documentation "12.20 csv -- CSV File Reading and Writing"
import csv
reader = csv.reader(file("some.csv"))
for row in reader:
    print row

How can i use the url as an input so that I can save data from that particular webpage to comma seperated file (csv).

Regards
Sandeep


     





-- 
http://mail.python.org/mailman/listinfo/python-list

some information

2005-03-13 Thread Sandeep Avinash Gohad

Hi,I want to know weather python conducts any certification exams like the other programming languages - 
Microsoft (MCP,MCSD)
Sun  (sun certification)

Regards,
Sandeep   




-- 
http://mail.python.org/mailman/listinfo/python-list

hi all

2007-02-13 Thread Sandeep Patil , Bangalore

I get an error while I try to call python through VB.

The error is " Error 429: Active X cant create object"

 

Pls anybody help me to call python through VB.

 

Thanks and Regards.

Sandeep Patil

HCL Technologies

" Expecting the world to treat you fairly coz you are a gud person, is
like expecting the Lion not to attack you as you are a Vegetarian. " 

 



DISCLAIMER:
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

- 
http://mail.python.org/mailman/listinfo/python-list