[issue43157] Bug in methods of creating the 2d list

2021-02-07 Thread sandeep kumar


sandeep kumar  added the comment:

def generateMatrix(A):
d=A-1
data=1
B=[[0]*A]*A
for l in range(int(A/2)):
i=l
j=l
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1

j+=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
i+=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
j-=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
i-=1
print()
d=d-2
print(d)
print(B)
if d==0:
B[int(A/2)][int(A/2)]=data
print(B[int(A/2)][int(A/2)])
print(B)
return B  


#This code is for generating spiral matrix


##if i'm using different approach to create 2d list . Then i'm getting right 
output .
in above code i used B=[[0]*A]*A and getting wrong output . A is positive 
integer.

##If i'm using for i in range(A-1):
B.append([0]*A)
then i'm getting correct output.

but the 2d list generated using both the approach are same.
2d list from approach 1== 2d list from approach 2 --->it is true

--

___
Python tracker 
<https://bugs.python.org/issue43157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43157] Bug in methods of creating the 2d list

2021-02-07 Thread sandeep kumar


Change by sandeep kumar :


--
title: Bug in methods of creating the list -> Bug in methods of creating the 2d 
list

___
Python tracker 
<https://bugs.python.org/issue43157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43157] Bug in methods of creating the list

2021-02-07 Thread sandeep kumar


New submission from sandeep kumar :

def generateMatrix(A):
d=A-1
data=1
B=[[0]*A]*A
for l in range(int(A/2)):
i=l
j=l
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1

j+=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
i+=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
j-=1
print()
for a in range(d):
B[i][j]=data
print("{0}:{1}:{2}".format(i,j,B[i][j]),end=" ")
data+=1
i-=1
print()
d=d-2
print(d)
print(B)
if d==0:
B[int(A/2)][int(A/2)]=data
print(B[int(A/2)][int(A/2)])
print(B)
return B   


##if i'm using different approach to create 2d list . Then i'm getting right 
output .
in above code i used B=[[0]*A]*A and getting wrong output . A is positive 
integer.

##If i'm using for i in range(A-1):
B.append([0]*A)
then i'm getting correct output.

but the 2d list generated using both the approach are same.
2d list from approach 1== 2d list from approach 2 --->it is true

--
messages: 386602
nosy: samrajput1143
priority: normal
severity: normal
status: open
title: Bug in methods of creating the list
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue43157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42836] docs: struct: clarify struct caching behaviour

2021-01-06 Thread Sandeep Subramanian

New submission from Sandeep Subramanian :

As per docs in :https://docs.python.org/3.7/library/struct.html#struct.Struct

> The compiled versions of the most recent format strings passed to Struct and 
> the module-level functions are cached, so programs that use only a few format 
> strings needn’t worry about reusing a single Struct instance.

This statement seems to imply that the format string passed as 
`struct.Struct(format)` is also cached. This doesn't appear to be the case.

Only format strings passed to the module level functions seems to be cached.

`cache_struct_converter` at 
https://github.com/python/cpython/blob/v3.7.7/Modules/_struct.c#L2052 
appears to be used only in the top module level functions `pack` and 
`pack_into` and is *not* used in `Struct.__init__`.


Would it be better to change the doc to:

> The compiled versions of the most recent format strings passed to the 
> module-level functions are cached, so programs that use only a few format 
> strings needn’t worry about reusing a single Struct instance.

This issue was introduced by 
https://github.com/python/cpython/commit/3666b3c1f695a145adab1bf644c22e564e8eb0ee

and is present in every version since.

Refs:
https://github.com/python/cpython/pull/7700
https://bugs.python.org/issue33032

--
assignee: docs@python
components: Documentation
messages: 384476
nosy: docs@python, sandeep2
priority: normal
severity: normal
status: open
title: docs: struct: clarify struct caching behaviour
type: enhancement
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42836>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39928] Pysftp Issue File Upload is not working - put command

