2012-11-30 19:16:41

hi all,
I am trying to learn to code with python
but I have a bit of a problem
I can't get nvda to read the output in the  python command line
and also in the idle gui nvda won't speak deleted characters
i'm using python 3.3

A learning experience is one of those things that say, "You know that thing you just did? Don't do that."

2012-11-30 22:23:01

Hi enes.
I used to have the same problem only with JAWS. What you need to do is go to the windows command prompt. If you are using windows 7 go to the start menu and type command prompt in to the search box an press enter when it comes up. type the path to the file name and press enter. NVDA should read your script to you and if there are any errors NVDA will tell you.
Since you are a beginner I recommend you not work with Idle until you are a little more experienced. Instead, use something like notepad it works just as well as idle.
Guitarman

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2012-12-01 01:25:55

For anything console-based I have always opened up a traditional command prompt and used command-line commands to do what needs doing. Apps with in-built "console" features for some reason have issues with some screen readers...Though NVDA has improved dramatically.  Ensure you're on the latest NVDA if guitarman's suggestion still isn't working.

2012-12-01 14:58:00

hi,
ok  the  command line worked,
but how can I save my programs or run the python shell from the command prompt
normally you do these through the menu bar

A learning experience is one of those things that say, "You know that thing you just did? Don't do that."

2012-12-01 20:45:13

Hi
Well I don't know why the menu bar doesn't work. For some reason you can't get to it. What you should do is write your program in notepad safe it an then you can go back to the file go to the menu bar and select edit with Idle. This way your program is saved while your editing the file.
Guitarman

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2012-12-03 08:03:23

Enes, the easiest way to handle this is write your code in Notepad, save it with a *.py extention, and then run your script from the command line like this. Assuming you were running Python 2.7.3 stable you would do
c:\python27\python scriptname.py
where scriptname is the name of your Python script to run of course. I believe you said you are running Python 3.3 so you'd replace c:\Python27 with C:\Python33. big_smile

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-12-03 18:16:34

hi,
is python 2.7 more accessible?

A learning experience is one of those things that say, "You know that thing you just did? Don't do that."

2012-12-04 03:49:46

Enes, interms of accessibility Python 2.7 and Python 3.3 are the same. The major issue is that Python 2.7 is still the major production release that most third-party modules and APIs are using. That is why I use Python 2.7 for all of my Python development.

For example, Pygame 1.9, the Python wrapper for SDL, currently only supports Python2.7 as well as a lot of other Python wrappers and modules. Therefore if you are considering Python for game development you will have to downgrade to Python 2.7.3 in order to install and use Pygame. Its for reasons such as this I highly recommend Python 2.7 instead of 3.3 for primary production. big_smile

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-12-08 11:57:39

hi,
ok I don't completely understand
is notepad a replacement for the idle and shell?
and will it still help when I use modjules etc
if I write scrips in notepad how do I debug them from the python run from the command prompt

A learning experience is one of those things that say, "You know that thing you just did? Don't do that."

2012-12-09 06:18:33

Enes, you don't have to have an IDE like IDL to write Python code. Your source files are basically nothing more than straight text files with a *.py extension rather than a *.txt extension. As a result you can write Python source code in any text editor you like such as Windows Notepad, Textpad, Gedit for Linux, whatever. It doesn't matter just as long as it can save a text file, and allows you to replace the default extension from *.txt to *.py.

To run and debug Python applications and scripts simply run it in the Windows command prompt using the Python program. For example let's assume I saved a test program in c:\test\test.py. Now, I could open the Windows Command Prompt, cd to the test directory with the command
cd c:\test
and then would run the command
c:\python27\python test.py
to run the test script using Python 2.7. If there are any errors they would be printed out on the screen which i could write down and go into test.py and fix. Does that make sense?

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-12-09 15:17:54

hi
just to make sure I understand this correctly
I can use notepad to write  source code
after I right it I run the script from the command prompt for example
first I would type c:\python33\python.exe and then type the path to my script?
is this correct?

A learning experience is one of those things that say, "You know that thing you just did? Don't do that."

2012-12-09 17:40:09

hello
sorry enes that i'm asking my question in your topic--- i'm trying to avoid making another topic about python.
it's basic, i just passed the exam of c++ core, and i know little things about programing, such as  i/o, vars, values, operators, and pointers, also loops.
now, i don't want to pay further to learn the c++ "advanced" that goes through the c++ object orientation and such.
i want to go directly to python and start learning it.
will you guys interduce me a good book or place to learn about python?
last night i tried "how to think like a computer scientist - interactive edition" and after some chapters it jumped onto simple graphic libs and such and i didn't understand anything.
thanks for any help~

twitter: @hadirezae3
discord: Hadi

2012-12-09 18:46:39

Enes, essentially, that is correct. However, I just want to point out if you are in the directory where your script or application is it isn't necessary to provide Python with the full path to the file and only the script name itself. Plus if you are willing to setup an environment variable in your registry you can make things easier on yourself by putting c:\Python33 on your system path.

Hadi, all the free documentation for Python can be found at
http://docs.python.org
and the getting started guide should be a decent enough introduction to the language. For things like Pygame etc we'll cross that bridge when we come to it.

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-12-10 23:52:31

Hi Hadi.
The python documentation is very good and I recommend starting with that. If you want to read something else and if you have a bookshare account you can get these two books Learning Python an Programming Python both by Mark Lutz. Also, a good book that will get you started programming simple computer games is Invent Your own Computer Games With Python by Al Sweigart.
To get this book go on the python website and go to the python books section. The book will be listed there and can be downloaded as a PDF. this book teaches you how to write simple games and you get to work a little with pygame.
Don't worry, all the games that you make in this book are all non graphical games which is why it is a good beginner's guide for making games.
Guitarman

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2012-12-13 00:26:41

thanks guitarman, i'll check those out
the problem is, that i'm kinda.. dum in terms of programming, i need a book to explain things and describe things so i could get the idea pretty well.

twitter: @hadirezae3
discord: Hadi

2012-12-14 02:24:15

Hi hadi.
I know exactly what you mean. It is much easier for me to learn from a book instead of somebody just telling me what to do.
If you have anymore questions about python let me know and I will do my best to help you.
Guitarman

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order