Re: [Tutor] Running a script!

2011-12-11 Thread David Smith
If I have understood you correctly you are looking at the Python Shell. On this window choose File then New Window this will open a script window albeit without any code. This window will have a Run menu and within this menu there is a Run Module item which is what I think you are looking for.

[Tutor] Visual and audible system bell

2011-12-11 Thread David Smith
Dear list In a terminal window python3.2 at the command gives me Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> then print ("\a") triggers a visual and aud

Re: [Tutor] how to stop a running program in python without closing python interface?

2012-02-12 Thread David Smith
On 12 Feb 2012, at 11:54, Debashish Saha wrote: > actually a i ran a progam in python which is sufficiently large . so i > want to stop the execution of the program now . how can i do this? This will depend on your operating system. On a Mac you press alt + command + esc and the choose the prog

Re: [Tutor] PIL and converting an image to and from a string value

2012-04-27 Thread Russell Smith
What did you do? On Friday, April 27, 2012, Chris Hare wrote: > > I got it figured out. > > On Apr 27, 2012, at 12:21 AM, Chris Hare wrote: > > > > > Here is what I am trying to: > > > > the application user chooses an image file. I want to store the image > data in a field in a sqlite database.

Re: [Tutor] Pygame installation problems

2012-04-27 Thread Russell Smith
I would google 'pygame download' and look at the first hit. You are right to add the import but you need to download the files still. On Friday, April 27, 2012, Osemeka Osuagwu wrote: > Hi, > I started learning Python recently, having only very little programming > experience. I installed Pygame

Re: [Tutor] more help with vitualenv

2012-04-27 Thread Russell Smith
http://pypi.python.org/pypi/virtualenv/1.7.1.2 Read the page at the link above. You will find it. On Friday, April 27, 2012, Ivor Surveyor wrote: > > As suggested I visited the site virtualenv. However I could not find the > files for download and to install on my machine. > Could I please ask

Re: [Tutor] Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Russell Smith
Make sure you installed the theme engine 'pixmap' or whichever gtk package that has the theme engine you are missing. Google search for the gtk packages. Look here http://askubuntu.com/questions/66356/gdk-gtk-warnings-and-errors-from-the-command-lineand you will see a very similar problem with a so

Re: [Tutor] Running a script in the background

2012-09-01 Thread c smith
You are thinking of && & is what you want ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] lazily decorated sort

2012-09-28 Thread Chris Smith
Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a fast hash sort if possible, and only decor

Re: [Tutor] html checker

2012-10-01 Thread c smith
You will not find much help in getting a program to 'just work' regardless of your own experience. My advice would be to try and run small parts at a time to pinpoint where the problem is. Are you opening and reading the file properly? Are you iterating over the read file properly? Does your html c

Re: [Tutor] html checker

2012-10-01 Thread c smith
yourlisthere.pop() will return the last element in the list and change the list so it no longer contains the element. yourlisthere.push(x) will add x to the end of the list. Works on more than just lists ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] HELP!

2012-10-01 Thread c smith
Is the only problem that your code is giving unexpected results, or that it doesnt run or what? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python help?

2012-10-01 Thread c smith
It is hard to see things like images and attachments. I think purely html is preferred, but i would have to look over 'the list rules' again. You should look into dictionaries as the structure to hold your info. ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread c smith
Would this be a time when regex is necessary? Maybe: \b[^.]*quarantine[^.]*\.[a-zA-Z]*\b ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What can I do if I'm banned from a website??

2012-10-10 Thread c smith
how could someone know enough to write their own web-scraping program and NOT know that this is not about python or how to get around this problem? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.o

Re: [Tutor] Python type confusion?

2015-09-28 Thread C Smith
On Mon, Sep 28, 2015 at 1:27 PM, Ken Hammer wrote: > A simple "type" problem? > > The following code works as a py file with the XX'd lines replacing the two > later "raw_input" lines. > Why do the "raw_input" lines yield a TypeError: 'str' object is not callable? > Same result if I use/omit >

Re: [Tutor] Python type confusion?

