Application Error (referenced error)

2005-08-01 Thread David Blomstrom
This is my first post on this list, and I'm new to
Python.

I downloaded a content management system called Plone
and get the following error message when I try to
start it:

Plone Controller - [Plone Status]: pythonw.exe -
Application Error
The instruction at "0x009d3f09" referenced memory at
"0x00cB". The memory could not be "read".
[EMAIL PROTECTED]

I uninstalled it, then reinstalled it again, witih the
same results. When I tried to start another Program in
the Plone folder, I got this error message:

"Windows is searching for runzope.bat. To locate the
file yourself, click Browse."

Do you have any idea what's causing this problem(s)
and how I can fix i?

Thanks.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Application Error (referenced error)

2005-08-01 Thread Brian Beck
David Blomstrom wrote:
> I downloaded a content management system called Plone
> and get the following error message when I try to
> start it:

Plone isn't a stand-alone application, it's a skin and collection of 
products for the Zope application server.  You'll have to get Zope up 
and running before you can use Plone.  See www.zope.org.  There are also 
specific mailing lists (on Gmane, www.gmane.org) dedicated to Zope, 
Plone, and their related packages.

-- 
Brian Beck
Adventurer of the First Order
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Application Error (referenced error)

2005-08-01 Thread Brian Beck
David Blomstrom wrote:
> This is my first post on this list, and I'm new to
> Python.

Oh, and I forgot to mention: welcome to Python and our community!

-- 
Brian Beck
Adventurer of the First Order
-- 
http://mail.python.org/mailman/listinfo/python-list


pycparser error or openSUSE error

2015-08-28 Thread Cecil Westerhof
When doing a ‘zypper update’ on openSUSE I get:
Installing: python-pycparser-2.12-8.2 
..[error]
Installation of python-pycparser-2.12-8.2 failed:
Error: Subprocess failed. Error: RPM failed: error: unpacking of archive failed 
on file /usr/lib/python2.7/site-packages/pycparser-2.12-py2.7.egg-info: cpio: 
rename failed - Is a directory
error: python-pycparser-2.12-8.2.noarch: install failed

Is this a Python error or an openSUSE error?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Error

2010-05-26 Thread William Miner
I¹m relative new to python and I puzzled by the following strange (to me)
behavior. I was taking pieces from two old scripts to build a new one. When
I began to debug it I got the following error message:

Traceback (most recent call last):
  File 
"/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/run_ex2gen_scan.py",
line 38, in 
if re.search('varm',line):
AttributeError: 'function' object has no attribute 'search'

This had worked in the previous script but not the new one. I noticed that
the new script had an additional line at the beginning (line 3)

#!/usr/bin/env python
import sys, math, os, shutil, commands, re, mpmath
from mpmath import *

When I deleted this line, the script ran. Why did the line

from mpmath import *

Trash the search function fro the regular expression module?

I¹m running Python 2.6.2 on  Mac running OS 10.6.3.

Thanks!

Buff Miner
-- 
Enig Associates, Inc.
Suite 500, Bethesda Crescent Bldg.
4600 East West Hwy
Bethesda, Maryland 20814
Tel:(301)680-8600
Fax:(301)680-8100

This message is intended only for the use of the intended recipient(s), and
it may be privileged and confidential. If you are not the intended
recipient, you are hereby notified that any review, retransmission,
conversion to hard copy, copying, circulation or other use of this message
is strictly prohibited and may be illegal. If you are not the intended
recipient, please notify the sender immediately by return e-mail, and delete
this message from your system. Thank you.


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


error

2006-09-12 Thread prashant.burghate


Hi,

Today is my first day of working on python. I want to execute python
script through C++ program. I found one very good article with example
at http://docs.python.org/ext/pure-embedding.html.
I followed the procedure as given, the code is compiled but while
running it is giving error like:
ImportError: No module named multiply
Failed to load "multiply"

Here are the steps I followed, please suggest where I am wrong and how
can I remove the above error.

Step 1: Copied the given C program into a file called test.cpp (using vi
editor)
Step 2: Compiled it using : g++ test.cpp  /usr/lib/libpython2.4.so
(created a.out)
Step 3: Wrote the given script of multipication in a file named as
multiply (using vi editor)
Step 4: But while running the program using :./a.out multiply
multiply 3 2
  Getting this error:   ImportError: No
module named multiply
  Failed to
load "multiply"

Please help me out.

Thanks & Regards,
Prashant Burghate
Project Engineer,
Embedded Systems,
Wipro Technologies, Pune.
Tel: +91-20-22933700 Extn: 51570
Mob. # 9850428252
Email: [EMAIL PROTECTED]


The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Error

2006-12-12 Thread dominis
Your message was undeliverable due to the following reason:

Your message was not delivered because the destination server was
unreachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.

Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.

Your message could not be delivered within 2 days:
Host 216.78.202.45 is not responding.

The following recipients did not receive this message:


Please reply to [EMAIL PROTECTED]
if you feel this message to be in error.

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

Error

2005-11-13 Thread danger
hi everybody, i have a problem with py2exe that gives me this error:

ImportError: could not import pango
ImportError: could not import pango
Traceback (most recent call last):
  File "acqua.py", line 40, in ?
  File "gtk\__init__.pyc", line 113, in ?
AttributeError: 'module' object has no attribute 'Font'

does anybody knows how to solve it?

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


Error

2005-07-30 Thread steve
The message cannot be represented in 7-bit ASCII encoding and has been sent as 
a binary attachment.


--  Virus Warning Message (on cse.iitkgp.ernet.in)

file.bat is removed from here because it contains a virus.

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

Error

2005-03-31 Thread Bounced mail
The original message was received at Thu, 31 Mar 2005 14:40:33 +0200 from 
python.org [34.34.108.175]

- The following addresses had permanent fatal errors -


- Transcript of the session follows -
... while talking to 136.158.179.151:
>>> DATA
<<< 400-aturner; -RMS-E-CRE, ACP file create failed
<<< 400-aturner; -SYSTEM-F-EXDISKQUOTA, disk quota exceeded
<<< 400

  Virus Warning Message 
The virus W32/[EMAIL PROTECTED] was detected in the attachment message.pif. The 
attached File message.pif has
been removed. For questions please contact the Helpdesk.

Er is een virus W32/[EMAIL PROTECTED] gevonden in de attachement/bijlage 
message.pif. De message.pif is verwijderd.
Voor meer informatie raadpleeg de speciale FAQ onder "Customer Services" -> 
"Helpdesk" op www.upc.nl.

Un virus W32/[EMAIL PROTECTED] a été détecté dans le fichier inclus 
message.pif.  Le fichier message.pif est
enlevé. Pour toutes questions cliquez sur le lien ci-dessous.

Er is een virus W32/[EMAIL PROTECTED] gevonden in de bijlage message.pif. De 
bijlage message.pif is verwijderd.
Voor vragen kunt u klikken op de link hieronder.

Et virus W32/[EMAIL PROTECTED] har blitt oppdaget i et vedlegg. Vedlegget 
message.pif har blitt fjernet. Har du
spørsmål ber vi deg klikke på linken under. 

Ett virus W32/[EMAIL PROTECTED] hittades i den bifogade filen message.pif. 
Filen message.pif har förstörts. För
mer information klicka på nedanstående länk.

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

error

2005-01-24 Thread me
whenever i try and run my Python GUI, my computer thinks for a sec, then
drops the process, without ever displaying the window. the command prompt
window seems to work fine, but the IDLE GUI won't start.

i'm running Windows 2K professional and python 2.4, so any advice help would
be appreciated. i've already tried reinstalling and use a thread response,
as the e-mail on this account is bogus.


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


error

2006-04-24 Thread [EMAIL PROTECTED]
Anyone know what this error means?

C:/Python24/pythonw.exe -u  "C:/Python24/MyProjects/HeadsUp/cls_Bot.py"
  File "C:/Python24/MyProjects/HeadsUp/cls_Bot.py", line 10246
elif handname == 'straightflush':
SystemError: com_backpatch: offset too large

thanks

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


Error

2008-10-21 Thread Amie
Hi,

what does is the meaning of this error: int object is unsubscriptable.
This is the code that I have written that seems to give me that:

def render_sideMenu(self, ctx, data):
def render_dataAge(unit):
results = [(i[0], i[1]
) for i in unit]
return self.dataTable(["Unit Name", "Current Data Age"],
results, sortable=True),
return
self.enamel.,storage.getDataAge(int(self.arguments[0])).addCallback(render_dataAge)
--
http://mail.python.org/mailman/listinfo/python-list


error

2008-07-21 Thread Anish Chapagain
from Tkinter import *
root=Tk()
f=Frame(root,height=200,width=200)
b=Button(f,text="quit",command=f.quit)
f.pack()
root.mainloop()

--
from Tkinter import *
import sys
root=Tk()
f=Frame(root,height=200,width=200)
b=Button(f,text="quit",command=sys.exit)
f.pack()
root.mainloop()

I am wondering that why the button after clikcing is not closing the
window..please any suggestion..
i tries command=f.quit, sys.quit also..
if there is something i'm missing please help
--
http://mail.python.org/mailman/listinfo/python-list


Error

2016-03-13 Thread Abeer Sohail
I get this error every time I open Python.
-- 
https://mail.python.org/mailman/listinfo/python-list


error

2015-09-02 Thread jorge . conrado

Hi,


I have a Python version: Python 2.7.8

I'm runing it on: Fedora release 21


Yesterday I a sent a question:


I'm starting in the Python scripts. I run this script:


import numpy as np

import netCDF4

f = netCDF4.Dataset('uwnd.mon.ltm.nc','r')


f.variables


and I had the message:


netcdf4.py
Traceback (most recent call last):
   File "", line 1, in 
NameError: name 'netcdf4' is not defined


I had two answers to my question. But I could not understand them. I 
don't have expericence with Python. So I downloaded from the Web a code 
to calcluate the dew point temperature:



import sys
import numpy as np

# approximation valid for
# 0 degC < T < 60 degC
# 1% < RH < 100%
# 0 degC < Td < 50 degC

# constants
a = 17.271
b = 237.7 # degC

# sys.argv[0] is program name
T=float(sys.argv[1])
RH=float(sys.argv[2])


def dewpoint_approximation(T,RH):

Td = (b * gamma(T,RH)) / (a - gamma(T,RH))

return Td


def gamma(T,RH):

g = (a * T / (b + T)) + np.log(RH/100.0)

return g


Td = dewpoint_approximation(T,RH)
print 'T, RH',T,RH
print 'Td=',Td


Then I run it and I had the message:

p2.py


Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'p2' is not defined


Like the same error that I had for my first run.

