Python

ZXNet echo conference «code.zx»

From Dima Kozlov To All 14 December 2006

Hello, maximk max> A good book - Learning Python, O'Reilly publishing house, but Russian I have not met max> edition. Electronics cannot be found in peer-to-peer networks max> problem. If you are comfortable with English, then it’s better to find it and watch it. I would recommend Dive into Python; available; publicly, at least the beginning translated into Russian Bla> I would like to know if anyone can tell me the correspondence of Python commands Bla> Specov's BASIC commands??? Python has a different approach to writing code. converting one to one from BASIC is not right Bla> I really liked this language, but I just can’t figure out how to do it Bla> some things. write an example in BASIC, I’ll try to convert it to Python...

From Max Kuleshov To All 14 December 2006

Hello Black1980 Bla> I would like to know if anyone can tell me the correspondence of Python commands Bla> Specov's BASIC commands??? There are people, but it’s just not worth asking the question like that. The languages are quite different, and in general if he is in Africa if :)

From Max Kuleshov To All 14 December 2006

Hello Black1980 A good book is Learning Python, published by O'Reilly, but I have a Russian edition I haven't met. Finding electronics in peer-to-peer networks is not a problem. If with English is fine - it’s better to find it and see it. Spectrum BASIC does not have developed procedural capabilities programming and does not have any object-oriented capabilities. Therefore, writing in Python “like BASIC” is not the most successful approach.

From Dmitry Kuzmin To All 14 December 2006

Hello, All Hello everyone, are there people who write programs in Python? I would like to know Can anyone tell me the correspondence between Python commands and Spec's BASIC commands??? Thanks in advance....

From Dmitry Kuzmin To All 14 December 2006

Hello elf/2 elf> write an example in BASIC, I'll try to convert it to Python... And if there are also comments, it will be great... 10 BORDER 1; PAPER; 1; CLS; 20 REM SCREEN 100 LET B$=" " 110 LET A$=B$+"PROGRAM; B.STROKA...; *** DEMO ***" 120 LET A$=A$+" UP....Q, DOWN....A, LEFT....O, " 130 LET A$=A$+"RIGHT....P, FIRE....M, END....E" 140 LET A$=A$+" AUTHOR; Petrow; Iwan 1993" 150 LET A$=A$+" PRESS ANY KEY TO CONTINUE" 160 LET A$=A$+B$ 200 FOR N=1 TO LEN A$31 210 PAUSE 7; IF; INKEY$<>"" THEN GO TO 300 220 LET B$=A$(N TO N+31) 230 PRINT #0;AT 1.0; INK 6;B$ 240 NEXT N 250 GO TO 200 A regular ticker... elf> Python has a different approach to writing code. translate one into one with elf> BASIC is not correct It’s just easier for me to understand the work of Python commands... In cycles, this is what I do the approach helped a lot... elf> I would recommend Dive into Python; available; publicly, at least elf> beginning translated into Russian Is there no address where I can download it???

From Dmitry Kuzmin To All 14 December 2006

Hello, maximk So it turns out that many operators have analogues, but some do not. Very I liked this language, but I just can’t figure out how to do some things. I I study this language in two books, one of which is 30 hours of BASIC for beginners (I take simple programs from it and translate them into Python), so I set myself a task about language commands...

From Dima Kozlov To All 14 December 2006

Hello Black1980 Bla> And if there are also comments, it will be great... 1. work with the console (i.e. analogues of AT, INK, PAPER) depends on what we write the axis. Accordingly, this is not included in the language itself. you need to look at the special modules, for example curses under Linux (http://www.amk.ca/python/howto/curses/) or Console (http://effbot.org/zone/console-index.htm) for Windows. 2. String concatenation is done with the usual plus, i.e. a = "string1" + " " + "string2" 3. The cycle of “cutting” a piece of string can be done, for example, like this: for i in range(len(str)-31) : part = str[i:i+31] # use slice 4. the analogue of pause is in the time module; import; time time.sleep(60) Bla> Is there no address where you can download it??? http://diveintopython.org/ next time ask google first.

From Dmitry Kuzmin To All 19 December 2006

Hello elf/2 Thank you very much for the link, sorry - I didn’t think to go to Google right away... :) I have another question, I’m digging around with the console module right now, but I don’t know whether I'm in the right direction or not. I figured out the colors and text placement in an arbitrary position too, but I just can’t figure out how to display the image to the screen in jpg and gif formats at a given position and at the sizes I need... Please help, if you provide the most antediluvian answer with the code I will be dead grateful to life. It’s just easier to understand with some examples, and English I don't really know... Thanks in advance...

From Dmitry Kuzmin To All 19 December 2006

Hello elf/2 Thank you very much for the link, sorry - I didn’t think to go to Google right away... :) I have another question, I’m digging around with the console module right now, but I don’t know whether I'm in the right direction or not. I figured out the colors and text placement in an arbitrary position too, but I just can’t figure out how to display the image on the screen in jpg and gif formats... Please help if you provide the most Antediluvian answer with code I will be grateful to the grave. Just on any examples are easier to understand, but I don’t really know English... Thanks in advance...

From Slavik Tretiak To All 20 December 2006

Hello Black1980 It seems to me that you can’t display the image in the console, that’s why it’s a console ;) Here's a toy, in short, driven on python and with sources. maybe you can pick something up from there: http://louhi.kempele.fi/~skyostil/uv/fretsonfire/source/ (it's for OpenGL)

From Dima Kozlov To All 20 December 2006

Hello Black1980 Bla> I have another question, I’m digging around with the console module right now, but not Bla> I know whether I'm in the right direction or not. I figured out the flowers, s Bla> by placing text in an arbitrary position, too, but no way Bla> I can understand how to display a picture on the screen in jpg and gif formats Bla> given position and with the dimensions I need... Please help Bla> if you provide the most antediluvian answer with the code, I will be dead Bla> grateful. It’s just easier to understand with some examples, but Bla> I don’t really know English... Thanks in advance... console is text by definition. accordingly, it does not show pictures maybe :( I'm not good at GUI modules. but you can look, for example, towards PIL (http://www.pythonware.com/library/) for Windows the example will look something like this: from PIL import Image, ImageWin im = Image.open("picture.jpg") im.resize((100,100)) dib = ImageWin.Dib(im) # I think that the window in which we will draw # has already been created using some # Tkinter (this is a module for creating UI) hwnd = ImageWin.HWND(widget.winfo_id()) dib.draw(hwnd, (0,0,100,100))

From Dmitry Kuzmin To All 20 December 2006

Hello Sinus Regarding the console, I’m also slowly coming to the conclusion that the picture is not You’ll display it on the screen, and thanks for the link, but I’d like to start with a simple problem I'll figure it out later and go to OpenGl... :) P.S. I would like to immediately make a reservation that all this is done in Python under Symbian OS (Series60)... Why on this forum, the answer is very simple, here people are more they are friendly and can help in any way...

From Dmitry Kuzmin To All 26 December 2006

Hello Black1980 I stepped, I apologize, the issue has been removed from the agenda.... :)

From Dmitry Kuzmin To All 26 December 2006

Hello elf/2 How can you implement the RND*256 command??? Thanks in advance...