2020-03-10 Thread Sandeep


Sandeep  added the comment:

Eric how can I contact the python Mailing list

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue39928>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39928] Pysftp Issue File Upload is not working - put command

2020-03-10 Thread Sandeep


New submission from Sandeep :

Hi 
   We have requirement where we need to get file from client path and then 
upload the same to vendor directory path. I am not able to upload the file to 
vendor directory path , however when I tried to use the WINSCP it worked fine. 
So I thought of checking with Gurus what is wrong I am doing in my script. 
Appreciate your input.
I will attach my script. Here is what I am doing.

Step1. Clear the client directory path
Step2. Make a call to HVAC Vault to get the username and password for client 
and vendor server
Step3. Use the username and password to establish connection using pysftp for 
client. 
Step4. Store the file in local path.
Step5. Segregate the file into different path based on file type
Step6  Establish a connection to vendor and copy the file to vendor.
Step7  Close the client and Vendor connection

Please see the file attached.

Also below is the error which I am getting

-
ERROR:root:Error in getting the file from EBS Outbound Server
Traceback (most recent call last):
  File "FILE_TRANSFER_PROCESS.py", line 191, in file_transfer
vendor.put(src_file, dst_file)
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 
364, in put
confirm=confirm)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 759, in put
return self.putfo(fl, remotepath, file_size, callback, confirm)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 720, in putfo
s = self.stat(remotepath)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 493, in stat
t, msg = self._request(CMD_STAT, path)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 813, in _request
return self._read_response(num)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 865, in _read_response
self._convert_status(msg)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 894, in _convert_status
raise IOError(errno.ENOENT, text)
FileNotFoundError: [Errno 2] /custom/OWO/ECE_OWO_20200303_143895.dat

--
components: Tests
files: File_Transfer_Process_Client.py
messages: 363870
nosy: Sandeep
priority: normal
severity: normal
status: open
title: Pysftp Issue File Upload is not working - put command
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48967/File_Transfer_Process_Client.py

___
Python tracker 
<https://bugs.python.org/issue39928>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26789] Please do not log during shutdown

2020-01-31 Thread Sandeep


Sandeep  added the comment:

I did import aiohttp and called function sys.is_finalizing() just before 
logging.basicConfig but still the same error.

Has  logging.basicConfig worked in past ? If yes what  additional package I 
need to add

Thanks

--
nosy: +Sandeep

___
Python tracker 
<https://bugs.python.org/issue26789>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-01-31 Thread Sandeep


New submission from Sandeep :

Hi 
   I wrote a python script which gets file from other server and it works fine 
till the time I don't introduces logging feature to it. 
Please advice how to fix below

This is the code I am using for logging '

import logging
logging.basicConfig(filename=localLogfile, level=logging.DEBUG)

--Error Message 

Traceback (most recent call last):
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 
1013, in __del__
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 
785, in close
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 194, in close
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 185, in _log
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp.py", line 158, 
in _log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1372, in log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1442, in _log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1452, in handle
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1514, in callHandlers
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
863, in handle
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1069, in emit
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1059, in _open
NameError: name 'open' is not defined

--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue39513>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-01-31 Thread Sandeep


Change by Sandeep :


--
components: Library (Lib)
nosy: Sandeep
priority: normal
severity: normal
status: open
title: NameError: name 'open' is not defined
type: crash
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue39513>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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


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


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


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


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


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


[issue29141] error in 2to3

2017-01-03 Thread Sandeep Srinivasa

New submission from Sandeep Srinivasa:

docs_uploaded_at = dict(filter(lambda (x,y):True if len(y) == 3 else 
False,docs_uploaded_at.iteritems()))

produces

docs_uploaded_at = dict([x_y for x_y in iter(docs_uploaded_at.items()) if True 
if len(x_y[1]) == 3 else False])


without_transaction_users = filter(lambda x:False if x.phone in 
with_transaction_mobile else True,registered)

