Problems trying Pymite 0.9 on win32 platform

238 views
Skip to first unread message

Bulek

unread,
Feb 21, 2013, 3:54:12 AM2/21/13
to python-o...@googlegroups.com
Hi,
I've closely followed instructions to build pymite on winxp (Visual C 2008).

At final step I get this error :
C:\My Documents\Delovni\_Godec\Delo\PyMite\pymite-09\src\tools>python ipm.py --desktop
Traceback (most recent call last):
File "ipm.py", line 419, in <module>
main()
File "ipm.py", line 382, in main
conn, pmfeatures_filename = parse_cmdline()
File "ipm.py", line 378, in parse_cmdline
return (c, pmfeatures_filename)
UnboundLocalError: local variable 'pmfeatures_filename' referenced before assignment

What am I doing wrong ?

Thanks,

Bulek.

Dean Hall

unread,
Feb 21, 2013, 10:42:39 AM2/21/13
to python-o...@googlegroups.com
Pardon my brevity,
Read the FAQ: http://code.google.com/p/python-on-a-chip/wiki/FAQ
Make sure you have Python 2.6 installed and that's what is being used on your command line.
Pull the latest code from the repo and try again.

!!Dean
> --
> --
> You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
> Site: http://groups.google.com/group/python-on-a-chip
>
> ---
> You received this message because you are subscribed to the Google Groups "python-on-a-chip" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to python-on-a-ch...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

pir...@gmail.com

unread,
Feb 21, 2013, 10:48:24 AM2/21/13
to python-o...@googlegroups.com

Hi Dean, any progress on the adaption of Python 2.7? Can we help you on something with it?

Sent from my Android cell phone, please forgive the lack of format on the text, and my fat thumbs :-P

Bulek

unread,
Feb 28, 2013, 7:27:09 PM2/28/13
to python-o...@googlegroups.com
Hi,

I've tried following :
- changed every python call to run python Ver 2.6 executable
- tried whole procedure with latest repo
- I always get error when I try to run ipm with this line: c:\Python26\python ipm.py --desktop
Traceback (most recent call last):
  File "ipm.py", line 418, in <module>
    main()
  File "ipm.py", line 381, in main
    conn, pmfeatures_filename = parse_cmdline()
  File "ipm.py", line 377, in parse_cmdline

    return (c, pmfeatures_filename)
UnboundLocalError: local variable 'pmfeatures_filename' referenced before assignment

To avoid this error I run it with : c:\Python26\python ipm.py -f ..\platform\windows\pmfeatures.py  --desktop
but something is still wrong, I get this :

C:\My Documents\Delovni\_Godec\Delo\Interpreterji\PyMite\svn\src\tools>c:\Python26\python ipm.py -f ..\platform\windows\pmfeatures.py  --desktop
Python-on-a-Chip is Copyright 2003, 2006, 2007, 2009, 2010 Dean Hall and others.
Python-on-a-Chip is licensed under the GNU LESSER GENERAL PUBLIC LICENSE V 2.1
PyMite is Copyright 2003, 2006, 2007, 2009, 2010 Dean Hall.
PyMite is licensed under the GNU GENERAL PUBLIC LICENSE V 2.
This software is offered with NO WARRANTY.  See LICENSE for details.
Type the Python code that you want to run on the target device.
If you see no prompt, type two consecutive returns to exit multiline mode.
Type Ctrl+C to interrupt and Ctrl+D to quit (or Ctrl+Z <enter> on Win32).
ipm> help
Type the Python code that you want to run on the target device.
If you see no prompt, type two consecutive returns to exit multiline mode.
Type Ctrl+C to interrupt and Ctrl+D to quit (or Ctrl+Z <enter> on Win32).
ipm> import sys
Connection write error, type Ctrl+Z to quit.
Hello
ipm> print "a"
Connection write error, type Ctrl+Z to quit.
Connection read error, type Ctrl+Z to quit.
ipm>
ipm>
ipm>
If I run main.exe from command line it just prints "Hello" and finishes.

I'd kindly ask for some help here...

thanks in advance,

Rob.
Message has been deleted

Bulek

unread,
Mar 4, 2013, 9:30:41 PM3/4/13
to python-o...@googlegroups.com
Hi,

my main problem stays but in between I got a bit further on windows target executable main.exe - I'm compiling with VC 2008.

But I got other problems on this path :
1. I can compile main.exe, but when I try to run and try few Python statements I see that some keywords are not working, but probably should :
This is my main.py :

print "Dialog D13:"


i = 0
print "Cnt = %d\n" % (i)
i += 1
print "Cnt = %d\n" % (i)
i += 1
print "Cnt = %d\n" % (i)
i += 1
print "-------------\n"

fruits = ['banana', 'apple',  'mango']
for index in range(len(fruits)):
   print 'Current fruit :', fruits[index]
print "-------------\n"

for i in range(1,5,1):
    print 'For, range is:', i
print "-------------\n"

count = 0
while count < 9:
   print 'The count is:', count
   count = count + 1
print "-------------\n"

i = 0
while i < 10:
    print i
    print "Cnt = %d\n" % (i)
    i += 1

print "-------------\n"

for num in range(10,20):  #to iterate between 10 to 20
   for i in range(2,num): #to iterate on the factors of the number
      if num%i == 0:      #to determine the first factor
         j=num/i          #to calculate the second factor
         print '%d equals %d * %d' % (num,i,j)
         break #to move to the next number, the #first FOR
   else:                  # else part of the loop
      print num, 'is a prime number'

print "-------------\n"

print "Done."

It works ok under Python 2.6 on desktop, but works only until "count = 0" statement. Nothing else is printed on cmd console.... Have no clue why that would happen. If I compile Release version, I get error in this line :
Traceback (most recent call first):
  File "main.py", line 34, in main
ImportError detected by FileId 0x00 line 0
Line 34 says:  "while count < 9:"

Any advice what is wrong ?

Thanks in advance,

regards,
Bulek.

Dean Hall

unread,
Mar 4, 2013, 10:57:08 PM3/4/13
to python-o...@googlegroups.com
No error stands out in you source code.
In that situation, either use your debugger (I can't help with windows)
or start removing half your lines of code (repeatedly) until you find the line of source that causes the problem.

!!Dean
Reply all
Reply to author
Forward
0 new messages