2015-09-28 Thread C Smith
On Mon, Sep 28, 2015 at 4:13 PM, C Smith wrote: > On Mon, Sep 28, 2015 at 1:27 PM, Ken Hammer wrote: >> A simple "type" problem? >> >> The following code works as a py file with the XX'd lines replacing the two >> later "raw_input" lines. >

Re: [Tutor] Mutable data type in python

2015-10-03 Thread C Smith
> Here is my modified version which I think works as you want: > > def findMinDepthPath(n): > if n <= 0: raise ValueError > elif n==1: > return 0 > elif n==2 or n==3: > return 1 > else: > d1 = findMinDepthPath(n-1)+1 > d2 = d3 = (d1+1) # initialize to

Re: [Tutor] Mutable data type in python

2015-10-03 Thread C Smith
On Sat, Oct 3, 2015 at 11:55 AM, Alan Gauld wrote: > On 03/10/15 19:10, C Smith wrote: >>> >>> Here is my modified version which I think works as you want: >>> >>> def findMinDepthPath(n): >>> if n <= 0: raise ValueError >>>

[Tutor] Why define a function inside a function?

2016-01-29 Thread Ryan Smith
Hi all, I am new to programming and python and had a question. I hope I articulate this well enough so here it goes... I was following along on a thread on this mailing list discussing how to test file I/O operations. In one of the suggested solutions the following code was used: def _open_as_st

Re: [Tutor] Why define a function inside a function?

2016-01-30 Thread Ryan Smith
Thank you to both you and Ben for taking the time and answering my question! The detailed explanation of the example code I provided really helped and made things clear. As did the explanations about closures and a simplified example. I definitely have a lot to learn, but this was very educational

[Tutor] Python "password" securely hashed in script

2016-04-27 Thread Paul Smith
So creating small programs that automate my day specifically logins, how can one "hash" or hide the user and pass items in the python script itself? I need to prevent someone from easily seeing or accessing these if they happen to gain access to my python files. Thanks in advance. _

Re: [Tutor] Need help

2016-10-13 Thread Ryan Smith
On Wednesday, October 12, 2016, Alan Gauld via Tutor wrote: > On 12/10/16 09:03, niraj pandey wrote: > > > Can you pls guide how to print this screen (Attached here) content in > > printer ? > > As we already pointed out this is a text list so attachments > are usually stripped off... > > However

[Tutor] feedback on simple python code

2017-02-27 Thread Ryan Smith
Hi all, New python student here. I have been using O¹reilly¹s "Python Beyond the Basics: Object Oriented Programming video series". In one of the assignments we are to write a simple inheritance hierarchy of three classes that write to text files. I have actually written the code for the assignmen

Re: [Tutor] feedback on simple python code

2017-03-02 Thread Ryan Smith
On 2/28/17, 3:32 AM, "Tutor on behalf of Peter Otten" wrote: >Ryan Smith wrote: > >> Hi all, >> >> New python student here. I have been using O¹reilly¹s "Python Beyond the >> Basics: Object Oriented Programming video series". In one of the &

[Tutor] if statement problems(noob question)

2013-04-08 Thread Max Smith
Hi, everyone whom might read this, im Max and i am really new to coding, been going at it for about two weeks using codeacademy and the book "think python". when i decided to experiment a little with if statements i ran into the following problem: def plus(x,y): if x and y == int or float:

[Tutor] syntax error when attempting simple urllib.request.urlopen item

2013-07-10 Thread Paul Smith
Tutor- Ok newbie to coding here attempting to build controlled web scraper and have followed several books-tutorials and am failing at step one. This is the 3.3.1 code I am trying to run.. === import urllib.request htmltext = urllib.request.urlopen("http://google.com";).read print htmltext ===

[Tutor] Timestamp issues when importing from FireFox sqlite field

2013-07-18 Thread Paul Smith
All- Newb here so apologies upfront. Attempting timestamp translation via python importing info from sqlite datetime item in firefox ,'1369751000393000'. Typical unix date time translation fails. I noted micro second addition but even '1369751000393000' / 1e6 does not get a chew-able range, at le