produces

without_transaction_users = [x for x in registered if False if x.phone in 
with_transaction_mobile else True]

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 284562
nosy: Sandeep Srinivasa
priority: normal
severity: normal
status: open
title: error in 2to3

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29141>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2014-06-17 Thread Sandeep Mathew

Sandeep Mathew added the comment:

It does build with some tweaking here and there. But I ran into runtime
issues. I am sorry, I cannot dedicate time on it further.  IMHO anything
built for VMS should use VMS specific API's in the way they are designed
for stability and performance reasons, some more code needs to be written.

Regards
Sandeep Mathew
On Tue, Jun 17, 2014 at 12:31 AM, John Malmberg rep...@bugs.python.org
wrote:


 John Malmberg added the comment:

 Does not look like anything vital to VMS got removed.

 Configure basically worked under current GNV.

 And a few tweaks later with out changing any files checked out of the
 Mercurial repository, make is producing a functional python binary before
 it quits.

 bash-4.2$ ./python notdeadyet.py
 I'm not Dead Yet, I think I'll go for a Walk
 bash-4.2$ ./python
 Python 3.5.0a0 (default, Jun 17 2014, 00:03:16) [C] on openvms0
 Type help, copyright, credits or license for more information.
   Exit
 bash-4.2$ uname -a
 OpenVMS EAGLE 0 V8.4 AlphaServer_DS10_617_MHz Alpha Alpha HP/OpenVMS

 More work is needed of course, mostly adding some more libraries that
 Python is expecting and showing GNV how to have configure and make find
 them.  A lot of compile warnings need to be resolved.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16136
 ___


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2013-03-13 Thread Sandeep Mathew

Sandeep Mathew added the comment:

Sorry for late response. I got delayed , I am working on it .

Regards
Sandeep Mathew

2013/3/9 Jesús Cea Avión rep...@bugs.python.org:

 Jesús Cea Avión added the comment:

 Ping...

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16136
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2012-11-06 Thread Sandeep Mathew

Sandeep Mathew added the comment:

Hey,
I was given access to HP's open source VMS cluster, Many thanks to HP. I should 
be able to continue python development for VMS. I shall ping you guys in case I 
get stuck. I should be good to go 

--Thomas

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2012-10-31 Thread Sandeep Mathew

Sandeep Mathew added the comment:

I have asked HP for access to a VMS box so that I restart my work. I initially 
checked with the university to see if I can get hold of an Itanium box. 

@Trent : If you have HP - UX already running, you may make use of Hyper-V to 
get vms running without changing the existing the HP-UX installation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2012-10-22 Thread Sandeep Mathew

Sandeep Mathew added the comment:

Hi ,

I love VMS very much, I could not concentrate actively on python
because other work commitments ate up most of my time. I have
left my job at HP and am now a PhD student and university of Nevada ,
Reno .  Now that I do not have any professional commitments , I should
be able to work on it in a more timely manner. I had used python for
an internal project in HP.


The problem now I have is that I need access to a VMS  machine. I was
not able to setup a build bot because buildbot needed some ports to be
open , the machine provided HP did not give privilleges to do that.
Another thing was that they wanted me to use gnv to compile python in
VMS . I however did not really agree with it , gnv is buggy and you
need to enable millions to of hacks to gets programs to compile.
Programs written for VMS should be written the VMS way not the unix
way. I was able to get Python 3.x to compile using gnv finally but it would not 
run properly. Is it possible for anyone to provide a VMS box with C Compiler 
and tools ( MMS) so that I can start working on it again. I will try asking HP 
, whether they would allow me to start working on it on the old VMS cluster 
they provided.


--Thomas