Please, someone can help me. I have a commercial software and I would 
like to use Python.


In advance. Thanks,

Conrado

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


Error

2015-12-21 Thread Amaan Hussain
Hello.
I get an error saying "api-ms-win-crt-runtime-l1-1-0.dll is missing"
Can you tell me how to fix this.
Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Error

2016-02-03 Thread Russell McCune via Python-list
Hi 

So I have installed python 3.5.1 (32-bit) for my windows 10 PC. I have also 
installed the IDE pycharm 5 to go along with it. Now my problem is when I run 
pycharm the 'Modify Setup' window for python keeps popping up everytime I try 
to do anything in pycharm. I don't know if i installed it incorrectly or what. 
What am I doing wrong??

Thank you
Russell McCune
-- 
https://mail.python.org/mailman/listinfo/python-list


error

2013-11-27 Thread speen saba
Hello there,
   I am attending the lectures, and written the codes according to lectures. 
Professor's codes are working fine, but my one gives an error. I am new to 
python. Please it's a humble request, just be easy on me while making me 
understand about the code. It will be much appreciated.



import math
##points as lists
def addPoints(p1, p2):
r = []
r.append(p1[0]+p2[0])
r.append(p1[1]+p2[1])
return r

p = [1,2]
q = [3,1]
r = addPoints(p,q)
print r

 ##points as classes

class cartesianPoint():
  pass

cp1 = cartesianPoint()
cp2 = cartesianPoint()
cp1.x = 1.0
cp1.y = 2.0
cp2.x = 3.0
cp2.y = 1.0

def samePoint(p1,p2):
  return (p1.x == p2.x) and (p1.y == p2.y)

def printPoint(p):
  print '(' + str(p.x) + ', ' +str(p.y) + ')'

class polarPoint:
  pass
pp1 = polarPoint()
pp2 = polarPoint()
pp1.radius = 1.0
pp1.angle = 0
pp2.radius = 2.0
pp2.angle = math.pi / 4.0


class cPoint():
  def __init__(self,x,y):
self.x = x
self.y = y
self.radius = math.sqrt(self.x*self.x + self.y*self.y)
self.angle = math.atan2(self.y, self.x)
  def cartesian(self):
return (self.x, self.y)
  def polar(self):
return (self.radius, self.angle)
  def __str__(self):
return '(' + str(self.x) + ', ' + str(self.y) + ')'
  def __cmp__(self,other):
return (self.x == other.x) and (self.y == other.y)


And below is the error. Evrything works fine untill class polar point, but when 
I try to pick point (instance) p in the list i.e x,y (1,2,3,1). It does not 
work. I mean p.x gets the error where it should give me the value of x. And i 
know this error will go all the way down to def__cmp if i dont fic it from top.


   >>> p.x

Traceback (most recent call last):
  File "", line 1, in 
p.x
AttributeError: 'list' object has no attribute 'x'
>>> p.y

Traceback (most recent call last):
  File "", line 1, in 
p.y
AttributeError: 'list' object has no attribute 'y'

Help will be much appreciated, thanks in advance.
-- 
https://mail.python.org/mailman/listinfo/python-list


error

2012-11-06 Thread inshu chauhan
I am getting this error while running my programme.. :

error: index is out of range

 I cannot find a valid reason for it in my prog can somebody suggest what
may be possible reasons for this error..

The part of the code is :

def addpoints (data, points, ix, iy): # makes a list of relevant points
if 0 < ix < data.width and 0 < iy < data.height:
point = data[ix, iy]
if point != (0.0, 0.0, 0.0):
points.append(point)
return points

for dx in xrange(-mask_size2, mask_size2 + 1):
for dy in xrange(-mask_size2, mask_size2 + 1):
ix, iy = x + dx, y + dy
addpoints(data, points, ix , iy )
-- 
http://mail.python.org/mailman/listinfo/python-list


Error

2012-11-14 Thread inshu chauhan
for this code m getting this error :

CODE :
def ComputeClasses(data):
radius = .5
points = []
for cy in xrange(0, data.height):
for cx in xrange(0, data.width):
if data[cy,cx] != (0.0,0.0,0.0):
centre = data[cy, cx]
points.append(centre)


change = True

while change:

for ring_number in xrange(1, 1000):
change = False
new_indices = GenerateRing(cx, cy, ring_number)


for idx in new_indices:
point = data[idx[0], idx[1]]

if point == (0.0, 0.0, 0.0 ):
  continue
else:
dist = distance(centre, point)
if  dist < radius :
print point
points.append(point)
change = True
print change


break


ERROR :
Traceback (most recent call last):
  File "Z:\modules\classification2.py", line 74, in 
ComputeClasses(data)
  File "Z:\modules\classification2.py", line 56, in ComputeClasses
dist = distance(centre, point)
UnboundLocalError: local variable 'centre' referenced before assignment

And i am unable to understand .. WHY ?
-- 
http://mail.python.org/mailman/listinfo/python-list


error

2022-10-22 Thread ishar jaiswal
my problem is not solving i sended you a message when i open python there
one error comes. then you why not taking action
[image: Screenshot (2).png]
-- 
https://mail.python.org/mailman/listinfo/python-list


error

2018-12-16 Thread Prasanna kumar


Sir/mam,
Fatal error in launcher: Unable to create process using   this is error which I 
am not getting clear with it . so, I request you to help me it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Error

2020-08-17 Thread Thiên Nguyễn Thanh
Hi,
I'm just starting to learn python.
I try to install a socketio library.
I got the following error
[image: image.png]
Please answer me with a detailed guide on how to solve the above problem!!
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Error

2020-12-06 Thread Barry Fitzgerald via Python-list
Good day,"

I purchased a book for my son and followed the directions to a T. (Coding Games 
in Python)
Whenever I got to the point of of moving the "hello" file over to pgzrun is 
where my trouble began.
Its not finding a path because I'm getting this "pgzrun is not recognized as an 
internal or external command".

I've uninstall reinstall and tried to trouble shoot offline.  I' believe its a 
"path" issue but that is a little over my head.  At least this is what I've 
read.  Yes I selected all users and the variables options on custom install.

Any Suggestions?


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


error

2021-01-27 Thread Maziar Ghasemi
Hi
i`m use eric6 to python 3.9.1 . when open eric see this:
Warning: translation file 'git_en_US' could not be loaded.
Using default.
and when i try to do repair`s python I see:
"C:/user/mazya/AppData/Local/programs/python/python39/python39.dll
Verify that you have access to that directory."
Please advise me how to resolve this error
-- 
mazyar ghasemi
MS student of Razi university
-- 
https://mail.python.org/mailman/listinfo/python-list


error

2019-07-27 Thread
다운로드를  하고 있는데 파이썬이 열리지가 않습니다.다운로드를 하고 있는 도중에 문제가 난듯이 파이썬이 안 열립니다.

Windows 10용 메일에서 보냄

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


Error

2019-09-12 Thread Courtney Mark
Hi

I am a brand new user.

I cannot type onto a shell window or a code window.

Kind Regards
Courtney

Sent from Mail for Windows 10

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


error

2020-01-13 Thread Barış AVCI
Kivy does not support python3.8

Saygılarımla,

Barış AVCI
Bakım Sorumlusu
[Açıklama: Açıklama: Açıklama: logo]
MAZSAN Makina İmalat San.ve Tic.Ltd.Şti.
İstanbul Anadolu Yakası Org. San. Böl.
2.Sanayi Cad.No:1 Tepeören-Tuzla İSTANBUL
TÜRKİYE-34953
Tel  : +90(216) 593 00 40
Fax : +90(216) 593 00 39

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


Re: pycparser error or openSUSE error

2015-08-28 Thread Laura Creighton
In a message of Sat, 29 Aug 2015 00:51:57 +0200, Cecil Westerhof writes:
>When doing a ‘zypper update’ on openSUSE I get:
>Installing: python-pycparser-2.12-8.2 
>......[error]
>Installation of python-pycparser-2.12-8.2 failed:
>Error: Subprocess failed. Error: RPM failed: error: unpacking of archive 
>failed on file /usr/lib/python2.7/site-packages/pycparser-2.12-py2.7.egg-info: 
>cpio: rename failed - Is a directory
>error: python-pycparser-2.12-8.2.noarch: install failed
>
>Is this a Python error or an openSUSE error?
>
>-- 
>Cecil Westerhof
>Senior Software Engineer
>LinkedIn: http://www.linkedin.com/in/cecilwesterhof

SuSe is complaining.

You almost certainly have this problem.

https://joshua.hoblitt.com/rtfm/2013/05/dealing_with_rpm_cpio_rename_package_installupdate_errors/

Laura

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


Re: pycparser error or openSUSE error

2015-08-28 Thread Laura Creighton
In a message of Sat, 29 Aug 2015 01:22:54 +0200, Laura Creighton writes:
>In a message of Sat, 29 Aug 2015 00:51:57 +0200, Cecil Westerhof writes:
>>When doing a ‘zypper update’ on openSUSE I get:
>>Installing: python-pycparser-2.12-8.2 
>>......[error]
>>Installation of python-pycparser-2.12-8.2 failed:
>>Error: Subprocess failed. Error: RPM failed: error: unpacking of archive 
>>failed on file 
>>/usr/lib/python2.7/site-packages/pycparser-2.12-py2.7.egg-info: cpio: rename 
>>failed - Is a directory
>>error: python-pycparser-2.12-8.2.noarch: install failed
>>
>>Is this a Python error or an openSUSE error?
>>
>>-- 
>>Cecil Westerhof
>>Senior Software Engineer
>>LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>
>SuSe is complaining.
>
>You almost certainly have this problem.
>
>https://joshua.hoblitt.com/rtfm/2013/05/dealing_with_rpm_cpio_rename_package_installupdate_errors/
>
>Laura

'Almost certainly' was overstating it.  (Just got home after beers
with friends).  The other good way I know to get this one is
for that directory to already be there, or be a symlink to another
device.  The packager manager ought to be a lot smarter, but it
defaults to 'panic, panic, die' ... when it sees something it didn't
expect.

Laura  (more correct though still far from sober)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pycparser error or openSUSE error

2015-08-31 Thread Cecil Westerhof
On Saturday 29 Aug 2015 01:22 CEST, Laura Creighton wrote:

> In a message of Sat, 29 Aug 2015 00:51:57 +0200, Cecil Westerhof
> writes:
>> When doing a ‘zypper update’ on openSUSE I get: Installing:
>> python-pycparser-2.12-8.2
>> ......[error]
>> Installation of python-pycparser-2.12-8.2 failed: Error: Subprocess
>> failed. Error: RPM failed: error: unpacking of archive failed on
>> file
>> /usr/lib/python2.7/site-packages/pycparser-2.12-py2.7.egg-info:
>> cpio: rename failed - Is a directory error:
>> python-pycparser-2.12-8.2.noarch: install failed
>>
>> Is this a Python error or an openSUSE error?
>>
>> -- 
>> Cecil Westerhof
>> Senior Software Engineer
>> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>
> SuSe is complaining.
>
> You almost certainly have this problem.
>
> https://joshua.hoblitt.com/rtfm/2013/05/dealing_with_rpm_cpio_rename_package_installupdate_errors/

Something to delve into. But the problem went away again. It took a
few days, but I suppose they solved it at openSUSE. But next time I
can solve it maybe a bit sooner by myself. :-D

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pycparser error or openSUSE error

2015-08-31 Thread Cecil Westerhof
On Saturday 29 Aug 2015 01:30 CEST, Laura Creighton wrote:

> In a message of Sat, 29 Aug 2015 01:22:54 +0200, Laura Creighton
> writes:
>> In a message of Sat, 29 Aug 2015 00:51:57 +0200, Cecil Westerhof
>> writes:
>>> When doing a ‘zypper update’ on openSUSE I get: Installing:
>>> python-pycparser-2.12-8.2
>>> ......[error]
>>> Installation of python-pycparser-2.12-8.2 failed: Error:
>>> Subprocess failed. Error: RPM failed: error: unpacking of archive
>>> failed on file
>>> /usr/lib/python2.7/site-packages/pycparser-2.12-py2.7.egg-info:
>>> cpio: rename failed - Is a directory error:
>>> python-pycparser-2.12-8.2.noarch: install failed
>>>
>>> Is this a Python error or an openSUSE error?
>>>
>>> -- 
>>> Cecil Westerhof
>>> Senior Software Engineer
>>> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>>
>> SuSe is complaining.
>>
>> You almost certainly have this problem.
>>
>> https://joshua.hoblitt.com/rtfm/2013/05/dealing_with_rpm_cpio_rename_package_installupdate_errors/
>>
>> Laura
>
> 'Almost certainly' was overstating it.  (Just got home after beers
> with friends).  The other good way I know to get this one is
> for that directory to already be there, or be a symlink to another
> device.  The packager manager ought to be a lot smarter, but it
> defaults to 'panic, panic, die' ... when it sees something it didn't
> expect.

It looks like they made it more smart: the error went away. ;-)


> Laura  (more correct though still far from sober)

Nothing wrong with letting your hair loose now and then.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


How to decipher error "Nonetype" Error

2015-09-02 Thread kbtyo
I am currently using Jupyter and Pythopn 3.4. I am currently using the 
following script to parse and convert XML data structures, nested in a CSV - 
formatted file, convert into a dictionary and then append write it back into 
the same CSV. I am using the following (I added comments to explain the thought 
process): 

https://gist.github.com/ahlusar1989/de2381c1fb77e96ae601

However, when I hit line 40 (referencing the gist), I receive the following 
error:

---
TypeError Traceback (most recent call last)
 in ()
 23 # to ensure that the field names in the XML don't match (and 
override) the
 24 # field names already in the dictionary
---> 25 row.update(xml_data)
 26 # ensure that the headers have all the right fields
 27 headers.update(row.keys())

TypeError: 'NoneType' object is not iterable 

I can only infer I am passing or converting an empty key or empty row. I 
welcome feedback.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decipher error "Nonetype" Error

2015-09-02 Thread Chris Angelico
On Thu, Sep 3, 2015 at 8:15 AM, kbtyo  wrote:
> However, when I hit line 40 (referencing the gist), I receive the following 
> error:
>
> ---
> TypeError Traceback (most recent call last)
>  in ()
>  23 # to ensure that the field names in the XML don't match (and 
> override) the
>  24 # field names already in the dictionary
> ---> 25 row.update(xml_data)
>  26 # ensure that the headers have all the right fields
>  27 headers.update(row.keys())
>
> TypeError: 'NoneType' object is not iterable
>
> I can only infer I am passing or converting an empty key or empty row. I 
> welcome feedback.

NoneType is the type of the singleton object None. So what this means
is that xml_data is None at this point.

In your just_xml_data() function, which is what provides xml_data at
that point, there are two code branches that matter here: one is the
"else: return xml", and the other is the implicit "return None" at the
end of the function. If you catch an exception, you print out a
message and then allow the function to return None. Is that really
your intention? It seems an odd way to do things, but if that is what
you want, you'll need to cope with the None return in the main
routine.

BTW, your gist has a couple of non-comments on lines 48 and 49. If you
can make sure that your code is functionally correct, it'll be easier
for us to test. (Even more so if you can include a sample input file
in the gist, though preferably not a huge one.) At the moment, I'm
just eyeballing the code itself, but if someone can actually run the
script and reproduce the exact error you're seeing, it makes debugging
that much easier.

All the best!

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


Re: How to decipher error "Nonetype" Error

2015-09-02 Thread John Gordon
In <6c0af13a-a07d-4c29-b1fd-dd53768e6...@googlegroups.com> kbtyo 
 writes:

> https://gist.github.com/ahlusar1989/de2381c1fb77e96ae601

Are you sure this is the actual code you're running?  Lines 48 and 49 are
clearly meant to be comments, but they do not begin with a hash sign.

-- 
John Gordon   A is for Amy, who fell down the stairs
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

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


Re: How to decipher error "Nonetype" Error

2015-09-02 Thread kbtyo
On Wednesday, September 2, 2015 at 6:29:05 PM UTC-4, Chris Angelico wrote:
> On Thu, Sep 3, 2015 at 8:15 AM, kbtyo wrote:
> > However, when I hit line 40 (referencing the gist), I receive the following 
> > error:
> >
> > ---
> > TypeError Traceback (most recent call last)
> >  in ()
> >  23 # to ensure that the field names in the XML don't match 
> > (and override) the
> >  24 # field names already in the dictionary
> > ---> 25 row.update(xml_data)
> >  26 # ensure that the headers have all the right fields
> >  27 headers.update(row.keys())
> >
> > TypeError: 'NoneType' object is not iterable
> >
> > I can only infer I am passing or converting an empty key or empty row. I 
> > welcome feedback.
> 
> NoneType is the type of the singleton object None. So what this means
> is that xml_data is None at this point.
> 
> In your just_xml_data() function, which is what provides xml_data at
> that point, there are two code branches that matter here: one is the
> "else: return xml", and the other is the implicit "return None" at the
> end of the function. If you catch an exception, you print out a
> message and then allow the function to return None. Is that really
> your intention? It seems an odd way to do things, but if that is what
> you want, you'll need to cope with the None return in the main
> routine.
> 
> BTW, your gist has a couple of non-comments on lines 48 and 49. If you
> can make sure that your code is functionally correct, it'll be easier
> for us to test. (Even more so if you can include a sample input file
> in the gist, though preferably not a huge one.) At the moment, I'm
> just eyeballing the code itself, but if someone can actually run the
> script and reproduce the exact error you're seeing, it makes debugging
> that much easier.
> 
> All the best!
> 
> ChrisA

Hi Chris:

I made changes to the gist: 
https://gist.github.com/ahlusar1989/de2381c1fb77e96ae601

Ahh  Thanks for catching that. No, I want to skip over the Exception 
and return the xml_data in the try block. I didn't realize that was the 
behaviour. I don't want to break the iterative loop. Any advice on how to 
absolve this?

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


Error codes

2024-08-11 Thread Charlotte Plant via Python-list
Hiya, I'm using the sims 4 mod constructor by Zerbu, and when saving I'm 
getting these error codes.
I'm going around in circles trying to figure out what is causing it, and I'm 
stuck!
Can you help please?
Thank you.
Errors:
There was an error compiling the generated Python script. This can happen if 
you tried to install Python but the isntallation was interrupted. Please try 
running the installer again. It should be located in the "Python Installer" 
subfolder of where you extracted Mod Constructor.
Element ID: (No Element)
Element Name: (No Element)
---

Could not find file 'C:\Users\Charl\OneDrive\Documents\The Sims 4 Mod 
Constructor\Projects\MetalMummysMods_Ehlers-DanlosMod\Python\__pycache__\MetalMummysMods_Ehlers-DanlosMod.cpython-37.pyc'.
Element ID: (No Element)
Element Name: (No Element)
---




Sent from Outlook for iOS<https://aka.ms/o0ukef>
-- 
https://mail.python.org/mailman/listinfo/python-list


pywintypes error

2009-11-30 Thread koranthala
Hi,
   When I try to use Django with Apache and mod_python, I am facing an
issue. Since this is a very usual configuration, I hope this issue is
already solved.
   My web sites fail with the following error :

"C:\\Python24\\Lib\\site-packages\\win32\\lib\\pywintypes.py", line
124, in?\n __import_pywin32_system_module__("pywintypes", globals())
[Mon Nov 30 15:13:50 2009] [error] [client 127.0.0.1] File"C:\
\Python24\\Lib\\site-packages\\win32\\lib\\pywintypes.py", line 114,
in__import_pywin32_system_module__\n assert sys.modules[modname]
isold_mod
[Mon Nov 30 15:13:50 2009] [error] [client 127.0.0.1] AssertionError

I checked the code in pywintypes and it is a sure assertion error:

old_mod = sys.modules[modname]
# Python can load the module
mod = imp.load_dynamic(modname, found)
# Check the sys.modules[] behaviour we describe above is true...
if sys.version_info < (3,0):
assert sys.modules[modname] is old_mod
assert mod is old_mod
else:
assert sys.modules[modname] is not old_mod
assert sys.modules[modname] is mod
# as above - re-reset to the *old* module object then update
globs.
sys.modules[modname] = old_mod
globs.update(mod.__dict__)

I have python 2.4 so, it goes to the first check and fails. Has
anyone else faced this issue? How to solve the same?
-- 
http://mail.python.org/mailman/listinfo/python-list


MySQL Error

2010-01-01 Thread Victor Subervi
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally threw
this error:

Traceback (most recent call last):
  File "/var/www/html/angrynates.com/cart/createAssociations2.py", line 137,
in ?
createAssociations2()
  File "/var/www/html/angrynates.com/cart/createAssociations2.py", line 108,
in createAssociations2
cursor.execute(sql)
  File "/usr/lib64/python2.4/site-packages/MySQLdb/cursors.py", line 163, in
execute
self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.4/site-packages/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, "Table 'test.productsAssociations' doesn't exist")

However, "ProgrammingError" is not an error. How do I discover the real
error, so I can write the appropriate except statement?
TIA,
beno

-- 
The Logos has come to bear
http://logos.13gems.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


