Does anyone use Python Tools for visual studio?

2011-11-01 Thread Wei
I got several buggy things going on.
First, the view of class tree stops expanding after creating more than
two classes.
Second, after 800 lines of code the classes and methods can't be
folded. (meaning the + sign is gone)
P.S. there is no warning or errors in my code.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Does anyone use Python Tools for visual studio?

2011-11-01 Thread Wei
On Nov 1, 12:57 pm, Wei  wrote:
> I got several buggy things going on.
> First, the view of class tree stops expanding after creating more than
> two classes.
> Second, after 800 lines of code the classes and methods can't be
> folded. (meaning the + sign is gone)
> P.S. there is no warning or errors in my code.

Also, I am using 64 bit win7 professional.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is this PEP-able? fwhile

2013-06-24 Thread wu wei
On Tue, Jun 25, 2013 at 10:19 AM, Fábio Santos 
 wrote:

> for X in (i for i in open('largefile') if is_part_of_header(i)):
>
> The above code would be wasting time on IO and processing. It would load
> another line and calculate the condition for every line of the large file
> and I just wanted to loop over the few header lines.
>
> itertools.takewhile and fwhile/for..while actually stops the loop when the
> condition is not meant, while your example keeps checking the condition
> until the end of file, even though it is a generator expression.
>
Ah yes, of course, my bad.

It's still possible by raising a StopIteration within the condition
function:

def is_part_of_header(x):
if header_condition:
return True
else:
raise StopIteration

But yes, by this point any clarity of the generator expression approach
comes with the cost of more explicit setup of the breaking condition.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Re: Objects in Python

2012-08-24 Thread wu wei
On Fri, Aug 24, 2012 at 7:14 PM, Evan Driscoll  wrote:

> On 8/23/2012 22:17, alex23 wrote:
> > But Roy's point was that referring to 'a' as a 'variable' makes no
> > sense, as it's not an allocated piece of memory.
>
> Does the computer just remember what 'a' refers to by keeping notes
> about it in Narnia?
>

You're correct. It will be, on some level, a piece of memory. But I don't
recall seeing any guarantee that the memory used to hold the dictionary key
of 'a' in one scope would be re-used if 'a' was first deleted and then
re-created. It's an implementation detail about the language that we don't
care about.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 Debian 6.0. Squeeze

2011-05-12 Thread Chen Wei
On Thu, May 12, 2011 at 12:03:26PM -0400, Jorge Romero wrote:
> Actually came back with some feedback to my own question.
> 
> The following repositories do the job:
> # /etc/apt/sources.list
> deb http://ftp.uk.debian.org/debian/ unstable main contrib non-free
> deb http://ftp.uk.debian.org/debian/ experimental main contrib non-free
> deb http://security.debian.org/ testing/updates main contrib

python2.7 is included in debian testing, so point the sources.list to
testing instead of unstable or experimental should also works.
deb http://ftp.uk.debian.org/debian/ testing main contrib non-free

> $ apt-get update
> $ apt-get install python2.7
> $ python --version
> Python 2.6.6
> $ python2.7 --version
> Python 2.7.1+
> 


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


how to apply "mvc" pattern to gui-design in python

2005-03-28 Thread Su Wei
i have a project want to  develop with python.
who can tell me that how to apply "mvc" pattern to gui-design in python.
please give me some advices!
ths in advanced.


-- 
蓦然回首曾经岁月,
朦胧中依稀闪烁着清晰。
才发现,
原来在我的记忆深处,
还残留着宁静而又幸福的瞬间。

一世风流已飘过,转眼渐成白头翁。
--
http://mail.python.org/mailman/listinfo/python-list


why and when we should do it?

2005-03-29 Thread Su Wei
hi,everybody,Sorry to bother you. 
i hvae seen some code like this before:

class BusinessBO :
dev __init__(slef):
#write you own code here
dev businessMethod :
#write you own code here
pass

why and when we should add the keyword "pass" ?

and some time i have seen

class SomeObject(Object) :
  #some code

why and when we should inherit Object?

thanks in advanced.


-- 
蓦然回首曾经岁月,
朦胧中依稀闪烁着清晰。
才发现,
原来在我的记忆深处,
还残留着宁静而又幸福的瞬间。

一世风流已飘过,转眼渐成白头翁。
--
http://mail.python.org/mailman/listinfo/python-list


Can Python do Perl's print <

