Re: Custom data type in a matrix.

2006-04-23 Thread Gaz
And how im supposed to assign data to a specific hex?

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


Re: Custom data type in a matrix.

2006-04-22 Thread Gaz
BTW, i tried the "classe Thinge(): pass" but does not qualify as "data
type" for a numpy array.

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


Custom data type in a matrix.

2006-04-22 Thread Gaz
Hi guys. I've been lookig for this in the numpy pdf manual, in this
group and on google, but i could not get an answer...

Is there a way to create a custom data type (eg: Name: string(30), Age:
int(2), married: boolean, etc) and then use that custom data in a
matrix? Actually, this is a two question question :P

Im doing a simple hex based game and i need a way to store every hex
property (color, owner,x, y, etc) in a matrix's "cell", representing
each cell a hex.

Thank you.

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


Re: Pythonesque interface.

2006-04-21 Thread Gaz
:)

Right now im trying to dl Jython (SF.net server down?), if it's
language sintaxis is just like Python and allows to use numpy and PIL,
im in! (i think :) )

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


Re: Pythonesque interface.

2006-04-21 Thread Gaz
OP?

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


Re: Pythonesque interface.

2006-04-21 Thread Gaz
Yeah, probably i'll be ending doing the front end in Flash and the back
end in Python.

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


Re: Pythonesque interface.

2006-04-21 Thread Gaz

Michael Tobis ha escrito:

> www.pygame.org
>
> Yes but he obviously wants this to be delivered to the browser. (Also
> the site is broken today... )
>
> This comes up a lot, but I don't think there's an answer to it as yet.
> 
> mt

Yeah, i want it playable on a browser.

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


Pythonesque interface.

2006-04-21 Thread Gaz
Hi guys. I'm doing a simple strategy game in python, hex based, with
the PIL library. I'd like to know if there is a way to check the
pointer position within a frame, so i can figure out which hex is the
pointer on, but in a pythonesque way, not using Java or Flash. Sajax is
the way to go? I dont think this is the solution, coz the frame should
be requiered to be refreshed like 30 times a second, but heck, you are
the Python savvies.

Thank you!

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


Re: Looking for a programming resource for newbees

2006-04-20 Thread Gaz

bambooforest ha escrito:

> Hi all,
>
> I'm from a Linguistics background and am new(er) to programming. Could
> someone recommend a book or resource that teaches programming aspects
> with Python? Python I hear is a very appropriate language for handling
> text and language processing.
>
> I'm searching for a resource that examines programming from a case
> study like perspective. Such as, you're faced with problem of type X -
> and here's how you should look at it to break it down to form an
> optimal solution (e.g. because this type or problem is handled well
> with this type of data structure, etc.).
>
> I've looked at the online Python tutorial at python.org and resources
> like O'Reilly's Python in a Nutshell, but they seem to teach you
> language syntax and concepts like data types, or assume you already
> know how to program. I'm searching for something that teaches
> programming.
>
> Thanks everyone,
>
> -Steve

Hi Steve,

If you know little about programming, you should get any book or google
for "programming tutorials" or something like that, no matter which
language uses that book/website as example. Programing is just learning
simple basic operation and tools to help you develop algorithms to
reach your goals. Once you have mastered those simple operation and
basic programming skills, read again the Pytutorial and find out how to
translate your little programs programmed with the language you used to
learn.

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


Python + PIL test server.

2006-04-11 Thread Gaz
Hi guys. I installed XAMPP, an easy to set up Apache, Mysql and PHP
server. But im trying to get Python work on it so i can test my
scripts. The addon for XAMPP is only for Linux, i wonder if you can
help me out in installing Python + PIL support.

Any tutorial or something? I searched here and in Python.org with no
luck.

Thanks in advance.

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


Re: No (and a meaningless subject here too!)

2006-02-23 Thread Gaz
Yeah, i did. Thank you, im analyzing the examples found. I'll post my
results :)

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


Re: No (and a meaningless subject here too!)

2006-02-23 Thread Gaz
Aye, but i dont need to run an FTP daemon every time i want to upload
an image to Imageshack or any other website.

About the topic name, yes, it's meaningless and its a shame. I fucked
it up when typing the title =P

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


Re: No