--
nosy: +sandman101

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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


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


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 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=p
sender='h4SenderName/
h4'+checkStringType(mailItem.SenderName)
time='brh4Time/
h4'+checkStringType(str(mailItem.ReceivedTime))
attachment='brh5Attachments Count/
h5'+str(len(mailItem.Attachments))
edata='h4Email Content/h4'+checkStringType(mailItem.Body)+/
phr/
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='htmlheadtitleYour Email Data log is here/title/
headbody'+emailData+'/body/html'
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 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=p
sender='h4SenderName/
h4'+checkStringType(mailItem.SenderName)
time='brh4Time/
h4'+checkStringType(str(mailItem.ReceivedTime))
attachment='brh5Attachments Count/
h5'+str(len(mailItem.Attachments))
edata='h4Email Content/h4'+checkStringType(mailItem.Body)+/
phr/
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='htmlheadtitleYour Email Data log is here/title/
headbody'+b+'/body/html'
return a

#main entrance to the program
def main():
global outlook_app,inbox_obj
outlook_app=getAppRef()
#print outlook_app.OlSaveAsType.olMSG
print '=='
print dir(outlook_app)
print '=='
inbox_obj=getOutLookFolders(outlook_app)
print dir(inbox_obj)
print

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=p
sender='h4SenderName/
h4'+checkStringType(mailItem.SenderName)
time='brh4Time/
h4'+checkStringType(str(mailItem.ReceivedTime))
attachment='brh5Attachments Count/
h5'+str(len(mailItem.Attachments))
edata='h4Email Content/h4'+checkStringType(mailItem.Body)+/
phr/
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='htmlheadtitleYour Email Data log is here/title/
headbody'+b+'/body/html'
return a

#main entrance to the program
def main():
global outlook_app,inbox_obj
outlook_app=getAppRef()
#print outlook_app.OlSaveAsType.olMSG
print '=='
print dir(outlook_app)
print '=='
inbox_obj=getOutLookFolders(outlook_app)
print dir(inbox_obj)
print (inbox_obj.Items)
#saveCopy(inbox_obj.Items[1])
getMailContent(inbox_obj)



main()


my setup file has this code

from distutils.core import setup
import py2exe

setup(console=['outlook.py'])


i have just copied and pasted it from the tutorial available at the
py2exe site and changed the filename with mine

[issue2724] Error in Python tutorial (http://docs.python.org/tut/node6.html)

2008-04-30 Thread Sandeep Sabnani

New submission from Sandeep Sabnani [EMAIL PROTECTED]:

Section 4.4 on page http://docs.python.org/tut/node6.html has a for loop
which uses the range function. However, the displayed output of that
loop is not correct. I ran the same code and got the output as follows:

3 is a prime number
4 = 2 * 2
5 is a prime number
5 is a prime number
5 is a prime number
6 = 2 * 3
7 is a prime number
7 is a prime number
7 is a prime number
7 is a prime number
7 is a prime number
8 = 2 * 4
9 is a prime number
9 = 3 * 3

Can this be corrected in the tutorial as it can be confusing for a
python newbie!

Thanks!

--
assignee: georg.brandl
components: Documentation
messages: 65996
nosy: georg.brandl, sandeepsabnani
severity: normal
status: open
title: Error in Python tutorial (http://docs.python.org/tut/node6.html)
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2724
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2724] Error in Python tutorial (http://docs.python.org/tut/node6.html)

2008-04-30 Thread Sandeep Sabnani

Sandeep Sabnani [EMAIL PROTECTED] added the comment:

Oh yes! Thanks for clearing my doubt and apologies for the silly error.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2724
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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


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


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 pyshell#13, line 1, in module
inverted_phonebook = invert(phonebook)
  File pyshell#9, 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 pyshell#14, line 1, in module
interted_phonebook= invert(phonebook)
  File pyshell#9, 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


python on window

2007-03-23 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 pyshell#4, line 1, in module
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 pyshell#7, line 1, in module
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


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


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

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


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=INref=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=channeltcid=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


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=INref=msn -Chennai, 
Mumbai, Hyderabad Bangalore.

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

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

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