[Tutor] sqlite3 woes opening Moz, FFox sqlite db with only the inevitable 'DatabaseError: file is encrypted or is not a database' occurring...

2013-07-23 Thread Paul Smith
title = three days lost and counting... Thanks in advance all: Ok- I want to work with data in FFox, specifically a sqlite db found here.. 'C:\Users\Hive2\AppData\Roaming\Mozilla\Firefox\Profiles\zabt0uq4.default\places.sqlite' ...more specifically my FFox history found in a table 'moz_places'.

[Tutor] Newbie question. Is it possible to run/call a python2.7 program and reference results from/in python3.3?

2013-09-13 Thread Paul Smith
27 program and use results in python33? Thank you in advance! Another nightmare is stripping-cleaning google search results into clean url lists... but I will defer to another post for that mess. Thanks again in advance Paul Smith +++ Two Kinds of Intelligence There are two kinds of intelligenc

[Tutor] Protecting username - password items in python3.3

2013-10-10 Thread Paul Smith
in advance! Paul Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Protecting username - password items in python3.3

2013-10-10 Thread Paul Smith
h our script. -Paul On Thu, Oct 10, 2013 at 5:49 PM, Oscar Benjamin wrote: > On 10 October 2013 22:28, Paul Smith wrote: > > Ok experts I need to protect username and password items in some > Python3.3 > > code I am writing. > > I'm not an expert on this subject but...

Re: [Tutor] Difficulty in getting logged on to python.org; want to resubscribe at the beginner level; finding "While" Loops in Python 3.4.0 to be extremely picky

2014-04-25 Thread C Smith
You can get python 3.4 to work on your mac, but it has 2.5 or 2.4 which the OS uses and things can get very messed up if you don't know what you are doing. You should use virtualbox to run virtual OS's on your mac without messing up your main computer. You should probably describe what kind of err

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
Just glancing at your work, I see you have curly braces around what looks like it should be a list. If you are concerned with the order of your output, dictionaries do not have a concept of order. On Sat, Apr 26, 2014 at 3:16 PM, Suhana Vidyarthi wrote: > Hi Danny, > > Let me give you a high le

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
err, set also is unordered. I can see you are using set for a reason, but has no concept of order. On Sat, Apr 26, 2014 at 3:20 PM, C Smith wrote: > Just glancing at your work, I see you have curly braces around what looks > like it should be a list. If you are concerned with the order o

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
to get you to answer your own questions or coax more information from you rather than simply provide their own version of your code. On Sat, Apr 26, 2014 at 3:48 PM, Suhana Vidyarthi wrote: > Thanks for the response Smith, I was thinking make be I have done > something incorrect and if th

Re: [Tutor] converting strings to float: strange case

2014-04-28 Thread C Smith
.split() will split things based on whitespace or newlines. Do you know that your file is only going to contain things that should convert to floats? If you post your entire code, the error you have included will be more helpful as it points to a certain line. The last line in your code has (stri)

Re: [Tutor] Stephen Mik-Almost Brand New to Python 3.4.0-"Guess My Number" program is syntactically correct but will not run as expected

2014-04-28 Thread C Smith
That is definitely more useful information in answering your questions. Whenever you see the error you are getting: NameError: name 'smv_guessNumber' is not defined That means you are using a variable, in this case 'smv_guessNumber', that has not been created yet. The reason this is happening he

Re: [Tutor] Stephen Mik-Almost Brand New to Python 3.4.0-"Guess My Number" program is syntactically correct but will not run as expected

2014-04-28 Thread C Smith
I should probably clarify that this list is mainly for python2.7, correct me if I am wrong. On Mon, Apr 28, 2014 at 1:49 PM, C Smith wrote: > That is definitely more useful information in answering your questions. > Whenever you see the error you are getting: > > Nam

Re: [Tutor] Stephen Mik-Almost Brand New to Python 3.4.0-"Guess My Number" program is syntactically correct but will not run as expected