2006-02-22 Thread Gaz
(the Input type = FILE is in the field)

please check this out

import ftplib
import os

...

def upload(ftp, file):
ext = os.path.splitext(file)[1]
if ext in (".txt", ".htm", ".html"):
ftp.storlines("STOR " + file, open(file))
else:
ftp.storbinary("STOR " + file, open(file, "rb"), 1024)

ftp = ftplib.FTP("ftp..f2o.org")
ftp.login("X", "X")

upload(ftp, "c:\check.jpg")

I'm still getting the file not found error:

http://img153.imageshack.us/img153/2720/error3ps.jpg

I believe the path is kinda wrong or something. But this time, the
script is supposed to fetch the file from my pc.

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


Re: No

2006-02-22 Thread Gaz
@ Steven: LOL =P

@ Frederik: aye, i uploaded the script by FTP, but the idea of this
little program is to allow a technician on field to upload photos from
their laptops when they get into a hotel, along with some text, anywere
in the world. We need the reports to be daily. Email is not an option,
because due my experience, they always lack of info, with a form, i can
put some conditions for sending the report.

So, they can not upload the photos by FTP because its too "geek" for
them. And i need to have a standarized form to handle the reports,
because otherwise its a organizational mess.

The program should handle the upload thingie in the backstage. I'll
look for a script like this in these forums...

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


Re: No

2006-02-21 Thread Gaz
Aye, but the file is in MY drive, not the server. Perhaps  thats the
issue? I bet it's so... how should i deal with it? Perhaps should be a
script that uploads the files to the server and then emails it... i
believed this was handled using the root in my PC, but now i see this
is not correct.

Now i need a script for uploading the files from MY pc and then use the
sendmail thingie. Any tips about that script?

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


Re: No

2006-02-21 Thread Gaz
Im running it in my test site at F2o.org. Perhaps its server's fault
and not script's fault. I'll deal this issue at its forums.

:)

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


Re: No

2006-02-21 Thread Gaz
OSError: [Errno 2] No such file or directory: 'c:/'
  args = (2, 'No such file or directory')
  errno = 2
  filename = 'c:/'
  strerror = 'No such file or directory'

Crazy... and if i use c:\, i get a 500 error.

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


No

2006-02-21 Thread Gaz
Check this piece of code:

#now add an image part
part = writer.nextpart()
part.addheader('Content-Transfer-Encoding', 'base64')
body = part.startbody('image/jpeg')
base64.encode(open('c:\check.jpg', 'rb'), body)

I get the following error:

IOError: [Errno 2] No such file or directory: 'c:\\check.jpg'
  args = (2, 'No such file or directory')
  errno = 2
  filename = r'c:\check.jpg'
  strerror = 'No such file or directory'

Dont know why im getting such error, the file is there. Perhaps wrong
filetype? Wrong read mode?

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


Re: Attached images by plain email.

2006-02-20 Thread Gaz
Can you help me a little bit more? Please check this out:


  102 part.addheader('Content-Transfer-Encoding', 'base64')
  103 body = part.startbody('image/jpeg; name=c:\check.jpg')
  104 base64.encode(open('check.jpg', 'rb'), body)
  105
  106
base64 = ,
base64.encode = , builtin open = , body =


IOError: [Errno 2] No such file or directory: 'check.jpg'
  args = (2, 'No such file or directory')
  errno = 2
  filename = 'check.jpg'
  strerror = 'No such file or directory'

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


Sendmail "ok" signal?

2006-02-16 Thread Gaz
Hey. I looked at the Sendmail help and did not find a property where i
can get an "ok" signal when the email is finally sent. I need something
like that to show a "Processing, please stand by" screen when the
server is sending an email, and when the email is out, another screen
appears with an "Email sent" message.

Do you know an alternative to the "ok" from the sendmail to do this?

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


Re: Attached images by plain email.

2006-02-15 Thread Gaz
You are the man!

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


Attached images by plain email.

2006-02-15 Thread Gaz
Hi guys. Im doing a simple CGI form to send data by email. They are for
some technicians on field so they can send daily reports about what
they made. The thing is, i dont know how to send images attached to the
email i generate with sendmail. I put the combos in the form, but i
dont know how to say to sendmail to add them to the email the form
assembles.

Any tips?

Thanks!

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