, as I've heard from other students that they
have over 200 lines. :)
I've attached the premise of what the task is asking for, due in 2 days.
Thank you in advance
Aditya Mukherjee.
___
Tutor maillist - Tutor@python.org
To unsubscri
I was trying to install Python 2.7 on my Windows 8.1(x64) PC and got
the following error:
"There is a problem with this Windows Istaller Package.A DLL required
for this install to complete could not be run.Contact your support
personnel or package vendor."
Please help!
_
.
--
Regards
Aditya
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Tue, Jun 21, 2011 at 12:45 PM, Alan Gauld wrote:
>
> "aditya" wrote
>
>
> is that although the Vbscript writes the output to the file correctly but
>> when the client sends the contents of the file to the server via socket ,
>> it
>> sometimes pri
ERVER.PY
import socket
host = ""
port = 2
size = 1024
backlog=5
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host,port))
s.listen(backlog)
while 1:
client, addr =s.accept()
data=client.recv(size)
if data:
print data
else:
print &q
id of it because I couldn't find a sys.stdout.close()
> command or any other std command that would help.
>
> Thanks!
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Regards
Aditya
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 04/02/08 10:42 PM, "Eric Brunson" <[EMAIL PROTECTED]> wrote:
> dave selby wrote:
>> Hi all,
>>
>> I am not sure if this is a Python or bash issue :).
>>
>> In bash if I execute 'motion' with the following ...
>>
>> [EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion &> /dev/null &
>> [1] 10
>
>
>
The simplest way to achieve this is as follows :
$ nohup python myfile.py &
Otherwise you need to become daemon from inside the program. fork(),
setsid(), etc. - the normal C language method for becoming a daemon..
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
t; s1
> > 'test/'
> > ##
> >
> > Take a closer look at the documentation of lstrip, and you should see
> that
> > what it takes in isn't treated as a prefix: rather, it'll be treated as
> a
> > set of characters.
> >
>
> But then the real bug is why does it not strip the trailing '/' in
> 'test/' or the 'e' that is in your set?
>
>
Thats because you called lstrip() and not strip() which will strip only from
left side.
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
1.5 in i[1] etc?
> Since the data is in columns in a text file or csv, I can't put 1.5 in the
> same sublist as 2, and 6 in the same sublist as 1.5 to make things
> easier. What can I do?
> Thank you for your help.
>
> --
On Nov 13, 2007 7:06 PM, bob gailer <[EMAIL PROTECTED]> wrote:
> Aditya Lal wrote:
> > [snip]
>
> > for i in a[:] will make i point to the elements of the list
> To be more precise:
> a[:] is a copy of the list
> the for statement assigns each list element in t
as a[i][j]
a[i][j] *= 2
You can use this to modify the array content as well. But do exercise
caution in case of length change.
Or have I completely misunderstood your question ?
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
After quizzing newbies in C on swapping without 3rd variable, I found this
to be really *cool* construct to swap :)
x = 10
y = 20
x,y = y,x
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
times.
After you are done press ^D to come out of session. Everything of that
session will be saved in the file .
On Windows, you can probably build something like "script" in python. BTW,
does your executable takes any user inputs ?
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 10/31/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Aditya Lal wrote:
> > On 10/29/07, *Kent Johnson* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> wrote:
>
> > - Common Python practice is to prefer the least restrictive type
> check
> &
D %s' %
> goodkey
> data[goodkey] = doc
> print 'Successfully shelved XML document with ID %s' % goodkey
>
> params['id'] = badkey
> url = baseurl + urllib.urlencode(params)
> doc = minidom.parseString(urllib.urlopen(url).read()
On 10/29/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Aditya Lal wrote:
> > or use types module
> >
> > import types
> >
> > if type(n) == types.IntType or type(n) == types.LongType :
> > blah!
>
> A few notes:
> - If you look at typ
gt; > [0, '3', '3', '3']
> >
> >
> >
> > So, I am not properly getting rid of the list[0], is it something with
> > the 'global' nature of the vairables... it looks like it's only changing
> > locallly in my source
r maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
Hi Dick,
I would expect that a type change will happen if there is a need. Hence if
type(n) is already long it does not have to get converted to int to
accommodate something small.
I changed your program
er lvalue is array or something else.
Anyway, you can initialize the variables as follows -
for v in ['STN_id', ... ] :
exec( 'global %s ; %s = [0]*5' % (v, v))
Unfortunately these variable need to be made global for them to be visible
everywhere.
HTH
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
the command and all your variables are populated ...
> exec(cmd)
>
>
> Thanks,
>
>
>
>
>
> > Thanks! This is helpful.. I like the RE approach as it's conceivable to
> > write a function...
> >
&g
n) == types.IntType or type(n) == types.LongType :
blah!
this comes handy especially for some unique conditions - like whether the
function passed is a generator or a normal function (well I kinda had this
problem ... :) )
ex.
if type(f) == types.GeneratorType or type(f) == types.lambdaType
STN_id[1] is not the first
element but the second element. But you can filter unwanted items from the
list if you want as in -
[ x for x in STN_id if x != 0 ]
HTH
Aditya
On 10/27/07, John <[EMAIL PROTECTED]> wrote:
>
> I have a file sitelocations:
>
> STN_id[1]=AAA
> STN
> 15):
> > > e = float(openoa)
> > > #else:
> > > #e = 1
> >
> > Maybe you need a 'break' statement after 'e = float(openoa)'?
> >
> > As written, e will have whatever value is appropriate for the last
> > line of your input file.
> >
> > --
> > John.
> >
>
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> with changes.
> >
> > Kent
> >
> >
> > ----
> >
> > ___
> > Tutor maillist - Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
r the
> >first time, but haven't figured it out yet. Ulipad now has it built
> >in, so I'd like to learn to use it it..
> >
> >2) I'm not able to get the "for char in wordWithCommas:" loop to stop
> >examining a wordWithCommas after it's
So, even though you created a new variable lstB it was actually modifying
lstA.
HTH
Aditya
On 10/12/07, Dick Moores <[EMAIL PROTECTED]> wrote:
>
> At 11:25 PM 10/11/2007, Aditya Lal wrote:
> >Hi Dick,
> >
> >You are deleting from the SAME list that you are traversing.
final = []
for word in lstA :
if wellFormed(word) :
final.append(word)
You can also look at documentation for filter function (which is now handled
via list comprehension).
finalList = filter( wellFormed, lstA )
or
finalList = [ word for word in lstA if wellformed(word) ]
HTH
Aditya
On
n.readlines()
for i in xrange(N) :
print solve(lines[i])
I will start working on psyco ... though not sure what is it ?
Thanks again Kent.
Cheers
Aditya
On 9/27/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Aditya Lal wrote:
>
> > def rev(n) :
>
ne something to improve input
processing.
Thanks
Aditya
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
A bug:
The function random.randint(a,b) include both ends
i.e. b is also included. Thus for file with single
line a=0,b=1 my algo will give an IndexError.
Significance of number 4096 :
file is stored in blocks of size 2K/4K/8K (depending
upon the machine). file seek for an offset goes block
by blo
mMem(filename)
getrandomline2("shaks12.txt")
Caveat : It will still skip 1st line during random
selection if its size exceed 4096 chars !!
--- Aditya Lal <[EMAIL PROTECTED]> wrote:
> An alternative approach (I found the Yorick's code
> to
> be too slow for large # of ca
on OSX)
Approach using enum approach : 12.2886080742 : for
[100] iterations
Approach using filename : 12.5682640076 : for [10]
iterations
Approach using file descriptor : 6.55952501297 : for
[10] iterations
Approach using class : 5.35413718224 : for [10]
iterations
I am attaching test progr
33 matches
Mail list logo