[Tutor] Question about subprocess

2014-01-10 Thread daedae11
p = subprocess.Popen(['E:/EntTools/360EntSignHelper.exe', 'E:/build/temp/RemoteAssistSetup.exe'], stdout=subprocess.PIPE, shell=True).stdout temp = p.readline(); print temp p.close() When I run the above code in command line, it works formally. However, when I writed it

[Tutor] Question about distribute in pypi

2013-12-26 Thread daedae11
Hi, Are distribute 0.6.49 and distribute 0.7.3 the same plugin's different version? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How to make a python script run on startup

2013-04-09 Thread daedae11
On Windows, how to make a python script run on startup? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] What's the difference between Queue(in module Queue) and list(build_in class)?

2012-02-13 Thread daedae11
What's the difference between Queue(in module Queue) and list(build_in class)? I think that when I pass a same queue object to two different threads, the change in each thread will affect each other as same as Queue. So why don't we use list or other variable object? daedae11

[Tutor] Same code has different result

2012-02-12 Thread daedae11
The code is: from nntplib import NNTP s = NNTP('news.gmane.org') resp, count, first, last, name = s.group('gmane.comp.python.committers') print 'Group', name, 'has', count, 'articles, range', first, 'to', last resp, subs = s.xhdr('subject', first + '-' + last) for id, sub in subs[-10:]: print i

[Tutor] Question about an example in Python doc

2012-02-10 Thread daedae11
The example is the third example in (Python2.7's doc)->(Python Library Reference)->17.2.2. The code of the example is: import socket # the public network interface HOST = socket.gethostbyname(socket.gethostname()) # create a raw socket and bind it to the public interface s = socket.socket(socke

[Tutor] Where can I download the document for twisted?

2012-02-10 Thread daedae11
Where can I download the document for twisted? I could't find it on twistedmatrix.com . daedae11___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] What the difference between the two RE?

2012-02-08 Thread daedae11
import re re.match("^hello", "hello") re.match("hello", "hello") Please give a string that matches RE "^hello" but does not match RE "hello", or matches RE "hello" but does not match RE "^hello". daedae11___ Tutor maillist - Tutor@python.org To un

[Tutor] exception about "ctrl+c"

2012-01-09 Thread daedae11
I want to catch the "ctrl+c" exception. My program is as following. But when I run my script and press "ctrl"+"c", the program output nothing. I don't know where did I go wrong. Please help me. Thank you! def safe_input(prompting): try: return raw_input(prompting); except Keyboa

[Tutor] How to invoke different member-function according to different object?

2012-01-06 Thread daedae11
I was asked to write a program to move files between ZIP(.zip) and TAR/GZIP(.tgz/.tar.gz) or TAR/BZIP2(.tbz/.tar.bz2) archive. my code is: import zipfile; import tarfile; import os; from os import path ; def showAllFiles(fileObj): if fileObj.filename.endswith("zip"): if isinstance

[Tutor] question about gzip module

2012-01-05 Thread daedae11
Is there anyone who can give me an example of how to use the gzip module? I have read the document, but there is no example in the document. Thank you!! daedae11___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: htt

[Tutor] question about a exercise

2012-01-05 Thread daedae11
The exercise is: Write a function which has 3 parameters. First parameter is a char, second parameter is a integer, third parameter is a integer. The function would create a file which have following requests: 1. the length of the file is in accordance with the third parameter. 2. the content of

[Tutor] question about the an exercise in (including the discription about the exercise)

2012-01-04 Thread daedae11
Who can give me an example program about the exercise 6 in chapter 9 in ? The exercise is: Write a program that compare the two files given by users. If the two files' content is equal, just print "equal". Else, print the rows And column number of the first different position. Thank you!

[Tutor] question about the exercises in

2012-01-04 Thread daedae11
Who can give me an example program about the exercise 4 in chapter 9 in ? Thank you! daedae11___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] question about the exercises in

2012-01-04 Thread daedae11
Who can give me an example program about the exercise 4 in chapter 9 in ? daedae11___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] question about pywin32

2011-12-26 Thread daedae11
Does pywin32 provide a module for AES encryption algorithm ? The description of some module in pywin32 document is so simple that there is not introduction about the function of the function. For example, "CryptProtectData" function in module win32crypt. daedae11___

[Tutor] An unknown error in my program

2011-12-25 Thread daedae11
The following program has an error : new += lists[int(j)]+"-"; UnboundLocalError: local variable 'new' referenced before assignment But when I put the sentence " new = '' " in the main() function, the program run normally. Please tell me why? Isn't va

[Tutor] question about the build-in function reversed in Python2.5

2011-12-24 Thread daedae11
The build-in function reversed() in Python2.5 returns a iterator. But I don't know how to use the iterator. Please give me a simple example about how to use bulid-in function reversed() to reverse a list. Thank you in advance. daedae11___ Tutor m