ctypes error

2010-01-14 Thread Gib Bogle
I have a simple demo program (on Windows XP) that uses the ctypes module to load 
a DLL.  This program works as expected with Python 2.5.4, but fails with Python 
2.6.4 (on a different machine, each machine has only one Python version 
installed), with these messages:


File "demo.py", line 37, in 
  mydll = windll.LoadLibrary("DEMO.DLL")
File "c:\python26\lib\ctypes\__init__.py, line 431, in LoadLibrary
  return self._dlltype(name)
File "c:\python26\lib\ctypes\__init__.py, line 353, in __init__
  self._handle = _dlopen(self._name, mode)
WindowsError: [Error 14001] This application has failed to start because the 
application configuration is incorrect.  Reinstalling the application may fix 
this problem


It isn't clear to me what the "application" is.  As far as I know I didn't 
install anything except Python 2.6.4.  Is it possible that ctypes doesn't work 
with 2.6.4?

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


easy_install error ...

2010-01-24 Thread tekion
All,
I am running into issue with easy install error, see error below:
python setup.py easy_install -m 'docutils==0.4'
running easy_install
error: Not a URL, existing file, or requirement spec:
"'docutils==0.4'"

any idea as to why?  thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


ftp.storlines error

2010-01-31 Thread Mik0b0
Good day/night/etc.
I am rather a newb in Python (learning Python 3). I am trying to
create a small script for FTP file uploads  on my home network. The
script looks like this:

from ftplib import FTP
ftp=FTP('10.0.0.1')
ftp.login('mike','*')
directory='/var/www/blabla/'
ftp.cwd(directory)
ftp.retrlines('LIST')
print('<- - - - - - - - - >')
file_to_change='test'
file=1
file=open(file_to_change,'w')
text='test'
file.write(text)
ftp.storlines('STOR ' + file_to_change,file)
ftp.retrlines('LIST')
file.close()

The output is like this:
Traceback (most recent call last):
  File "ftp.py", line 13, in 
ftp.storlines('STOR ' + file_to_change,i)
  File "/usr/lib/python3.1/ftplib.py", line 474, in storlines
buf = fp.readline()
IOError: not readable

What is wrong?
-- 
http://mail.python.org/mailman/listinfo/python-list


UnicodeEncode Error ?

2009-03-11 Thread Rama Vadakattu
While doing the below

1) fetch  html page
2) extract title using BeatifulSoup
3) Save into the database.

iam getting the below error (at the bottom).

Few observations which i had:
 1) type of variable which holds this title is 
 2) iam getting this problem when the title has character whose
ordinal value > 128

I searched in google and tried various suggestions but none of them is
working.And also i couldnot able to understand the rootcause for such
a kind of behaviour.

What will be the root cause for such a kind of problem?Any hint on how
to resolve this error?

~~~
Error
--
Traceback (most recent call last):
  File "fetchcron.py", line 11, in 
cmanager.triggerfetchFeed()
  File "/home/rama/djangoprojects/socialreader/views.py", line 40, in
triggerfetchFeed
self.fetchFeed(furl)
  File "/home/rama/djangoprojects/socialreader/views.py", line 102, in
fetchFeed
ne.save()
  File "/usr/lib/python2.5/site-packages/django/db/models/base.py",
line 311, in save
self.save_base(force_insert=force_insert,
force_update=force_update)
  File "/usr/lib/python2.5/site-packages/django/db/models/base.py",
line 383, in save_base
result = manager._insert(values, return_id=update_pk)
  File "/usr/lib/python2.5/site-packages/django/db/models/manager.py",
line 138, in _insert
return insert_query(self.model, values, **kwargs)
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py",
line 894, in insert_query
return query.execute_sql(return_id)
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/
subqueries.py", line 309, in execute_sql
cursor = super(InsertQuery, self).execute_sql(None)
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/
query.py", line 1734, in execute_sql
cursor.execute(sql, params)
  File "/usr/lib/python2.5/site-packages/django/db/backends/util.py",
line 19, in execute
return self.cursor.execute(sql, params)
  File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/
base.py", line 83, in execute
return self.cursor.execute(query, args)
  File "/var/lib/python-support/python2.5/MySQLdb/cursors.py", line
151, in execute
query = query % db.literal(args)
  File "/var/lib/python-support/python2.5/MySQLdb/connections.py",
line 247, in literal
return self.escape(o, self.encoders)
  File "/var/lib/python-support/python2.5/MySQLdb/connections.py",
line 180, in string_literal
return db.string_literal(obj)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc9' in
position 1: ordinal not in range(128)
---
--
http://mail.python.org/mailman/listinfo/python-list


value error

2009-04-23 Thread Francesco Pietra
hi:
with script

data = open('134-176_rectified_edited.pdb', 'r')
outp = open('134-176_renumbered.pdb', 'w')

for L in data:
   if L[3] == 'M':
 L = L[:24] + "%4d" % (int(L[24-28])+133) + L[28:]
   outp.write(L)


i wanted to modify lines of the type:
ATOM  1 HH31 ACE 1   1.573   1.961   0.769  1.00  0.00   H

to add 133 to column 25, getting 134 there, and so on for next lines 2
-> 135, 3 -> 136, etc.


i must have heavily messed things because the file was not even read:

$ python renumber.py 134-176_rectified.pdb
Traceback (most recent call last):
  File "renumber.py", line 6, in 
L = L[:24] + "%4d" % (int(L[24-28])+133) + L[28:]
ValueError: invalid literal for int() with base 10: ''



thanks for having an expert look

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


Pythonwin.exe Error?!?

2009-09-05 Thread kennyken747
HELP! So apparently after installing EPD 5.0 (a python 2.5 dist) aside
my main Python installation (2.6) I started getting this error.

-Pure virtual function call

Whenever I open up ActiveState Python, it gets this runtime error
under pythonwin.exe

Already uninstalled EPD but am still getting this error. I've done
everything from re-install Python and ActiveState to deleting
everything in the registry to do with Python!!! I suggest that nobody
install that until they sort their problems out.

But for now, any help is appreciated.

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


indentation error

2010-03-05 Thread asit
Consider the following code

import stat, sys, os, string, commands

try:
pattern = raw_input("Enter the file pattern to search for :\n")
commandString = "find " + pattern
commandOutput = commands.getoutput(commandString)
findResults = string.split(commandOutput, "\n")
print "Files : "
print commandOutput
print "="
for file in findResults:
mode = stat.S_IMODE(os.lstat(file)[stat.ST_MODE])
print "\nPermissions for file", file, ":"
for level in "USR", "GRP", "OTH":
for perm in "R", "W", "X":
if mode & getattr(stat,"S_I"+perm+level):
print level, " has ", perm, " permission"
else:
print level, " does NOT have ", perm, "
permission"
except:
print "There was a problem - check the message above"


According to me, indentation is ok. but the python interpreter gives
an indentation error

[asit ~/py] $ python search.py
  File "search.py", line 7
findResults = string.split(commandOutput, "\n")
  ^
IndentationError: unindent does not match any outer indentation level
-- 
http://mail.python.org/mailman/listinfo/python-list


odd error

2010-03-09 Thread Alex Hall
Hi all,
In the same program I wrote about yesterday, I have a dictionary of
keystrokes which are captured. I just tried adding a new one, bringing
the total to 11. Here are entries 10 and 11; 10 has been working fine
for months.

  10 : (57, win32con.MOD_CONTROL),
  11 : (99, win32con.MOD_CONTROL | win32con.MOD_SHIFT)

Now, though, when I press ctrl-shift-c (keystroke 11), nothing
happens. Pressing any other keystroke after that will crash the
program with some sort of Python internal com server exception that I
have never seen before. When set to a keystroke I already use, such as
#10, the function called by #11 works just fine. Does anyone see a
problem with the above syntax? The trouble almost definitely has to be
there; again, using an already-working keystroke instead of making a
new one works perfectly, it is just when I add this new one that
things break.

-- 
Have a great day,
Alex (msg sent from GMail website)
mehg...@gmail.com; http://www.facebook.com/mehgcap
-- 
http://mail.python.org/mailman/listinfo/python-list


COM ERROR

2010-11-12 Thread Girish
Hello All,

I have an issue while accessing COM API of an application. I got
following error when I tried to run following command:

win32com.client.Dispatch()

  File "C:\Python25\Lib\site-packages\win32com\client\__init__.py",
line 95, in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 98, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 78, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147024882, 'Not enough storage is available to complete
this operation.', None, None)

Your help would be appreciated.

Thanks,
Girish.
-- 
http://mail.python.org/mailman/listinfo/python-list


urllib2 error

2010-11-17 Thread asit
I have this piece of code

import urllib2

proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/
JAN/cm01JAN2001bhav.csv.zip'
print 'processing', proc_url
req = urllib2.Request(proc_url)
res = urllib2.urlopen(req)

when i run this...following error comes

Traceback (most recent call last):
  File "C:/Python26/reqnse.py", line 92, in 
res = urllib2.urlopen(req)
  File "C:\Python26\lib\urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
  File "C:\Python26\lib\urllib2.py", line 395, in open
response = meth(req, response)
  File "C:\Python26\lib\urllib2.py", line 508, in http_response
'http', request, response, code, msg, hdrs)
  File "C:\Python26\lib\urllib2.py", line 433, in error
return self._call_chain(*args)
  File "C:\Python26\lib\urllib2.py", line 367, in _call_chain
result = func(*args)
  File "C:\Python26\lib\urllib2.py", line 516, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

would anyone help me why ??
-- 
http://mail.python.org/mailman/listinfo/python-list


apscheduler error

2011-01-07 Thread linna li
I tried to use the apscheduler and used the sample code below from the
tutorial, but got the error message: Exception in thread APScheduler
(most likely raised during interpreter shutdown). What's going on
here? I really appreciate any help!

from apscheduler.scheduler import Scheduler

sched = Scheduler()
sched.start()

def some_job():
print "Decorated job"

sched.add_interval_job(some_job,minutes=1)
-- 
http://mail.python.org/mailman/listinfo/python-list


compile() error

2010-05-19 Thread Iuri
>>> compile("for i in [1,2,3]:\n pass\n#end\n", "test_file.py", "exec")
 at 0x266a378, file "test_file.py", line 1>
>>> compile("for i in [1,2,3]:\n pass\n#end", "test_file.py", "exec")
Traceback (most recent call last):
File "", line 1, in 
File "", line 2, in cptest
File "test_file.py", line 3
#end
^
SyntaxError: invalid syntax

I guess these commands explain the problem.

Any ideas about what is happening?

Regards,
iuri
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error