2006-08-23 Thread yichun . wei
Perl has the ability to do the following:

  print > QSUB.stdin, qsubcmds
  (or Popen.communicate(qsubcmds))

the "rm -f " was not executed in my case.

The corresponding perl script runs fine:

  open(QSUB, "| $qsubcmds -") || die "kao";
  print QSUB 

Fwd: Checking a string against multiple matches

2008-12-03 Thread wu wei
Sorry to hassle the list with this but I'm getting irregular spam from this
asshole, clearly triggered by comp.lang.python posts being resent to the
python-list. I've contacted Yahoo abuse -and- the list administrators but
its still occurring.

Is anyone able to remove this guy from the list? I've asked him to stop but
he rather abusively replied saying that he wasn't doing anything wrong.

-- Forwarded message --
From: Stephen Meredith <[EMAIL PROTECTED]>
Date: Tue, Dec 2, 2008 at 11:08 AM
Subject: Re: Checking a string against multiple matches
To: alex23 <[EMAIL PROTECTED]>


THE 10 DOLLAR PAYPAL MONEY MAKING METHOD
As On 20/20 - TURN 10$ into a good chunk of change in a short time
Earn money using PAYPAL as seen on Oprah & 20/20
THE PAYPAL 6 DOLLAR MONEY-MAKING METHOD
AS SEEN ON OPRAH EARN HUGE 
all you need is:
1) An email address
2) A PayPal account
3) $10.00
I have participated in sending $1 dollar to six people, and have not
made as much money as with $5 dollars to 2 people. For and extra 4
dollars you will bring in much more money then the dollar method.
THIS IS A October 2008 , CURRENT EMAIL LIST, What do you have to lose
being you are only sending 5 dollars to 2 people. I WAS SKEPTICAL AT
FIRST, but over about a week hundreds starting appearing in my paypal
account! It was like Christmas morning
INSTRUCTIONS:
STEP 1:
The first thing to do is highlight and SAVE this entire post in word
or notepad on your computer so you can come back to it later. After
that, if you are not already a PayPal user you need to go to
the PayPal website at
https://www.paypal.com/au/mrb/pal=CW4RHQ... and
SIGN UP. If you want to be able to receive credit card payments from
other people then you will need to sign up for a PREMIER or BUSINESS
account (not just a PERSONAL
account). This is highly recommended to allow others easy payment
options. In order to place the initial 10$ into your account, you
will have to verify your bank account with PAYPAL (which may take a
few days). PAYPAL is 100% secure and is used by millions of people
worldwide.
STEP 2:
Here is where the action occurs. The first thing to do is to send a
$5.00 payment to each of the 2 email addresses on the current list
from your PayPal account. To do this quickly and successfully,
follow
these simple steps:
1. Login to PayPal and click on the "Send Money" tab near the top of
the screen
2. In the "Recipient's Email" field enter the email address
3. In the "Amount" field enter "5" (This is your $5.00 payment)
4. In the "Category" field select "Service" (Keeping it legal)
5. In the "Subject" field type "Tutoring Help", and in the "NOTE"
field
Enter "Thanks for the help" or even better Enter "Thank you for
answering my (pick a subject ex. Business, financial etc) question."
By doing this, you are
creating a service and maintaining the legality of the system by
"paying" for the service. In theory you are tutoring others how to
make money online through paypal. It is very important that you follow
those directions since that is what keeps it legal. You probably have
seen this exact method before with others telling you to write "please
put me on your email list" in the note section. I originally used the
"please put me on your email list" and it worked great until paypal
said that is considered a pyramid scheme. They were really nice about
it, telling me that I couldn't do this anymore (They let me keep the
954.34 that I had made over the 3 weeks, I just had to stop). So I now
have been using this NEW method for about 3 months and there have been
no problems. This is providing a helping service to others, which
paypal has verified as legal. I promise you that this works and is
legal, I even called customer service explaining what I was doing
would not get me in trouble. They gave me the thumbs up, saying this
method meet their user policy! Whats the worst that happens, you lose
10$ dollars? Unlike most people, I have tried this program and have
figured out what works! The great thing about this email list is that
I have contacted all of them by email. They all are active in this
paypal method, guaranteeing that they will be posting their list with
your email address to hundreds of posts. You have to be careful, since
many email lists are filled with inactive or wrong emails! If you need
help getting started or have any questions feel free to email me at
[EMAIL PROTECTED], working together is what will allow us to
make this potential large sum of money.
Remember, all of this is ABSOLUTELY LEGAL! If you have any doubts,
please refer to le 18 Sec.1302 & 1241 of the United States Postal
laws.
Now, click on the "Continue" button to complete the payment.
Repeat these steps for each of the 2 email addresses. That's it! By
sending the $5.00 payment to each address, you are implementing the
compounding POWER of the system. You will reap what you sow!
Here is the current e-mail list:
*
The email list

