Diez B. Roggisch wrote:
> No, it will only return _always_ a value if you provide a default one.
> If not, they have the exact same semantics.
>
> What you've got here is something usually called "syntactic sugaring" -
> a specialized syntax that performs certain instructions that _could_ be
> don
Hi,
I wonder what is the difference between the built-in function
getattr() and the normal call of a function of a class. Here is the
details:
getattr( object, name[, default])
Return the value of the named attributed of object. name must be a
string. If the string is the name of one of the
the "somebody" happen to put the file on the
default location of the Open() method? If so, does any one know the
default location?
Thanks for your consideration.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 20, 11:24 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> At Friday 20/10/2006 00:08, Johnny wrote:
>
> >doc.Workbooks.Open(excelFile, ReadOnly=True)
>
> >But the problem is when I only pass the filename to the Open()
> >method, and of course the
I have taken a look at the code that dose one download at time, in
multi threaded manner:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/465531
What I wanted to do is, make it download multiple files at the same
time. I am new to python and have gone over "Dive In To Python"
yesterday.
Where or What folder does the ftp files get downloaded to?
Justin Ezequiel wrote:
> import ftplib, posixpath, threading
> from TaskQueue import TaskQueue
>
> def worker(tq):
> while True:
> host, e = tq.get()
>
> c = ftplib.FTP(host)
> c.connect()
> try:
>
When I run the following script, with host and password and username
changed, I get the following errors:
raise error_temp, resp
error_temp: 421 Unable to set up secure anonymous FTP
Dose the host should allow 4 simultaneous login at a time?
Justin Ezequiel wrote:
> import ftplib, posixpath, thre
It works using ftp.microsoft.com. But where does it put the downloaded
files? can I specify a download folder location?
Justin Ezequiel wrote:
> johnny wrote:
> > When I run the following script, with host and password and username
> > changed, I get the following errors:
>
It places the ftp downloaded contents on the same folder as the this
ftp python script. How do I set a diffrent download folder location?
johnny wrote:
> It works using ftp.microsoft.com. But where does it put the downloaded
> files? can I specify a download folder location?
>
> Jus
elif n.lower().endswith('.jpeg'):
q.put((host, n))
finally: c.close()
numworkers = 4
for i in range(numworkers):
t = threading.Thread(target=worker, args=(q,))
t.setDaemon(True)
t.start()
q.join()
print 'Done.
lipse/workspace/src/ftp_download/' + p,
'wb')
johnny wrote:
> I am getting the following error:
>
> raise error_temp, resp
> error_temp: 421 Unable to set up secure anonymous FTP
>
> Here is the code:
>
> import ftplib, posixpath, threading
> from TaskQueue i
How do I join two string variables?
I want to do: download_dir + filename.
download_dir=r'c:/download/'
filename =r'log.txt'
I want to get something like this:
c:/download/log.txt
--
http://mail.python.org/mailman/listinfo/python-list
In my code, I have the following:
p = posixpath.basename(e).strip
filename = download_dir+p
I am getting the following error:
filename = download_dir+p
TypeError: cannot concatenate 'str' and 'builtin_function_or_method'
objects
Cameron Walsh wrote:
> johnny wrote
What I want to do is the following:
Web user uploads a word doc, and I need it to move the uploaded word
doc, on to another machine and conver it to pdf. Then update the
database and allow immediate pdf download. I am thinking of using ftp
from machine 1 -> machine 2, then convert doc to pdf on
What I want to do is the following:
Web user uploads a word doc (web app written in php), and I need it to
move the uploaded word
doc, on to another machine and conver it to pdf. Then update the
database and allow immediate pdf download. I am thinking of using ftp
from machine 1 -> machine 2, th
I have a module called ftp and I have another module called
processKick. What I need is to have processKick, create fork and
execute ftp like below.
Relevant processKick code as follows:
def do_child_stuff():
ftp
def fork_test():
pid = os.fork()
if pid == 0:
# child
johnny wrote:
> I have a module called ftp and I have another module called
> processKick. What I need is to have processKick, create fork and
> execute ftp like below.
>
> Relevant processKick code as follows:
>
> def do_child_stuff():
> ftp
>
> def fo
What is the purpose of
if __name__ == "__main__":
If you have a module, does it get called automatically?
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> Reading the Python Tutorial helps a lot.
>
I did read "Dive Into Python", one week ago. It's a good book, but it
didn't cover this kind of situation.
--
http://mail.python.org/mailman/listinfo/python-list
I have python script does ftp download in a multi threaded way. Each
thread downloads a file, close the file, calls the comman line to
convert the .doc to pdf. Command line should go ahead and convert the
file. My question is, when each thread calls the command line, does one
command line process a
[EMAIL PROTECTED] wrote:
>
> That depends on how you invoke it: os.system creates a new shell which
> in turn creates a new process; the spawn* functions do that directly.
I am using os.system. Here is my code
import ftplib, posixpath, threading
from TaskQueue import TaskQueue
def worker(tq):
How do you create multiple connection in the treads. Lets say I will
have at most 5 threads and I want to create at most 5 connections. If
I create a connection in the "worker method", does it create connection
for each threads.
def worker(tq):
while True:
host, e = tq.get()
I am getting following connection error from my python script:
conn.close()
AttributeError: adodb_mysql instance has no attribute 'close'
Here is my relevant code below:
def worker(tq):
while True:
host, e = tq.get()
c = ftplib.FTP(host)
c.connect()
try:
I am getting the following errors:
File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in
_send_output
self.send(msg)
File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in send
self.connect()
File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 1073, in
connect
For getLogger, can you pass anything in there and it will return a
object?
Would that returned object, be your root logger?
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
How do I pipe the output, generated from os.system(some_command), to
the logging file?
--
http://mail.python.org/mailman/listinfo/python-list
I want to print individual exception for database connection, sql
execution, database closing, closing the cursor. Can I do it with one
try..catch or I need a nested try...catch?
conn = adodb.NewADOConnection('mysql')
conn.Connect('localhost', 'temp', 'temp', 'temp')
sql
I am getting a log error. I am running ActiveState Python 2.4.3. Any
help greatly appreciated. Here is my code:
file.py
-
def main()
setupLogging()
blah
def setupLogging():
global log
log = logging.getLogger("ftp")
formatter = logging.Formatter('%(name)-12s:
I am doing the os.system(encode_cmd) within a thread. So you are
saying, have each thread create a subprocess module. Did you mean,
"Popen" (os.popen)?
Like os.popen(encode_cmd) , not os.system(encode_cmd)?
Gabriel Genellina wrote:
> At Monday 11/12/2006 20:47, johnny wrote:
>
16:02:02 -0800, "johnny" <[EMAIL PROTECTED]> declaimed
> the following in gmane.comp.python.general:
>
> > I want to print individual exception for database connection, sql
> > execution, database closing, closing the cursor. Can I do it with one
> > try..catch
I checked out couple of books from Library, one that I like called
"Foundation of Python Network Programming", this is what I needed, code
with understandable explantion. ;) Thread pooling and many others.
Thanks all of you for the help.
Dustan wrote:
> Dennis Lee Bieber wrote:
> > On 13 Dec 20
Can someone tell me what is the reason "[0]" appears after
".communicate()"
For example:
last_line=subprocess.Popen([r"tail","-n 1", "x.txt"],
stdout=subprocess.PIPE).communicate()[0]
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Scope of ids:
When I print "ids", it's always empty string '', as I have intialized
before. That's not what I want. I want the ids to have
str(r['id']).join(',')
if res:
ids = ''
for r in res['key']:
ids = str(r['id']).join(',')
Anyone know how I can make Machine A python script execute a python
script on Machine B ?
--
http://mail.python.org/mailman/listinfo/python-list
Any Good tools to create CSV Files? ReportLab only creates pdf
files. I need something to create CSV files.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to call a function on a specified interval(seconds,
milliseconds) every time, like polling user defined method?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Can a class inside a module, access a method, outside of class, but
inside of the module?
Eg. Can instance of class a access main, if so how? What is the
scope of "def main()" interms of class A?
myModule:
class A:
main()
def main():
thnx.
--
http://mail.python.org/mailman/listinfo/pyt
en all jobs are done, spawned threads
join. When the next interval is up this process repeat itself.
Thanks.
On May 7, 11:19 pm, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote:
> On May 7, 10:42 pm, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote:
>
>
>
> > On May 7, 10:07 pm, jo
I need to get the content inside the bracket.
eg. some characters before bracket (3.12345).
I need to get whatever inside the (), in this case 3.12345.
How do you do this with python regular expression?
--
http://mail.python.org/mailman/listinfo/python-list
Any python module for navigating and selecting, parsing HTML files?
--
http://mail.python.org/mailman/listinfo/python-list
from people.models import *
Now I make changes to the models.py. How do I reload this module in
Python Shell?
--
http://mail.python.org/mailman/listinfo/python-list
When I do the following, rounding to 2 decimal places doesn't seem to
work. I should get 0.99 :
>>> a =0.99
>>> a
0.98999
>>> round(a,2)
0.98999
>>>
thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Breakfast at Tiffany's
Movie
Classic
Borat
Movie
Comedy
How do you represent DVD id=1 and it's elements, and DVD id=2 and it's
elements as child of root "Library"?
Like this:?
from lxml import etree
from lxml import objectify
root = objectify.Element("Library")
child[1] = objectify.Elemen
Is there any open source "live web chat support" program or script out
there? Any you can recommend?
--
http://mail.python.org/mailman/listinfo/python-list
What is **kwargs mean in python? When you put double **, does it mean
passing by reference?
For example:
def redirect_to(request, url, **kwargs):
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I'm new to Python and am looking for a really good/complete open
source project to learn from. I'd like it to take input from the
browser and query mysql. Suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 13, 9:14 am, [EMAIL PROTECTED] wrote:
> On Nov 13, 9:20 am, Johnny <[EMAIL PROTECTED]> wrote:
>
> > Hi, I'm new to Python and am looking for a really good/complete open
> > source project to learn from. I'd like it to take input from the
> >
if I want to fill zeros to the right, what function can help??
ex:
'1.23'=>'1.2300'
but '1.23'.zfill(6)=>'001.23'
--
http://mail.python.org/mailman/listinfo/python-list
I was not sure if this message was sent before my membership was accepted.
Please disregard if it's a duplicate.
Thanks
Begin forwarded message:
> From: Johnny Venter
> Date: August 5, 2011 8:15:53 AM EDT
> To: python-list@python.org
> Subject: Sockets: Receiving C Struct
&
I',s.recv(4))[0]
s.close()
print data
What I would like to do is take the input from the server, and store it in an
array. The type of data is int.
Can someone help?
Thanks, Johnny
PGP.sig
Description: This is a digitally signed message part
--
http://mail.python.org/mailman/listinfo/python-list
Thank you all for the replies. I would like to query various Windows' objects
and resources from Mac and/or Linux such as Active Directory users, network
shares, group members, etc... What module or methods can I use with python to
accomplish this?
I found dcerpc might be the way to go.
On A
his?
On Aug 20, 2011, at 7:57 PM, Chris Angelico wrote:
> On Sun, Aug 21, 2011 at 12:51 AM, Johnny Venter
> wrote:
>> Thank you all for the replies. I would like to query various Windows'
>> objects and resources from Mac and/or Linux such as Active Directory users,
http://greenteapress.com/thinkpython/
On Aug 23, 2011, at 10:46 PM, User wrote:
> Hello all,
> Does anyone have any good resources for learning Python? I know basic Java
> and basic Python (loops, data types, if-then statements, etc), but I want to
> delve into Python further. If anyone knows o
http://xxx.xxx.xxx";>xx
In fact it's filtered from this kind of source:
http://xxx.xxx.xxx";>xx"
But some result are right, I wonder how can I get the all the
answers clean like "http://xxx.xxx.xxx";? Thanks for your help.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> ".*" gives the longest possible match (you can think of it as searching back-
> wards from the right end). if you want to search for "everything until a
> given
> character", searching for "[^x]*x" is often a better choice than ".*x".
>
> in this case, I suggest using some
, the program will never get the sentence "return n".
I googled for the problem but didn't find much help. So any one here
could give me a hand? thanks
regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
raise urllib2.URLError until the program exits. I tried
many ways to work it out, using urllib, set a sleep(1) in the filter (I
thought it was the massive urls crashed the program). But none works.
BTW, if I set the url from which the program crashed to base url, the
program will still crashed at th
Alex Martelli wrote:
> Johnny Lee <[EMAIL PROTECTED]> wrote:
>...
> >try:
> > webPage = urllib2.urlopen(url)
> >except urllib2.URLError:
>...
> >webPage.close()
> >return True
> > --
Steve Holden wrote:
> Johnny Lee wrote:
> > Alex Martelli wrote:
> >
> >>Johnny Lee <[EMAIL PROTECTED]> wrote:
> >> ...
> >>
> >>> try:
> >>> webPage = urllib2.urlopen(url)
> >>> excep
Steve Holden wrote:
> Steve Holden wrote:
> > Johnny Lee wrote:
> > [...]
> >
> >>I've sent the source, thanks for your help.
> >>
> >
> > [...]
> > Preliminary result, in case this rings bells with people who use urllib2
> >
"r")
>>> f.tell()
0L
>>> f.readline()
'http://cn.realestate.yahoo.com\n'
>>> f.tell()
28L
--
Here is the a snapshot from cygwin:
---
Johnny [EMAIL PROTECTED] /cygdrive/d
$ python
Python 2.4.1 (#1, May 27 2005, 18:02:40
Class A:
def __init__(self):
self.member = 1
def getMember(self):
return self.member
a = A()
So, is there any difference between a.member and a.getMember? thanks
for your help. :)
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten 写道:
> Johnny Lee wrote:
>
> > Class A:
> >def __init__(self):
> > self.member = 1
> >
> >def getMember(self):
> > return self.member
> >
> > a = A()
> >
> > So, is there any difference betw
But I still wonder what's the difference between the A().getMember and
A().member besides the style
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli 写道:
> Johnny Lee <[EMAIL PROTECTED]> wrote:
>
> > But I still wonder what's the difference between the A().getMember and
> > A().member besides the style
>
> Without parentheses after it, getMember is a method. The difference
> between a meth
It looks like there isn't a last word of the differrences
--
http://mail.python.org/mailman/listinfo/python-list
translated first into C, where can I get the C source?
Thanks for your help.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
a crush on cygwin. I
used a session of python code to produce the crush, and want to
translate it into C and reproduce it. Is the tools provided by you help
with these issues? Of coz, I'll try them first. :)
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your tips Niemann:)
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Szabolcs and Laurence, it's not the crash of python but the
crash of cygwin. We can locate the line number but when we submit the
crash to cygwin's mail list, they told us they don't speak python. So
I'm just trying to re-produce the crash in C.
Regard
nt time1, time2
1130748744.461 1130748744.500
>>> float(time2) - float(time1)
0.03934332275391
>>>
Why are there so many nonsense tails? thanks for your help.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
answer, if you could also cc your
reply to my email [EMAIL PROTECTED], would be much obliged. Thanks
again!)
Best,
-Johnny
www.johnny-lin.com
--
http://mail.python.org/mailman/listinfo/python-list
thanks everyone for the replies!
John Hunter, yep, this is Johnny Lin in geosci :).
re using return: the problem i have is somewhere in my code there's a
memory leak. i realize return is supposed to unbind all the local
variables, but since the memory leak is happening despite retu
thanks again for all the help! especially the advice on ideas of
tracking down the memory leak :). (sorry for not mentioning it
earlier...i had thought deleting everything might be a quick and dirty
way short-term fix. :P)
best,
-Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Here is the source:
#! /bin/python
[EMAIL PROTECTED] This is a xunit test framework for python, see TDD for more
details
class TestCase:
def setUp(self):
print "setUp in TestCase"
pass
def __init__(self, name):
print "__init__ in Te
Hi,
I'm new in python and I was wondering what's the difference between
the two code section below:
(I)
class TestResult:
_pass_ = "pass"
_fail_ = "fail"
_exception_ = "exception"
(II)
class TestResult:
pass = "pass"
fail = "fail"
exception = "ex
As what you said, the following two code section is totally the same?
(I)
class TestResult:
_passxxx_ = "pass"
(II)
class TestResult:
passxxx = "pass"
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis wrote:
>
> No, of course not. One defines a class varaible named `_passxxx_', the
> other defines one named `passsxxx'.
>
I mean besides the difference of name...
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis wrote:
>
> You're going to have to be more clear; I don't understand your question.
> What's the difference between
>
> a = 1
>
> and
>
> b = 1
>
> besides the difference of name?
>
I thought there must be something special when you named a VAR with '_'
the first ch
Hi,
I've met a problem to understand the code at hand. And I wonder
whether there is any useful tools to provide me a way of step debug?
Just like the F10 in VC...
Thanks for your help.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Look at the follow command in python command line, See what's
interesting?:)
>>> class A:
i = 0
>>> a = A()
>>> b = A()
>>> a.i = 1
>>> print a.i, b.i
1 0
---
>>> class A:
arr = []
>>> a = A()
>>> b = A()
>>> a
<__main__.A instance at 0x
bruno modulix wrote:
>
> I dont see anything interesting nor problematic here. If you understand
> the difference between class attributes and instance attributes, the
> difference between mutating an object and rebinding a name, and the
> attribute lookup rules in Python, you'll find that all thi
Roy Smith wrote:
>
> For closer control over output, use the write() function. You want
> something like:
>
> import sys
> for i in range(3):
>sys.stdout.write (str(i))
here is the output of my machine:
>>> import sys
>>> for i in range(3):
... sys.stdout.write(str(i))
...
012>>>
Kanthi Kiran Narisetti wrote:
> Hi All,
>
> I am Windows Systems Administrator(planning to migrate to Linux
> administration in near future), I have occassionally written few
batch
> files and Vbscripts to automate my tasks.
>
> Now I have strong interest to learn a programming language that would
You seem to have a lot of questions for someone who talks to God every
three minutes.
What do you guys do, discuss the Yankees or something?
--
http://mail.python.org/mailman/listinfo/python-list
There is no God. OK, Ron, discuss.
Ron wrote:
> Reports to [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
> [EMAIL PROTECTED], [EMAIL PROTECTED]
>
> And do not feed the troll!
--
http://mail.python.org/mailman/listinfo/python-list
C'mon. Everyone knows God plays a Martin.
--
http://mail.python.org/mailman/listinfo/python-list
Can we stop crossposting this shit to the Beatles NG, please?
Donald L McDaniel wrote:
> Matt Hayden wrote:
> > Johnny Gentile wrote:
> >> C'mon. Everyone knows God plays a Martin.
> >
> > I dunno. I think God has a honkin' big collection so he won
Donald - go away. Far away. Now.
And, for the last time (hopefully), stop crossposting to
rec.music.beatles.
Go sell crazy somewhere else. We're all stocked up.
Donald L McDaniel wrote:
> AKA wrote:
> > "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> MC05 w
>From the Book of Armaments:
"And Saint Attila raised the hand grenade up on high,
saying, 'Oh, Lord, bless this thy hand grenade that with it thou
mayest blow thy enemies to tiny bits, in thy mercy.' And the Lord
did grin, and people did feast upon the lambs, and sloths, and
carp, and anchovies,
aa.
--
http://mail.python.org/mailman/listinfo/python-list
Enough salvation for one day.
--
http://mail.python.org/mailman/listinfo/python-list
.
--
http://mail.python.org/mailman/listinfo/python-list
And this is OK w/ Google?
--
http://mail.python.org/mailman/listinfo/python-list
.
[EMAIL PROTECTED] wrote:
> Best Viewed at << 1024x768 >>
>
http://groups-beta.google.com/group/alt.religion.christian/browse_thread/thread/73352e0ed6923d23/1ea6c7a1ea6923ab?hl=en#1ea6c7a1ea6923ab
>
>
***
>
***
thanks steve h.,
works like this just perfectly!
steve b.:
for the next time if i cannot figure it out i will just do it like
this!
thanks a lot guys,
Frank
--
http://mail.python.org/mailman/listinfo/python-list
Hello Group!
I really tried hard for two hours to rewrite the following expression
(python 2.4):
--
teilnehmer = []
for r in Reisen.select(AND(Reisen.q.RESVON <= datum, Reisen.q.RESBIS
>= datum)):
for g in r.BUCHUNGEN:
for t in g.aktiveTeilnehmer:
I have just discovered Python and am familiarizing myself with the syntax
but I have always found that code examples where the best way for me to
learn.
Can anyone point me to a site with some good open source functioning python
applications?
I would appreciate any help.
Also, does anyo
[EMAIL PROTECTED] wrote:
> Hi all,
> I have created a XML-RPC model (with server and client) written in
> Java.
> I want to call the methods in another XML-RPC model written in
> Python.
> I know that in Java, I can use like
> "xmlrpc_client.excute("handler_name.method", param)" to call
Timothy Grant wrote:
>
> granted the left side of that equality could be messed up due to
> create_output() NOT doing the right thing. But the right side is
> simply the contents of the variable "text" so WHY is the first part of
> the path being substituted with "..."?
>
Some grepping on '...' r
1 - 100 of 102 matches
Mail list logo