2010-05-26 Thread Chris Rebert
On Wed, May 26, 2010 at 10:48 AM, William Miner  wrote:
> I’m relative new to python and I puzzled by the following strange (to me)
> behavior. I was taking pieces from two old scripts to build a new one. When
> I began to debug it I got the following error message:
>
> Traceback (most recent call last):
>   File
> "/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/run_ex2gen_scan.py",
> line 38, in 
> if re.search('varm',line):
> AttributeError: 'function' object has no attribute 'search'
>
> This had worked in the previous script but not the new one. I noticed that
> the new script had an additional line at the beginning (line 3)
>
> #!/usr/bin/env python
> import sys, math, os, shutil, commands, re, mpmath
> from mpmath import *
>
> When I deleted this line, the script ran. Why did the line
>
> from mpmath import *
>
> Trash the search function fro the regular expression module?

mpmath defines a function named re() which returns the real part of a
complex number. Because you used "import *", the existing value of the
global variable "re", which was the regular expression module, gets
clobbered with mpmath's re() function. Thus, you get that error when
you try to call the "search" method on what is now a function object.

This is precisely why using the `from foo import *` syntax is discouraged.

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error

2010-05-26 Thread MRAB

William Miner wrote:
I’m relative new to python and I puzzled by the following strange (to 
me) behavior. I was taking pieces from two old scripts to build a new 
one. When I began to debug it I got the following error message:


Traceback (most recent call last):
  File 
"/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/run_ex2gen_scan.py", 
line 38, in 

if re.search('varm',line):
AttributeError: 'function' object has no attribute 'search'

This had worked in the previous script but not the new one. I noticed 
that the new script had an additional line at the beginning (line 3)


#!/usr/bin/env python
import sys, math, os, shutil, commands, re, mpmath
from mpmath import *

When I deleted this line, the script ran. Why did the line

from mpmath import *

Trash the search function fro the regular expression module?

I’m running Python 2.6.2 on  Mac running OS 10.6.3.


When you write:

from mpmath import *

you're importing all the 'public' names (by which I mean those not
starting with '_') from the mpmath module.

The mpmath module happens to contain a function called 're', so 're'
will now refer to that function instead of the re module.

That's why using "import *" is usually a bad idea.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Error

2010-05-26 Thread D'Arcy J.M. Cain
On Wed, 26 May 2010 13:48:42 -0400
William Miner  wrote:
> #!/usr/bin/env python
> import sys, math, os, shutil, commands, re, mpmath
> from mpmath import *
> 
> When I deleted this line, the script ran. Why did the line
> 
> from mpmath import *
> 
> Trash the search function fro the regular expression module?

What is mpmath?  It isn't in the standard distribution.  My guess is
that it has an object called "re" that is overwriting the re module.

-- 
D'Arcy J.M. Cain  |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error

2010-05-26 Thread Gary Herron

On 05/26/2010 10:48 AM, William Miner wrote:
I'm relative new to python and I puzzled by the following strange (to 
me) behavior. I was taking pieces from two old scripts to build a new 
one. When I began to debug it I got the following error message:


Traceback (most recent call last):
  File 
"/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/run_ex2gen_scan.py", 
line 38, in 

if re.search('varm',line):
AttributeError: 'function' object has no attribute 'search'

This had worked in the previous script but not the new one. I noticed 
that the new script had an additional line at the beginning (line 3)


#!/usr/bin/env python
import sys, math, os, shutil, commands, re, mpmath
from mpmath import *

When I deleted this line, the script ran. Why did the line

from mpmath import *


Just a guess, (since I don;t have mpmath on hand), but if mpmath has a 
definition for something named re, it would overwrite any previous 
definition of re.


So general advice says don't use the "from xxx import *" unless you 
really *know* what is in the module, and need *all* of it imported.


Either:
  from mpmath import x,y,z,whatever

or
  import re
  import mpmath
  ... re.search ...
  ... mpmath.whatever ...



Gary Herron






Trash the search function fro the regular expression module?

I'm running Python 2.6.2 on  Mac running OS 10.6.3.

Thanks!

Buff Miner
--
Enig Associates, Inc.
Suite 500, Bethesda Crescent Bldg.
4600 East West Hwy
Bethesda, Maryland 20814
Tel:(301)680-8600
Fax:(301)680-8100

This message is intended only for the use of the intended 
recipient(s), and

it may be privileged and confidential. If you are not the intended
recipient, you are hereby notified that any review, retransmission,
conversion to hard copy, copying, circulation or other use of this message
is strictly prohibited and may be illegal. If you are not the intended
recipient, please notify the sender immediately by return e-mail, and 
delete

this message from your system. Thank you.



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


Re: Error

2010-05-26 Thread Alister
On Wed, 26 May 2010 11:09:58 -0700, Chris Rebert wrote:

> On Wed, May 26, 2010 at 10:48 AM, William Miner 
> wrote:
>> I’m relative new to python and I puzzled by the following strange (to
>> me) behavior. I was taking pieces from two old scripts to build a new
>> one. When I began to debug it I got the following error message:
>>
>> Traceback (most recent call last):
>>   File
>> "/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/
run_ex2gen_scan.py",
>> line 38, in 
>> if re.search('varm',line):
>> AttributeError: 'function' object has no attribute 'search'
>>
>> This had worked in the previous script but not the new one. I noticed
>> that the new script had an additional line at the beginning (line 3)
>>
>> #!/usr/bin/env python
>> import sys, math, os, shutil, commands, re, mpmath from mpmath import *
>>
>> When I deleted this line, the script ran. Why did the line
>>
>> from mpmath import *
>>
>> Trash the search function fro the regular expression module?
> 
> mpmath defines a function named re() which returns the real part of a
> complex number. Because you used "import *", the existing value of the
> global variable "re", which was the regular expression module, gets
> clobbered with mpmath's re() function. Thus, you get that error when you
> try to call the "search" method on what is now a function object.
> 
> This is precisely why using the `from foo import *` syntax is
> discouraged.
> 
> Cheers,
> Chris
I am fairly new to Python but had already decided to opt a style that  
would always use import XXX rather than the from XXX import * syntax.

It is nice to know that at least one of my decisions on best practice is 
good
 

as an old programmer (8 bit assembler for micro controller applications) 
picking up the baton again for fun I have to say Python is great
(I find C to be so low level I might just as well go back to assembler!).



-- 
"Linux doesn't support any sub-32-bit computers, and despite the 
occasional
 deranged people interested in retro-computing (ie Alan Cox) I doubt it
 seriously will.."

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


Tkinter error