A question about funcation parameter and self defined object

2008-10-08 Thread Wei Guo
Hi,

I defined a class called vec3 which contains x, y, z and in another
function, I tried to call a function which takes a vec3 as a parameter, but
it seems that parameter is passed as a generic object and I can not access x
, y, z in my vec3. Could anyone help me with that?

 class vec3:
def __init__(self, x_ = 0.0, y_ = 0.0, z_ = 0.0):
self.x = x_
self.y = y_
self.z = z_
class mat4:
 def translation( traV = vec3() ):
  tranM.rowLst[index][0] = traV.x
AttributeError: 'NoneType' object has no attribute 'x'

Could anyone help me how to turn the traV as type of vec3() instead of
NoneType object?

Thanks a lot,

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


Re: A question about funcation parameter and self defined object

2008-10-08 Thread Wei Guo
Hi Chris,

Thanks a lot for reply, you are right. I want to use this method as a static
method as:

translation = staticmethod( translation )

I think that here the built in function pass None. So we can not pass any
self defined object for static method?

Best regards,

Wei

On Wed, Oct 8, 2008 at 5:50 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:

> On Wed, Oct 8, 2008 at 4:36 PM, Wei Guo <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I defined a class called vec3 which contains x, y, z and in another
> > function, I tried to call a function which takes a vec3 as a parameter,
> but
> > it seems that parameter is passed as a generic object and I can not
> access x
> > , y, z in my vec3. Could anyone help me with that?
>
> Being dynamically typed, Python has no notion of variables having
> types, so the object isn't being "passed as a generic object", you're
> getting what really is a "generic object" value of type NoneType,
> which means the value of traV is indeed None, not vec3().
>
> >
> > class vec3:
> > def __init__(self, x_ = 0.0, y_ = 0.0, z_ = 0.0):
> > self.x = x_
> > self.y = y_
> > self.z = z_
> > class mat4:
> >  def translation( traV = vec3() ):
> >   tranM.rowLst[index][0] = traV.x
> > AttributeError: 'NoneType' object has no attribute 'x'
>
> This code is perfectly fine. See below.
>
> >
> > Could anyone help me how to turn the traV as type of vec3() instead of
> > NoneType object?
>
> That's not what's happening. It's not like traV is being cast to
> NoneType thus making x inaccessible, as that's not even possible to
> express in Python.
> What's happening is something is calling translation() with None as an
> argument, and of course None (the value the caller provided for traV)
> has no attribute 'x', hence the error. So, check the full exception
> traceback and see who's calling translation() and how the argument
> being passed to it got to be None.
>
> Cheers,
> Chris
> --
> Follow the path of the Iguana...
> http://rebertia.com
>
> >
> > Thanks a lot,
> >
> > Wei
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> >
>
--
http://mail.python.org/mailman/listinfo/python-list


Re: A question about funcation parameter and self defined object

2008-10-09 Thread Wei Guo
Hi Terry,

Thanks for your reply. But the reason I want to have that is for not
changing the functions which already based on translation functions.

If there is any idea how to bring parameter in static method, that will be
great.

Wei
On Wed, Oct 8, 2008 at 8:24 PM, Terry Reedy <[EMAIL PROTECTED]> wrote:

> Wei Guo wrote:
>
>> Hi Chris,
>>  Thanks a lot for reply, you are right. I want to use this method as a
>> static method as:
>>  translation = staticmethod( translation )
>>
>
> static methods are mostly useless in Python.  Just put the definition of
> translation outside of any class.
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list


Question about optimization

2008-07-24 Thread Wei Hao
Hi:

I'm pretty new to python and I have some optimization issues. I'll show you
the piece of code which is causing it, with pseudo-code before it and
comments. I'm accessing a gigantic table (like 15 million rows) in SQL.


d is some dictionary, r is a precompiled regex string
Big loop, so I search through the table in chunks given by delta
SQL query ("select * from table where rowID >= n and rowID < (n +
delta)"), result of query stored in a. Each individual row is a[n1], columns
of rows are a[n1][n2].