2014-04-28 Thread C Smith
The reason this is happening here is you need to import sys. > I don't know why you would think importing sys would fix this. docs say it accepts from sys.stdin On Mon, Apr 28, 2014 at 1:55 PM, Philip Dexter wrote: > > > On Mon, 28 Apr 2014, C Smith wrote: >

Re: [Tutor] Stephen Mik-Almost Brand New to Python 3.4.0-"Guess My Number" program is syntactically correct but will not run as expected

2014-04-28 Thread C Smith
, 2014 at 1:59 PM, C Smith wrote: > > > The reason this is happening here is you need to import sys. >> > > I don't know why you would think importing sys would fix this. > > docs say it accepts from sys.stdin > > > On Mon, Apr 28, 2014 at 1:55 PM,

[Tutor] Fwd: Logical error?

2014-05-02 Thread C Smith
The first loop tests for the last element of fullPath to have today's date. The second loop tests the first element in fullPath, if it is not today, you will end up running sys.exit() when you hit the else clause in second loop. On Fri, May 2, 2014 at 6:38 PM, C Smith wrote: > The fi

[Tutor] append vs list addition

2014-05-04 Thread C Smith
I had always assumed that append() was more efficient, but some recent discussions seem to point at that it is the same as append(). Which is preferable and why? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https:

Re: [Tutor] append vs list addition

2014-05-04 Thread C Smith
Sorry. I meant for example: list1 = [1,2,3] list2 = [3,4,5] newList = list1 + list2 versus for x in list2: list1.append(x) Which is the preferred way to add elements from one list to another? On Sun, May 4, 2014 at 7:36 AM, Dave Angel wrote: > C Smith Wrote in message: >> &

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-04 Thread C Smith
Hey, you will want to include some code to show your progress so far. Can you write a basic program and then work the requirements into it? Do you have some idea of where to start? Are you supposed to modify a completed version of "hangman" that is in your text, or come up with an original 'hangman

Re: [Tutor] Alice_in_wonderland Question

