igraph and usage of Read(klass, f, format=None, *args, **kwds) question

2012-04-04 Thread ishwar . rattan
I have a file with with adjacency list of an undirected graph one vertex list 
per input line [0 1, 1 2 3, 2 1, 3 1] assume a newline for commas (file is 
named adjl.txt). Can some one give an example of loading this into graph of 4 
vertices?

import igraph
g = igraph.Graph()
g.Read(adjl.txt, edgelist)
   does not work..

Help will be appreciated.
-ishwar
-- 
http://mail.python.org/mailman/listinfo/python-list


OT: Ideas for a first course using Python

2008-02-21 Thread ishwar . rattan
Sorry to butt in but I am shopping for some ideas.

I am interested in putting together a programming course for non-
programmers (outside the computer science domain) based on Pyhton. I
envision the course
similar to ones that used old-Basic interpreter.

Any one out there has such a course (already designed) or has some
experience
of such a course?

What could be a list of topics to be addressed in such a course
(domain), other
than the language syntax?

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


Re: help on packet format for tcp/ip programming

2007-02-08 Thread rattan
On Feb 8, 3:40 am, Grant Edwards [EMAIL PROTECTED] wrote:
 On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  struct module pack and unpack will only work for fixed size buffer :
  pack('1024sIL', buffer, count. offset) but the buffer size can vary
  from one packet to the next  :-(

 Oh for Pete's sake...

 struct.pack('%dsIL' % len(buffer), buffer, count, offset)

 --
 Grant Edwards   grante Yow!  I want the presidency
   at   so bad I can already taste
visi.comthe hors d'oeuvres.

that is great but how does one unpack on the other side?

-ishwar

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


help on packet format for tcp/ip programming

2007-02-07 Thread rattan
I want a specific packet format for packet exchange between a client
server across the network. For example frame format
as a python class could be:
class Frame:
def __init__(self, buffer=None, count=0, offset=0):
self.buffer = buffer
self.count = count
self.offset = offset
the question is how to convert it to a byte stream so that format of
count and offset also becomes a sequence of bytes. I tried
the pickle module as:
 a = Frame()
dat = pickle.dumps(a)
but the size of dat is quite large almost to 4 X the size of a, which
probably is an overkill for the numbers of bytes exchanged. Is there a
simpler solution (similar to C language -- set aside a buffer and fill
it with bytes and network byteorder values for count and offset and
send it out, there is no increase in byte count in the outgoing
packet)?

Any pointers will be appreciated.
-ishwar

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


Re: help on packet format for tcp/ip programming

2007-02-07 Thread rattan
On Feb 8, 1:43 am, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  I want a specific packet format for packet exchange between a
  client server across the network. For example frame format
  as a python class could be:
  class Frame:
  def __init__(self, buffer=None, count=0, offset=0):
  self.buffer = buffer
  self.count = count
  self.offset = offset
  the question is how to convert it to a byte stream so that format
  of count and offset also becomes a sequence of bytes.

 Try struct.

 Regards,

 Björn

 --
 BOFH excuse #208:

 Your mail is being routed through Germany ... and they're censoring
 us.

struct module pack and unpack will only work for fixed size buffer :
pack('1024sIL', buffer, count. offset) but the buffer size can vary
from one packet to the next  :-(

-ishwar

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


find login name of user?

2006-12-30 Thread rattan
Is there a function/module to find the login name of the user under
UNIX environment?

-ishwar

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


Re: find login name of user?

2006-12-30 Thread rattan

karel wrote:
 [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Is there a function/module to find the login name of the user under
  UNIX environment?

 who
 who am i
 finger
 id

I was talking about under python environment.

-ishwar

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


re module help

2005-09-09 Thread rattan
I am trying to make prescript-2.2 (old python based psotscript to plain
text converter).
It gives the following dprecation message

/local/users/ishwar/prescript-2.2/misc.py:23: DeprecationWarning: the
regex module is deprecated; please use the re module
  import os, regex, sys, string

if I start replacing regex by re I get stuck at replacement of
   regex.symcomp() and regex.pattern()

methods. The are not in re module.

Is there a solution?
-ishwar

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