t1 = time.clock() #to track speed
for m in a:
for temp in m:
if str(temp) == "None": #basically skip over the columns that
are null for this particular row
continue
s += temp #get the columns into one long string
s = s.replace("between", "")
s = s.replace("and", "")
s = s.replace("where", "")
s = s.replace("like", "") #these words cause problems, need to get
rid of them.
b = re.findall(r,s) #looking for the stuff I want, always at least
one per row of table, about 3-4 on average.
for t in b: #store count of things I want in dictionary
if t in d:
d[t] += 1
else:
d[t] = 1
print n, (time.clock()-t1) #to track speed


I am 100% sure it's this code snippet that's the cause of my problems.
Here's what I can tell you. Each chunk of rows that I grab is essentially
equal in size (rowID skips over stuff, but rather arbitrarily). The time it
takes to fetch the SQL query doesn't change. But as the program progresses,
this snippet gets slower. Here's the output:

2500 0.441551299341
5000 1.26162739664
7500 2.35092688403
1 3.48417469666
12500 4.59031305491
15000 5.78972588775
17500 6.28305527139
2 6.73344570903
22500 8.31732146487
25000 9.65322872159
27500 8.98186042757
3 11.8042818095
32500 12.1965593712
35000 13.2735763291
37500 14.0282617344

What is it in the code snippet that slows down as n increases? Is there
something about the way low level python functions I don't understand which
is slowing me down?

Thanks in advance for your time.

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

A question about string and float number

2008-08-06 Thread Wei Guo
Hi all,

I am new of python. Could anyone help me a question as below?

Is there any function that can judge a string s is a float number or not?
FOr example, if s = '1.232' or s='1e+10', then it returns true, otherwise,
it will return false.

isdigit() in string doesn't work. float() will throw an exception and I just
need true or false as result.

Thanks a lot in advance,

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

Re: A question about string and float number

2008-08-07 Thread Wei Guo
Hi Thanks for Tyler and Edwin's help.

For my questions, I need to import some xml file and there are floating
number and strings in it. I need to process string and number differently.
This is reason that I am asking question here. Is this background
information we need for this quesions.

Btw, which way is better? type or with exception ValueError?

Thanks,

Wei


On 8/6/08, Tyler Breisacher <[EMAIL PROTECTED]> wrote:
>
> It's generally a bad idea to use "except" without naming a specific
> exception. The exception you might expect in this case is ValueError. Any
> other exception *should* be uncaught if it happens. By the way, this method
> will return true for integers as well as floats. For example, isFloat('3')
> will return 3.0. So make sure this is what you want, since it wasn't 100%
> clear from the original message.
>
>
> Wei Guo wrote:
>
>> #this is a better way of testing a string for float
>> def isFloat(s):
>>try:
>>s = float(s)
>>except:
>>return False
>>return True
>>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list

Re: A question about string and float number

2008-08-07 Thread Wei Guo
Hi I tried the first type method but it seens that it doesn't work. Could
anyone help me about it?

>>> s = '3.145'
>>> type(s) == type(float())
False
>>> type(s)

>>> type(float())

>>>

Best regards,

Wei


On 8/7/08, Wei Guo <[EMAIL PROTECTED]> wrote:
>
> Hi Thanks for Tyler and Edwin's help.
>
> For my questions, I need to import some xml file and there are floating
> number and strings in it. I need to process string and number differently.
> This is reason that I am asking question here. Is this background
> information we need for this quesions.
>
> Btw, which way is better? type or with exception ValueError?
>
> Thanks,
>
> Wei
>
>
>  On 8/6/08, Tyler Breisacher <[EMAIL PROTECTED]> wrote:
>>
>> It's generally a bad idea to use "except" without naming a specific
>> exception. The exception you might expect in this case is ValueError. Any
>> other exception *should* be uncaught if it happens. By the way, this method
>> will return true for integers as well as floats. For example, isFloat('3')
>> will return 3.0. So make sure this is what you want, since it wasn't 100%
>> clear from the original message.
>>
>>
>> Wei Guo wrote:
>>
>>> #this is a better way of testing a string for float
>>> def isFloat(s):
>>>try:
>>>s = float(s)
>>>except:
>>>return False
>>>return True
>>>
>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
--
http://mail.python.org/mailman/listinfo/python-list

Re: A question about string and float number