2014-05-04 Thread C Smith
>ordered_keys = word_count.keys() >sorted(ordered_keys) sorted() does not modify the list, but returns a sorted version of the list for me on Python 2.7 my_sorted_list = sorted(ordered_keys) This will alphabetize all of the words, regardless of frequency. >print ("All the words and their frequenc

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-05 Thread C Smith
ode, pseudo code,worries about > using Dictionaries,Lists.embedded while lists,for loops: > Thank you,. C. Smith for responding to my help plea on Python-Tutor.org. One > version of the "Hang Man" problem is listed in the textbook,but it doesn't > use Dictionaries,Lists,embedded w

[Tutor] How inefficient is this code?

2014-05-07 Thread C Smith
A topic came up on slashdot concerning "intermediate" programming, where the poster expressed the feeling that the easy stuff is too easy and the hard stuff is too hard. Someone did point out that 'intermediate' programming would still involve actually selling code or at least some professional ex

Re: [Tutor] How inefficient is this code?

2014-05-07 Thread C Smith
eturn (or reaches the end of its body), the > for loop ends. > > This is called a generator function, and is a really nice way to > simplify and optimize your loops. > > You can read more about generators here: > https://wiki.python.org/moin/Generators > > > On Wed,

Re: [Tutor] How inefficient is this code?

2014-05-07 Thread C Smith
I guess intuiting efficiency doesn't work in Python because it is such high-level? Or is there much more going on there? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with Python

2014-05-11 Thread C Smith
Hey Glen, include the error you are getting. It will make answering your question easier. How are you running this program, in an IDE? On Sat, May 10, 2014 at 11:16 PM, Glen Chan wrote: > Hello, I am a student trying to figure out Python. I am getting errors that > I don't know how to fix. What d

[Tutor] Real world experience

2014-05-11 Thread C Smith
I have never known anyone that works in this industry. I got one job transforming xml (should have used xslt, ended up using sed and python regex scripts) where the guy asked me how much I wanted and I threw 200 bucks out there because I could get a room for two weeks at that cost. He just laughed

Re: [Tutor] Real world experience

2014-05-11 Thread C Smith
to the industry. > > If you want to pursue a career in IT, you need to finish high school. You > would be wise to get a degree. > > My $0.02. > > Tim > > > On Sun, May 11, 2014 at 7:12 PM, C Smith > wrote: >> >> I have never known anyone that works i

Re: [Tutor] Real world experience

2014-05-12 Thread C Smith
Thanks to everyone. >> practice. That programming doesn't have to be a solitary thing needs >> to be strongly emphasized, because the media likes to exaggerate, >Yes, This can't be stressed too much. Industrial coding is a team activity not >a solo process. This is particularly good advice for

Re: [Tutor] Real world experience

2014-05-12 Thread C Smith
Freeside is more makers. I haven't gone but have known people that have. You might find some arduino supposedly, but not much coding otherwise and you have to pay membership fees. It is more social than technical, I think. And your car will probably be broken into. I will check out the python-atlan

Re: [Tutor] Real world experience

2014-05-12 Thread C Smith
I think that is going to be my new wallpaper. On Mon, May 12, 2014 at 8:25 PM, Martin A. Brown wrote: > > Hello, > > 10 Pick one favorite specific topic, any topic (XML parsing; Unix > process handling; databases). The topic matters for you. > Learn it deeply. Keep learning it. The

Re: [Tutor] for the error about 'import site' failed; use -v for traceback

2014-05-14 Thread C Smith
That looks pretty normal. I don't see any errors. On Wed, May 14, 2014 at 5:42 AM, Tao Zhu wrote: > Hi everyone, > when I use python, the problem occured. when I used the command "python -v", > the results are listed as follows. could you tell me what wrong? > > $ python -v > # installing zipimpo

Re: [Tutor] for the error about 'import site' failed; use -v for traceback

2014-05-14 Thread C Smith
What are you trying to do? On Wed, May 14, 2014 at 12:24 PM, C Smith wrote: > That looks pretty normal. I don't see any errors. > > On Wed, May 14, 2014 at 5:42 AM, Tao Zhu wrote: >> Hi everyone, >> when I use python, the problem occured. when I used the command "

Re: [Tutor] Translator - multiple choice answer

2014-05-14 Thread C Smith
This might be useful for reading values from a text value into a dictionary: https://stackoverflow.com/questions/17775273/how-to-read-and-store-values-from-a-text-file-into-a-dictionary-python On Wed, May 14, 2014 at 7:00 PM, Danny Yoo wrote: >> Program read TXT file (c:\\slo3.txt) >> In this fil

Re: [Tutor] While truth

2014-05-20 Thread C Smith
You can test out a condition like this in IDLE like so: while 6: print "yes its true" break while 0: print "yes its true" break while -1: print "yes its true" break emptyList = [] while emtpyList: print "yes its true" break This way you don't have to deal with

Re: [Tutor] While truth

2014-05-20 Thread C Smith
Of course that isn't very useful code. I thought it might be a useful quick test for someone learning how while loops treat different values. On Tue, May 20, 2014 at 2:46 PM, Danny Yoo wrote: > On Tue, May 20, 2014 at 11:44 AM, C Smith > wrote: >> You can test out a condition

Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread C Smith
Sorry, typing is hard. *You will need to use virtualenv On Thu, May 22, 2014 at 2:40 PM, C Smith wrote: > You can't use apt-get or similar to install 3.1. > You will need to virtualenv. > > On Thu, May 22, 2014 at 12:22 PM, Alex Kleider wrote: >> On 2014-05-22 06:17, M

Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread C Smith
You can't use apt-get or similar to install 3.1. You will need to virtualenv. On Thu, May 22, 2014 at 12:22 PM, Alex Kleider wrote: > On 2014-05-22 06:17, Markos wrote: >> >> Hi, >> >> I'm learning Python and I'm using Debian 6.0 (squeeze) >> >> The installed version is 2.6.6. (python -V) >> >> I

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread C Smith
Learning Python Design Patterns, by Gennadiy Zlobin Let us know when your book is done! On Mon, Jun 30, 2014 at 7:05 AM, Bob Williams wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 29/06/14 23:41, Alan Gauld wrote: >> I'm looking for tips for an appendix to a book that I'm workin

Re: [Tutor] Why is Quick Search at docs.Python.org so useless?

2014-07-05 Thread C Smith
I agree very much. I feel like I might have a learning disability when I try to reference the official Python docs for something that seems like it should be a very common task. On Sat, Jul 5, 2014 at 1:31 PM, Deb Wyatt wrote: > I am betting that a big reason newbies don't go straight to document

[Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
I am on OSX, which needs to escape spaces in filenames with a backslash. There are multiple files within one directory that all have the same structure, one or more characters with zero or more spaces in the filename, like this: 3 Song Title XYZ.flac. I want to use Python to call ffmpeg to convert

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
passed to the shell without escaping the spaces. >Why not using ffmpeg without jumping into Python. It's well documented, check >Google. I guess you mean that the ability to change multiple files with ffmpeg is possible. I hadn't considered that but I would rather do it with Python,

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
e Python interpreter strip off backslashes or something with strings? On Thu, Jul 31, 2014 at 5:53 PM, C Smith wrote: >>Change: > > >>subprocess.call(['ffmpeg', '-i', filename, str(track)+'.mp3']) > >>to: > >>subprocess.call(['ffmpeg

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
Okay I messed up with slash instead of backslash, so the re.sub() works, but I am still curious about the previous question. On Thu, Jul 31, 2014 at 6:14 PM, C Smith wrote: > Even when I am using: > re.sub('/s', '\\/s', filename) > I am still getting the same outp

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
. So, I am still wondering about that too. On Thu, Jul 31, 2014 at 6:20 PM, C Smith wrote: > Okay I messed up with slash instead of backslash, so the re.sub() > works, but I am still curious about the previous question. > > On Thu, Jul 31, 2014 at 6:14 PM, C Smith wrote: >> Ev

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
> emails are coming in slowly and out of order, but I have a suggestion: > > On Thu, Jul 31, 2014 at 03:53:48PM -0400, C Smith wrote: >> I am on OSX, which needs to escape spaces in filenames with a backslash. > > Same as any other Unix, or Linux, or, indeed, Windows. > >

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
woops, I see it pathname != filename On Thu, Jul 31, 2014 at 6:55 PM, C Smith wrote: >>for track, filename in enumerate(os.listdir(directory), 1): > It seems kinda counter-intuitive to have track then filename as > variables, but enumerate looks like it gets passed the filename

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
Works now, thanks! On Thu, Jul 31, 2014 at 6:57 PM, C Smith wrote: > woops, I see it pathname != filename > > On Thu, Jul 31, 2014 at 6:55 PM, C Smith wrote: >>>for track, filename in enumerate(os.listdir(directory), 1): >> It seems kinda counter-intuitive to hav

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
Huh, that is quite an annoyance about changing the order though. Any ideas about that? I will look into it further in the meantime... On Thu, Jul 31, 2014 at 6:57 PM, C Smith wrote: > Works now, thanks! > > On Thu, Jul 31, 2014 at 6:57 PM, C Smith wrote: >> woops, I see it pathn

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
thanks, got it import os, subprocess, re directory = 'abs/path' for track, filename in enumerate(os.listdir(directory), 1): pathname = os.path.join(directory, filename) subprocess.call(['ffmpeg', '-i', pathname, filename+str(track)+'.mp3']) On Thu,

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
or more accurately import os, subprocess, re directory = '/abs/path' for track, filename in enumerate(os.listdir(directory), 1): pathname = os.path.join(directory, filename) subprocess.call(['ffmpeg', '-i', pathname, filename[:-5]+'.mp3']) On Thu,

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread C Smith
wrote: > C Smith wrote: > > I'd throw in a check to verify that filename is indeed a flac: > >> or more accurately >> import os, subprocess, re >> directory = '/abs/path' >> for track, filename in enumerate(os.listdir(directory), 1): >&

Re: [Tutor] Using subprocess on a series of files with spaces

2014-08-01 Thread C Smith
4:38 AM, Ben Finney wrote: > Peter Otten <__pete...@web.de> writes: > >> C Smith wrote: >> >> > Nice, these are useful tools. I have been building something with >> > just basic stuff and avoiding learning any libraries. If I wanted to >> > get s

Re: [Tutor] Using subprocess on a series of files with spaces

2014-08-01 Thread C Smith
rote: > >>You may have already have solved your problem, unfortunately my >>emails are coming in slowly and out of order, but I have a suggestion: >> >>On Thu, Jul 31, 2014 at 03:53:48PM -0400, C Smith wrote: >>> I am on OSX, which needs to escape spaces in fil

Re: [Tutor] Help

2014-09-18 Thread C Smith
Check this guy's youtube channel. He has very basic examples. His username is thenewboston On Wed, Sep 17, 2014 at 4:36 PM, Art Pelletier wrote: > > I am a beginner with pythons programming I would like to see if their is a > site that has samples programs that I can practice on. > Sent from m

[Tutor] Module? Error handling specific to SQLite3

2014-09-26 Thread Paul Smith
Ok Tutor help please... Early stages messing with module sqlite3 in python3.4. I am successful in creating sqlite tables of my own and interacting with other sqlite tables, however in refining the code from a purely "it can do it" stage to a more stable working piece of code I run into this proble

[Tutor] Whack-a-mole

2014-10-01 Thread Ben Smith
Hi, Can anyone help explain why you can keep hitting the Mole even when hittable should be False? from tkinter import * root = Tk() #root.state('zoomed') sec = 0 points=0 pic=PhotoImage(file='Dirt.gif') pic2=PhotoImage(file='Mole.gif') hittable=False def HIT(): if hittable==True: gl

Re: [Tutor] Tutor Digest, Vol 129, Issue 22

2014-11-11 Thread Ben Smith
Hi - I'm a teacher & sometimes when we're holding a two minute silence for an important occasion an email comes through & makes my computer ping loudly. Is there a python script to stop these kind of things happening? ;) -Original Message- From: Tutor [mailto:tutor-bounces+ben.smith=arn

Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-05 Thread Ryan Smith
+1 for Wing IDE. I have been using it for about 6-7 months now and absolutely love it. Ryan On Sun, Jun 4, 2017 at 11:37 AM Ryan Smith wrote: > > On Sun, Jun 4, 2017 at 8:13 AM wolfrage8...@gmail.com < > wolfrage8...@gmail.com> wrote: > >> Atom.io Editor is my curre

[Tutor] Python Questions

2017-07-18 Thread Max Smith
I have some questions about python. What's the easiest way to learn python currently I'm using google's excersise program, I'm just reading and making notes then testing out what I have learnt. Since I' need to understand python fully as I've got a exam in Python for my GCSE's if you could gi

[Tutor] intro book for python

2017-09-01 Thread Derek Smith
Hello! I am new to python coming from a Perl and Unix Admin background. I reviewed the site https://wiki.python.org/moin/IntroductoryBooks and would like to know which book(s) you all recommended for a newbie? Thank you! ___ Tutor maillist - Tuto

[Tutor] array input from keyboard

2017-09-15 Thread Derek Smith
I need to accept input from the user then store in an array/list. This is my 1st python script. #!/usr/bin/env python # Derek Smith # 09/2017 # accept volumes for TSM for tape mgmt. import os import sys nput1 = "" nput2 = "" nput1 = input("\nIs your input 'file

[Tutor] pip install of subprocess module

2017-09-18 Thread Derek Smith
ine 707, in call_subprocess % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command "git clone -q https://github.com/python/cpython/blob/3.6/Lib/subprocess.py /tmp/pip-bw8rryo9-build" failed with error code 128 in None Derek Smith |

[Tutor] subprocess check_output

2017-09-20 Thread Derek Smith
", "status='Scratch'", "and", "library_name='TS3200'" ] ) print (scratch) __OUTPUT__ # ./ts3200_scratchcount_check.py email sent successfully b' 8\n' Thx!! Derek Smith | Unix/TSM Administrator | Racksquared Data Centers :: dere

[Tutor] get javascript output data from ssi file

2017-11-27 Thread Derek Smith
31 (1)   Slot 32 (1)   Slot 35 (1)   Slot 36 (1)   Slot 37 (1)   Slot 40 (1)   Slot 41 (1)   Slot 44 (1)   Derek Smith

[Tutor] Fwd: print a for loop system call

2018-01-20 Thread Derek Smith
Sent from my iPhone Begin forwarded message: From: Derek Smith mailto:dereksm...@racksquared.com>> Date: January 19, 2018 at 4:01:58 PM EST To: "tutor-requ...@python.org<mailto:tutor-requ...@python.org>" mailto:tutor-requ...@python.org>> Subject: print a for loop

[Tutor] Help understanding base64 decoding

2018-09-12 Thread Ryan Smith
Hello All, I am currently working on a small utility that finds any base64 encoded strings in files and decodes them. I am having issue understanding how the Base64 module actually works. The regular expression that I am using correctly matches on the encoded strings. I simply want to be able to c

Re: [Tutor] Help understanding base64 decoding

2018-09-13 Thread Ryan Smith
being encoded in UTF-8. Hence I'm guessing is the reason for converting strings to a bytes object in the first place. Again thank you for the assistance! Ryan On Thu, Sep 13, 2018 at 2:57 AM, Peter Otten <__pete...@web.de> wrote: > Ryan Smith wrote: > >> Hello All, >> &g

[Tutor] Performance Issue

2018-10-17 Thread Stephen Smith
I have written a screen scraping program that watches a clock (on the app's server) and at 7:00:00 AM dashes to make a reservation on line. It works fine. However, i have spent time trying to improve its performance. I am using selenium, with chrome driver. Here is what i have learned. I have tri

[Tutor] Making Regular Expressions readable

2010-03-08 Thread Stephen Nelson-Smith
uot; % (lines,) print "There were %s lines with missing Site Intelligence cookies." % (no_cookies,) It works fine, but it looks pretty unreadable and unmaintainable to anyone who hasn't spent all day writing regular expressions. I remember reading about verbose regular expressi

[Tutor] Not Storing State

2009-02-27 Thread Stephen Nelson-Smith
Hi, This is both a general question and a specific one. I want to iterate over a bunch of lines; If any line contains a certain string, I want to do something, otherwise do something else. I can store state - eg line 1 - did it contain the string? no.. ok we're cool, next line But, I'd like

[Tutor] CSS Minification

2009-11-02 Thread Stephen Nelson-Smith
Is there a Python CSS and/or javascript minifier available? I've got to convert some ant scripts to python, and ant has a minifier plugin that I need to replicate. Maybe Beautiful Soup can do this? S. -- Stephen Nelson-Smith Technical Director Atalanta Systems Ltd www.atalanta-system

[Tutor] Logfile Manipulation

2009-11-08 Thread Stephen Nelson-Smith
ll, awk etc in a big pipeline? The shell script kills the CPU * What's the best way to extract the data for a given time, eg - 2359 yesterday? Any advice or experiences? S. -- Stephen Nelson-Smith Technical Director Atalanta Systems Ltd www.atalanta-systems.com

Re: [Tutor] Logfile Manipulation

2009-11-09 Thread Stephen Nelson-Smith
On Mon, Nov 9, 2009 at 8:47 AM, Alan Gauld wrote: > I'm not familiar with Apache log files so I'll let somebody else answer, > but I suspect you can either use string.split() or a re.findall(). You might > even be able to use csv. Or if they are in XML you could use ElementTree. > It all depends

Re: [Tutor] Logfile Manipulation

2009-11-09 Thread Stephen Nelson-Smith
Sorry - forgot to include the list. On Mon, Nov 9, 2009 at 9:33 AM, Stephen Nelson-Smith wrote: > On Mon, Nov 9, 2009 at 9:10 AM, ALAN GAULD wrote: >> >>> An apache logfile entry looks like this: >>> >>>89.151.119.196 - - [04/Nov/2009:04:02:10 +] &q

<    1   2   3   4   5   >