2010-05-27 Thread ipatrol6010
I run a program (important parts at http://paste.pocoo.org/show/219148/) and 
all I get is this error: warning: callback failed in WindowList  : invalid command name ".45328424.windows"

Why?

P.S.: Please CC all replies to me, I don't watch the list



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


Hashbang error

2010-06-01 Thread pradeepbpin
I use gVim as an editor to create python scripts on a windows machine.
To run the same script on my ubuntu machine, I added a hashbang line
to the script. Now when I run this script from command line of ubuntu,
I get a bad interpreter error, like below

/usr/bin/python^M: bad interpreter: No such file or directory

This, I understand, is due to the interpretation of newline character
at the end of the hashbang.

I have checked and found out that this does not happen if I create the
script in Ubuntu with gVim.

Now, how can I avoid this error when I create the script on a windows
machine?
-- 
http://mail.python.org/mailman/listinfo/python-list


Unicode error

2010-07-23 Thread dirknbr
I am having some problems with unicode from json.

This is the error I get

UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in
position 61: ordinal not in range(128)

I have kind of developped this but obviously it's not nice, any better
ideas?

try:
text=texts[i]
text=text.encode('latin-1')
text=text.encode('utf-8')
except:
text=' '

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


sendmail error

2010-08-31 Thread sandric ionut


Hello:

I have a script for sending email from python (it is attached bellow). When I 
am 
launching the script I get the error:
TypeError: cannot concatenate 'str' and 'type' objects if I use sys.argv[1], 
but 
if I input from the begging an email address like "em...@email.com", the script 
is working OK

What could be the problem?

Thank you,

Ionut

import
mesaj = email.MIMEMultipart.MIMEMultipart()
fromEmail = sys.argv[
toEmail = os, sys, smtplib, email1]"toEmail"mesaj[
mesaj[
mesaj["From"] = fromEmail"To"] = toEmail"Subject"] = "Teste"mesaj[
atasament = r"Date"] = 
email.Utils.formatdate(localtime=True)"d:\Doc1.zip"atasamentP = 
email.MIMEBase.MIMEBase(
atasamentP.set_payload(open(atasament,
email.Encoders.encode_base64(atasamentP)
atasamentP.add_header(
mesaj.attach(atasamentP)
mesaj.attach(email.MIMEText.MIMEText(
smtpObj = 
smtplib.SMTP('application','zip')"rb").read())'Content-Disposition','attachement;
 filename="%s"'% os.path.basename(atasament))"Email transmis la data: ", 
email.Utils.formatdate(localtime=False)))"192.168.1.2")try
smtpObj.sendmail(fromEmail, toEmail, mesaj.as_string())
smtpObj.close():exceptsmtplib.SMTPException:print"eroare: "+ 
smtplib.SMTPException


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


Runtime error

2010-10-28 Thread Sebastian

Hi all,

I am new to python and I don't know how to fix this error. I only try to 
execute python (or a cgi script) and I get an ouptu like


[...]
'import site' failed; traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site.py", line 513, in 
main()
File "/usr/lib/python2.6/site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python2.6/site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
[...]
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 175, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/usr/lib/python2.6/site.py", line 76, in makepath
dir = os.path.abspath(os.path.join(*paths))
RuntimeError: maximum recursion depth exceeded


What is going wrong with my python install? What do I have to change?

Thanks,
Sebastian
--
http://mail.python.org/mailman/listinfo/python-list


Runtime Error

2010-10-28 Thread Sebastian

Hi all,

I am new to python and I don't know how to fix this error. I only try to 
execute python (or a cgi script) and I get an ouptu like


[...]
'import site' failed; traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site.py", line 513, in 
main()
File "/usr/lib/python2.6/site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python2.6/site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
[...]
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "", line 1, in 
File "/usr/lib/python2.6/site.py", line 175, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/usr/lib/python2.6/site.py", line 76, in makepath
dir = os.path.abspath(os.path.join(*paths))
RuntimeError: maximum recursion depth exceeded


What is going wrong with my python install? What do I have to change?

Thanks,
Sebastian
-- 
http://mail.python.org/mailman/listinfo/python-list


Error Trapping

2006-07-01 Thread JohnJohnUSA
I ran the following program to retrieve entries from the windows
registry on Windows XP:


import win32api, win32con
aReg = win32api.RegConnectRegistry(None,
win32con.HKEY_CURRENT_USER)
aKey = win32api.RegOpenKeyEx(aReg,
r"Software\Microsoft\Internet Explorer\PageSetup")
for i in range(100):
Name, Data, Type = win32api.RegEnumValue(aKey, i)
print "Index=(", i,") Name=[",
Name,"] Data=[",Data,"]
Type=[",Type,"]"
win32api.RegCloseKey(aKey)

This is the program output:

[code:1:8bb6fccb25]Index=( 0 ) Name=[ header ]
Data=[ &w&bPage &p of &P ] Type=[ 1
]
Index=( 1 ) Name=[ footer ] Data=[
&u&b&d ] Type=[ 1 ]
Index=( 2 ) Name=[ margin_bottom ] Data=[ 0.75
] Type=[ 1 ]
Index=( 3 ) Name=[ margin_left ] Data=[ 0.75
] Type=[ 1 ]
Index=( 4 ) Name=[ margin_right ] Data=[ 0.75
] Type=[ 1 ]
Index=( 5 ) Name=[ margin_top ] Data=[ 0.75
] Type=[ 1 ]

Traceback (most recent call last):
  File "F:/temp/Python Test Folder/Read Windows Registry
Entries (No error trapping).py", line 5, in -toplevel-
Name, Data, Type = win32api.RegEnumValue(aKey, i)
error: (259, 'PyRegEnumValue', 'No more data is
available.')[/code:1:8bb6fccb25]

I received an error because I tried to read past the last entry for
this key.  The following is a modified version of the program to trap
any error on key entry retrieval:

[code:1:8bb6fccb25]import win32api, win32con, sys
aReg = win32api.RegConnectRegistry(None,
win32con.HKEY_CURRENT_USER)
aKey = win32api.RegOpenKeyEx(aReg,
r"Software\Microsoft\Internet Explorer\PageSetup")
for i in range(100):
try:
Name, Data, Type = win32api.RegEnumValue(aKey, i)
print "Index=(", i,") Name=[",
Name,"] Data=[",Data,"]
Type=[",Type,"]"
except:
break
win32api.RegCloseKey(aKey)[/code:1:8bb6fccb25]

This is the program output:

[code:1:8bb6fccb25]Index=( 0 ) Name=[ header ]
Data=[ &w&bPage &p of &P ] Type=[ 1
]
Index=( 1 ) Name=[ footer ] Data=[
&u&b&d ] Type=[ 1 ]
Index=( 2 ) Name=[ margin_bottom ] Data=[ 0.75
] Type=[ 1 ]
Index=( 3 ) Name=[ margin_left ] Data=[ 0.75
] Type=[ 1 ]
Index=( 4 ) Name=[ margin_right ] Data=[ 0.75
] Type=[ 1 ]
Index=( 5 ) Name=[ margin_top ] Data=[ 0.75
] Type=[ 1 ][/code:1:8bb6fccb25]

The latter program will trap any error resulting from trying to
retrieve the key values.  What I want to do is to specifically trap
the error denoting that there is no more data available so I can
continue executing more code as oppose to aborting the program.  if
the error is something other than no more data available, then I want
to abort the program with an error message.

What code is needed to specifically trap the "no more data is
available" error?

Thank you in advance for your help!

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


import error

2006-07-31 Thread cheeky
Hi, all.

I now really like to program with Python, even though I'm a newbie. I
have difficulty in solving the following problem.

$ python
Traceback (most recent call last):
  File "x.py", line 6, in ?
import calendar, time
  File "time.py", line 5, in ?
now = time.time()
TypeError: 'module' object is not callable

I now see the above error message. The source code is the following.

$ cat -n x.py
 1  #!/usr/bin/python
 2
 3  import traceback
 4
 5  from datetime import date
 6  import calendar, time

I don't have the line now = time.time() which encountered an error in
the previous step. I removed that line but I still see the error.

Someone says I should reload time module. However, I can't even import
time module. That's why I can't even try to reload time module name.

What's wrong with me? I'm studying on Ubuntu Linux. On Window IDLE
doesn't seem to have this problem. I saw someone saying it could be
happening when running independent script. I don't know what is right.

I really would like to know what is going on my system and how to clear
the past information. Thank you.

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


error handling

2006-08-10 Thread Chris
I want to handle errors for a program i'm building in a specific way,
but I don't want to use try/except/finally because it requires forming
new blocks of code. I want to be able things like this:

a = [2, 423, "brownie", 234.34]
try: a[890]
except IndexError: # I don't use 'finally' here because I specifically
want to check for an IndexError
 sys.exit("That number is way too big!")

But sometimes you can have too many of these statements in your
program, and it starts to get tangled and nasty looking. Is there a way
I can modify sys.error so that when the interpreter comes accross an
IndexError it prints "That number is way too big!" before it exits?

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


path error

2007-07-20 Thread godavemon
I'm on an intel macbook using OS X 10.4 and for some reason my path is
being interpreted incorrectly.  See the example:

[EMAIL PROTECTED] pwd
/Users/dave/til/jared <- dirname = jared
[EMAIL PROTECTED] python
...
>>> import os
>>> os.path.abspath('')
'/Users/dave/til/Jared'   <- dirname = Jared


python is capitalizing my jared directory.  It has worked for a long
time but suddenly doesn't.  I'm working on the project over SVN, could
it be some kind  of incompatibility with someone who submitted using
windows or something?  Any solutions for this?

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


access error

2007-08-15 Thread Sreerama Veeranna
Hi all,
  
Sometimes, python gets crash by giving access error sometimes doesn’t.
Why is this?
 
 
Regards
Sreerama V

[ The information contained in this e-mail is confidential and is intended for 
the named recipient only. If you are not the named recipient, please notify us 
by telephone on +44 (0)1666 580 000 immediately, destroy the message and delete 
it from your computer. Silver Software has taken every reasonable precaution to 
ensure that any attachment to this e-mail has been checked for viruses. 
However, we cannot accept liability for any damage sustained as a result of any 
such software viruses and advise you to carry out your own virus check before 
opening any attachment. Furthermore, we do not accept responsibility for any 
change made to this message after it was sent by the sender.]
-- 
http://mail.python.org/mailman/listinfo/python-list

Tkinter error

2007-05-28 Thread BartlebyScrivener
Finally started trying to build a simple gui form for inserting text
data into a mysql db of quotations.

I found this nice Tkinter tutorial,

http://www.ibiblio.org/obp/py4fun/gui/tkPhone.html

but midway I'm getting an error.

from Tkinter import *

 >>> win = Tk()
>>> f = Frame(win)
>>> b1 = Button(f, "One")

Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1936, in __init__
Widget.__init__(self, master, 'button', cnf, kw)
  File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1859, in __init__
BaseWidget._setup(self, master, cnf)
  File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1839, in _setup
if cnf.has_key('name'):
AttributeError: 'str' object has no attribute 'has_key'

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


mysqlimport error

2007-06-07 Thread moishyyehuda
whey when I execute this statment
cursor.execute("""mysqlimport merchandise 1.txt""")
I get this error
ProgrammingError: (1064, "You have an error in your SQL syntax. Check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'mysqlimport merchandise 1.txt' at line 1")
  args = (1064, "You have an error in your SQL syntax. Check
the...se near 'mysqlimport merchandise 1.txt' at line 1")

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


win32con.client.constants error

2007-04-01 Thread Barry Newberger
I am working on a Outlook COM project. For some reason 
win32com.client.constants

quit working between runs of one of my test scripts.  It's supposed to 
acquire attributes for all constants defined in loaded COM servers 
through its __dicts__ attribute,and did for awhile

Now it is throwing an AttributeError:



PythonWin 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] 
on win32.

Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' 
for further copyright information.

Traceback (most recent call last):

  File 
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
 line 310, in RunScript

exec codeObject in __main__.__dict__

  File "C:\Documents and 
Settings\bnewberg\Desktop\mail_script\mail_move_init_test.py", line 22, 
in ?

msgFolderTypeConsts = {'Rcvd': constants.olFolderInbox, 'Sent': 
constants.olFolderSentMail}

  File "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line 
168, in __getattr__

raise AttributeError, a

AttributeError: olFolderInbox



Code snippet:
from win32com.client import gencache, constan

[SNIP]

class MSOutlook(object):

def __init__(self):

try:

self.oOutlookApp = 
gencache.EnsureDispatch("Outlook.Application")

self.outlookFound = True

except:

print "MSOutlook: unable to load Outlook"

self.outlookFound = False

if not self.outlookFound: return

[SNIP]

# Outlook default folder constants

   msgFolderTypeConsts = {'Rcvd': constants.olFolderInbox, 'Sent': 
constants.olFolderSentMail}

   folderSet = [yr, mo, msgType] #  Used to loop over folder tree.



 I am running Python 2.4.4 and pywin32-210. I tried reinstalling pywin 
without success.

 Thanks,

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


shelve error

2007-04-04 Thread 7stud
test1.py:

import shelve

s = shelve.open("/Users/me/2testing/dir1/aaa.txt")
s['x'] = "red"
s.close()
output:--

$ python test1.py
Traceback (most recent call last):
  File "test1.py", line 3, in ?
s = shelve.open("/Users/me/2testing/dir1/aaa.txt")
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/shelve.py", line 231, in open
return DbfilenameShelf(filename, flag, protocol, writeback,
binary)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/shelve.py", line 212, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol,
writeback, binary)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/anydbm.py", line 80, in open
raise error, "db type could not be determined"
anydbm.error: db type could not be determined
Exception exceptions.AttributeError: "DbfilenameShelf instance has no
attribute 'writeback'" in  ignored
-

What should I do to correct that error?

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


os.path.isfile() error

2007-04-07 Thread 7stud
Here's the code:

import os, os.path, pprint

mydir = "/Users/me/2testing"

files = [file for file in os.listdir(mydir)]
pprint.pprint(files)

print os.path.join(mydir, "helloWorld.py")

files = [file
for file in os.listdir(mydir)
if os.path.isfile(os.path.join(dir, file) )
]

pprint.pprint(files)
output:

['.DS_Store', 'cpTest', 'dir1', 'testfile1', 'xmlFile.xml']
/Users/me/2testing/helloWorld.py
Traceback (most recent call last):
  File "test1.py", line 16, in ?
files = [file
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/posixpath.py", line 62, in join
elif path == '' or path.endswith('/'):
AttributeError: 'builtin_function_or_method' object has no attribute
'endswith'

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


Syntax error

2007-04-17 Thread hg
Hi,

I've had this problem in the past and still cannot fully understand.

I latelly passed my source code in Wing IDE wihch asked be to resolve
tab/space/CRLF conflicts and I said yes (initially the code was developped
under Linux ... and now all source got tabs replaced by spaces and all EOL
when switched to Windows CR/LF)

I sent a new release of the software, tested here first, to the customer who
got a syntax error on a line which visibly did not have any error.

retyping that line by and made the error jump around the file like crazy.

I had the customer comment out the first two lines of the file:

"""
#!/bin/env python
# -*- coding: iso-8859-15 -*-
"""

... and the problem disappeared.

I am at a loss.

Any clue ?

Thanks

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


RPM error

2007-04-24 Thread CSUIDL PROGRAMMEr
Hi folks

 I am trying to write a program that will install RPM.
IS there any built in Exception in python that will catch the faied
dependencies in python.

Also if not how can i write one ??


thanks

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


RPM error

2007-04-24 Thread CSUIDL PROGRAMMEr
Hi folks
I am new to python
I am trying to write a program that will install rpm
using rpm -ivh xxx.rpm

I want to know if python has in-built exceptions  to catch no-
dependencies error.

If not how can i build them

thanks

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


Atribute error

2007-04-26 Thread gtb


In file Test1.py below I get a attribute error on the line
"self.logon()". It worked earlier when Test1 was derived from class
newLogon but that does not seem logical to me. Any suggestions?

Thanks,

john

#~~~
#File Test1.py

# Generated by MaxQ [com.bitmechanic.maxq.generator.CompactGenerator]
#Test1.py

from CompactTest import CompactTest
from newLogon import newLogon

class Test1(CompactTest):
# Recorded test actions.
def runTest(self):
self.msg('Test started')

self.logon()

# ^^^ Insert new recordings here.  (Do not remove this line.)


# Code to load and run the test
if __name__ == 'main':
Test1('Test1').Run()


#

#File newLogon.py
# Generated by MaxQ [com.bitmechanic.maxq.generator.CompactGenerator]
from CompactTest import CompactTest

class newLogon(CompactTest):
# Recorded test actions.
def logon(self):
self.msg('Test started')


# ^^^ Insert new recordings here.  (Do not remove this line.)


# Code to load and run the test
if __name__ == 'main':
newLogon('newLogon').Run()

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


file Error

2007-05-03 Thread saif . shakeel
Hi,
I am parsing an xml file,and using raw_input command to ask the
user to enter the file name.Ex

>>>
Enter The ODX File Path:

Suppose my code does not work properly,then in the python idle window
it shows something like this:
>>>
C:\Projects\ODX Import\Sample Files\MiscFiles
\CIM_A3300_diag_spec_sw49.xml
Traceback (most recent call last):
  File "C:\Projects\ODX Import\code_ini\odxparse_mod_off_comm.py",
line 339, in 
process_variant(variant)
  File "C:\Projects\ODX Import\code_ini\odxparse_mod_off_comm.py",
line 285, in process_variant
triplet = triplet + get_did_lengths(iservice,local_service_id)
  File "C:\Projects\ODX Import\code_ini\odxparse_mod_off_comm.py",
line 238, in get_did_lengths
local_min = local_min + ddoref_min[ddorefstring]
KeyError: '_210'

   This is some bug related to code ..thats ok..but when i run
the program immediately again for some other input..then it does not
show the prompt :
>>>
Enter The ODX File Path:

   but instead a blinking prompt which accepts the
filename something like this:
>>>
C:\Projects\ODX Import\Sample Files\MiscFiles\Diagnostic CTS Global
Epsilon TIM V1.4.xml

    I want the inputfile prompt to appear regardless of
the error condition.I dont know where the problem lies.Can someone
help me out.
 Thanks

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


Atttribute error

2007-05-08 Thread HMS Surprise
The snippet below causes an attribute error.

AttributeError: module 'urllib' has no attribute 'urlopen'

I am using python 2.2.3. According to the documentation at C:
\Python22\Doc\lib urllib has a function called urlopen.

#~~~
import urllib

class login(CompactTest):
# Recorded test actions.
def runTest(self):
f = urllib.urlopen("http://www.python.org/";)
f.read()

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


psycopg2 error

2007-05-08 Thread Luis P. Mendes
Hi,

I've installed psycopg2 under Slacware 11.0 along with PostgreSQL 8.2.4.

When I run the python shell I get the following error: [EMAIL PROTECTED] ~$
python
Python 2.4.3 (#1, Jul 26 2006, 20:13:39) [GCC 3.4.6] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.4/site-packages/psycopg2/__init__.py", line 60,
  in ?
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file or
directory

The strange thing is that under root and postgres users, there is no
error. [EMAIL PROTECTED] ~$ python
Python 2.4.3 (#1, Jul 26 2006, 20:13:39) [GCC 3.4.6] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>>
>>>
libpq files are readable by the world: [EMAIL PROTECTED] pgsql # ll lib/ -d
drwxr-xr-x 3 postgres postgres 1528 2007-05-07 23:25 lib/

[EMAIL PROTECTED] lib # ll libpq*
-rw-r--r-- 1 postgres postgres 155858 2007-05-07 23:25 libpq.a lrwxrwxrwx
1 postgres postgres 12 2007-05-07 23:25 libpq.so -> libpq.so.5.0
lrwxrwxrwx 1 postgres postgres 12 2007-05-07 23:25 libpq.so.5 ->
libpq.so.5.0 -rwxr-xr-x 1 postgres postgres 126496 2007-05-07 23:25
libpq.so.5.0

The postgreSQL lib is in ld.so.conf and ldconfig has been run: # cat
/etc/ld.so.conf
/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/opt/kde/lib
/usr/lib/qt/lib
/usr/local/pgsql/lib

What is wrong?


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


COM error

2006-10-13 Thread Teja
What is "ValueError: argument is not a COM object" ? I get this error
when I try to pass a COM object to a thread.

Any pointers

Thanks

Teja

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


Attribute error

2006-10-13 Thread Teja
Hi all,

What is attribute error? what causes that error, especially with COM
objects?

To be precise :

Attribute Error: LCAS.LabcarController.writeLogWindow()

Here, LCAS is a COM object

Thanks
Teja.P

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


numpy error

2006-10-23 Thread Juergen Kareta
Hello,

this is my first try to get wxmpl-1.2.8 running. Therefor I installed:

python 2.5
matplotlib-0.87.6.win32-py2.5.exe
numpy-1.0rc3.win32-py2.5.exe

on WinXP SP2

The result is a version mismatch (see below).

Numpy version 102 seems to be numpy-1.0b5 which is not downloadable 
anymore. Any hints ?

Thanks in advance.

Jürgen


traceback:

from pylab import *
RuntimeError: module compiled against version 102 of C-API but this 
version of numpy is 109

The import of the numpy version of the nxutils module,
_nsnxutils, failed.  This is is either because numpy was
unavailable when matplotlib was compiled, because a dependency of
_nsnxutils could not be satisfied, or because the build flag for
this module was turned off in setup.py.  If it appears that
_nsnxutils was not built, make sure you have a working copy of
numpy and then re-install matplotlib. Otherwise, the following
traceback gives more details:

Traceback (most recent call last):
   File "", line 1, in 
   File "C:\Python25\Lib\site-packages\pylab.py", line 1, in 
 from matplotlib.pylab import *
   File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 199, 
in 
 import mlab  #so I can override hist, psd, etc...
   File "C:\Python25\Lib\site-packages\matplotlib\mlab.py", line 64, in 

 import nxutils
   File "C:\Python25\Lib\site-packages\matplotlib\nxutils.py", line 17, 
in 
 from matplotlib._ns_nxutils import *
ImportError: numpy.core.multiarray failed to import
-- 
http://mail.python.org/mailman/listinfo/python-list


Import Error

2006-10-27 Thread Joseph
Hi,
I am using Karrigell & Sprite for web development. Sprite is placed in
the main
folder of my app. I got a sub-folder called admin. I am using the below
line to import Sprite from the subfolder.

from ..sprite import Sprite

Most of the time it works. However time to time, it will throw an error
that there is no module called Sprite. I delete the .pyc file, call a
page in the main folder, then it will work.

Any help how I can resolve it? 

Thank you in advance,
Joseph

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


Import Error

2006-10-27 Thread Joseph
Hi,
I am using Karrigell & Sprite for web development. Sprite is placed in
the main
folder of my app. I got a sub-folder called admin. I am using the below
line to import Sprite from the subfolder.

from ..sprite import Sprite

Most of the time it works. However time to time, it will throw an error
that there is no module called Sprite. I delete the .pyc file, call a
page in the main folder, then it will work.

Any help how I can resolve it? 

Thank you in advance,
Joseph

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


Import Error

2006-10-27 Thread Joseph
Hi,
I am using Karrigell & Sprite for webdevelopment. Sprite is placed in
the main folder of my app. I got a sub-folder called admin. I am using
the below line to import Sprite within the subfolder.

from ..sprite import Sprite

Most of the time it works. However time to time, it will throw an error
that there is no module called Sprite. I delete the .pyc file, call a
page in the main folder, then it will work.

Any help how I can resolve it? 

Thanks in advance,
Joseph

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


sqlite error?

2006-11-06 Thread John Salerno
Am I using the ? placeholder wrong in this example?


t = ('hi', 'bye')

self.connection.execute("INSERT INTO Personal (firstName, lastName) 
VALUES ?", t)



Traceback (most recent call last):
   File "C:\Python25\myscripts\labdb\dbapp.py", line 93, in OnSaveRecord
 self.save_to_database(textfield_values)
   File "C:\Python25\myscripts\labdb\dbapp.py", line 97, in save_to_database
 self.connection.execute("INSERT INTO Personal (firstName, lastName) 
VALUES ?", t)
sqlite3.OperationalError: near "?": syntax error
-- 
http://mail.python.org/mailman/listinfo/python-list


Unicode Error

2006-08-22 Thread Gallagher, Tim (NE)









Hey all I am learning Python
and having a fun time doing so.  I have a question for y'all, it has to do with
active directory.

 

I want to get the last login
for a computer from Active Directory.  I am using the active_directory module
and here is my code.

 

[START]

 

import active_directory

 

computer =
active_directory.root()

for cpu in computer.search
("cn='Computer_Name'"): 

    print cpu.samAccountName    ←---
Works find

    print
cpu.operatingSystem   ←--- Works find

    print cpu.lastLogon     ←---
Getting Error

 

[END]

 

 

I get an error that I am not sure what to do with,
the error is TypeError: coercing to Unicode: need string or buffer, instance
found in my line Do I have to change the output to meet Unicode formation?

 

Thanks,

-T






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

urlopen() error

2006-09-08 Thread Tempo
Hello. I am getting an error and it has gotten me stuck. I think the
best thing I can do is post my code and the error message and thank
everybody in advanced for any help that you give this issue. Thank you.

#
Here's the code:
#

import urllib2
import re
import xlrd
from BeautifulSoup import BeautifulSoup

book = xlrd.open_workbook("ige_virtualMoney.xls")
sh = book.sheet_by_index(0)
rx = 1
for rx in range(sh.nrows):
u = sh.cell_value(rx, 0)
page = urllib2.urlopen(u)
soup = BeautifulSoup(page)
p = soup.findAll('span', "sale")
p = str(p)
p2 = re.findall('\$\d+\.\d\d', p)
for price in p2:
print price

##
Here are the error messages:
##

Traceback (most recent call last):
  File "E:\Python24\scraper.py", line 16, in -toplevel-
page = urllib2.urlopen(u)
  File "E:\Python24\lib\urllib2.py", line 130, in urlopen
return _opener.open(url, data)
  File "E:\Python24\lib\urllib2.py", line 350, in open
protocol = req.get_type()
  File "E:\Python24\lib\urllib2.py", line 233, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: List

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


Re: error

2006-09-12 Thread Rob Wolfe

[EMAIL PROTECTED] wrote:
> Hi,
[...]
> Step 3: Wrote the given script of multipication in a file named as
> multiply (using vi editor)

The name of module should be multiply.py

HTH,
Rob

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


Re: error

2006-09-12 Thread John Machin

[EMAIL PROTECTED] wrote:
> Hi,
>
> Today is my first day of working on python. I want to execute python
> script through C++ program. I found one very good article with example
> at http://docs.python.org/ext/pure-embedding.html.
> I followed the procedure as given, the code is compiled but while
> running it is giving error like:
> ImportError: No module named multiply
> Failed to load "multiply"
>
> Here are the steps I followed, please suggest where I am wrong and how
> can I remove the above error.
>
> Step 1: Copied the given C program into a file called test.cpp (using vi
> editor)
> Step 2: Compiled it using : g++ test.cpp  /usr/lib/libpython2.4.so
> (created a.out)
> Step 3: Wrote the given script of multipication in a file named as
> multiply (using vi editor)

Try naming your source file multiply.py but continue to use the module
name (multiply) in the command line.  [Note: you could have a binary
extension module called multiply in a binary file called multiply.so]

I guess the author of that manual section didn't contemplate somebody
on their first day with Python doing some embedding :-)

HTH,
John

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


Re: error

2006-09-12 Thread John Machin

Rob Wolfe wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
> [...]
> > Step 3: Wrote the given script of multipication in a file named as
> > multiply (using vi editor)
>
> The name of module should be multiply.py
>

module != source_file
module don't have no ferschlugginer dots in its name

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


Re: error

2006-09-12 Thread Rob Wolfe

John Machin wrote:
> Rob Wolfe wrote:
> > [EMAIL PROTECTED] wrote:
> > > Hi,
> > [...]
> > > Step 3: Wrote the given script of multipication in a file named as
> > > multiply (using vi editor)
> >
> > The name of module should be multiply.py
> >
>
> module != source_file
> module don't have no ferschlugginer dots in its name

Ooops... sorry.
I meant name of python source file, of course.

Regards,
Rob

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


Re: error

2006-09-12 Thread Gabriel Genellina

At Tuesday 12/9/2006 09:16, [EMAIL PROTECTED] wrote:


Today is my first day of working on python. I want to execute python
script through C++ program. I found one very good article with example


I suggest *first* try to familiarize a little with Python (read the 
tutorial, it's easy and it's well written) and only then, try to 
embed it inside a C++ program.

Even if you are not going to write the Python scripts yourself.



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


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

sqlite3 error

2006-09-27 Thread John Salerno
Here's my script:

import sqlite3

con = sqlite3.connect('labdb')
cur = con.cursor()
cur.executescript('''
DROP TABLE IF EXISTS Researchers;
CREATE TABLE Researchers (
 researcherID varchar(9) PRIMARY KEY NOT NULL,
 birthYear int(4) DEFAULT NULL,
 birthMonth int(2) DEFAULT NULL,
 birthDay int(2) DEFAULT NULL,
 birthCountry varchar(50) DEFAULT NULL,
 birthState char(2) DEFAULT NULL,
 birthCity varchar(50) DEFAULT NULL,
 nameFirst varchar(50) NOT NULL,
 nameLast varchar(50) NOT NULL,
 nameGiven varchar(255) DEFAULT NULL,
);
''')

And here's the error:

Traceback (most recent call last):
   File "C:\Python25\myscripts\labdb\dbtest.py", line 19, in 
 ''')
OperationalError: near ")": syntax error
 >>>

My script looks just like the example in the docs, so I'm not sure what 
I'm doing wrong. The error message seems like it should be easy to 
figure out, but all I did was close the triple quotes and then close the 
parentheses, just like the example.

Hope someone can shed some light on this! :)
-- 
http://mail.python.org/mailman/listinfo/python-list


os.isfile() error

2006-05-06 Thread Gary Wessle
Hi

could someone help me to find out whats wrong with this code?

 code 
import os, sys

if len(sys.argv) < 2:
sys.exit("please enter a suitable directory.")

dpath = sys.argv[1]
for name in os.listdir(dpath):
if os.isfile(dpath+name):
infile = open(os.path.join(dpath,name), 'rb')
print type(infile)


 error 
Traceback (most recent call last):
  File "python/useful/cat2all.py", line 13, in ?
if os.isfile(dpath+name):
AttributeError: 'module' object has no attribute 'isfile'


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


Strange error

2006-05-18 Thread WSobczuk
I have encountered a very strange error and I'm hoping that some Python
hackers here could give me insight on this.

searchview.py file contains two functions:
def mysearch(indexname, request, c, page = 0, searchdburl = INDEX_URL,
query_add = {}, queries = [], form = True, limit = DEFAULT_LIMIT, tags
= {}, order = ''):
and
def search(findquery, path = None, page=0, tags = {}, order='', limit =
DEFAULT_LIMIT, queries=[], searchdburl = INDEX_URL):

I import and call both from various places.  Now recently I discovered
that when I call:
mysearch('pubcomm', request, vars, page = page, query_add =
query_add)
from one place, then inside mysearch() (I test it at the start of the
function) the tags argument *has* a value leftover from apparently from
a previous call.  When investigating I have also found that it
sometimes has the value of the search() function's tags parameter from,
apparently, some previous call.
After I changed the call to this:
mysearch('pubcomm', request, vars, page = page, query_add =
query_add, tags = {})
the error stopped occurring, so it seems that what I'm suspecting is
right.

The searchview.py file does not contain any global 'tags' variable, but
the search() function does process it's own tags argument like so:
tags = dict([(k, listify(v)) for k, v in tags.iteritems()])

The whole thing is happening on Python 2.4.2 on Linux (I tried it on
Fedora and Gentoo).  It's under a heavy load (the whole thing happens
inside a Flup based FCGI backend), but I'm not using threads so there
is no concurrency involved - only sequential processing of requests.

I haven't isolated a test case yet, hoping that someone could give me a
hint on this.  Maybe I'm making some stupid mistake or maybe it's some
namespace bug (or 'feature').  Any ideas?

Thanks,
Wojtek

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


An error ?

2006-06-11 Thread Bo Yang
Hi ,
I am confronted with an odd question in the python cgi module !

Below is my code :

import cgitb ; cgitb.enable()
import cgi

print "Hello World !"

How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py
but apache give me a 'Server internal error !'
and the error log is :


[Fri Jun 16 14:06:45 2006] [error] [client 10.10.110.17] malformed
header from script. Bad header=Hello World!: a.py

I wish somebody could help me , thanks in advance !

Best Regard !


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

BeautifulSoup error

2006-06-15 Thread William Xu
Hi, all,

This piece of code used to work well. i guess the error occurs after
some upgrade.

>>> import urllib
>>> from BeautifulSoup import BeautifulSoup
>>> url = 'http://www.google.com'
>>> port = urllib.urlopen(url).read()
>>> soup = BeautifulSoup()
>>> soup.feed(port)
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.3/sgmllib.py", line 94, in feed
self.rawdata = self.rawdata + data
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb8 in position 565: 
ordinal not in range(128)
>>>

Any ideas to solve this?

version info:

Python 2.3.5 (#2, Mar  7 2006, 12:43:17)
[GCC 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)] on linux2

python-beautifulsoup: 3.0.1-1

-- 
William

"I'd love to go out with you, but I have to floss my cat."
-- 
http://mail.python.org/mailman/listinfo/python-list


Thread error

2006-12-03 Thread Salvatore Di Fazio
Hi guys,
when I close the application I get the following error:

-
Traceback (most recent call last):
  File "main.py", line 88, in 
while exit : pass
KeyboardInterrupt
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
-

This is the code:
-
# Echo client program
import socket
import sys
import thread
import mtalk

HOST = '192.168.0.115'# The remote host
PORT = 3580   # The same port as used by the server

buff = ""
buffStatus = 0
s = None
exit = 1

### keywordDataIn ###
def keywordDataIn():
  global buff, buffStatus, exit
  talkmsg = mtalk.TalkMessage()
  while exit:
line = sys.stdin.readline()
if line == 'quit\n':
  exit = 0
  break
elif line != '\n':
  lock.acquire()
  buff = talkmsg.Make(line)
  buffStatus = 1
  lock.release()
elif line == '\n':
  pass

### dataToServer ###
def dataToServer():
  global buff, buffStatus, exit
  while exit:
if buffStatus == 1:
  try:
lock.acquire()
s.sendall(buff)
buff = ""
buffStatus = 0
lock.release()
  except: socket.error
  pass # errore da controllare

## dataFromServer ##
def dataFromServer():
  global exit
  while exit:
data = s.recv(1024)
print 'Received', repr(data)




### Main ###
if __name__ == "__main__" :

  for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC,
socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res

  buffStatus = 0

  try:
    s = socket.socket(af, socktype, proto)
  except socket.error, msg:
print("Unexpected error")
s = None
sys.exit(1)

  try:
s.connect(sa)
print 'Connection ...'
  except socket.error, msg:
print("The server was not reachable")
s.close()
s = None
sys.exit(1)

  print 'Connected'

  # mutex
  lock = thread.allocate_lock()
  thread.start_new_thread(keywordDataIn, ())
  thread.start_new_thread(dataToServer, ())
  thread.start_new_thread(dataFromServer, ())

  while exit : pass

  s.close()
-


Tnx

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


  1   2   3   4   5   6   7   8   9   10   >