2008-08-07 Thread Wei Guo
Hi Grant,

I am using the try/exception and just curious why function type doesn't
work.

Best regards,

Wei


On 8/7/08, Timothy Grant <[EMAIL PROTECTED]> wrote:
>
> That's because s IS a string. It's not been converted to a float.
>
> In [1]: s = '3.1415'
> In [2]: n = float(s)
> In [3]: type(s)
> Out[3]: 
> In [4]: type(n)
> Out[4]: 
>
> Why are you avoiding the very simple try:/except: solution to this problem?
>
> On Thu, Aug 7, 2008 at 1:28 PM, Wei Guo <[EMAIL PROTECTED]> wrote:
> > Hi I tried the first type method but it seens that it doesn't work. Could
> > anyone help me about it?
> >
> >>>> s = '3.145'
> >>>> type(s) == type(float())
> > False
> >>>> type(s)
> > 
> >>>> type(float())
> > 
> >>>>
> >
> > Best regards,
> >
> > Wei
> >
> >
> > On 8/7/08, Wei Guo <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi Thanks for Tyler and Edwin's help.
> >>
> >> For my questions, I need to import some xml file and there are floating
> >> number and strings in it. I need to process string and number
> differently.
> >> This is reason that I am asking question here. Is this background
> >> information we need for this quesions.
> >>
> >> Btw, which way is better? type or with exception ValueError?
> >>
> >> Thanks,
> >>
> >> Wei
> >>
> >>
> >> On 8/6/08, Tyler Breisacher <[EMAIL PROTECTED]> wrote:
> >>>
> >>> It's generally a bad idea to use "except" without naming a specific
> >>> exception. The exception you might expect in this case is ValueError.
> Any
> >>> other exception *should* be uncaught if it happens. By the way, this
> method
> >>> will return true for integers as well as floats. For example,
> isFloat('3')
> >>> will return 3.0. So make sure this is what you want, since it wasn't
> 100%
> >>> clear from the original message.
> >>>
> >>>
> >>> Wei Guo wrote:
> >>>>
> >>>> #this is a better way of testing a string for float
> >>>> def isFloat(s):
> >>>>try:
> >>>>s = float(s)
> >>>>except:
> >>>>return False
> >>>>return True
> >>>
> >>>
> >>> --
> >>> http://mail.python.org/mailman/listinfo/python-list
> >>
> >
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
> --
> Stand Fast,
> tjg.  [Timothy Grant]
>
--
http://mail.python.org/mailman/listinfo/python-list

Re: Jython

2006-03-11 Thread Wei Zhuo
jython2.2 is under developing, you can download the alpha version in sourceforge.2006/3/12, rtilley <[EMAIL PROTECTED]>:
Is development still going on with Jython? Version 2.1 came out in 2001and it's still the most current stable release.Thanks!--http://mail.python.org/mailman/listinfo/python-list

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

Re: print line number and source filename

2010-11-22 Thread Wei Sun
Here is what you want for printing python source filename:

print __file__

> On Tuesday, June 22, 2010 12:44 PM Peng Yu wrote:

> I want to print filename and line number for debugging purpose. So far
> I only find how to print the line number but not how to print
> filename.
> 
> import inspect
> print inspect.currentframe().f_lineno
> 
> I found inspect.getsourcefile(), but I have to supply a class name to
> it. I have searched online, but I do not find how to print the source
> filename. Would you please let me know?
> 
> Also, always importing the inspect module and getting the frame and
> accessing the lineno from the frame is not very convenient to type. Is
> there a shorter way to access the line number (for example, in C++ and
> perl, __LINE__ can be used to access line number, which is much more
> convenient than the way that I found in python).
> 
> --
> Regards,
> Peng


> Submitted via EggHeadCafe 
> Merging SharePoint List Data into Word Documents
> http://www.eggheadcafe.com/tutorials/aspnet/6054abc5-c5fb-4e86-a352-afd0e8c4a7c6/merging-sharepoint-list-data-into-word-documents.aspx
-- 
http://mail.python.org/mailman/listinfo/python-list


GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, James
When I am editing python program with SPE, I found that SPE will
freeze when it is doing auto-completion. The behavior is very strange
that I can not edit the file again. If I switch to another file and
then switch back, I can edit it again.

So I switch to eclipse+pydev, but I found the same thing happen. So I
think it is not the problem of SPE or eclipse or pydev.

If I disable auto-completion function in SPE or Eclipse+PyDev, it will
not freeze any longer.

Anybody can give me some hints?

I am using Ubuntu 8.10 and updated to latest. All packages is
installed through package manager.


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


Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, James
On Jun 18, 10:45 am, "Wei, James"  wrote:
> When I am editing python program with SPE, I found that SPE will
> freeze when it is doing auto-completion. The behavior is very strange
> that I can not edit the file again. If I switch to another file and
> then switch back, I can edit it again.
>
> So I switch to eclipse+pydev, but I found the same thing happen. So I
> think it is not the problem of SPE or eclipse or pydev.
>
> If I disable auto-completion function in SPE or Eclipse+PyDev, it will
> not freeze any longer.
>
> Anybody can give me some hints?
>
> I am using Ubuntu 8.10 and updated to latest. All packages is
> installed through package manager.

the only thing I googled related with it is

http://www.nabble.com/-pydev---Users--jython-2.5b1-Froze-eclipse-on-autocomplete-td21394274.html

but I think they are different.

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


Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, Xiaohai
yes, the same problem even on an empty program. every file has the same
problem.

for example, if I new a file and input the following:
import os
os.
after I input '.', it will pop up the window, and i can select the function
of os module or continue input. but after that, no action can be taken for
this file unless I switch to other files and then switch back.

On Thu, Jun 18, 2009 at 10:57 AM, Tyler Laing  wrote:

> Do you experience the same problem even on an empty program file or is it
> limited to just one file?
>
> -Tyler
>
> On Wed, Jun 17, 2009 at 7:47 PM, Wei, James  wrote:
>
>> On Jun 18, 10:45 am, "Wei, James"  wrote:
>> > When I am editing python program with SPE, I found that SPE will
>> > freeze when it is doing auto-completion. The behavior is very strange
>> > that I can not edit the file again. If I switch to another file and
>> > then switch back, I can edit it again.
>> >
>> > So I switch to eclipse+pydev, but I found the same thing happen. So I
>> > think it is not the problem of SPE or eclipse or pydev.
>> >
>> > If I disable auto-completion function in SPE or Eclipse+PyDev, it will
>> > not freeze any longer.
>> >
>> > Anybody can give me some hints?
>> >
>> > I am using Ubuntu 8.10 and updated to latest. All packages is
>> > installed through package manager.
>>
>> the only thing I googled related with it is
>>
>>
>> http://www.nabble.com/-pydev---Users--jython-2.5b1-Froze-eclipse-on-autocomplete-td21394274.html
>>
>> but I think they are different.
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Visit my blog at http://oddco.ca/zeroth/zblog
>



-- 
Best wishes to you.

Yours sincerely

Xiaohai Wei
[email protected]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-18 Thread Wei, Xiaohai
Thanks for your reply.

where is the error log? I can not find it at /var/log

I have a virtual network card to bridge kvm virtual machine. will it cause
problem?

as you said configuration of interpretor, how should I configure the
interpretor?

Thanks

James

On Fri, Jun 19, 2009 at 9:32 AM, Fabio Zadrozny  wrote:

> > yes, the same problem even on an empty program. every file has the same
> > problem.
> >
> > for example, if I new a file and input the following:
> > import os
> > os.
> > after I input '.', it will pop up the window, and i can select the
> function
> > of os module or continue input. but after that, no action can be taken
> for
> > this file unless I switch to other files and then switch back.
>
> If it's in pydev, there's probably some problem in your interpreter
> configuration (when you do os. it'll spawn a shell to gather the
> completions -- but that should be pretty quick unless you have some
> firewall that's preventing the communication or the spawn didn't go
> well -- check your error log to see if you have any errors... In linux
> I've seen some problems when connecting to 127.0.0.1 while having ipv6
> enabled or in a network card misconfiguration that could cause
> problems too).
>
> Cheers,
>
> Fabio
>
>
> >
> > On Thu, Jun 18, 2009 at 10:57 AM, Tyler Laing 
> wrote:
> >>
> >> Do you experience the same problem even on an empty program file or is
> it
> >> limited to just one file?
> >>
> >> -Tyler
> >>
> >> On Wed, Jun 17, 2009 at 7:47 PM, Wei, James  wrote:
> >>>
> >>> On Jun 18, 10:45 am, "Wei, James"  wrote:
> >>> > When I am editing python program with SPE, I found that SPE will
> >>> > freeze when it is doing auto-completion. The behavior is very strange
> >>> > that I can not edit the file again. If I switch to another file and
> >>> > then switch back, I can edit it again.
> >>> >
> >>> > So I switch to eclipse+pydev, but I found the same thing happen. So I
> >>> > think it is not the problem of SPE or eclipse or pydev.
> >>> >
> >>> > If I disable auto-completion function in SPE or Eclipse+PyDev, it
> will
> >>> > not freeze any longer.
> >>> >
> >>> > Anybody can give me some hints?
> >>> >
> >>> > I am using Ubuntu 8.10 and updated to latest. All packages is
> >>> > installed through package manager.
> >>>
> >>> the only thing I googled related with it is
> >>>
> >>>
> >>>
> http://www.nabble.com/-pydev---Users--jython-2.5b1-Froze-eclipse-on-autocomplete-td21394274.html
> >>>
> >>> but I think they are different.
> >>>
> >>> --
> >>> http://mail.python.org/mailman/listinfo/python-list
> >>
> >>
> >>
> >> --
> >> Visit my blog at http://oddco.ca/zeroth/zblog
> >
> >
> >
> > --
> > Best wishes to you.
> >
> > Yours sincerely
> >
> > Xiaohai Wei
> > [email protected]
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> >
>



-- 
Best wishes to you.

Yours sincerely

Xiaohai Wei
[email protected]
-- 
http://mail.python.org/mailman/listinfo/python-list


Strange problem when using re module with threads

2007-11-01 Thread Wei Lee Woon
Dear all

I've been getting a rather strange problem with the following multithreaded
code (reduced to the minimum which still results in the problem):

import threading
import re

class hey(threading.Thread):
def run(self):
print re.compile("\d+").search("hey95you").group();

thlist=[]
for tech in range(2):
thlist.append(hey())
thlist[-1].start()

for th in thlist:
th.join()

After saving this to a file (say "test.py"), if I try to run this from the
console using "python test.py", it seems to work fine, but when i try to run
it from the python interactive shell using "import test", it freezes up (if
i don't issue the join() it is fine, though). Any ideas why this is so?

Thanks
Wei Lee
-- 
http://mail.python.org/mailman/listinfo/python-list

ModuleNotFoundError: No module named 'Paramiko'

2024-04-08 Thread Wenyong Wei via Python-list


Dear Sir/Madam,

Recently I encounter a problem that I can't import paramiko in my computer. My 
PC running on window 10 64 bits. I have investigate this issue via internet, 
there are a lot of solutions for this issue, after trying most of the steps, I 
still can't run this module, the major steps I have try are:


  1.
Install python ver 3.7.1 or 3.11.8 by itself or customer installation (changing 
the installation folder) and check add python to the path.
  2.
pip install paramiko, if ver 3.7.1 installed, need to upgrade the pip version.
  3.
Checking the environment path, there are two path related to the python, one 
for python.exe, the other for \Lib\site-packages\paramiko

can you please provide advice on this issue?



BR

Ken
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ModuleNotFoundError: No module named 'Paramiko'

2024-04-09 Thread Wenyong Wei via Python-list
hi Sravan,

Thanks for your response, checked and found there is only one python in my PC.




From: Sravan Kumar Chitikesi 
Sent: Tuesday, 9 April 2024 3:42 AM
To: Wenyong Wei 
Cc: [email protected] 
Subject: Re: ModuleNotFoundError: No module named 'Paramiko'

pip may be pointed to another python version. try to remove other python 
versions and re install pip

Regards,
Sravan Chitikesi
AWS Solutions Architect - Associate


On Mon, Apr 8, 2024 at 10:58 PM Wenyong Wei via Python-list 
mailto:[email protected]>> wrote:

Dear Sir/Madam,

Recently I encounter a problem that I can't import paramiko in my computer. My 
PC running on window 10 64 bits. I have investigate this issue via internet, 
there are a lot of solutions for this issue, after trying most of the steps, I 
still can't run this module, the major steps I have try are:


  1.
Install python ver 3.7.1 or 3.11.8 by itself or customer installation (changing 
the installation folder) and check add python to the path.
  2.
pip install paramiko, if ver 3.7.1 installed, need to upgrade the pip version.
  3.
Checking the environment path, there are two path related to the python, one 
for python.exe, the other for \Lib\site-packages\paramiko

can you please provide advice on this issue?



BR

Ken
--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list